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

◆ find_unit()

bool MutableComplex::find_unit ( iterator & i,
const size_t flags ) const

Definition at line 80 of file mutablecomplex.cpp.

81{
82 if (!(flags & FLAG_BEST_UNIT)) return next_unit(i, flags);
83
84 iterator j(*this, i.index());
85 if (!next_unit(j, flags)) return false;
86 size_t t = -1, s = complexity(j, flags);
87 while (next_unit(j, flags))
88 {
89 s = complexity(j, flags);
90 if (s < t)
91 {
92 t = s;
93 *i = *j;
94 }
95 ++j;
96 }
97 return true;
98}
Cursor pointing at one entry of one differential matrix in the complex: a (matrix index,...
bool next_unit(iterator &i, const size_t flags) const
size_t complexity(const iterator &i, const size_t flags) const
const size_t flags
void size_t s
Definition m2-mem.cpp:271
#define FLAG_BEST_UNIT

References complexity(), FLAG_BEST_UNIT, flags, MutableComplex::iterator::index(), next_unit(), and s.

Referenced by prune_matrix().