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

◆ wrapperFrobbyAlexanderDual()

MonomialIdeal * wrapperFrobbyAlexanderDual ( const MonomialIdeal * I,
const M2_arrayint top )
static

Definition at line 362 of file monomial-ideal.cpp.

366{
367 // Create a Frobby Ideal containing I.
368 int nv = I->topvar() + 1;
369 if (nv == 0)
370 {
371 INTERNAL_ERROR("attempting to use frobby with zero variables");
372 return nullptr;
373 }
374
375 mpz_t *topvec = nullptr;
376 if (top->len > 0)
377 {
378 topvec = newarray(mpz_t, top->len);
379 for (int i = 0; i < top->len; i++)
380 mpz_init_set_si(topvec[i], top->array[i]);
381 }
382
384
385 // Clean up
386 if (topvec != nullptr)
387 {
388 for (int i = 0; i < top->len; i++) mpz_clear(topvec[i]);
389 freemem(topvec);
390 }
391
392 return result;
393}
int topvar() const
Definition monideal.hpp:187
Engine-side monomial ideal: a decision tree of Nmi_nodes storing the (typically minimal) generators b...
Definition monideal.hpp:136
void INTERNAL_ERROR(const char *s,...)
Definition error.c:36
void freemem(void *s)
Definition m2-mem.cpp:103
VALGRIND_MAKE_MEM_DEFINED & result(result)
static MonomialIdeal * FrobbyAlexanderDual(const MonomialIdeal *I, const mpz_t *topvec)
#define newarray(T, len)
Definition newdelete.hpp:82

References freemem(), FrobbyAlexanderDual(), INTERNAL_ERROR(), newarray, result(), and MonomialIdeal::topvar().

Referenced by alexDual().