15 #include <sys/syscall.h>
52 DECLARE_FUNCTION_1P(fabs)
53 DECLARE_FUNCTION_1P(PL)
54 DECLARE_FUNCTION_1P(CT)
60 DECLARE_FUNCTION_1P(WRA)
61 extern
int VEO_Digits;
96 virtual vector<exmap>
x2y(
const ex &xpol) =0;
97 vector<exmap> x2y(
const lst &xpols);
99 static bool VerifySD(vector<exmap> vmap,
bool quick =
true);
100 static ex XMonomials(
const ex & expr);
108 vector<exmap> x2y(
const ex &xpol)
override;
109 static vector<vector<int>> RunQHull(
const matrix &pts);
111 vector<matrix> ZeroFaces(
const matrix &pts);
112 matrix NormalVectors(
const vector<matrix> &zfs);
113 matrix DualCone(
const matrix &pts);
114 vector<matrix> SimplexCones(matrix pts);
135 typedef int (*SDD_Type) (
const unsigned int xn,
const dREAL x[],
const unsigned int yn,
dREAL y[],
const dREAL pl[],
const dREAL las[]);
136 typedef int (*SDQ_Type) (
const unsigned int xn,
const qREAL x[],
const unsigned int yn,
qREAL y[],
const qREAL pl[],
const qREAL las[]);
137 typedef int (*SDMP_Type) (
const unsigned int xn,
const mpREAL x[],
const unsigned int yn,
mpREAL y[],
const mpREAL pl[],
const mpREAL las[]);
142 SDD_Type IntegrandD = NULL;
143 SDQ_Type IntegrandQ = NULL;
144 SDMP_Type IntegrandMP = NULL;
168 static int Wrapper(
unsigned int xdim,
size_t npts,
const qREAL *x,
void *fdata,
unsigned int ydim,
qREAL *y);
170 typedef void (*PrintHookerType) (
qREAL*,
qREAL*,
size_t *,
void *);
172 virtual ex Integrate(
size_t n=0)
override;
173 static void DefaultPrintHooker(
qREAL*,
qREAL*,
size_t *,
void*);
174 PrintHookerType PrintHooker = DefaultPrintHooker;
175 bool use_last =
false;
185 size_t RunPTS = 100000;
188 unsigned int Threads = 0;
198 int inDQMP(
qREAL const *x);
206 static int Wrapper(
unsigned int xdim,
size_t npts,
const mpREAL *x,
void *fdata,
unsigned int ydim,
mpREAL *y);
208 virtual ex Integrate(
size_t n=0)
override;
209 static void DefaultPrintHooker(
mpREAL*,
mpREAL*,
size_t *,
void*);
210 PrintHookerType PrintHooker = DefaultPrintHooker;
212 size_t RunPTS = 100000;
215 unsigned int Threads = 0;
217 ex mp2ex(
const mpREAL & num);
220 bool use_last =
false;
227 int inDQMP(
qREAL const *x);
235 static int Wrapper(
unsigned ydim,
mpREAL *y,
mpREAL *e,
unsigned xdim,
const mpREAL *x,
void *fdata);
236 typedef void (*PrintHookerType) (
mpREAL *,
mpREAL *,
size_t *,
void *);
237 virtual ex Integrate(
size_t n=0)
override;
238 static void DefaultPrintHooker(
mpREAL *,
mpREAL *,
size_t *,
void *);
239 PrintHookerType PrintHooker = DefaultPrintHooker;
242 ex mp2ex(
const mpREAL & num);
251 static int Wrapper(
unsigned yn,
mpREAL *y,
mpREAL *e,
unsigned xdim,
const mpREAL *x,
void *fdata);
253 virtual ex Integrate(
size_t n=0)
override;
254 static void DefaultPrintHooker(
mpREAL *,
mpREAL *,
size_t *,
void *);
255 PrintHookerType PrintHooker = DefaultPrintHooker;
261 ex mp2ex(
const mpREAL & num);
264 typedef long double dREAL;
282 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;
284 virtual void Minimize(
int nvars, FunctionType func,
dREAL *ip)
override;
285 virtual void ForceStop()
override;
291 FunctionType ObjectFunction;
292 dREAL UpperBound[50];
293 dREAL LowerBound[50];
302 GINAC_DECLARE_PRINT_CONTEXT(
CppFormat, print_csrc_cl_N)
304 CppFormat(ostream &os,
const string & s =
"L",
unsigned opt = 0);
306 string MQuote =
"\"";
308 template<
class T>
const CppFormat & operator << (
const T & v)
const {
312 const CppFormat & operator << (
const basic & v)
const;
313 const CppFormat & operator << (
const ex & v)
const;
314 const CppFormat & operator << (
const lst & v)
const;
315 const CppFormat & operator<<(std::ostream& (*v)(std::ostream&))
const;
324 static _init CppFormat_init;
326 static void print_integer(
const CppFormat & c,
const cln::cl_I & x);
327 static void print_real(
const CppFormat & c,
const cln::cl_R & x);
328 static void print_numeric(
const numeric & p,
const CppFormat & c,
unsigned level);
332 GINAC_DECLARE_PRINT_CONTEXT(
ExFormat, print_dflt)
334 ExFormat(ostream &os,
const string & s =
"L",
unsigned opt = 0);
337 string MQuote =
"\"";
339 template<
class T>
const ExFormat & operator << (
const T & v)
const {
343 const ExFormat & operator << (
const basic & v)
const;
344 const ExFormat & operator << (
const ex & v)
const;
345 const ExFormat & operator << (
const lst & v)
const;
346 const ExFormat & operator<<(std::ostream& (*v)(std::ostream&))
const;
352 static _init ExFormat_init;
353 static void print_integer(
const ExFormat & c,
const cln::cl_I & x);
354 static void print_real(
const ExFormat & c,
const cln::cl_R & x);
355 static void print_numeric(
const numeric & p,
const ExFormat & c,
unsigned level);
389 static bool isProjective(
const ex fe,
const ex delta);
390 static void Projectivize(ex &fe,
const ex delta,
const ex xsum=0);
391 static void Scalelize(ex &fe,
const lst xs,
const ex cy);
392 static void Scalelize(ex &fe,
const ex xi,
const ex cy);
393 static exvector Binarize(ex
const fe, ex
const eqn);
394 static void Binarize(ex
const fe, ex
const eqn, exvector & ovec);
395 static bool isLinearizable(
const ex ft,
const ex delta, lst & xcs);
396 static void Linearize(
const lst xcs, ex & fe, ex & ft);
397 static bool isPartilizable(
const ex ft,
const ex delta, lst &xcs,
int mode=0);
398 static void Partilize(
const lst xcs,
const lst delta,
const ex fe, exvector & ret_lst);
400 static exvector Evaluate(
const ex & fe);
401 static exvector WickRotation(
const exvector & fe_vec);
402 static exvector Apply(
const exvector & fe_vec,
const ex & ft=0);
403 inline static exvector
Apply(
const ex & fe,
const ex & ft=0) {
405 fe_vec.push_back(fe);
406 return Apply(fe_vec, ft);
419 lst eps_lst = { lst{
eps,0}, lst{
ep,0} };
421 int PoleRequested = -5;
422 bool vs_before_ep =
false;
423 bool use_XMonomials =
true;
424 bool disable_Contour =
false;
434 bool CheckEnd =
false;
435 bool use_ErrMin =
false;
436 bool use_las =
false;
437 bool save_las =
false;
439 bool use_Normalizes =
true;
440 bool use_XReOrders =
false;
442 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 };
452 size_t LambdaSplit = 5;
466 void BiSection(ex xi, ex x0);
475 void KillPowers(
int bits=1+2);
476 bool IsBad(ex f, vector<exmap> vmap);
477 exvector AutoEnd(ex po_ex);
478 void CIPrepares(
const string & key =
"");
479 void Contours(
const string & key =
"",
const string & pkey =
"");
480 void Integrates(
const string & key=
"",
const string & pkey=
"",
int kid=0);
481 void ReIntegrates(
const string & key,
const string & pkey,
qREAL err);
483 void Evaluate(
XIntegrand xint,
const string & key =
"");
484 void Evaluate(
const exvector & FunExp,
const string & key =
"");
489 static bool VerifySD(vector<exmap> vmap,
bool quick =
true);
490 static ex XRefined(ex
const & ft);
491 static lst XRefined_lst(ex
const & ft);
492 static ex PrefactorFIESTA(
int nLoop);
494 void VEPrint(
bool endlQ=
true);
495 static ex PExpand(ex xpol,
bool delta=
true);
496 static int PRank(matrix m);
497 static ex ContinuousWRA(ex expr_in,
int nc=15);
502 exvector DS(
const ex po_ex);
503 lst Normalize(
const ex &input);
505 bool KillPowerD(ex fe,
int kpi);
506 bool KillPower(ex fe,
int kpi,
int bits);
508 void CompileMatDet();
509 vector<lst> ciResult;
520 ex Parse(ex expr,
bool reset=
true);
523 vector<pair<int, ex>> os();
525 map<ex, ex, ex_is_less> ex_var_map;
527 vector<pair<int, ex>> o_ex_vec;
536 const vector<pair<int,ex>> &
vs();
538 ex Parse(ex expr,
bool reset);
539 map<ex, int, ex_is_less> exn;
543 vector<pair<int,ex>> on_ex_vec;
class to manipulate with Cheng-Wu theorem
static exvector Apply(const ex &fe, const ex &ft=0)
static IntegratorBase * Integrator
static MinimizeBase * miner
numerical integrator using HCubatureMP
numerical integrator using HCubature
class to minimize a function using HookeJeeves
base for numerical integrator
virtual ~IntegratorBase()
virtual ex Integrate(size_t n=0)=0
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
virtual void ForceStop()=0
numerical integrator using TanhSinhMP
virtual vector< exmap > x2y(const ex &xpol)=0
SecDec by geometric method.
SecDec the main class to use Sector Decompostion method.
map< int, numeric > Parameter
numerical integrator using TanhSinhMP
class for Common SubExpression Parser
namespace for Numerical integration with Sector Decomposition method
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)
DECLARE_FUNCTION_2P(CV) DECLARE_FUNCTION_1P(WRA) extern int VEO_Digits
ex exp_simplify(const ex expr_in)
int x_free_index(ex expr)
complex< dREAL > dCOMPLEX
complex< mpREAL > mpCOMPLEX
exvector get_pl_from(ex pol)
exvector get_y_from(ex pol)
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