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

◆ flip()

Matrix * Matrix::flip ( const FreeModule * G,
const FreeModule * H )
static

Definition at line 547 of file matrix.cpp.

548{
549 const Ring *R = F->get_ring();
550 if (R != G->get_ring())
551 {
552 ERROR("flip: expected same ring");
553 return nullptr;
554 }
555 const FreeModule *H = F->tensor(G);
556 const FreeModule *K = G->tensor(F);
557
558 MatrixConstructor mat(K, H, nullptr);
559 int next = 0;
560 for (int f = 0; f < F->rank(); f++)
561 for (int g = 0; g < G->rank(); g++)
562 mat.set_column(next++, R->e_sub_i(f + g * F->rank()));
563 return mat.to_matrix();
564}
FreeModule * tensor(const FreeModule *G) const
Definition freemod.cpp:271
friend class FreeModule
Definition matrix.hpp:73
friend class MatrixConstructor
Definition matrix.hpp:76
vec e_sub_i(int r) const
Definition ring-vecs.cpp:85
const int ERROR
Definition m2-mem.cpp:55
tbb::flow::graph G

References Ring::e_sub_i(), ERROR, flip(), FreeModule, G, FreeModule::get_ring(), Matrix(), MatrixConstructor, FreeModule::rank(), MatrixConstructor::set_column(), FreeModule::tensor(), and MatrixConstructor::to_matrix().

Referenced by flip().