Macaulay2 Engine
Loading...
Searching...
No Matches

◆ inverse() [5/5]

template<typename Mat>
bool MatrixOps::inverse ( const Mat & A,
Mat & result_inv )

the inverse of a square matrix

result_inv is set to the inverse of the square matrix A, if A is invertible. result_inv should be a Mat, with the same ring/type as the input matrix A. result_inv does not need to be the same size as A, it will be resized if needed. returns true exactly when the matrix is invertible, and result_inv has been set.

throws an engine_error for ring/matrix types where the function is not implemented. throws an error if the matrix is not square.

Note: the inverse of a 0 x 0 matrix is another 0 x 0 matrix.

Definition at line 156 of file mat-linalg.hpp.

157{
158 (void) A;
159 (void) result_inv;
160 throw exc::engine_error(
161 "'invert' not implemented for this kind of matrix over this ring");
162}

Referenced by MutableMat< Mat >::invert().