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

◆ transpose()

Matrix * Matrix::transpose ( ) const

Definition at line 566 of file matrix.cpp.

567{
568 const FreeModule *F = cols()->transpose();
569 const FreeModule *G = rows()->transpose();
570 const Ring *R = F->get_ring();
571
573
574 // The efficiency of this code relies on the way of ordering
575 // the sparse vectors (lead term has largest component)
576 iterator i(this);
577 for (int c = 0; c < n_cols(); c++)
578 {
579 for (i.set(c); i.valid(); i.next())
580 {
581 ring_elem f = i.entry();
582 mat.set_entry(c, i.row(), R->antipode(f));
583 }
584 }
585 return mat.to_matrix();
586}
FreeModule * transpose() const
Definition freemod.cpp:227
const Ring * get_ring() const
Definition freemod.hpp:102
friend class FreeModule
Definition matrix.hpp:73
const_monomial degree_shift() const
Definition matrix.hpp:149
friend class MatrixConstructor
Definition matrix.hpp:76
int n_cols() const
Definition matrix.hpp:147
const FreeModule * rows() const
Definition matrix.hpp:144
const FreeModule * cols() const
Definition matrix.hpp:145
virtual ring_elem antipode(ring_elem f) const
Definition ring.hpp:517
tbb::flow::graph G

References Ring::antipode(), cols(), degree_shift(), Matrix::iterator::entry(), FreeModule, G, FreeModule::get_ring(), Matrix(), MatrixConstructor, n_cols(), Matrix::iterator::next(), Matrix::iterator::row(), rows(), Matrix::iterator::set(), MatrixConstructor::set_entry(), MatrixConstructor::to_matrix(), transpose(), and Matrix::iterator::valid().

Referenced by IM2_Matrix_transpose(), and transpose().