Package Functions

Class QuadraticDiagonalFunction

java.lang.Object
Functions.QuadraticDiagonalFunction
All Implemented Interfaces:
Function

public class QuadraticDiagonalFunction
extends java.lang.Object
implements Function
CLass for economic representation of quadratic function from R^n by diagonal matrix.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    (package private) double[] A
    Matrix of square terms.
    (package private) double[] B
    Vector of one-dimensional terms
    (package private) double C
    Constant of function
    (package private) int dimention
    Dimention of matrix
  • Constructor Summary

    Constructors 
    Constructor Description
    QuadraticDiagonalFunction​(double[] a, double[] b, double c)
    Standard constructor for the function given by diagonal matrix
  • Method Summary

    Modifier and Type Method Description
    double[] multiply​(double[] x)
    function that compute (A * x)
    double run​(double[] x)
    Compute the function meaning in the point given like vector
    double[] runGradient​(double[] x)
    Compute gradient of the function in given point

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • A

      final double[] A
      Matrix of square terms. B_{ii} = A_{i} = 2 * x{i}^2
    • B

      final double[] B
      Vector of one-dimensional terms
    • C

      final double C
      Constant of function
    • dimention

      final int dimention
      Dimention of matrix
  • Constructor Details

    • QuadraticDiagonalFunction

      public QuadraticDiagonalFunction​(double[] a, double[] b, double c)
      Standard constructor for the function given by diagonal matrix
      Parameters:
      a - A
      b - B
      c - C
  • Method Details

    • run

      public double run​(double[] x)
      Description copied from interface: Function
      Compute the function meaning in the point given like vector
      Specified by:
      run in interface Function
      Parameters:
      x - vector that represent point
      Returns:
      meaning of function like f(x)
    • runGradient

      public double[] runGradient​(double[] x)
      Description copied from interface: Function
      Compute gradient of the function in given point
      Specified by:
      runGradient in interface Function
      Parameters:
      x - vector that represent point
      Returns:
      vector that represent gradient of the function
    • multiply

      public double[] multiply​(double[] x)
      Description copied from interface: Function
      function that compute (A * x)
      Specified by:
      multiply in interface Function
      Parameters:
      x - point for multiply
      Returns:
      result of computing (A * x)