flatsurf / e-antic

Embedded algebraic number fields
https://flatsurf.github.io/e-antic/libeantic/
GNU Lesser General Public License v3.0
12 stars 11 forks source link

Provide faster method for a +/-= b*c in C++ #209

Open saraedum opened 3 years ago

saraedum commented 3 years ago

Currently, writing a += b*c creates too many temporaries in C++.

We should provide a specialized method to perform such common operations in the C++ interface.

Ideally, we could use yap to rewrite a += b*c to use such a specialized implementation. Creating yap machinery just for this is too much work. We should just provide a function on renf_elem_class to perform these operations.

videlec commented 3 years ago

Directly related to #144

videlec commented 3 years ago

Also, it is customary to implement addmul/submul on the C objects. Such interface exists in arb (void arb_addmul(arb_t z, const arb_t x, const arb_t y, slong prec) and void arb_submul(arb_t z, const arb_t x, const arb_t y, slong prec)) but not in antic.