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

◆ inverse()

bool ffpackInterface::inverse ( const DMatZZpFFPACK & A,
DMatZZpFFPACK & result_inv )

Definition at line 113 of file dmat.cpp.

114{
115 assert(mat.numRows() == mat.numColumns());
116 result_inv.resize(mat.numRows(), mat.numRows());
117
118 assert(result_inv.numRows() == mat.numRows());
119 assert(result_inv.numColumns() == mat.numRows());
120
121 if (mat.numRows() == 0)
122 {
123 // 26 April 2014: this branch is needed as FFPACK gives answer of 0 in
124 // this case.
125 return true;
126 }
127
128 DMatZZpFFPACK N(mat);
129 size_t n = mat.numRows();
130 int nullspacedim;
131 FFPACK::Invert2(
132 mat.ring().field(), n, N.rowMajorArray(), n, result_inv.rowMajorArray(), n, nullspacedim);
133 return (nullspacedim == 0);
134}
#define DMatZZpFFPACK

References DMatZZpFFPACK.

Referenced by DMatLinAlg< M2::ARingZZpFFPACK >::inverse().