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

◆ make_minimal()

Matrix * res2_comp::make_minimal ( int i) const

Definition at line 2119 of file res-a0.cpp.

2120{
2121 const FreeModule *F = minimal_free_of(i - 1);
2122 const FreeModule *G = minimal_free_of(i);
2123 MatrixConstructor result(F, G, nullptr);
2124 if (i <= 0 || i >= resn.size() - 1) return result.to_matrix();
2125 if (do_by_level > 0) return make(i);
2126
2127 VECTOR(res2_pair *) elems;
2128 VECTOR(res2term *) stripped;
2129
2130 int n = 0;
2131 for (res2_pair *p = resn[i]->pairs; p != nullptr; p = p->next)
2132 {
2133 p->me = n++;
2134 elems.push_back(p);
2135 stripped.push_back(static_cast<res2term *>(nullptr));
2136 }
2137
2138 int thisx = 0;
2139 for (int x = 0; x < elems.size(); x++)
2140 {
2141 res2_pair *p = elems[x];
2142 if (p->syz_type == SYZ2_MINIMAL)
2143 {
2144 if (stripped[p->me] == nullptr)
2145 {
2146 stripped[p->me] = R->strip(p->syz);
2147 reduce_minimal(x, stripped[p->me], elems, stripped);
2148 }
2149 result.set_column(thisx++, R->to_vector(stripped[p->me], F, 1));
2150 }
2151 }
2152
2153 return result.to_matrix();
2154}
res2_poly * R
Definition res-a0.hpp:123
Matrix * make(int i) const
Definition res-a0.cpp:2073
FreeModule * minimal_free_of(int i) const
Definition res-a0.cpp:2052
void reduce_minimal(int x, res2term *&f, VECTOR(res2_pair *)&elems, VECTOR(res2term *)&stripped) const
Definition res-a0.cpp:2091
unsigned char do_by_level
Definition res-a0.hpp:173
int p
VALGRIND_MAKE_MEM_DEFINED & result(result)
#define VECTOR(T)
Definition newdelete.hpp:78
volatile int x
@ SYZ2_MINIMAL
tbb::flow::graph G

References do_by_level, G, make(), Matrix, minimal_free_of(), p, R, reduce_minimal(), result(), SYZ2_MINIMAL, VECTOR, and x.

Referenced by get_matrix().