SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.differentiation.multivariate
Class Gradient

java.lang.Object
  extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixMathImpl<T>
      extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixStorageImpl<DenseMatrix>
          extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.dense.DenseMatrix
              extended by com.numericalmethod.suanshu.analysis.differentiation.multivariate.Gradient
All Implemented Interfaces:
DeepCopyable, AbelianGroup<Matrix>, Monoid<Matrix>, Ring<Matrix>, Matrix, MatrixAccessor, MatrixRing, Densifiable, MatrixDimension

public class Gradient
extends DenseMatrix

The gradient of a scalar field is a vector field which points in the direction of the greatest rate of increase of the scalar field, and of which the magnitude is the greatest rate of change.

Mathematically, the gradient of a scalar function is a 1xn matrix, where n is the domain dimension of f.

        ∂f         ∂f
 gf = [----, ..., ----]
        ∂x1        ∂x2
 

The gradient matrix is computed numerically using the finite difference method.

See Also:
FiniteDifference, Wikipedia: Gradient

Constructor Summary
Gradient(RealScalarFunction f, double... x)
          Construct a gradient row matrix for a multivariate function f at point x.
 
Method Summary
 
Methods inherited from class com.numericalmethod.suanshu.matrix.doubles.matrixtype.dense.DenseMatrix
add, deepCopy, getColumn, getColumn, getMatrixData, getRow, getRow, getSample, minus, multiply, multiply, ONE, overwrite, scaled, t, toDense, ZERO
 
Methods inherited from class com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixStorageImpl
equals, get, hashCode, set, setMatrixData
 
Methods inherited from class com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixMathImpl
add, call, minus, multiply, nCols, nRows, opposite, setColumn, setColumn, setRow, setRow, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Gradient

public Gradient(RealScalarFunction f,
                double... x)
Construct a gradient row matrix for a multivariate function f at point x.

Parameters:
f - a multivariate function
x - the point to evaluate the gradient of f at

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.