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

◆ vec_sort()

template<typename CoeffRing>
void SMat< CoeffRing >::vec_sort ( sparsevec *& v) const
private

Definition at line 746 of file smat.hpp.

747{
748 if (f == 0 || f->next == 0) return;
749 sparsevec *f1 = 0;
750 sparsevec *f2 = 0;
751 while (f != 0)
752 {
753 sparsevec *t = f;
754 f = f->next;
755 t->next = f1;
756 f1 = t;
757
758 if (f == 0) break;
759 t = f;
760 f = f->next;
761 t->next = f2;
762 f2 = t;
763 }
764
765 vec_sort(f1);
766 vec_sort(f2);
767 vec_add_to(f1, f2);
768 f = f1;
769}
void vec_sort(sparsevec *&v) const
Definition smat.hpp:746
void vec_add_to(sparsevec *&v, sparsevec *&w) const
Definition smat.hpp:542
Definition smat.hpp:43

References SMat< ACoeffRing >::sparsevec::next, vec_add_to(), and vec_sort().

Referenced by vec_permute(), and vec_sort().