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

◆ subduct1() [2/2]

ring_elem sagbi::subduct1 ( int numslots,
const PolyRing * T,
const PolyRing * S,
ring_elem a,
const RingMap * inclusionAmbient,
const RingMap * fullSubstitution,
const RingMap * substitutionInclusion,
GBComputation * gbI,
GBComputation * gbReductionIdeal )
static

Definition at line 71 of file sagbi.cpp.

80{
81 Nterm *f = a;
82 ring_elem fr = f;
83 MatrixConstructor matT(T->make_FreeModule(1), 1);
84 MatrixConstructor matS(S->make_FreeModule(1), 1);
85 bool breakFlag = false;
86
87 (void) numslots;
88 while ((f != nullptr) && (breakFlag == false))
89 {
90 // tensorRingg = S#"inclusionAmbient" liftg
91 // tesnorRingg = gInT
92 ring_elem gInT = S->eval(inclusionAmbient,fr,0);
93
94 // This might be the wrong way to deal with this issue.
95 // I don't know what to do, however.
96 if(gInT != nullptr)
97 {
98 // tensorRingLTg = leadTerm tensorRingg
99 // tensorRingLTg = LTgInT
100 Nterm *LTgInT = gInT;
101 LTgInT->next = nullptr;
102
103 // h = tensorRingLTg % (inAIdeal)
104 // h = h1
105 matT.set_entry(0,0,LTgInT);
106 Matrix *m = matT.to_matrix();
107 const Matrix *n = gbReductionIdeal->matrix_remainder(m);
108 ring_elem h1 = n->elem(0,0);
109 delete m;
110 delete n;
111
112 ring_elem projectionh = T->eval(substitutionInclusion,h1,0);
113
114 if(projectionh != nullptr)
115 {
116 // hSub = (S#"fullSubstitution" h) % I
117 ring_elem hInS = T->eval(fullSubstitution,h1,0);
118 matS.set_entry(0,0,hInS);
119 Matrix *k = matS.to_matrix();
120 const Matrix *l = gbI->matrix_remainder(k);
121 ring_elem h1InS = l->elem(0,0);
122 delete k;
123 delete l;
124
125 S->internal_subtract_to(fr,h1InS);
126 f = fr;
127 }
128 else
129 breakFlag = true;
130 }
131 else
132 breakFlag = true;
133 }
134
135 return ring_elem(f);
136}
virtual const Matrix * matrix_remainder(const Matrix *m)=0
ring_elem elem(int i, int j) const
Definition matrix.cpp:307
virtual ring_elem eval(const RingMap *map, const ring_elem f, int first_var) const
Definition poly.cpp:1346
void internal_subtract_to(ring_elem &f, ring_elem &g) const
Definition poly.cpp:744
virtual FreeModule * make_FreeModule() const
Definition ring.cpp:53
#define Matrix
Definition factory.cpp:14
Nterm * next
Definition ringelem.hpp:157
#define T
Definition table.c:13

References Matrix::elem(), PolyRing::eval(), PolyRing::internal_subtract_to(), Ring::make_FreeModule(), Matrix, GBComputation::matrix_remainder(), Nterm::next, MatrixConstructor::set_entry(), T, and MatrixConstructor::to_matrix().

Referenced by rawSubduction1(), and subduct1().