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

◆ diff()

int SkewMultiplication::diff ( const int * exp1,
const int * exp2,
int * result ) const

Definition at line 109 of file skew.cpp.

114{
115 for (int i = 0; i < _n_vars; i++)
116 {
117 int cmp = exp2[i] - exp1[i];
118 if (cmp < 0) return 0;
119 result[i] = cmp;
120 }
123 int a = skew_vars(result, SKEW1);
124 int b = skew_vars(exp1, SKEW2);
125 int sign = sort_sign(a, SKEW1, b, SKEW2);
126 int c = b % 4;
127 if (c == 2 || c == 3) sign = -sign;
128 return sign;
129}
exponents::Exponents exponents_t
unsigned long skew_byte_size
Definition skew.hpp:62
int skew_vars(const int *exp, int *result) const
Definition skew.cpp:61
VALGRIND_MAKE_MEM_DEFINED & result(result)
#define ALLOCATE_EXPONENTS(byte_len)
Definition monoid.hpp:62
const mpreal exp2(const mpreal &x, mp_rnd_t r=mpreal::get_default_rnd())
Definition mpreal.h:2299
static int sort_sign(int a, int *v1, int b, int *v2)
Definition skew.cpp:19

References _n_vars, ALLOCATE_EXPONENTS, result(), skew_byte_size, skew_vars(), and sort_sign().