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

◆ mult() [2/2]

void M2::ARingCCC::mult ( ElementType & res,
const ElementType & a,
const RealElementType & b ) const
inline

Definition at line 328 of file aring-CCC.hpp.

331 {
332 mpfr_t tmp;
333 Element result(*this);
334 mpfr_init2(tmp, get_precision());
335
336 // &result.re = &a.re*&b;
337 mpfr_mul(tmp, &a.re, &b, MPFR_RNDN);
338 mpfr_set(&result.value().re, tmp, MPFR_RNDN);
339
340 // &result.im = &a.im*&b;
341 mpfr_mul(tmp, &a.im, &b, MPFR_RNDN);
342 mpfr_set(&result.value().im, tmp, MPFR_RNDN);
343
344 set(res, result);
345 mpfr_clear(tmp);
346 }
unsigned long get_precision() const
Definition aring-CCC.hpp:88
void set(ElementType &result, const ElementType &a) const
VALGRIND_MAKE_MEM_DEFINED & result(result)

References get_precision(), cc_struct::im, cc_struct::re, result(), and set().

Referenced by addMultipleTo(), power(), subtract_multiple(), TEST(), TEST(), TEST(), and TEST().