LinearOperator<T>.Create Method

Creates a linear operator from a vector multiplication function.

Definition

Namespace: Numerics.NET.LinearAlgebra
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.9.0
C#
public static LinearOperator<T> Create(
	int rowCount,
	int columnCount,
	Func<TransposeOperation, Vector<T>, Vector<T>?, Vector<T>> multiply
)

Parameters

rowCount  Int32
The nonnegative number of rows.
columnCount  Int32
The nonnegative number of columns.
multiply  Func<TransposeOperation, Vector<T>, Vector<T>, Vector<T>>
A function receiving the requested transpose operation, input vector and optional destination. Return the product, overwriting every result component. The destination may be null. Implement supported transpose operations or throw NotSupportedException.

Return Value

LinearOperator<T>
A multiplication operator. Direct and least-squares solves are not supported.

Remarks

The delegate is retained. Concurrent use requires a thread-safe delegate. Input and output vectors that are the same instance are separated by copying the input. Returning a different vector is supported; its values are copied into a requested destination. A returned null or wrong-sized vector is rejected.

Exceptions

ArgumentNullExceptionThe multiplication function is null.
ArgumentOutOfRangeExceptionA dimension is negative.

See Also