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

◆ mult()

void Monoid::mult ( const_monomial m,
const_monomial n,
monomial result ) const

Definition at line 363 of file monoid.cpp.

364{
366 for (int i = monomial_size_; i != 0; i--) switch (*t++)
367 {
368 case OVER:
369 *result++ = safe::add(*m++, *n++);
370 break;
371 case OVER1:
372 *result++ = safe::pos_add(*m++, *n++);
373 break;
374 case OVER2:
375 *result++ = safe::pos_add_2(*m++, *n++);
376 break;
377 case OVER4:
378 *result++ = safe::pos_add_4(*m++, *n++);
379 break;
380 default:
381 throw(exc::internal_error("missing case"));
382 }
383}
overflow_type
Definition monoid.hpp:146
@ OVER2
Definition monoid.hpp:146
@ OVER4
Definition monoid.hpp:146
@ OVER1
Definition monoid.hpp:146
enum Monoid::overflow_type * overflow
int monomial_size_
size of an encoded monomial
Definition monoid.hpp:123
VALGRIND_MAKE_MEM_DEFINED & result(result)
static int32_t pos_add(int32_t x, int32_t y, const char *msg)
Definition overflow.hpp:197
static int32_t add(int32_t x, int32_t y, const char *msg)
Definition overflow.hpp:116
static int32_t pos_add_4(int32_t x, int32_t y, const char *msg)
Definition overflow.hpp:222
static int32_t pos_add_2(int32_t x, int32_t y, const char *msg)
Definition overflow.hpp:209

References safe::add(), monomial_size_, OVER, OVER1, OVER2, OVER4, overflow, safe::pos_add(), safe::pos_add_2(), safe::pos_add_4(), and result().

Referenced by FreeMonoid::multi_degree(), res2_comp::multi_degree(), ResF4toM2Interface::to_M2_freemodule(), and Ring::vec_is_homogeneous().