15#include <sys/syscall.h>
57 DECLARE_FUNCTION_1P(fabs)
58 DECLARE_FUNCTION_1P(PL)
59 DECLARE_FUNCTION_1P(CT)
60 DECLARE_FUNCTION_2P(FTX)
61 DECLARE_FUNCTION_2P(VE)
62 DECLARE_FUNCTION_2P(VEO)
63 DECLARE_FUNCTION_2P(VEO2)
64 DECLARE_FUNCTION_2P(CV)
65 DECLARE_FUNCTION_1P(WRA)
101 virtual vector<exmap>
x2y(
const ex &xpol) =0;
102 vector<exmap>
x2y(
const lst &xpols);
104 static bool VerifySD(vector<exmap> vmap,
bool quick =
true);
113 vector<exmap>
x2y(
const ex &xpol)
override;
114 static vector<vector<int>>
RunQHull(
const matrix &pts);
116 vector<matrix> ZeroFaces(
const matrix &pts);
117 matrix NormalVectors(
const vector<matrix> &zfs);
118 matrix DualCone(
const matrix &pts);
119 vector<matrix> SimplexCones(matrix pts);
174 static int Wrapper(
unsigned int xdim,
size_t npts,
const qREAL *x,
void *fdata,
unsigned int ydim,
qREAL *y);
178 virtual ex
Integrate(
size_t n=0)
override;
199 vector<qREAL> LastResult;
200 vector<qREAL> LastAbsErr;
204 int XDQMP(
qREAL const *x);
212 static int Wrapper(
unsigned int xdim,
size_t npts,
const mpREAL *x,
void *fdata,
unsigned int ydim,
mpREAL *y);
214 virtual ex
Integrate(
size_t n=0)
override;
223 ex mp2ex(
const mpREAL & num);
226 bool use_last =
false;
228 vector<mpREAL> LastResult;
229 vector<mpREAL> LastAbsErr;
241 virtual ex
Integrate(
size_t n=0)
override;
246 ex mp2ex(
const mpREAL & num);
257 virtual ex
Integrate(
size_t n=0)
override;
265 ex mp2ex(
const mpREAL & num);
275 virtual ex
Integrate(
size_t n=0)
override;
283 ex mp2ex(
const mpREAL & num);
286 typedef long double dREAL;
314 dREAL UpperBound[50];
315 dREAL LowerBound[50];
324 GINAC_DECLARE_PRINT_CONTEXT(
CppFormat, print_csrc_cl_N)
326 CppFormat(ostream &os,
const string & s =
"L",
unsigned opt = 0);
346 static _init CppFormat_init;
348 static void print_integer(
const CppFormat & c,
const cln::cl_I & x);
349 static void print_real(
const CppFormat & c,
const cln::cl_R & x);
350 static void print_numeric(
const numeric & p,
const CppFormat & c,
unsigned level);
354 GINAC_DECLARE_PRINT_CONTEXT(
ExFormat, print_dflt)
356 ExFormat(ostream &os,
const string & s =
"L",
unsigned opt = 0);
374 static _init ExFormat_init;
375 static void print_integer(
const ExFormat & c,
const cln::cl_I & x);
376 static void print_real(
const ExFormat & c,
const cln::cl_R & x);
377 static void print_numeric(
const numeric & p,
const ExFormat & c,
unsigned level);
412 static void Projectivize(ex &fe,
const ex delta,
const ex xsum=0);
413 static void Scalelize(ex &fe,
const lst xs,
const ex cy);
414 static void Scalelize(ex &fe,
const ex xi,
const ex cy);
415 static exvector
Binarize(ex
const fe, ex
const eqn);
416 static void Binarize(ex
const fe, ex
const eqn, exvector & ovec);
417 static bool isLinearizable(
const ex ft,
const ex delta, lst & xcs);
418 static void Linearize(
const lst xcs, ex & fe, ex & ft);
419 static bool isPartilizable(
const ex ft,
const ex delta, lst &xcs,
int mode=0);
420 static void Partilize(
const lst xcs,
const lst delta,
const ex fe, exvector & ret_lst);
422 static exvector
Evaluate(
const ex & fe);
424 static exvector
Apply(
const exvector & fe_vec,
const ex & ft=0);
425 inline static exvector
Apply(
const ex & fe,
const ex & ft=0) {
427 fe_vec.push_back(fe);
428 return Apply(fe_vec, ft);
464 lst
BisectionPoints = lst { ex(1)/13, ex(1)/19, ex(1)/29, ex(1)/59, ex(1)/41, ex(1)/37, ex(1)/43, ex(1)/53 };
497 void Evaluate(
const string & key=
"");
499 bool IsBad(ex f, vector<exmap> vmap);
502 void Contours(
const string & key =
"",
const string & pkey =
"");
503 void Integrates(
const string & key=
"",
const string & pkey=
"",
int kid=0);
512 static bool VerifySD(vector<exmap> vmap,
bool quick =
true);
516 ex
VEResult(
const ex & chop_err = 0);
518 static ex
PExpand(ex xpol,
bool delta=
true);
519 static int PRank(matrix m);
525 exvector DS(
const ex po_ex);
526 lst Normalize(
const ex &input);
528 bool KillPowerD(ex fe,
int kpi);
529 bool KillPower(ex fe,
int kpi,
int bits);
531 void CompileMatDet();
532 vector<lst> ciResult;
543 ex
Parse(ex expr,
bool reset=
true);
546 vector<pair<int, ex>>
os();
548 map<ex, ex, ex_is_less> ex_var_map;
550 vector<pair<int, ex>> o_ex_vec;
559 const vector<pair<int,ex>> &
vs();
561 ex
Parse(ex expr,
bool reset);
562 map<ex, int, ex_is_less> exn;
566 vector<pair<int,ex>> on_ex_vec;
569 vector<matrix>
Triangularize(
const lst & fs_in,
const ex & xs_in,
const lst & nsubs={});
570 void Triangularize(exvector & FunExp,
const lst & fs_in,
const ex & xs_in,
const lst & nsubs={});
574 auto pbit = mpfr::digits2bits(prec);
575 if(mpfr::mpreal::get_default_prec()!=pbit) mpfr::mpreal::set_default_prec(pbit);
576 mpPi = mpfr::const_pi();
578 mpiEpsilon = complex<mpREAL>(0,mpfr::machine_epsilon()*100);
mpfr::mpreal mpPi
namespace for Numerical integration with Sector Decomposition method
std::complex< mpfr::mpreal > mpiEpsilon
class to manipulate with Cheng-Wu theorem
static bool isPartilizable(const ex ft, const ex delta, lst &xcs, int mode=0)
isPartilize w.r.t. F-term, generized to isLinearizable
static bool isLinearizable(const ex ft, const ex delta, lst &xcs)
Linearize w.r.t. F-term.
static exvector Apply(const exvector &fe_vec, const ex &ft=0)
ChengWu-rized on the vector of fe, note that 1st element of the output, which needs to be droped,...
static exvector Binarize(ex const fe, ex const eqn)
Binarize the input fe, w.r.t. the linear eqn.
static exvector Apply(const ex &fe, const ex &ft=0)
static void Projectivize(ex &fe, const ex delta, const ex xsum=0)
to Projectivize the input fe, the fe will be updated
static void Partilize(const lst xcs, const lst delta, const ex fe, exvector &ret_lst)
Partilize function, generized to Linearize.
static void Scalelize(ex &fe, const lst xs, const ex cy)
to Scalelize the input fe, the fe will be updated
static bool isProjective(const ex fe, const ex delta)
to check the input fe is Projective or NOT w.r.t. delta
static exvector Evaluate(const ex &fe)
ChengWu Internal, make sure ft in the first term, ONLY appear in ChengWu.cpp.
static void Linearize(const lst xcs, ex &fe, ex &ft)
Linearize w.r.t. xcs_in.
static exvector WickRotation(const exvector &fe_vec)
WickRotation, just check WRA exist or NOT to see successful or NOT. Still Experimental.
static IntegratorBase * Integrator
static MinimizeBase * miner
static dREAL IntError(int nvars, dREAL *las, dREAL *n1, dREAL *n2)
numerical integrator using HCubatureMP
static int Wrapper(unsigned int xdim, size_t npts, const mpREAL *x, void *fdata, unsigned int ydim, mpREAL *y)
static void DefaultPrintHooker(mpREAL *, mpREAL *, size_t *, void *)
virtual ex Integrate(size_t n=0) override
void(* PrintHookerType)(mpREAL *, mpREAL *, size_t *, void *)
PrintHookerType PrintHooker
numerical integrator using HCubature
virtual ex Integrate(size_t n=0) override
static void DefaultPrintHooker(qREAL *, qREAL *, size_t *, void *)
PrintHookerType PrintHooker
static int Wrapper(unsigned int xdim, size_t npts, const qREAL *x, void *fdata, unsigned int ydim, qREAL *y)
void(* PrintHookerType)(qREAL *, qREAL *, size_t *, void *)
class to minimize a function using HookeJeeves
virtual void Minimize(int nvars, FunctionType func, dREAL *ip) override
virtual dREAL FindMinimum(int nvars, FunctionType func, dREAL *PL=NULL, dREAL *las=NULL, dREAL *UB=NULL, dREAL *LB=NULL, dREAL *IP=NULL, bool compare0=false, int TryPTS=0, int SavePTS=0) override
virtual void ForceStop() override
base for numerical integrator
qREAL(* FT_Type)(const qREAL xx[], const qREAL pl[])
int(* SDD_Type)(const unsigned int xn, const dREAL x[], const unsigned int yn, dREAL y[], const dREAL pl[], const dREAL las[])
int(* SDQ_Type)(const unsigned int xn, const qREAL x[], const unsigned int yn, qREAL y[], const qREAL pl[], const qREAL las[])
virtual ~IntegratorBase()
virtual ex Integrate(size_t n=0)=0
int(* SDMP_Type)(const unsigned int xn, const mpREAL x[], const unsigned int yn, mpREAL y[], const mpREAL pl[], const mpREAL las[])
const mpREAL * mpParameter
base for class to minimize a function
virtual void Minimize(int nvars, FunctionType func, dREAL *ip)=0
virtual dREAL FindMinimum(int nvars, FunctionType func, dREAL *PL=NULL, dREAL *las=NULL, dREAL *UB=NULL, dREAL *LB=NULL, dREAL *IP=NULL, bool compare0=false, int TryPTS=0, int SavePTS=0)=0
dREAL(* FunctionType)(int nvars, dREAL *x, dREAL *pl, dREAL *las)
virtual void ForceStop()=0
almost the same as QuadMP, using vector to avoid stack overflow for large dimension in Y
void(* PrintHookerType)(mpREAL *, mpREAL *, size_t *, void *)
PrintHookerType PrintHooker
static void DefaultPrintHooker(mpREAL *, mpREAL *, size_t *, void *)
virtual ex Integrate(size_t n=0) override
static int Wrapper(unsigned yn, mpREAL *y, mpREAL *e, unsigned xdim, const mpREAL *x, void *fdata)
numerical integrator using QuadMP
static void DefaultPrintHooker(mpREAL *, mpREAL *, size_t *, void *)
static int Wrapper(unsigned yn, mpREAL *y, mpREAL *e, unsigned xdim, const mpREAL *x, void *fdata)
virtual ex Integrate(size_t n=0) override
void(* PrintHookerType)(mpREAL *, mpREAL *, size_t *, void *)
PrintHookerType PrintHooker
static bool VerifySD(vector< exmap > vmap, bool quick=true)
Verify the Sector Decompostion is valid.
virtual vector< exmap > x2y(const ex &xpol)=0
static ex XMonomials(const ex &expr)
XMonomials.
SecDec by geometric method.
vector< exmap > x2y(const ex &xpol) override
static vector< vector< int > > RunQHull(const matrix &pts)
SecDec the main class to use Sector Decompostion method.
void KillPowers(int bits=1+2)
Kill Powers will call KillPowerD or KillPower.
void VEPrint(bool endlQ=true)
bool IsBad(ex f, vector< exmap > vmap)
Check the x-END.
void Evaluate(const string &key="")
map< int, numeric > Parameter
static bool VerifySD(vector< exmap > vmap, bool quick=true)
static ex PExpand(ex xpol, bool delta=true)
PExpand from asy2.1.1.m.
void Contours(const string &key="", const string &pkey="")
Contours, note that here we need to provide the specific Parameter.
IntegratorBase * Integrator
exvector AutoEnd(ex po_ex)
Auto BiSection.
void Initialize(FeynmanParameter fpi)
static lst XRefined_lst(ex const &ft)
static int PRank(matrix m)
PRank from FIESTA.
static ex XRefined(ex const &ft)
static ex PrefactorFIESTA(int nLoop)
void Integrates(const string &key="", const string &pkey="", int kid=0)
Contours, note that here we need to provide the specific Parameter.
static ex ContinuousWRA(ex expr_in, int nc=15)
ContinuousWRA, note that here we need to provide the specific Parameter.
void ReIntegrates(const string &key, const string &pkey, qREAL err)
Contours, note that here we need to provide the specific Parameter.
void BiSection(ex xi, ex x0)
void CIPrepares(const string &key="")
Prepare for the Contours and Integrates calls .so will be generated, for more detailed exported funct...
ex VEResult(const ex &chop_err=0)
numerical integrator using TanhSinhMP
static void DefaultPrintHooker(mpREAL *, mpREAL *, size_t *, void *)
PrintHookerType PrintHooker
void(* PrintHookerType)(mpREAL *, mpREAL *, size_t *, void *)
virtual ex Integrate(size_t n=0) override
static int Wrapper(unsigned ydim, mpREAL *y, mpREAL *e, unsigned xdim, const mpREAL *x, void *fdata)
class for Common SubExpression Parser
ex Parse(ex expr, bool reset=true)
vector< pair< int, ex > > os()
const vector< pair< int, ex > > & vs()
vector< matrix > Triangularize(const lst &fs_in, const ex &xs_in, const lst &nsubs={})
to Triangularize the domain with each xi from 0 to +infinity
ex FactorOutX(const ex expr)
exvector get_z_from(ex pol)
exvector get_xy_from(ex pol)
ex xyz_pow_simplify(const ex expr_in)
ex exp_simplify(const ex expr_in)
int x_free_index(ex expr)
complex< dREAL > dCOMPLEX
ex FactorFT(const ex &expr)
complex< mpREAL > mpCOMPLEX
exvector get_pl_from(ex pol)
exvector get_y_from(ex pol)
void set_mpfr_prec(int prec)
exvector get_x_from(ex pol)
int y_free_index(ex expr)
int epsRank(ex expr_in, ex epi)
ex Factor(const ex expr_in)
ex pow_simplify(const ex expr_in)
wrap parameters for loop integrals
wrap parameters for generic parameter integrals