MultivariatePolynomial.Gradients Method

Definition

Namespace: Numerics.NET.Curves.Surfaces
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0

Overload List

Gradients(Matrix<Double>) Computes the gradients of the surface at multiple points.
Gradients(Matrix<Double>, Matrix<Double>) Computes the gradients of the polynomial at multiple points.
Gradients(ReadOnlySpan2D<Double>, Span2D<Double>) Computes the gradients of the polynomial at multiple points stored in column-major layout.

Gradients(Matrix<Double>, Matrix<Double>)

Computes the gradients of the polynomial at multiple points.
C#
public Matrix<double> Gradients(
	Matrix<double> points,
	Matrix<double>? result = null
)

Parameters

points  Matrix<Double>
A matrix where each row represents one point.
result  Matrix<Double>  (Optional)
An optional matrix to receive the computed gradients. If null, a new matrix is allocated. Each row corresponds to one point, and each column corresponds to one coordinate dimension.

Return Value

Matrix<Double>
A matrix where row i contains the gradient at point i.

Exceptions

ArgumentNullExceptionpoints is null.
ArgumentException The number of columns in points does not equal Dimension, or result is not null and its dimensions are incorrect.

Gradients(ReadOnlySpan2D<Double>, Span2D<Double>)

Computes the gradients of the polynomial at multiple points stored in column-major layout.
C#
public void Gradients(
	ReadOnlySpan2D<double> points,
	Span2D<double> gradients
)

Parameters

points  ReadOnlySpan2D<Double>
A 2D read-only span containing the points in column-major order, where each column represents one point and rows represent coordinate dimensions.
gradients  Span2D<Double>
A 2D span to receive the computed gradients. Each column corresponds to one point, and each row corresponds to one coordinate dimension.

Remarks

This method computes the gradient at each point stored as a column in points and stores the results in the corresponding column of gradients.

Exceptions

ArgumentException The dimensions of points or gradients are incorrect.

See Also