Solves the linear system AX = B.

Namespace:  CenterSpace.NMath.Core
Assembly:  NMath (in NMath.dll) Version: 5.1.0.0

Syntax

C#
public static DoubleComplexMatrix Solve(
	DoubleComplexMatrix A,
	DoubleComplexMatrix B
)
Visual Basic (Declaration)
Public Shared Function Solve ( _
	A As DoubleComplexMatrix, _
	B As DoubleComplexMatrix _
) As DoubleComplexMatrix
Visual C++
public:
static DoubleComplexMatrix^ Solve(
	DoubleComplexMatrix^ A, 
	DoubleComplexMatrix^ B
)

Parameters

A
Type: CenterSpace.NMath.Core..::.DoubleComplexMatrix
A coefficient matrix.
B
Type: CenterSpace.NMath.Core..::.DoubleComplexMatrix
The matrix of right hand sides. B must have the same number of rows as the matrix A.

Return Value

A matrix with the same number of columns as B containing the solutions.

Remarks

The ith column of X, X(i), is the solution to the equation AX(i) = B(i), where B(i) is the ith column of B.
Note that a DoubleComplexLUFact 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:

Examples

DoubleComplexLUFact fact = new DoubleComplexLUFact( A, false ); ... fact.Solve( B );

Exceptions

ExceptionCondition
CenterSpace.NMath.Core..::.MatrixNotSquareExceptionThrown if the matrix is not square.
CenterSpace.NMath.Core..::.SingularMatrixExceptionThrown if the matrix is singular.
CenterSpace.NMath.Core..::.MismatchedSizeExceptionThrown if the number of rows in B is different than the number of rows in the matrix A.

See Also