5#include <M2/math-include.h>
14#include <libnormaliz/cone.h>
29 const size_t c = C->
n_cols();
30 const size_t r = C->
n_rows();
32 auto ineqs = libnormaliz::Matrix<Integer>(r, c);
33 for (
size_t i = 0; i < r; i++)
34 for (
size_t j = 0; j < c; j++)
36 ineqs[i][j] = (-1) *
static_cast<Integer>(C->
elem(i, j).get_mpz());
38 auto cone = libnormaliz::Cone<Integer>(libnormaliz::Type::inequalities, ineqs);
39 auto rays = cone.getExtremeRays();
40 size_t n = rays.size();
43 for (
size_t i = 0; i < n; i++)
44 for (
size_t j = 0; j < c; j++)
46 mpz_ptr z =
newitem(__mpz_struct);
47 mpz_init_set(z, rays[i][j].get_mpz_t());
69 const size_t c = C->
n_cols();
70 const size_t r = C->
n_rows();
72 auto rays = libnormaliz::Matrix<Integer>(r, c);
73 for (
size_t i = 0; i < r; i++)
74 for (
size_t j = 0; j < c; j++)
77 auto cone = libnormaliz::Cone<Integer>(libnormaliz::Type::cone, rays);
80 auto HB = cone.getHilbertBasis();
84 for (
size_t i = 0; i < n; i++)
85 for (
size_t j = 0; j < c; j++)
87 mpz_ptr z =
newitem(__mpz_struct);
88 mpz_init_set(z, HB[i][j].get_mpz_t());
const Ring * get_ring() const
ring_elem elem(int i, int j) const
void set_entry(int r, int c, ring_elem a)
Mutable builder used to assemble an immutable Matrix one column (or one term) at a time.
virtual FreeModule * make_FreeModule() const
const Matrix * rawHilbertBasis(const Matrix *C)
const Matrix * rawFourierMotzkin(const Matrix *C)
Engine-boundary C API for rational polyhedral cone operations.
Debugger-callable d* helpers that pretty-print engine values to stderr.
void mpz_reallocate_limbs(mpz_ptr _z)
Inline helpers that move GMP / MPFR / MPFI limbs from malloc-managed storage into the bdwgc heap.
MatrixConstructor — the mutable builder that produces an immutable Matrix.
Engine-boundary C API for constructing, transforming, and inspecting immutable Matrix objects.
Matrix — the engine's immutable homomorphism F -> G between free modules.
RingElement — tagged (Ring*, ring_elem) pair, the engine's universal element type.
mpz_srcptr get_mpz() const