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

◆ vec_divide()

template<typename CoeffRing>
void SMat< CoeffRing >::vec_divide ( sparsevec *& v,
const elem & a ) const
private

Definition at line 517 of file smat.hpp.

518{
519 if (ring().is_zero(a))
520 {
521 vec_remove(v);
522 v = 0;
523 return;
524 }
526 head.next = v;
527 for (sparsevec *p = &head; p->next != 0; p = p->next)
528 {
529 ring().divide(p->next->coeff, p->next->coeff, a);
530 if (ring().is_zero(p->next->coeff))
531 {
532 sparsevec *tmp = p->next;
533 p->next = tmp->next;
535 if (p->next == 0) break;
536 }
537 }
538 v = head.next;
539}
const CoeffRing & ring() const
Definition smat.hpp:104
void vec_remove(sparsevec *&v) const
Definition smat.hpp:294
bool is_zero() const
Definition smat.hpp:1107
void vec_remove_node(sparsevec *&v) const
Definition smat.hpp:287
Definition smat.hpp:43

References is_zero(), SMat< ACoeffRing >::sparsevec::next, p, ring(), vec_remove(), and vec_remove_node().

Referenced by divide_column().