Package functions

Class QuadraticFunction

java.lang.Object
functions.QuadraticFunction
All Implemented Interfaces:
interfaces.Function

public class QuadraticFunction
extends java.lang.Object
implements interfaces.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)
    вычисляет значение A * x
    double run​(double[] x)
    вычисляет значение функции в указанной точке
    double[] runGradient​(double[] x)
    вычисляет градиент функции в указанной точке
    double[][] runHessian​(double[] x)
    Вычисляет значение матрицы Гессе в указанной точке

    Methods inherited from class java.lang.Object

    clone, equals, finalize, 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: interfaces.Function
      вычисляет значение функции в указанной точке
      Specified by:
      run in interface interfaces.Function
      Parameters:
      x - точка, в которой требуется вычислить функцию
      Returns:
      значение функции в данной точке
    • runGradient

      public double[] runGradient​(double[] x)
      Description copied from interface: interfaces.Function
      вычисляет градиент функции в указанной точке
      Specified by:
      runGradient in interface interfaces.Function
      Parameters:
      x - точка, в которой требуется вычислить градиент
      Returns:
      градиент функции в указанной точке
    • multiply

      public double[] multiply​(double[] x)
      Description copied from interface: interfaces.Function
      вычисляет значение A * x
      Specified by:
      multiply in interface interfaces.Function
      Parameters:
      x - точка
      Returns:
      результат умножения
    • runHessian

      public double[][] runHessian​(double[] x)
      Description copied from interface: interfaces.Function
      Вычисляет значение матрицы Гессе в указанной точке
      Specified by:
      runHessian in interface interfaces.Function
      Parameters:
      x - - точка, в которой требуется вычислить значение матрицы Гессе
      Returns:
      матрица Гессе в указанной точке