Class LinearFunction<N extends java.lang.Comparable<N>>
- java.lang.Object
-
- org.ojalgo.function.multiary.LinearFunction<N>
-
- All Implemented Interfaces:
BasicFunction
,BasicFunction.PlainUnary<Access1D<N>,N>
,MultiaryFunction<N>
,MultiaryFunction.Linear<N>
,MultiaryFunction.TwiceDifferentiable<N>
public final class LinearFunction<N extends java.lang.Comparable<N>> extends java.lang.Object implements MultiaryFunction.TwiceDifferentiable<N>, MultiaryFunction.Linear<N>
[l]T[x]
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LinearFunction.Factory<N extends java.lang.Comparable<N>>
-
Nested classes/interfaces inherited from interface org.ojalgo.function.BasicFunction
BasicFunction.Differentiable<N extends java.lang.Comparable<N>,F extends BasicFunction>, BasicFunction.Integratable<N extends java.lang.Comparable<N>,F extends BasicFunction>, BasicFunction.PlainUnary<T,R>
-
Nested classes/interfaces inherited from interface org.ojalgo.function.multiary.MultiaryFunction
MultiaryFunction.Affine<N extends java.lang.Comparable<N>>, MultiaryFunction.Constant<N extends java.lang.Comparable<N>>, MultiaryFunction.Convex<N extends java.lang.Comparable<N>>, MultiaryFunction.Linear<N extends java.lang.Comparable<N>>, MultiaryFunction.PureQuadratic<N extends java.lang.Comparable<N>>, MultiaryFunction.Quadratic<N extends java.lang.Comparable<N>>, MultiaryFunction.TwiceDifferentiable<N extends java.lang.Comparable<N>>
-
-
Field Summary
Fields Modifier and Type Field Description private MatrixStore<N>
myCoefficients
-
Constructor Summary
Constructors Constructor Description LinearFunction(MatrixStore<N> coefficients)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
arity()
(package private) PhysicalStore.Factory<N,?>
factory()
static <N extends java.lang.Comparable<N>>
LinearFunction.Factory<N>factory(PhysicalStore.Factory<N,?> factory)
MatrixStore<N>
getGradient(Access1D<N> point)
The gradient of a scalar field is a vector field that points in the direction of the greatest rate of increase of the scalar field, and whose magnitude is that rate of increase.MatrixStore<N>
getHessian(Access1D<N> point)
The Hessian matrix or Hessian is a square matrix of second-order partial derivatives of a function.MatrixStore<N>
getLinearFactors(boolean negated)
N
invoke(Access1D<N> arg)
PhysicalStore<N>
linear()
static <N extends java.lang.Comparable<N>>
LinearFunction<N>wrap(PhysicalStore<N> coefficients)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ojalgo.function.multiary.MultiaryFunction
andThen
-
Methods inherited from interface org.ojalgo.function.multiary.MultiaryFunction.TwiceDifferentiable
toFirstOrderApproximation, toSecondOrderApproximation
-
-
-
-
Field Detail
-
myCoefficients
private final MatrixStore<N extends java.lang.Comparable<N>> myCoefficients
-
-
Constructor Detail
-
LinearFunction
LinearFunction(MatrixStore<N> coefficients)
-
-
Method Detail
-
factory
public static <N extends java.lang.Comparable<N>> LinearFunction.Factory<N> factory(PhysicalStore.Factory<N,?> factory)
-
wrap
public static <N extends java.lang.Comparable<N>> LinearFunction<N> wrap(PhysicalStore<N> coefficients)
-
arity
public int arity()
- Specified by:
arity
in interfaceMultiaryFunction<N extends java.lang.Comparable<N>>
-
getGradient
public MatrixStore<N> getGradient(Access1D<N> point)
Description copied from interface:MultiaryFunction.TwiceDifferentiable
The gradient of a scalar field is a vector field that points in the direction of the greatest rate of increase of the scalar field, and whose magnitude is that rate of increase.
The Jacobian is a generalization of the gradient. Gradients are only defined on scalar-valued functions, but Jacobians are defined on vector- valued functions. When f is real-valued (i.e., f : Rn → R) the derivative Df(x) is a 1 × n matrix, i.e., it is a row vector. Its transpose is called the gradient of the function: ∇f(x) = Df(x)T , which is a (column) vector, i.e., in Rn. Its components are the partial derivatives of f:
The first-order approximation of f at a point x ∈ int dom f can be expressed as (the affine function of z) f(z) = f(x) + ∇f(x)T (z − x).
- Specified by:
getGradient
in interfaceMultiaryFunction.TwiceDifferentiable<N extends java.lang.Comparable<N>>
-
getHessian
public MatrixStore<N> getHessian(Access1D<N> point)
Description copied from interface:MultiaryFunction.TwiceDifferentiable
The Hessian matrix or Hessian is a square matrix of second-order partial derivatives of a function. It describes the local curvature of a function of many variables. The Hessian is the Jacobian of the gradient.
The second-order approximation of f, at or near x, is the quadratic function of z defined by f(z) = f(x) + ∇f(x)T (z − x) + (1/2)(z − x)T ∇2f(x)(z − x)
- Specified by:
getHessian
in interfaceMultiaryFunction.TwiceDifferentiable<N extends java.lang.Comparable<N>>
-
getLinearFactors
public MatrixStore<N> getLinearFactors(boolean negated)
- Specified by:
getLinearFactors
in interfaceMultiaryFunction.TwiceDifferentiable<N extends java.lang.Comparable<N>>
- Returns:
- The gradient at origin (0-vector), negated or not
-
linear
public PhysicalStore<N> linear()
- Specified by:
linear
in interfaceMultiaryFunction.Linear<N extends java.lang.Comparable<N>>
-
factory
PhysicalStore.Factory<N,?> factory()
-
-