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

◆ column2by2()

template<typename CoeffRing>
void SMat< CoeffRing >::column2by2 ( size_t c1,
size_t c2,
elem a1,
elem a2,
elem b1,
elem b2 )

Definition at line 974 of file smat.hpp.

983{
984 // Make first column: v1 = a1*c1+a2*c2
987 vec_scale(v1, a1);
988 vec_scale(v2, a2);
989 vec_add_to(v1, v2);
990
991 // Second column: w1 = b1*c1 + b2*c2
994 vec_scale(w1, b1);
995 vec_scale(w2, b2);
996 vec_add_to(w1, w2);
997
998 // Set the matrices:
999 columns_[c1] = v1;
1000 columns_[c2] = w1;
1001}
void vec_scale(sparsevec *&v, const elem &a) const
Definition smat.hpp:461
void vec_add_to(sparsevec *&v, sparsevec *&w) const
Definition smat.hpp:542
sparsevec * vec_copy(const sparsevec *v) const
Definition smat.hpp:305
sparsevec ** columns_
Definition smat.hpp:234
Definition smat.hpp:43

References columns_, vec_add_to(), vec_copy(), and vec_scale().

Referenced by MatElementaryOps< SMat< RT > >::column2by2().