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

◆ from_expvector()

bool MonomialInfo::from_expvector ( const_ntuple_monomial e,
long comp,
packed_monomial result ) const
inline

Definition at line 191 of file moninfo.hpp.

194 {
195 // Pack the vector e[0]..e[nvars-1],comp. Create the hash value at the same
196 // time.
198 result[0] = 0;
199 result[1] = comp;
200
201 for (int i = 0; i < nvars; i++)
202 {
203 result[firstvar + i] = e[i];
204 if (e[i] > 0) result[0] += hashfcn[i] * e[i];
205 }
206
207 const int *wt = mWeightVectors.data();
208 for (int j = 0; j < mNumWeights; j++, wt += nvars)
209 {
210 long val = 0;
211 for (int i = 0; i < nvars; i++)
212 {
213 long a = e[i];
214 if (a > 0) val += a * wt[i];
215 }
216 result[2 + j] = val;
217 }
218 return true;
219 }
unsigned long ncalls_from_expvector
Definition moninfo.hpp:135
std::vector< int > mWeightVectors
Definition moninfo.hpp:119
monomial_word * hashfcn
Definition moninfo.hpp:111
VALGRIND_MAKE_MEM_DEFINED & result(result)

References firstvar, hashfcn, mNumWeights, mWeightVectors, ncalls_from_expvector, nvars, and result().

Referenced by F4toM2Interface::from_M2_vec().