Macaulay2 Engine
Loading...
Searching...
No Matches
aring-translate.hpp File Reference

Cross-ring coercion templates: mypromote / mylift between two aring rings, and get_from_* from an external M2 numeric type into an aring. More...

#include "aring-RR.hpp"
#include "aring-CC.hpp"
#include "aring-RRR.hpp"
#include "aring-CCC.hpp"
#include "aring-RRi.hpp"
#include "aring-CCi.hpp"
#include "aring-zz-gmp.hpp"
#include "aring-zzp.hpp"
#include "aring-zzp-ffpack.hpp"
#include "aring-qq.hpp"
#include "aring-m2-gf.hpp"
#include "aring-tower.hpp"
#include "aring-zz-flint.hpp"
#include "aring-zzp-flint.hpp"
#include "aring-gf-flint-big.hpp"
#include "aring-gf-flint.hpp"

Go to the source code of this file.

Namespaces

namespace  M2

Functions

template<typename RT>
bool M2::get_from_BigReal (const RT &R, typename RT::ElementType &a, gmp_RR b)
template<typename RT>
bool M2::get_from_Interval (const RT &R, typename RT::ElementType &a, gmp_RRi b)
template<typename RT>
bool M2::get_from_ComplexInterval (const RT &R, typename RT::ElementType &a, gmp_CCi b)
template<typename RT>
bool M2::get_from_BigComplex (const RT &R, typename RT::ElementType &a, gmp_CC b)
template<typename RT>
bool M2::get_from_double (const RT &R, typename RT::ElementType &a, double b)
template<typename RT>
bool M2::get_from_complex_double (const RT &R, typename RT::ElementType &a, double re, double im)
bool M2::get_from_BigReal (const ARingRR &R, ARingRR::ElementType &a, gmp_RR b)
bool M2::get_from_BigReal (const ARingRRR &R, ARingRRR::ElementType &a, gmp_RR b)
bool M2::get_from_BigReal (const ARingRRi &R, ARingRRi::ElementType &a, gmp_RR b)
bool M2::get_from_BigReal (const ARingCC &R, ARingCC::ElementType &a, gmp_RR b)
bool M2::get_from_BigReal (const ARingCCC &R, ARingCCC::ElementType &a, gmp_RR b)
bool M2::get_from_BigComplex (const ARingCCC &R, ARingCCC::ElementType &a, gmp_CC b)
bool M2::get_from_BigComplex (const ARingCC &R, ARingCC::ElementType &a, gmp_CC b)
bool M2::get_from_double (const ARingRRR &R, ARingRRR::ElementType &a, double b)
bool M2::get_from_double (const ARingRRi &R, ARingRRi::ElementType &a, double b)
bool M2::get_from_Interval (const ARingRRi &R, ARingRRi::ElementType &a, gmp_RRi b)
bool M2::get_from_ComplexInterval (const ARingCCi &R, ARingCCi::ElementType &a, gmp_CCi b)
bool M2::get_from_double (const ARingCCi &R, ARingCCi::ElementType &a, double b)
bool M2::get_from_Interval (const ARingCCi &R, ARingCCi::ElementType &a, gmp_RRi b)
bool M2::get_from_BigComplex (const ARingCCi &R, ARingCCi::ElementType &a, gmp_CC b)
bool M2::get_from_BigReal (const ARingCCi &R, ARingCCi::ElementType &a, gmp_RR b)
bool M2::get_from_double (const ARingRR &R, ARingRR::ElementType &a, double b)
bool M2::get_from_double (const ARingCCC &R, ARingCCC::ElementType &a, double b)
bool M2::get_from_double (const ARingCC &R, ARingCC::ElementType &a, double b)
bool M2::get_from_complex_double (const ARingCCC &R, ARingCCC::ElementType &a, double re, double im)
bool M2::get_from_complex_double (const ARingCC &R, ARingCC::ElementType &a, double re, double im)
bool M2::get_from_complex_double (const ARingCCi &R, ARingCCi::ElementType &a, double re, double im)
template<typename RingR, typename RingS>
bool M2::mypromote (const RingR &R, const RingS &S, const typename RingR::ElementType &fR, typename RingS::ElementType &result_fS)
template<typename RingR, typename RingS>
bool M2::mylift (const RingR &R, const RingS &S, typename RingR::ElementType &result_gR, const typename RingS::ElementType &gS)
bool M2::mypromote (const ARingQQ &R, const ARingRR &S, const ARingQQ::ElementType &fR, ARingRR::ElementType &fS)
bool M2::mypromote (const ARingQQ &R, const ARingRRR &S, const ARingQQ::ElementType &fR, ARingRRR::ElementType &fS)
bool M2::mypromote (const ARingQQ &R, const ARingRRi &S, const ARingQQ::ElementType &fR, ARingRRi::ElementType &fS)
bool M2::mypromote (const ARingQQ &R, const ARingCC &S, const ARingQQ::ElementType &fR, ARingCC::ElementType &fS)
bool M2::mypromote (const ARingQQ &R, const ARingCCC &S, const ARingQQ::ElementType &fR, ARingCCC::ElementType &fS)
bool M2::mypromote (const ARingRR &R, const ARingRR &S, const ARingRR::ElementType &fR, ARingRR::ElementType &fS)
bool M2::mypromote (const ARingRR &R, const ARingRRR &S, const ARingRR::ElementType &fR, ARingRRR::ElementType &fS)
bool M2::mypromote (const ARingRR &R, const ARingCC &S, const ARingRR::ElementType &fR, ARingCC::ElementType &fS)
bool M2::mypromote (const ARingRR &R, const ARingCCC &S, const ARingRR::ElementType &fR, ARingCCC::ElementType &fS)
bool M2::mypromote (const ARingRRR &R, const ARingRRR &S, const ARingRRR::ElementType &fR, ARingRRR::ElementType &fS)
bool M2::mypromote (const ARingRRR &R, const ARingRR &S, const ARingRRR::ElementType &fR, ARingRR::ElementType &fS)
bool M2::mypromote (const ARingRRR &R, const ARingCCC &S, const ARingRRR::ElementType &fR, ARingCCC::ElementType &fS)
bool M2::mypromote (const ARingRRR &R, const ARingCC &S, const ARingRRR::ElementType &fR, ARingCC::ElementType &fS)
bool M2::mypromote (const ARingRRi &R, const ARingRRi &S, const ARingRRi::ElementType &fR, ARingRRi::ElementType &fS)
bool M2::mypromote (const ARingRR &R, const ARingRRi &S, const ARingRR::ElementType &fR, ARingRRi::ElementType &fS)
bool M2::mypromote (const ARingRRR &R, const ARingRRi &S, const ARingRRR::ElementType &fR, ARingRRi::ElementType &fS)
bool M2::mypromote (const ARingCC &R, const ARingCC &S, const ARingCC::ElementType &fR, ARingCC::ElementType &fS)
bool M2::mypromote (const ARingCC &R, const ARingCCC &S, const ARingCC::ElementType &fR, ARingCCC::ElementType &fS)
bool M2::mypromote (const ARingCCC &R, const ARingCC &S, const ARingCCC::ElementType &fR, ARingCC::ElementType &fS)
bool M2::mypromote (const ARingCCC &R, const ARingCCC &S, const ARingCCC::ElementType &fR, ARingCCC::ElementType &fS)
bool M2::mypromote (const ARingCCi &R, const ARingCCi &S, const ARingCCi::ElementType &fR, ARingCCi::ElementType &fS)
bool M2::mypromote (const ARingRR &R, const ARingCCi &S, const ARingRR::ElementType &fR, ARingCCi::ElementType &fS)
bool M2::mypromote (const ARingRRi &R, const ARingCCi &S, const ARingRRi::ElementType &fR, ARingCCi::ElementType &fS)
bool M2::mypromote (const ARingRRR &R, const ARingCCi &S, const ARingRRR::ElementType &fR, ARingCCi::ElementType &fS)
bool M2::mypromote (const ARingCC &R, const ARingCCi &S, const ARingCC::ElementType &fR, ARingCCi::ElementType &fS)
bool M2::mypromote (const ARingCCC &R, const ARingCCi &S, const ARingCCC::ElementType &fR, ARingCCi::ElementType &fS)
bool M2::mylift (const ARingRRR &R, const ARingRR &S, ARingRRR::ElementType &result_gR, const ARingRR::ElementType &gS)
bool M2::mylift (const ARingRRR &R, const ARingRRR &S, ARingRRR::ElementType &result_gR, const ARingRRR::ElementType &gS)
bool M2::mylift (const ARingRRR &R, const ARingCCC &S, ARingRRR::ElementType &result_gR, const ARingCCC::ElementType &gS)
bool M2::mylift (const ARingRRR &R, const ARingCC &S, ARingRRR::ElementType &result_gR, const ARingCC::ElementType &gS)
bool M2::mylift (const ARingRR &R, const ARingRR &S, ARingRR::ElementType &result_gR, const ARingRR::ElementType &gS)
bool M2::mylift (const ARingRR &R, const ARingRRR &S, ARingRR::ElementType &result_gR, const ARingRRR::ElementType &gS)
bool M2::mylift (const ARingRR &R, const ARingCCC &S, ARingRR::ElementType &result_gR, const ARingCCC::ElementType &gS)
bool M2::mylift (const ARingRR &R, const ARingCC &S, ARingRR::ElementType &result_gR, const ARingCC::ElementType &gS)
bool M2::mylift (const ARingCCC &R, const ARingCCC &S, ARingCCC::ElementType &result_gR, const ARingCCC::ElementType &gS)
bool M2::mylift (const ARingCCC &R, const ARingCC &S, ARingCCC::ElementType &result_gR, const ARingCC::ElementType &gS)
bool M2::mylift (const ARingCC &R, const ARingCCC &S, ARingCC::ElementType &result_gR, const ARingCCC::ElementType &gS)
bool M2::mylift (const ARingCC &R, const ARingCC &S, ARingCC::ElementType &result_gR, const ARingCC::ElementType &gS)
bool M2::mylift (const ARingRR &R, const ARingRRi &S, ARingRR::ElementType &result_gR, const ARingRRi::ElementType &gS)
bool M2::mylift (const ARingRRR &R, const ARingRRi &S, ARingRRR::ElementType &result_gR, const ARingRRi::ElementType &gS)
bool M2::mylift (const ARingQQ &R, const ARingRRi &S, ARingQQ::ElementType &result_gR, const ARingRRi::ElementType &gS)

