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

◆ rankUsingSparseMatrix()

template<typename Gen>
int SchreyerFrame::rankUsingSparseMatrix ( Gen & D)

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

608{
610 // std::cout << "--- sparse matrix ----" << std::endl;
611 // dmatrix(M);
612 // std::cout << "----------------------" << std::endl;
613 auto timeA = timer();
614 GaussElimComputation comp { M, 0, 0 };
615 comp.set_stop_conditions(false, nullptr, -1, -1, -1, -1, -1, false, nullptr);
616 comp.start_computation();
617 // const Matrix* gbM = comp.get_gb();
618 // std::cout << "--- gb of matrix ----" << std::endl;
619 // dmatrix(gbM);
620 // std::cout << "----------------------" << std::endl;
621
622 int rk = comp.get_initial(-1)->n_cols();
623 auto timeB = timer();
624 double nsecs = seconds(timeB - timeA);
625
626 timeComputeSparseRanks += nsecs;
627
628 if (M2_gbTrace >= 2)
629 {
630 if (M->n_rows() > 0 and M->n_cols() > 0)
631 std::cout << " sparse rank = " << rk
632 << " time = " << nsecs << " sec"
633 << std::endl;
634 }
635
636 return rk;
637}
Computation * set_stop_conditions(M2_bool always_stop, M2_arrayint degree_limit, int basis_element_limit, int syzygy_limit, int pair_limit, int codim_limit, int subring_limit, M2_bool just_min_gens, M2_arrayint length_limit)
Definition comp.cpp:11
virtual void start_computation()
Definition gauss.cpp:216
virtual const Matrix * get_initial(int nparts)
Definition gauss.cpp:278
int n_cols() const
Definition matrix.hpp:147
int n_rows() const
Definition matrix.hpp:146
#define Matrix
Definition factory.cpp:14
int M2_gbTrace
Definition m2-types.cpp:52
Matrix * matrixFromSparseMatrixGenerator(Gen &G)
std::chrono::steady_clock::time_point timer()
Definition timing.hpp:35
double seconds(DurationType time_diff)
Definition timing.hpp:59

References GaussElimComputation::get_initial(), M2_gbTrace, Matrix, matrixFromSparseMatrixGenerator(), Matrix::n_cols(), Matrix::n_rows(), seconds(), Computation::set_stop_conditions(), GaussElimComputation::start_computation(), timeComputeSparseRanks, and timer().

Referenced by rank().