chsvlib
chsv helper source code

◆ SolveRightSLE()

derived_type SolveRightSLE ( const Matrix< Val, Alloc, Derived_t, Policy > &  refResult) const

Solves a system of linear equations with the current matrix being multiplied to the solution vector from the right such that the specified result is to be a product.

Parameters
refResultis a reference to a vector (represented as a matrix with the only column) that is an expected linear combination of columns of the current matrix.
Returns
One solution to the system, if any exist.

Suppose that \(C_{m\times n}\) is the current matrix, \(R_{m\times 1}\) is a matrix that equals to refResult, and \(X_{n\times 1}\) is the sought result. The method solves the following system of linear equations:

\(C_{m\times n} \cdot X_{n\times 1} = R_{m \times 1}\)

The system need not to be Cramer's.

If the system has no solutions, that is if \(rank\left(A_{m\times n}\right) \neq rank\left(augment\left(A_{m\times n}, R_{m\times 1}\right)\right)\), the method throws std::domain_error exception.

If the system has infinitely many solutions, that is the rank of the system is less than a number columns in the current matrix, then free unknowns are taken zero (i.e. value_type(Chusov::Memory::additive_identity), and the corresponding solution is returned.

Exceptions
Chusov::Exceptions::InvalidParameterExceptionSizes of input matrices do not match for construction of the system of linear equations
std::domain_errorThe system has no solutions