*/
#include <ginac/ginac.h>
+
+#ifndef NO_GINAC_NAMESPACE
using namespace GiNaC;
+#endif // ndef NO_GINAC_NAMESPACE
static unsigned check_diff(const ex &e, const symbol &x,
const ex &d, unsigned nth=1)
#include <ginac/ginac.h>
+
+#ifndef NO_GINAC_NAMESPACE
using namespace GiNaC;
+#endif // ndef NO_GINAC_NAMESPACE
#define VECSIZE 100
*/
#include <ginac/ginac.h>
+
+#ifndef NO_GINAC_NAMESPACE
using namespace GiNaC;
+#endif // ndef NO_GINAC_NAMESPACE
/* Simple tests on the sine trigonometric function. */
static unsigned inifcns_consist_sin(void)
*/
#include <ginac/ginac.h>
+
+#ifndef NO_GINAC_NAMESPACE
using namespace GiNaC;
+#endif // ndef NO_GINAC_NAMESPACE
unsigned lsolve_onedim(void)
{
#include <stdexcept>
#include <ginac/ginac.h>
+
+#ifndef NO_GINAC_NAMESPACE
using namespace GiNaC;
+#endif // ndef NO_GINAC_NAMESPACE
static unsigned matrix_determinants(void)
{
*/
#include <ginac/ginac.h>
+
+#ifndef NO_GINAC_NAMESPACE
using namespace GiNaC;
+#endif // ndef NO_GINAC_NAMESPACE
static symbol x("x"), y("y"), z("z");
#include <stdlib.h>
#include <ginac/ginac.h>
+
+#ifndef NO_GINAC_NAMESPACE
using namespace GiNaC;
+#endif // ndef NO_GINAC_NAMESPACE
/* Simple and maybe somewhat pointless consistency tests of assorted tests and
* conversions. */
*/
#include <ginac/ginac.h>
+
+#ifndef NO_GINAC_NAMESPACE
using namespace GiNaC;
+#endif // ndef NO_GINAC_NAMESPACE
unsigned numeric_output(void)
{
*/
#include <ginac/ginac.h>
+
+#ifndef NO_GINAC_NAMESPACE
using namespace GiNaC;
+#endif // ndef NO_GINAC_NAMESPACE
// The very first pair of historic problems had its roots in power.cpp and was
// finally resolved on April 27th. (Fixing the first on April 23rd actually
*/
#include <ginac/ginac.h>
+
+#ifndef NO_GINAC_NAMESPACE
using namespace GiNaC;
+#endif // ndef NO_GINAC_NAMESPACE
const int MAX_VARIABLES = 5;
*/
#include <ginac/ginac.h>
+
+#ifndef NO_GINAC_NAMESPACE
using namespace GiNaC;
+#endif // ndef NO_GINAC_NAMESPACE
static unsigned powerlaws1(void)
{
*/
#include <ginac/ginac.h>
+
+#ifndef NO_GINAC_NAMESPACE
using namespace GiNaC;
+#endif // ndef NO_GINAC_NAMESPACE
static symbol x("x");
#include "mul.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
const add some_add;
type_info const & typeid_add=typeid(some_add);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <ginac/expairseq.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** Sum of expressions. */
class add : public expairseq
return static_cast<const add &>(*e.bp);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_ADD_H__
#include "utils.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
int max_recursion_level=1024;
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <typeinfo>
#include <vector>
+// CINT needs <algorithm> to work properly with <vector>
+#include <algorithm>
+
#include <ginac/flags.h>
#include <ginac/tinfos.h>
#include <ginac/assertion.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
class basic;
class ex;
class lst;
class numeric;
-typedef vector<ex> exvector;
+//typedef vector<ex> exvector;
+typedef vector<ex,malloc_alloc> exvector; // CINT does not like vector<...,default_alloc>
#define INLINE_BASIC_CONSTRUCTORS
// convenience macros
+#ifndef NO_GINAC_NAMESPACE
+
#define is_of_type(OBJ,TYPE) \
(dynamic_cast<TYPE *>(const_cast<GiNaC::basic *>(&OBJ))!=0)
#define is_ex_exactly_of_type(OBJ,TYPE) \
((*(OBJ).bp).tinfo()==GiNaC::TINFO_##TYPE)
+#else // ndef NO_GINAC_NAMESPACE
+
+#define is_of_type(OBJ,TYPE) \
+ (dynamic_cast<TYPE *>(const_cast<basic *>(&OBJ))!=0)
+
+#define is_exactly_of_type(OBJ,TYPE) \
+ ((OBJ).tinfo()==TINFO_##TYPE)
+
+#define is_ex_of_type(OBJ,TYPE) \
+ (dynamic_cast<TYPE *>(const_cast<basic *>((OBJ).bp))!=0)
+
+#define is_ex_exactly_of_type(OBJ,TYPE) \
+ ((*(OBJ).bp).tinfo()==TINFO_##TYPE)
+
+#endif // ndef NO_GINAC_NAMESPACE
+
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_BASIC_H__
+
#include "utils.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
const clifford some_clifford;
type_info const & typeid_clifford=typeid(some_clifford);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <ginac/indexed.h>
#include <ginac/ex.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** Base class for clifford object */
class clifford : public indexed
return static_cast<const clifford &>(*e.bp);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_CLIFFORD_H__
#include "relational.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
}
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
+
#include <ginac/indexed.h>
#include <ginac/ex.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
const unsigned MAX_REPRESENTATION_LABELS = 4;
const unsigned COLOR_EIGHT = 8; // N*N-1
void append_exvector_to_exvector(exvector & dest, exvector const & source);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_COLOR_H__
#include "utils.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
const coloridx some_coloridx;
type_info const & typeid_coloridx=typeid(some_coloridx);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <ginac/idx.h>
#include <ginac/ex.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
class coloridx : public idx
{
return static_cast<const coloridx &>(*e.bp);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_COLORIDX_H__
#include "ex.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
* Diverts straight into CLN for evalf(). */
const constant Catalan("Catalan", CatalanEvalf);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <string>
#include <ginac/basic.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** This class holds constants, symbols with specific numerical value. Each
* object of this class must either provide their own function to evaluate it
extern const constant Catalan;
extern const constant EulerGamma;
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_CONSTANT_H__
#define __GINAC_${CONTAINER_UC}_H__
#include <${STLHEADER}>
+
+// CINT needs <algorithm> to work properly with <vector> and <list>
+#include <algorithm>
+
#include <ginac/basic.h>
#include <ginac/ex.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
-typedef ${STLHEADER}<ex> ${STLT};
+// typedef ${STLHEADER}<ex> ${STLT};
+typedef ${STLHEADER}<ex,malloc_alloc> ${STLT}; // CINT does not like ${STLHEADER}<...,default_alloc>
class ${CONTAINER} : public basic
{
return static_cast<const ${CONTAINER} &>(*e.bp);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_${CONTAINER_UC}_H__
#include "ex.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
${RESERVE_IMPLEMENTATION}
const ${CONTAINER} some_${CONTAINER};
type_info const & typeid_${CONTAINER}=typeid(some_${CONTAINER});
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
END_OF_IMPLEMENTATION
#include "series.h"
#include "symbol.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** Default implementation of ex::diff(). It prints and error message and returns a fail object.
* @see ex::diff */
return ndiff;
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include "power.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
return *eMINUSHALF;
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <ginac/basic.h>
#include <ginac/operators.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
class ex;
class expand_options;
class symbol;
class lst;
-typedef vector<ex> exvector;
+// typedef vector<ex> exvector;
// enum definitions
inline void swap(ex & e1, ex & e2)
{ e1.swap(e2); }
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_EX_H__
+
#include <ginac/ex.h>
#include <ginac/numeric.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** A pair of expressions.
* This similar to, but slightly extended STL's pair<> but we need to account
}
};
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_EXPAIR_H__
#include "debugmsg.h"
#include "utils.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
#ifdef EXPAIRSEQ_USE_HASHTAB
#error "FIXME: expair_needs_further_processing not yet implemented for hashtabs, sorry. A.F."
const expairseq some_expairseq;
type_info const & typeid_expairseq=typeid(some_expairseq);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <vector>
#include <list>
+
+// CINT needs <algorithm> to work properly with <vector> and <list>
+//#include <algorithm>
+
#include <ginac/expair.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//#define EXPAIRSEQ_USE_HASHTAB
return static_cast<const expairseq &>(*e.bp);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_EXPAIRSEQ_H__
#include "exprseq.h"
#include "ex.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
bool exprseq::info(unsigned inf) const
{
return seq[i];
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include "fail.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
const fail some_fail;
type_info const & typeid_fail=typeid(some_fail);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <ginac/basic.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
class fail : public basic
{
extern const fail some_fail;
extern type_info const & typeid_fail;
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_FAIL_H__
#ifndef __GINAC_FLAGS_H__
#define __GINAC_FLAGS_H__
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
class expand_options {
public:
};
};
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_FLAGS_H__
return $res;
}
-$declare_function_macro=generate(
- <<'END_OF_DECLARE_FUNCTION_MACRO','GiNaC::ex const & p${N}','p${N}');
+$declare_function_macro_namespace=generate(
+ <<'END_OF_DECLARE_FUNCTION_MACRO_NAMESPACE','GiNaC::ex const & p${N}','p${N}');
#define DECLARE_FUNCTION_${N}P(NAME) \\
extern const unsigned function_index_##NAME; \\
inline GiNaC::function NAME(${SEQ1}) { \\
return GiNaC::function(function_index_##NAME, ${SEQ2}); \\
}
-END_OF_DECLARE_FUNCTION_MACRO
+END_OF_DECLARE_FUNCTION_MACRO_NAMESPACE
+
+$declare_function_macro_no_namespace=generate(
+ <<'END_OF_DECLARE_FUNCTION_MACRO_NO_NAMESPACE','ex const & p${N}','p${N}');
+#define DECLARE_FUNCTION_${N}P(NAME) \\
+extern unsigned function_index_##NAME; \\
+inline function NAME(${SEQ1}) { \\
+ return function(function_index_##NAME, ${SEQ2}); \\
+}
+
+END_OF_DECLARE_FUNCTION_MACRO_NO_NAMESPACE
$typedef_eval_funcp=generate(
'typedef ex (* eval_funcp_${N})(${SEQ1});'."\n",
#include <string>
#include <vector>
+
+#ifdef __CINT__
+// CINT needs <algorithm> to work properly with <vector>
+#include <algorithm>
+#endif // def __CINT__
+
#include <ginac/exprseq.h>
+#ifndef NO_GINAC_NAMESPACE
+
// the following lines have been generated for max. ${maxargs} parameters
-$declare_function_macro
+$declare_function_macro_namespace
// end of generated lines
+#else // ndef NO_GINAC_NAMESPACE
+
+// the following lines have been generated for max. ${maxargs} parameters
+$declare_function_macro_no_namespace
+// end of generated lines
+
+#endif // ndef NO_GINAC_NAMESPACE
+
+#ifndef NO_GINAC_NAMESPACE
+
#define REGISTER_FUNCTION(NAME,E,EF,D,S) \\
+
const unsigned function_index_##NAME=GiNaC::function::register_new(#NAME,E,EF,D,S);
+#else // ndef NO_GINAC_NAMESPACE
+
+const unsigned function_index_##NAME=function::register_new(#NAME,E,EF,D,S);
+
+#endif // ndef NO_GINAC_NAMESPACE
+
#define BEGIN_TYPECHECK \\
bool automatic_typecheck=true;
automatic_typecheck=false; \\
} else
+#ifndef NO_GINAC_NAMESPACE
+
#define TYPECHECK_INTEGER(VAR) \\
if (!(VAR).info(GiNaC::info_flags::integer)) { \\
automatic_typecheck=false; \\
} else
+#else // ndef NO_GINAC_NAMESPACE
+
+#define TYPECHECK_INTEGER(VAR) \\
+if (!(VAR).info(info_flags::integer)) { \\
+ automatic_typecheck=false; \\
+} else
+
+#endif // ndef NO_GINAC_NAMESPACE
+
#define END_TYPECHECK(RV) \\
{} \\
if (!automatic_typecheck) { \\
return RV.hold(); \\
}
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
class function;
and user defined functions */
class function : public exprseq
{
+ // CINT has a linking problem
friend void ginsh_get_ginac_functions(void);
// member functions
// utility macros
+#ifndef NO_GINAC_NAMESPACE
+
#define is_ex_the_function(OBJ, FUNCNAME) \\
(is_ex_exactly_of_type(OBJ, function) && static_cast<GiNaC::function *>(OBJ.bp)->getserial() == function_index_##FUNCNAME)
+#else // ndef NO_GINAC_NAMESPACE
+
+#define is_ex_the_function(OBJ, FUNCNAME) \\
+ (is_ex_exactly_of_type(OBJ, function) && static_cast<function *>(OBJ.bp)->getserial() == function_index_##FUNCNAME)
+
+#endif // ndef NO_GINAC_NAMESPACE
+
// global constants
extern const function some_function;
extern type_info const & typeid_function;
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_FUNCTION_H__
#include "ex.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
const function some_function;
type_info const & typeid_function=typeid(some_function);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
END_OF_IMPLEMENTATION
#include "utils.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
return res;
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#define __GINAC_IDX_H__
#include <string>
-#include <vector>
+//#include <vector>
#include <ginac/basic.h>
#include <ginac/ex.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
class idx : public basic
{
// global functions
-typedef vector<ex> exvector;
+// typedef vector<ex> exvector;
int canonicalize_indices(exvector & iv, bool antisymmetric=false);
exvector idx_intersect(exvector const & iv1, exvector const & iv2);
exvector const & idxv_co);
unsigned count_index(ex const & e, ex const & i);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_IDX_H__
#include "idx.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
const indexed some_indexed;
type_info const & typeid_indexed=typeid(some_indexed);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <string>
#include <ginac/exprseq.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** Base class for non-commutative indexed objects */
class indexed : public exprseq
return static_cast<const indexed &>(*e.bp);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_INDEXED_H__
#include "series.h"
#include "symbol.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// dilogarithm
unsigned force_include_gamma = function_index_gamma;
unsigned force_include_zeta = function_index_zeta;
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <ginac/function.h>
#include <ginac/ex.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** Sine. */
DECLARE_FUNCTION_1P(sin)
return is_ex_the_function(e, Order);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_INIFCNS_H__
#include "power.h"
#include "symbol.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// Gamma-function
const unsigned function_index_psi2 = function::register_new("psi", psi2_eval, psi2_evalf, psi2_diff, NULL);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include "numeric.h"
#include "power.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// exponential function
REGISTER_FUNCTION(atanh, atanh_eval, atanh_evalf, atanh_diff, NULL);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include "power.h"
#include "symbol.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// Riemann's Zeta-function
REGISTER_FUNCTION(zeta, zeta_eval, zeta_evalf, zeta_diff, zeta_series);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include "utils.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
const isospin some_isospin;
type_info const & typeid_isospin=typeid(some_isospin);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
+
#include <string>
#include <ginac/indexed.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** Base class for isospin object */
class isospin : public indexed
return static_cast<const isospin &>(*e.bp);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_ISOSPIN_H__
#include "utils.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
const lorentzidx some_lorentzidx;
type_info const & typeid_lorentzidx=typeid(some_lorentzidx);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <vector>
#include <ginac/idx.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
class lorentzidx : public idx
{
return static_cast<const lorentzidx &>(*e.bp);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_LORENTZIDX_H__
#include "lst.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
bool lst::info(unsigned inf) const
{
return basic::info(inf);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include "matrix.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor, assignment operator
const matrix some_matrix;
type_info const & typeid_matrix=typeid(some_matrix);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <ginac/basic.h>
#include <ginac/ex.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** Symbolic matrices. */
class matrix : public basic
return static_cast<const matrix &>(*e.bp);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_MATRIX_H__
#include "power.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
const mul some_mul;
type_info const & typeid_mul=typeid(some_mul);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <ginac/expairseq.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** Product of expressions. */
class mul : public expairseq
return static_cast<const mul &>(*e.bp);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_MUL_H__
#include "mul.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
status_flags::evaluated);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <ginac/exprseq.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** Non-commutative product of expressions. */
class ncmul : public exprseq
return static_cast <const ncmul &>(*e.bp);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_NCMUL_H__
#include "series.h"
#include "symbol.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
// If comparing expressions (ex::compare()) is fast, you can set this to 1.
// Some routines like quo(), rem() and gcd() will then return a quick answer
ex numeric::smod(const numeric &xi) const
{
+#ifndef NO_GINAC_NAMESPACE
return GiNaC::smod(*this, xi);
+#else // ndef NO_GINAC_NAMESPACE
+ return ::smod(*this, xi);
+#endif // ndef NO_GINAC_NAMESPACE
}
ex add::smod(const numeric &xi) const
epvector::const_iterator itend = seq.end();
while (it != itend) {
GINAC_ASSERT(!is_ex_exactly_of_type(it->rest,numeric));
+#ifndef NO_GINAC_NAMESPACE
numeric coeff = GiNaC::smod(ex_to_numeric(it->coeff), xi);
+#else // ndef NO_GINAC_NAMESPACE
+ numeric coeff = ::smod(ex_to_numeric(it->coeff), xi);
+#endif // ndef NO_GINAC_NAMESPACE
if (!coeff.is_zero())
newseq.push_back(expair(it->rest, coeff));
it++;
}
GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
+#ifndef NO_GINAC_NAMESPACE
numeric coeff = GiNaC::smod(ex_to_numeric(overall_coeff), xi);
+#else // ndef NO_GINAC_NAMESPACE
+ numeric coeff = ::smod(ex_to_numeric(overall_coeff), xi);
+#endif // ndef NO_GINAC_NAMESPACE
return (new add(newseq,coeff))->setflag(status_flags::dynallocated);
}
#endif // def DO_GINAC_ASSERT
mul * mulcopyp=new mul(*this);
GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
+#ifndef NO_GINAC_NAMESPACE
mulcopyp->overall_coeff = GiNaC::smod(ex_to_numeric(overall_coeff),xi);
+#else // ndef NO_GINAC_NAMESPACE
+ mulcopyp->overall_coeff = ::smod(ex_to_numeric(overall_coeff),xi);
+#endif // ndef NO_GINAC_NAMESPACE
mulcopyp->clearflag(status_flags::evaluated);
mulcopyp->clearflag(status_flags::hash_calculated);
return mulcopyp->setflag(status_flags::dynallocated);
return e;
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#ifndef __GINAC_NORMAL_H__
#define __GINAC_NORMAL_H__
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
class ex;
class symbol;
// Square-free factorization of a polynomial a(x)
extern ex sqrfree(const ex &a, const symbol &x);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_NORMAL_H__
#include <cln.h>
#endif
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
// linker has no problems finding text symbols for numerator or denominator
//#define SANE_LINKER
* assignment from C++ unsigned ints and evaluated like any built-in type. */
_numeric_digits Digits;
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
class cl_N; // We want to include cln.h only in numeric.cpp in order to
// avoid namespace pollution and keep compile-time low.
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
#define HASHVALUE_NUMERIC 0x80000001U
return static_cast<const numeric &>(*e.bp);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_NUMERIC_H__
#include "relational.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
// binary arithmetic operators ex with ex
throw(std::logic_error("input from streams not yet implemented"));
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <iostream>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
class ex;
class numeric;
ostream & operator<<(ostream & os, ex const & e);
istream & operator>>(istream & is, ex & e);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_OPERATORS_H__
#include "symbol.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
typedef vector<int> intvector;
const power some_power;
type_info const & typeid_power=typeid(some_power);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <ginac/basic.h>
#include <ginac/ex.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
class numeric;
class add;
inline ex sqrt(ex const & a)
{ return power(a,exHALF()); }
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_POWER_H__
#include "symbol.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
void ex::print(ostream & os, unsigned upper_precedence) const
{
os << m[row*col-1] << "]] ]]";
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include "symbol.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** Print expression as a C++ statement. The output looks like
* "<type> <var_name> = <expression>;". The "type" parameter has an effect
os << ")";
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include "symbol.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
void ex::printraw(ostream & os) const
{
os << m[row*col-1] << "))";
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include "symbol.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
void ex::printtree(ostream & os, unsigned indent) const
{
#endif // def EXPAIRSEQ_USE_HASHTAB
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include "numeric.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
const relational some_relational;
type_info const & typeid_relational=typeid(some_relational);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <ginac/basic.h>
#include <ginac/ex.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** This class holds a relation consisting of two expressions and a logical
* relation between them. */
return static_cast<const relational &>(*e.bp);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_RELATIONAL_H__
#include "symbol.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
-
+#endif // ndef NO_GINAC_NAMESPACE
/*
* Default constructor, destructor, copy constructor, assignment operator and helpers
const series some_series;
type_info const & typeid_series = typeid(some_series);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <ginac/basic.h>
#include <ginac/expairseq.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** This class holds a extended truncated power series (positive and negative
* integer powers). It consists of expression coefficients (only non-zero
return (static_cast<const series &>(*e.bp).convert_to_poly(true));
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_SERIES_H__
#include "symbol.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
return spmapkey(strstrpair(v1.name,v2.name),anon);
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <ginac/indexed.h>
#include <ginac/lorentzidx.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
typedef pair<string,string> strstrpair;
typedef pair<strstrpair,lorentzidx> spmapkey;
ex simplify_simp_lor(ex const & e, scalar_products const & sp);
ex Dim(void);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef _SIMP__GINAC_LOR_H__
#include "structure.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
const structure some_structure;
type_info const & typeid_structure=typeid(some_structure);
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <ginac/basic.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
struct registered_structure_info {
char const * name;
extern const structure some_structure;
extern type_info const & typeid_structure;
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_STRUCTURE_H__
#include <ginac/structure.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
class ${STRUCTURE} : public structure
{
#define ex_to_${STRUCTURE}(X) (static_cast<${STRUCTURE} const &>(*(X).bp))
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef _${STRUCTURE_UC}_H_
#include "${STRUCTURE}.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
type_info const & typeid_${STRUCTURE}=typeid(some_${STRUCTURE});
const unsigned tinfo_${STRUCTURE}=structure::register_new("${STRUCTURE}");
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
END_OF_IMPLEMENTATION
#include "idx.h"
#include "debugmsg.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
{
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include <ginac/basic.h>
#include <ginac/ex.h>
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** Basic CAS symbol. It has a name because it must know how to output itself.
* It may be assigned an expression, but this feature is only intended for
inline int ldegree(symbol const & a, symbol const & s)
{ return a.ldegree(s); }
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_SYMBOL_H__
#ifndef __GINAC_TINFOS_H__
#define __GINAC_TINFOS_H__
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
const unsigned TINFO_basic = 0x00000001U;
const unsigned TINFO_coloridx = 0x000d1001U;
const unsigned TINFO_lorentzidx = 0x000d1002U;
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_TINFOS_H__
#include "utils.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
/** Integer binary logarithm */
unsigned log2(unsigned n)
// private
// none
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#include "config.h"
#include "assertion.h"
+#ifndef NO_GINAC_NAMESPACE
namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
template<class T>
string ToString(T const & t)
}
}
+#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
#endif // ndef __GINAC_UTILS_H__
#endif
#include <ginac/ginac.h>
+
+#ifndef NO_GINAC_NAMESPACE
using namespace GiNaC;
+#endif // ndef NO_GINAC_NAMESPACE
// yacc stack type
#define YYSTYPE ex
}
// All registered GiNaC functions
-void GiNaC::ginsh_get_ginac_functions(void)
+#ifndef NO_GINAC_NAMESPACE
+#else // ndef NO_GINAC_NAMESPACE
+void ginsh_get_ginac_functions(void)
+#endif // ndef NO_GINAC_NAMESPACE
{
vector<registered_function_info>::const_iterator i = function::registered_functions().begin(), end = function::registered_functions().end();
unsigned serial = 0;