Macaulay2 Engine
Loading...
Searching...
No Matches
◆
subtract_multiple()
void M2::ARingZZpFlint::subtract_multiple
(
ElementType
&
result
,
ElementType
a
,
ElementType
b
) const
inline
Definition at line
201
of file
aring-zzp-flint.hpp
.
204
{
205
ElementType
a1 = nmod_neg(a,
mModulus
);
206
207
// the code below was an attempt to prevent flint from calling the
208
// version of the general multiply code if the product of the two flint
209
// integers always fits in a single limb. Speedup was not significant in testing.
210
211
//if (mModulus.norm >= FLINT_BITS/2) /* addmul will fit in a limb */
212
//{
213
// mp_limb_t ab_hi, ab_lo;
214
// umul_ppmm(ab_hi, ab_lo, a1, b); // a_hi is not needed in this case
215
// ab_lo = nmod_add(result, ab_lo, mModulus);
216
// NMOD_RED(result,ab_lo,mModulus);
217
//}
218
//else // product does not fit in a single limb
219
220
NMOD_ADDMUL(
result
, a1, b,
mModulus
);
221
}
M2::ARingZZpFlint::mModulus
nmod_t mModulus
Definition
aring-zzp-flint.hpp:333
M2::ARingZZpFlint::ElementType
mp_limb_t ElementType
Definition
aring-zzp-flint.hpp:88
result
VALGRIND_MAKE_MEM_DEFINED & result(result)
References
mModulus
, and
result()
.
M2
ARingZZpFlint
Generated on
for Macaulay2 Engine by
1.15.0