13 pfaffs.append(
R->make_vec(0,
R->one()));
17 if (
p % 2 != 0 ||
p < 0 || (
p >
M->n_cols()) || (
p >
M->n_rows()))
23 for (
int i = 0; i <
p; i++)
row_set[i] = i;
35 pfaffs.append(
R->make_vec(0, r));
67 if (p2 == 2)
return M->elem(
static_cast<int>(r[0]),
static_cast<int>(r[1]));
71 for (
int i = p2 - 2; i >= 0; i--)
76 M->elem(
static_cast<int>(r[p2 - 2]),
static_cast<int>(r[p2 - 1]));
94 size_t temp = r[p2 - 2];
95 for (
size_t i = p2 - 2; i > 0; i--) r[i] = r[i - 1];
103 if (
get_ring()->get_precision() > 0)
105 ERROR(
"pfaffian computations over RR or CC not yet implemented");
const Ring * get_ring() const
Matrix(const FreeModule *rows, const FreeModule *cols, const_monomial degree_shift, VECTOR(vec) &entries)
Matrix * pfaffians(int p) const
ring_elem pfaffian() const
Mutable builder used to assemble an immutable Matrix one column (or one term) at a time.
ring_elem calc_pfaff(void)
ring_elem calc_pfaff(size_t *r, int p)
PfaffianComputation(const Matrix *M, int p)
const Ring * get_ring() const
Computation of pfaffians of a skew symmetric matrix.
static bool increment(size_t n, Subset &s)
Subsets — combinatorial-number-system encoding of p-subsets of {0,...,n-1}.
bool system_interrupted()
system_interrupted() — thread-safe polling predicate for Ctrl+C handling.
VALGRIND_MAKE_MEM_DEFINED & result(result)
void swap(mpfr::mpreal &x, mpfr::mpreal &y)
#define newarray_atomic(T, len)
PfaffianComputation — Pfaffians of skew-symmetric matrices via row expansion.