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

◆ tensor()

FreeModule * FreeModule::tensor ( const FreeModule * G) const

Definition at line 271 of file freemod.cpp.

273{
274 if (R != G->get_ring())
275 {
276 ERROR("expected free modules over the same ring");
277 return nullptr;
278 }
279 auto D = R->degree_monoid();
281 monomial deg = D->make_one();
282
283 for (int i = 0; i < rank(); i++)
284 for (int j = 0; j < G->rank(); j++)
285 {
286 D->mult(degree(i), G->degree(j), deg);
287 result->append(deg);
288 }
289
290 D->remove(deg);
291 if (schreyer != nullptr && G->schreyer != nullptr)
292 result->schreyer = schreyer->tensor(G->schreyer);
293 return result;
294}
virtual FreeModule * new_free() const
Definition freemod.cpp:125
SchreyerOrder * schreyer
Definition freemod.hpp:73
const_monomial degree(int i) const
Definition freemod.hpp:104
FreeModule(const Ring *R, int n, bool has_schreyer_order)
Definition freemod.cpp:32
const Ring * R
Definition freemod.hpp:75
int rank() const
Definition freemod.hpp:105
#define monomial
Definition gb-toric.cpp:11
const int ERROR
Definition m2-mem.cpp:55
VALGRIND_MAKE_MEM_DEFINED & result(result)
tbb::flow::graph G

References degree(), ERROR, FreeModule(), G, monomial, new_free(), R, rank(), result(), and schreyer.

Referenced by Matrix::diff(), Matrix::flip(), IM2_FreeModule_tensor(), Matrix::module_tensor(), and Matrix::wedge_product().