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

◆ determinant()

template<class RingType>
void DMatLinAlg< RingType >::determinant ( ElementType & result)

Output: result, the determinant of A.

Definition at line 308 of file dmat-lu.hpp.

309{
310 const Mat& LU = mLUObject.LUinPlace();
311
312 // This is just the product of the diagonal entries of mLU.
313 assert(LU.numRows() == LU.numColumns());
314
315 if (mLUObject.signOfPermutation())
316 ring().set_from_long(result, 1);
317 else
318 ring().set_from_long(result, -1);
319 for (size_t i = 0; i < LU.numRows(); i++)
320 ring().mult(result, result, LU.entry(i, i));
321}
DMatLUinPlace< RingType > mLUObject
Definition dmat-lu.hpp:64
const RingType & ring() const
Definition dmat-lu.hpp:107
DMat< RingType > Mat
Definition dmat-lu.hpp:61

References mLUObject, result(), and ring().

Referenced by SLEvaluatorConcrete< RT >::computeNextNode(), and MatrixOps::determinant().