Package Functions

Class QuadraticFunction

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

public class QuadraticFunction
extends java.lang.Object
implements Function
Class for representation of quadratic function of R^n
  • 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
  • Constructor Summary

    Constructors 
    Constructor Description
    QuadraticFunction​(double[][] a, double[] b, double c)
    Standard constructor of matrix representation of function
  • 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. A_{ij}=A_{ji}, A_{ii} = 2 * x{i}^2
    • B

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

      final double C
      Constant of function
  • Constructor Details

    • QuadraticFunction

      public QuadraticFunction​(double[][] a, double[] b, double c)
      Standard constructor of matrix representation of function
      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)