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

◆ quotient() [1/2]

MonomialIdeal * MonomialIdeal::quotient ( const MonomialIdeal & J) const

Definition at line 773 of file monideal.cpp.

774{
775 // std::cout << "--calling quotient -- I = ";
776 // dmonideal(const_cast<MonomialIdeal*>(this));
777 // std::cout << std::endl << " -- J = ";
778 // dmonideal(const_cast<MonomialIdeal*>(&J));
779 // std::cout << std::endl << " -- I:J = ";
780 // debug_check();
781 // J.debug_check();
782
784 Bag *b = new Bag();
785 varpower::one(b->monom());
786 result->insert(b);
787 for (Bag& a : J)
788 {
789 MonomialIdeal *result1 = quotient(a.monom().data());
790 // result1->debug_check();
791 MonomialIdeal *next_result = result->intersect(*result1);
792 // next_result->debug_check();
793 delete result1;
794 delete result;
795 result = next_result;
796 }
797 // dmonideal(result);
798 // std::cout << "----" << std::endl;
799 GC_reachable_here(&J);
800 return result;
801}
static void one(Vector &result)
MonomialIdeal * quotient(const_varpower m) const
Definition monideal.cpp:759
MonomialIdeal(const PolynomialRing *RR, stash *mi_stash=nullptr)
Definition monideal.cpp:91
const PolynomialRing * get_ring() const
Definition monideal.hpp:190
gc_vector< int > & monom()
Definition int-bag.hpp:60
int_bag Bag
Definition int-bag.hpp:70
VALGRIND_MAKE_MEM_DEFINED & result(result)

References get_ring(), int_bag::monom(), MonomialIdeal(), ExponentList< int, true >::one(), quotient(), and result().