Detailed Description

Cross-ring coercion templates: mypromote / mylift between two aring rings, and get_from_* from an external M2 numeric type into an aring.

Note
AI-generated documentation. Verify against the source before relying on it.

Declares the templated cross-ring coercion routines: mypromote<RingR, RingS>(R, S, fR, result_fS) for the forward direction R -> S (e.g. Q -> RR via S.set_from_mpq, Z -> Z/p), mylift<RingR, RingS> for the reverse S -> R (e.g. Z/p -> Z lifting to a canonical representative), and the get_from_* family (get_from_BigReal, get_from_BigComplex, get_from_Interval, get_from_ComplexInterval, get_from_double, get_from_complex_double) that injects an external M2 numeric type into an aring element. Each generic template body returns false to signal "this pair is unsupported"; the supported pairs (ARingQQ -> ARingRR / ARingRRR / ARingRRi / ARingCC, the various BigReal/Complex/Interval -> ARing*, ...) are added as inline overload-resolution specialisations further down. Because each aring's own header knows only about itself, this file pulls in every aring-*.hpp so the specialisations have access to both source and target types.

Together with aring-glue.hpp this file completes the aring integration story: aring-glue.hpp is the vertical bridge (aring up to the legacy Ring* API) and aring-translate.hpp is the horizontal bridge (aring across to another aring). The promote / lift paths in the legacy Ring machinery funnel through these templates whenever the source and target rings are both aring-backed.

See also
aring.hpp
aring-glue.hpp
ringmap.hpp

Definition in file aring-translate.hpp.