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

◆ add()

template<class FREEMODULETYPE, class VECTYPE>
void geobucket< FREEMODULETYPE, VECTYPE >::add ( VECTYPE p)
inline

Definition at line 99 of file geobucket.hpp.

100{
101 mLead = -1;
102 int len = F->n_terms(p);
103 int i= 0;
104 while (len >= heap_size[i]) i++;
105 F->add_to(heap[i], p);
106 len = F->n_terms(heap[i]);
107 p = NULL;
108 while (len >= heap_size[i])
109 {
110 i++;
111 F->add_to(heap[i], heap[i-1]);
112 len = F->n_terms(heap[i]);
113 heap[i-1] = NULL;
114 }
115 if (i > top_of_heap)
116 top_of_heap = i;
117}
VECTYPE heap[GEOHEAP_SIZE]
Definition geobucket.hpp:56
FREEMODULETYPE * F
Definition geobucket.hpp:54
int top_of_heap
Definition geobucket.hpp:57

References F, heap, heap_size, mLead, p, and top_of_heap.

Referenced by res2_comp::reduce3(), and res2_comp::reduce_heap_by_level().