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

◆ minors() [2/2]

Matrix * Matrix::minors ( int p,
int strategy,
int n_to_compute,
M2_arrayintOrNull first_row,
M2_arrayintOrNull first_col ) const

Definition at line 455 of file det.cpp.

462{
463 if (strategy == DET_BAREISS && get_ring()->get_precision() > 0)
464 {
465 ERROR(
466 "determinant computations over RR or CC requires Strategy=>Cofactor");
467 return nullptr;
468 }
469 if (first_row != nullptr || first_col != nullptr)
470 {
471 // Make sure these are the correct size, and both are given
472 if (first_row == nullptr || first_row->len != p)
473 {
474 ERROR("row index set inappropriate");
475 return nullptr;
476 }
477 if (first_col == nullptr || first_col->len != p)
478 {
479 ERROR("column index set inappropriate");
480 return nullptr;
481 }
482 }
483 DetComputation *d = new DetComputation(this, p, 0, strategy);
484 if (first_row != nullptr && first_col != nullptr)
485 d->set_next_minor(first_row->array, first_col->array);
486 d->calc(n_to_compute);
487 Matrix *result = d->determinants();
488 freemem(d);
489 return result;
490}
void set_next_minor(const int *rows, const int *cols)
Definition det.cpp:258
int calc(int nsteps)
Definition det.cpp:272
Matrix * determinants()
Definition det.hpp:143
const Ring * get_ring() const
Definition matrix.hpp:134
const int DET_BAREISS
Definition det.hpp:45
#define Matrix
Definition factory.cpp:14
int p
void freemem(void *s)
Definition m2-mem.cpp:103
const int ERROR
Definition m2-mem.cpp:55
VALGRIND_MAKE_MEM_DEFINED & result(result)

References DetComputation::calc(), DET_BAREISS, DetComputation::determinants(), ERROR, freemem(), get_ring(), Matrix(), minors(), p, result(), and DetComputation::set_next_minor().