Click or drag to resize

NMathFunctionsSolve(FloatComplexMatrix, FloatComplexVector) Method

Computes the solution, x, to the linear system Ax = b.

Namespace: CenterSpace.NMath.Core
Assembly: NMath (in NMath.dll) Version: 7.4
Syntax
public static FloatComplexVector Solve(
	FloatComplexMatrix A,
	FloatComplexVector b
)

Parameters

A  FloatComplexMatrix
A matrix of coefficients.
b  FloatComplexVector
A vector to solve for. Must have the same length as the number of rows of the matrix A.

Return Value

FloatComplexVector
Vector x that is the solution to Ax = b.
Exceptions
ExceptionCondition
MatrixNotSquareExceptionThrown if the matrix is not square.
SingularMatrixExceptionThrown if the matrix is singular.
MismatchedSizeExceptionThrown if the length of b is different than the number of rows in the matrix A.
Remarks
Note that a FloatComplexLUFact instance is created with each call. If you are calling Solve() repeatedly (inside a loop, for example), and the coefficient matrix A is not changing between calls, this is more efficient:
Example
FloatComplexLUFact fact = new FloatComplexLUFact( A, false ); ... fact.Solve( b );
See Also