org.ojalgo.function.multiary

## Class ConstantFunction<N extends Number>

• ### Nested classes/interfaces inherited from interface org.ojalgo.function.multiary.MultiaryFunction

`MultiaryFunction.Constant<N extends Number,F extends MultiaryFunction.Constant<N,?>>, MultiaryFunction.Convex<N extends Number>, MultiaryFunction.Linear<N extends Number>, MultiaryFunction.Quadratic<N extends Number>, MultiaryFunction.TwiceDifferentiable<N extends Number>`
• ### Nested classes/interfaces inherited from interface org.ojalgo.function.BasicFunction

`BasicFunction.Differentiable<N extends Number,F extends BasicFunction>, BasicFunction.Integratable<N extends Number,F extends BasicFunction>, BasicFunction.PlainUnary<T,R>`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`int` `arity()`
`F` `constant(Number constant)`
`protected PhysicalStore.Factory<N,?>` `factory()`
`N` `getConstant()`
`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.
`Access1D<N>` `getLinearFactors()`
`protected Scalar<N>` `getScalarConstant()`
`N` `invoke(Access1D<N> arg)`
`static ConstantFunction<ComplexNumber>` `makeComplex(int arity)`
`static ConstantFunction<ComplexNumber>` ```makeComplex(int arity, Number constant)```
`static ConstantFunction<Double>` `makePrimitive(int arity)`
`static ConstantFunction<Double>` ```makePrimitive(int arity, Number constant)```
`static ConstantFunction<RationalNumber>` `makeRational(int arity)`
`static ConstantFunction<RationalNumber>` ```makeRational(int arity, Number constant)```
`void` `setConstant(Number constant)`
`FirstOrderApproximation<N>` `toFirstOrderApproximation(Access1D<N> arg)`
`SecondOrderApproximation<N>` `toSecondOrderApproximation(Access1D<N> arg)`
• ### 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`
• ### Method Detail

• #### makeComplex

`public static ConstantFunction<ComplexNumber> makeComplex(int arity)`
• #### makeComplex

```public static ConstantFunction<ComplexNumber> makeComplex(int arity,
Number constant)```
• #### makePrimitive

`public static ConstantFunction<Double> makePrimitive(int arity)`
• #### makePrimitive

```public static ConstantFunction<Double> makePrimitive(int arity,
Number constant)```
• #### makeRational

`public static ConstantFunction<RationalNumber> makeRational(int arity)`
• #### makeRational

```public static ConstantFunction<RationalNumber> makeRational(int arity,
Number constant)```
• #### arity

`public int arity()`

`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).

• #### 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)

• #### invoke

`public N invoke(Access1D<N> arg)`
• #### factory

`protected PhysicalStore.Factory<N,?> factory()`
• #### constant

`public final F constant(Number constant)`
Specified by:
`constant` in interface `MultiaryFunction.Constant<N extends Number,F extends org.ojalgo.function.multiary.AbstractMultiary<N,?>>`
• #### getConstant

`public final N getConstant()`
Specified by:
`getConstant` in interface `MultiaryFunction.Constant<N extends Number,F extends org.ojalgo.function.multiary.AbstractMultiary<N,?>>`
• #### getLinearFactors

`public Access1D<N> getLinearFactors()`
Specified by:
`getLinearFactors` in interface `MultiaryFunction.TwiceDifferentiable<N extends Number>`
Returns:
• #### setConstant

`public final void setConstant(Number constant)`
Specified by:
`setConstant` in interface `MultiaryFunction.Constant<N extends Number,F extends org.ojalgo.function.multiary.AbstractMultiary<N,?>>`
• #### toFirstOrderApproximation

`public final FirstOrderApproximation<N> toFirstOrderApproximation(Access1D<N> arg)`
Specified by:
`toFirstOrderApproximation` in interface `MultiaryFunction.TwiceDifferentiable<N extends Number>`
• #### toSecondOrderApproximation

`public final SecondOrderApproximation<N> toSecondOrderApproximation(Access1D<N> arg)`
Specified by:
`toSecondOrderApproximation` in interface `MultiaryFunction.TwiceDifferentiable<N extends Number>`
• #### getScalarConstant

`protected final Scalar<N> getScalarConstant()`