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

◆ get_pairs()

int gb2_comp::get_pairs ( )
private

Definition at line 530 of file res-a2-gb.cpp.

531{
532 int n = 0;
533 s_pair head;
534 s_pair *slast = &head;
535
536 for (;;)
537 {
538 s_pair *p = spairs->remove();
539 if (p == nullptr) break;
540 if (p->degree != this_degree)
541 {
542 spairs->put_back(p);
543 break;
544 }
545
546 slast->next = p;
547 slast = p;
548 n++;
549 }
550
551 slast->next = nullptr;
552 these_pairs = head.next;
553 total_pairs.push_back(this_degree);
554 total_pairs.push_back(n);
555 return n;
556}
gc_vector< int > total_pairs
Definition res-a2.hpp:131
s_pair * these_pairs
Definition res-a2.hpp:130
int this_degree
Definition res-a2.hpp:125
s_pair_heap * spairs
Definition res-a2.hpp:129
int p
s_pair * next
Definition spair.hpp:90

References s_pair::next, p, spairs, these_pairs, this_degree, and total_pairs.

Referenced by calc_gb().