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

◆ vec_copy()

template<typename CoeffRing>
SMat< CoeffRing >::sparsevec * SMat< CoeffRing >::vec_copy ( const sparsevec * v) const
private

Definition at line 305 of file smat.hpp.

307{
310 for (const sparsevec *p = v; p != 0; p = p->next)
311 {
312 sparsevec *w = vec_new();
313 result->next = w;
314 result = w;
315 w->row = p->row;
316 ring().init_set(w->coeff, p->coeff);
317 }
318 result->next = 0;
319 return head.next;
320}
const CoeffRing & ring() const
Definition smat.hpp:104
sparsevec * vec_new() const
Definition smat.hpp:281
Definition smat.hpp:43

References SMat< ACoeffRing >::sparsevec::coeff, SMat< ACoeffRing >::sparsevec::next, p, result(), ring(), SMat< ACoeffRing >::sparsevec::row, and vec_new().

Referenced by addInPlace(), column2by2(), initialize(), subtractInPlace(), and vec_column_op().