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

◆ support()

M2_arrayint Tower::support ( const ring_elem a) const
virtual

Reimplemented from Ring.

Definition at line 91 of file tower.cpp.

92{
93 TowerPolynomial f1 = TOWER_POLYNOMIAL_VAL(a);
94 std::vector<int> max_degs;
95 D->degrees_of_vars(f1, max_degs);
96 int nelems = 0;
97 for (size_t i = 0; i < max_degs.size(); i++)
98 if (max_degs[i] > 0) nelems++;
99 M2_arrayint result = M2_makearrayint(nelems);
100 int next = 0;
101 for (size_t i = 0; i < max_degs.size(); i++)
102 if (max_degs[i] > 0) result->array[next++] = static_cast<int>(i);
103 return result;
104}
DRing * D
Definition tower.hpp:66
VALGRIND_MAKE_MEM_DEFINED & result(result)
M2_arrayint M2_makearrayint(int n)
Definition m2-types.cpp:6
#define TOWER_POLYNOMIAL_VAL(f)
Definition tower.cpp:12

References D, M2_makearrayint(), result(), and TOWER_POLYNOMIAL_VAL.