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

◆ rankUsingDenseMatrix()

template<typename Gen>
int SchreyerFrame::rankUsingDenseMatrix ( Gen & D,
bool transposed = true )

Definition at line 640 of file res-f4-m2-interface.cpp.

641{
642 unsigned int charac =
643 static_cast<unsigned int>(vectorArithmetic().ring()->characteristic());
644 M2::ARingZZpFFPACK R(charac);
645 DMat<M2::ARingZZpFFPACK> M(R, 0, 0);
646 if (!transposed)
648 else
650 auto a = DMatLinAlg<M2::ARingZZpFFPACK>(M);
651 // std::cout << "---- dense matrix ----" << std::endl;
652 // displayMat(M);
653 // std::cout << "----------------------" << std::endl;
654 auto timeA = timer();
655 int rk = static_cast<int>(a.rank());
656 auto timeB = timer();
657 double nsecs = seconds(timeB - timeA);
658
659 timeComputeRanks += nsecs;
660
661 if (M2_gbTrace >= 2)
662 {
663 if (M.numRows() > 0 and M.numColumns() > 0)
664 std::cout << " dense rank = " << rk
665 << " time = " << nsecs << " sec"
666 << std::endl;
667 }
668
669 return rk;
670}
long characteristic() const
Definition ring.hpp:159
const VectorArithmetic & vectorArithmetic() const
const Ring * ring() const
int M2_gbTrace
Definition m2-types.cpp:52
void setDMatFromSparseMatrixGeneratorTransposed(Gen &G, DMat< RingType > &M)
void setDMatFromSparseMatrixGenerator(Gen &G, DMat< RingType > &M)
std::chrono::steady_clock::time_point timer()
Definition timing.hpp:35
double seconds(DurationType time_diff)
Definition timing.hpp:59

References Ring::characteristic(), M2_gbTrace, DMat< ACoeffRing >::numColumns(), DMat< ACoeffRing >::numRows(), VectorArithmetic::ring(), seconds(), setDMatFromSparseMatrixGenerator(), setDMatFromSparseMatrixGeneratorTransposed(), timeComputeRanks, timer(), and vectorArithmetic().

Referenced by rank().