result += fcntimer(series_expansion);
result += fcntimer(lortensor_check);
}
- } catch (exception const & e) {
+ } catch (const exception &e) {
cout << "error: caught an exception: " << e.what() << endl;
result++;
}
@code{collect()} accomplishes this task. Here is its declaration:
@example
-ex ex::collect(symbol const & s);
+ex ex::collect(const symbol & s);
@end example
Note that the original polynomial needs to be in expanded form in order
@cindex @code{degree()}
@cindex @code{ldegree()}
@example
-int ex::degree(symbol const & s);
-int ex::ldegree(symbol const & s);
+int ex::degree(const symbol & s);
+int ex::ldegree(const symbol & s);
@end example
where @code{degree()} returns the highest coefficient and
look something like this:
@example
-static ex cos_eval_method(ex const & x)
+static ex cos_eval_method(const ex & x)
@{
// if (!x%(2*Pi)) return 1
// if (!x%Pi) return -1
function that does so, in this case the one in class @code{numeric}:
@example
-static ex cos_evalf_method(ex const & x)
+static ex cos_evalf_method(const ex & x)
@{
return sin(ex_to_numeric(x));
@}
@code{sin} how to differentiate itself:
@example
-static ex cos_diff_method(ex const & x, unsigned diff_param)
+static ex cos_diff_method(const ex & x, unsigned diff_param)
@{
return cos(x);
@}
destroy(0);
}
-add::add(add const & other)
+add::add(const add & other)
{
debugmsg("add copy constructor",LOGLEVEL_CONSTRUCT);
copy(other);
}
-add const & add::operator=(add const & other)
+const add & add::operator=(const add & other)
{
debugmsg("add operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void add::copy(add const & other)
+void add::copy(const add & other)
{
inherited::copy(other);
}
// public
-add::add(ex const & lh, ex const & rh)
+add::add(const ex & lh, const ex & rh)
{
debugmsg("add constructor from ex,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_add;
GINAC_ASSERT(is_canonical());
}
-add::add(exvector const & v)
+add::add(const exvector & v)
{
debugmsg("add constructor from exvector",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_add;
}
/*
-add::add(epvector const & v, bool do_not_canonicalize)
+add::add(const epvector & v, bool do_not_canonicalize)
{
debugmsg("add constructor from epvector,bool",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_add;
}
*/
-add::add(epvector const & v)
+add::add(const epvector & v)
{
debugmsg("add constructor from epvector",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_add;
GINAC_ASSERT(is_canonical());
}
-add::add(epvector const & v, ex const & oc)
+add::add(const epvector & v, const ex & oc)
{
debugmsg("add constructor from epvector,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_add;
GINAC_ASSERT(is_canonical());
}
-add::add(epvector * vp, ex const & oc)
+add::add(epvector * vp, const ex & oc)
{
debugmsg("add constructor from epvector *,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_add;
}
}
-int add::degree(symbol const & s) const
+int add::degree(const symbol & s) const
{
int deg=INT_MIN;
if (!overall_coeff.is_equal(_ex0())) {
return deg;
}
-int add::ldegree(symbol const & s) const
+int add::ldegree(const symbol & s) const
{
int deg=INT_MAX;
if (!overall_coeff.is_equal(_ex0())) {
return deg;
}
-ex add::coeff(symbol const & s, int const n) const
+ex add::coeff(const symbol & s, int n) const
{
epvector coeffseq;
coeffseq.reserve(seq.size());
return (seq.begin())->rest.get_indices();
}
-ex add::simplify_ncmul(exvector const & v) const
+ex add::simplify_ncmul(const exvector & v) const
{
if (seq.size()==0) {
return inherited::simplify_ncmul(v);
// protected
-int add::compare_same_type(basic const & other) const
+int add::compare_same_type(const basic & other) const
{
return inherited::compare_same_type(other);
}
-bool add::is_equal_same_type(basic const & other) const
+bool add::is_equal_same_type(const basic & other) const
{
return inherited::is_equal_same_type(other);
}
return (*seq.begin()).rest.return_type_tinfo();
}
-ex add::thisexpairseq(epvector const & v, ex const & oc) const
+ex add::thisexpairseq(const epvector & v, const ex & oc) const
{
return (new add(v,oc))->setflag(status_flags::dynallocated);
}
-ex add::thisexpairseq(epvector * vp, ex const & oc) const
+ex add::thisexpairseq(epvector * vp, const ex & oc) const
{
return (new add(vp,oc))->setflag(status_flags::dynallocated);
}
-expair add::split_ex_to_pair(ex const & e) const
+expair add::split_ex_to_pair(const ex & e) const
{
if (is_ex_exactly_of_type(e,mul)) {
- mul const & mulref=ex_to_mul(e);
+ const mul & mulref=ex_to_mul(e);
ex numfactor=mulref.overall_coeff;
// mul * mulcopyp=static_cast<mul *>(mulref.duplicate());
mul * mulcopyp=new mul(mulref);
return expair(e,_ex1());
}
-expair add::combine_ex_with_coeff_to_pair(ex const & e,
- ex const & c) const
+expair add::combine_ex_with_coeff_to_pair(const ex & e,
+ const ex & c) const
{
GINAC_ASSERT(is_ex_exactly_of_type(c,numeric));
if (is_ex_exactly_of_type(e,mul)) {
- mul const & mulref=ex_to_mul(e);
+ const mul & mulref=ex_to_mul(e);
ex numfactor=mulref.overall_coeff;
//mul * mulcopyp=static_cast<mul *>(mulref.duplicate());
mul * mulcopyp=new mul(mulref);
return expair(e,c);
}
-expair add::combine_pair_with_coeff_to_pair(expair const & p,
- ex const & c) const
+expair add::combine_pair_with_coeff_to_pair(const expair & p,
+ const ex & c) const
{
GINAC_ASSERT(is_ex_exactly_of_type(p.coeff,numeric));
GINAC_ASSERT(is_ex_exactly_of_type(c,numeric));
return expair(p.rest,ex_to_numeric(p.coeff).mul_dyn(ex_to_numeric(c)));
}
-ex add::recombine_pair_to_ex(expair const & p) const
+ex add::recombine_pair_to_ex(const expair & p) const
{
//if (p.coeff.compare(_ex1())==0) {
//if (are_ex_trivially_equal(p.coeff,_ex1())) {
//////////
const add some_add;
-type_info const & typeid_add=typeid(some_add);
+const type_info & typeid_add=typeid(some_add);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
public:
add();
~add();
- add(add const & other);
- add const & operator=(add const & other);
+ add(const add & other);
+ const add & operator=(const add & other);
protected:
- void copy(add const & other);
+ void copy(const add & other);
void destroy(bool call_parent);
// other constructors
public:
- add(ex const & lh, ex const & rh);
- add(exvector const & v);
- add(epvector const & v);
- //add(epvector const & v, bool do_not_canonicalize=0);
- add(epvector const & v, ex const & oc);
- add(epvector * vp, ex const & oc);
+ add(const ex & lh, const ex & rh);
+ add(const exvector & v);
+ add(const epvector & v);
+ //add(const epvector & v, bool do_not_canonicalize=0);
+ add(const epvector & v, const ex & oc);
+ add(epvector * vp, const ex & oc);
// functions overriding virtual functions from bases classes
public:
void printraw(ostream & os) const;
void printcsrc(ostream & os, unsigned type, unsigned upper_precedence=0) const;
bool info(unsigned inf) const;
- int degree(symbol const & s) const;
- int ldegree(symbol const & s) const;
- ex coeff(symbol const & s, int const n=1) const;
+ int degree(const symbol & s) const;
+ int ldegree(const symbol & s) const;
+ ex coeff(const symbol & s, int n=1) const;
ex eval(int level=0) const;
- ex diff(symbol const & s) const;
- ex series(symbol const & s, ex const & point, int order) const;
+ ex diff(const symbol & s) const;
+ ex series(const symbol & s, const ex & point, int order) const;
ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
numeric integer_content(void) const;
ex smod(const numeric &xi) const;
numeric max_coefficient(void) const;
exvector get_indices(void) const;
- ex simplify_ncmul(exvector const & v) const;
+ ex simplify_ncmul(const exvector & v) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
unsigned return_type(void) const;
unsigned return_type_tinfo(void) const;
- ex thisexpairseq(epvector const & v, ex const & oc) const;
- ex thisexpairseq(epvector * vp, ex const & oc) const;
- expair split_ex_to_pair(ex const & e) const;
- expair combine_ex_with_coeff_to_pair(ex const & e,
- ex const & c) const;
- expair combine_pair_with_coeff_to_pair(expair const & p,
- ex const & c) const;
- ex recombine_pair_to_ex(expair const & p) const;
+ ex thisexpairseq(const epvector & v, const ex & oc) const;
+ ex thisexpairseq(epvector * vp, const ex & oc) const;
+ expair split_ex_to_pair(const ex & e) const;
+ expair combine_ex_with_coeff_to_pair(const ex & e,
+ const ex & c) const;
+ expair combine_pair_with_coeff_to_pair(const expair & p,
+ const ex & c) const;
+ ex recombine_pair_to_ex(const expair & p) const;
ex expand(unsigned options=0) const;
// new virtual functions which can be overridden by derived classes
// global constants
extern const add some_add;
-extern type_info const & typeid_add;
+extern const type_info & typeid_add;
// utility functions
inline const add &ex_to_add(const ex &e)
GINAC_ASSERT((!(flags & status_flags::dynallocated))||(refcount==0));
}
-basic::basic(basic const & other) : flags(0), refcount(0), tinfo_key(TINFO_BASIC)
+basic::basic(const basic & other) : flags(0), refcount(0), tinfo_key(TINFO_BASIC)
{
debugmsg("basic copy constructor", LOGLEVEL_CONSTRUCT);
copy(other);
}
#endif
-basic const & basic::operator=(basic const & other)
+const basic & basic::operator=(const basic & other)
{
debugmsg("basic operator=", LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
#if 0
-void basic::copy(basic const & other)
+void basic::copy(const basic & other)
{
flags=other.flags & ~ status_flags::dynallocated;
hashvalue=other.hashvalue;
return 0;
}
-ex basic::op(int const i) const
+ex basic::op(int i) const
{
return (const_cast<basic *>(this))->let_op(i);
}
-ex & basic::let_op(int const i)
+ex & basic::let_op(int i)
{
throw(std::out_of_range("op() out of range"));
}
-ex basic::operator[](ex const & index) const
+ex basic::operator[](const ex & index) const
{
if (is_exactly_of_type(*index.bp,numeric)) {
- return op(static_cast<numeric const &>(*index.bp).to_int());
+ return op(static_cast<const numeric &>(*index.bp).to_int());
}
throw(std::invalid_argument("non-numeric indices not supported by this type"));
}
-ex basic::operator[](int const i) const
+ex basic::operator[](int i) const
{
return op(i);
}
-bool basic::has(ex const & other) const
+bool basic::has(const ex & other) const
{
GINAC_ASSERT(other.bp!=0);
if (is_equal(*other.bp)) return true;
return false;
}
-int basic::degree(symbol const & s) const
+int basic::degree(const symbol & s) const
{
return 0;
}
-int basic::ldegree(symbol const & s) const
+int basic::ldegree(const symbol & s) const
{
return 0;
}
-ex basic::coeff(symbol const & s, int const n) const
+ex basic::coeff(const symbol & s, int n) const
{
return n==0 ? *this : _ex0();
}
-ex basic::collect(symbol const & s) const
+ex basic::collect(const symbol & s) const
{
ex x;
int ldeg=ldegree(s);
return *this;
}
-ex basic::subs(lst const & ls, lst const & lr) const
+ex basic::subs(const lst & ls, const lst & lr) const
{
return *this;
}
return exvector(); // return an empty exvector
}
-ex basic::simplify_ncmul(exvector const & v) const
+ex basic::simplify_ncmul(const exvector & v) const
{
return simplified_ncmul(v);
}
// protected
-int basic::compare_same_type(basic const & other) const
+int basic::compare_same_type(const basic & other) const
{
return compare_pointers(this, &other);
}
-bool basic::is_equal_same_type(basic const & other) const
+bool basic::is_equal_same_type(const basic & other) const
{
return compare_same_type(other)==0;
}
// public
-ex basic::subs(ex const & e) const
+ex basic::subs(const ex & e) const
{
// accept 2 types of replacement expressions:
// - symbol==ex
/** Compare objects to establish canonical order.
* All compare functions return: -1 for *this less than other, 0 equal,
* 1 greater. */
-int basic::compare(basic const & other) const
+int basic::compare(const basic & other) const
{
unsigned hash_this = gethash();
unsigned hash_other = other.gethash();
return cmpval;
}
-bool basic::is_equal(basic const & other) const
+bool basic::is_equal(const basic & other) const
{
unsigned hash_this = gethash();
unsigned hash_other = other.gethash();
// protected
-basic const & basic::hold(void) const
+const basic & basic::hold(void) const
{
return setflag(status_flags::evaluated);
}
//////////
const basic some_basic;
-type_info const & typeid_basic=typeid(some_basic);
+const type_info & typeid_basic=typeid(some_basic);
//////////
// global variables
;
#endif // def INLINE_BASIC_CONSTRUCTORS
- basic(basic const & other)
+ basic(const basic & other)
#ifdef INLINE_BASIC_CONSTRUCTORS
{
copy(other);
;
#endif // def INLINE_BASIC_CONSTRUCTORS
- virtual basic const & operator=(basic const & other);
+ virtual const basic & operator=(const basic & other);
protected:
- void copy(basic const & other)
+ void copy(const basic & other)
{
flags = other.flags & ~status_flags::dynallocated;
hashvalue = other.hashvalue;
virtual void dbgprinttree(void) const;
virtual bool info(unsigned inf) const;
virtual unsigned nops() const;
- virtual ex op(int const i) const;
- virtual ex & let_op(int const i);
- virtual ex operator[](ex const & index) const;
- virtual ex operator[](int const i) const;
- virtual bool has(ex const & other) const;
- virtual int degree(symbol const & s) const;
- virtual int ldegree(symbol const & s) const;
- virtual ex coeff(symbol const & s, int const n=1) const;
- virtual ex collect(symbol const & s) const;
+ virtual ex op(int i) const;
+ virtual ex & let_op(int i);
+ virtual ex operator[](const ex & index) const;
+ virtual ex operator[](int i) const;
+ virtual bool has(const ex & other) const;
+ virtual int degree(const symbol & s) const;
+ virtual int ldegree(const symbol & s) const;
+ virtual ex coeff(const symbol & s, int n=1) const;
+ virtual ex collect(const symbol & s) const;
virtual ex eval(int level=0) const;
virtual ex evalf(int level=0) const;
- virtual ex diff(symbol const & s) const;
- virtual ex series(symbol const & s, ex const & point, int order) const;
- virtual ex subs(lst const & ls, lst const & lr) const;
+ virtual ex diff(const symbol & s) const;
+ virtual ex series(const symbol & s, const ex & point, int order) const;
+ virtual ex subs(const lst & ls, const lst & lr) const;
virtual ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
virtual numeric integer_content(void) const;
virtual ex smod(const numeric &xi) const;
virtual numeric max_coefficient(void) const;
virtual exvector get_indices(void) const;
- virtual ex simplify_ncmul(exvector const & v) const;
+ virtual ex simplify_ncmul(const exvector & v) const;
protected: // non-const functions should be called from class ex only
- virtual int compare_same_type(basic const & other) const;
- virtual bool is_equal_same_type(basic const & other) const;
+ virtual int compare_same_type(const basic & other) const;
+ virtual bool is_equal_same_type(const basic & other) const;
virtual unsigned return_type(void) const;
virtual unsigned return_type_tinfo(void) const;
virtual unsigned calchash(void) const;
// non-virtual functions in this class
public:
- ex subs(ex const & e) const;
- int compare(basic const & other) const;
- bool is_equal(basic const & other) const;
- basic const & hold(void) const;
+ ex subs(const ex & e) const;
+ int compare(const basic & other) const;
+ bool is_equal(const basic & other) const;
+ const basic & hold(void) const;
unsigned gethash(void) const {if (flags & status_flags::hash_calculated) return hashvalue; else return calchash();}
unsigned tinfo(void) const {return tinfo_key;}
protected:
- basic const & setflag(unsigned f) const {flags |= f; return *this;}
- basic const & clearflag(unsigned f) const {flags &= ~f; return *this;}
+ const basic & setflag(unsigned f) const {flags |= f; return *this;}
+ const basic & clearflag(unsigned f) const {flags &= ~f; return *this;}
void ensure_if_modifiable(void) const;
// member variables
// global constants
extern const basic some_basic;
-extern type_info const & typeid_basic;
+extern const type_info & typeid_basic;
// global variables
destroy(0);
}
-clifford::clifford(clifford const & other)
+clifford::clifford(const clifford & other)
{
debugmsg("clifford copy constructor",LOGLEVEL_CONSTRUCT);
copy (other);
}
-clifford const & clifford::operator=(clifford const & other)
+const clifford & clifford::operator=(const clifford & other)
{
debugmsg("clifford operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void clifford::copy(clifford const & other)
+void clifford::copy(const clifford & other)
{
indexed::copy(other);
name=other.name;
// public
-clifford::clifford(string const & initname)
+clifford::clifford(const string & initname)
{
debugmsg("clifford constructor from string",LOGLEVEL_CONSTRUCT);
name=initname;
// protected
-int clifford::compare_same_type(basic const & other) const
+int clifford::compare_same_type(const basic & other) const
{
GINAC_ASSERT(other.tinfo() == TINFO_clifford);
const clifford *o = static_cast<const clifford *>(&other);
return serial < o->serial ? -1 : 1;
}
-ex clifford::simplify_ncmul(exvector const & v) const
+ex clifford::simplify_ncmul(const exvector & v) const
{
return simplified_ncmul(v);
}
// non-virtual functions in this class
//////////
-void clifford::setname(string const & n)
+void clifford::setname(const string & n)
{
name=n;
}
//////////
const clifford some_clifford;
-type_info const & typeid_clifford=typeid(some_clifford);
+const type_info & typeid_clifford=typeid(some_clifford);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
public:
clifford();
~clifford();
- clifford(clifford const & other);
- clifford const & operator=(clifford const & other);
+ clifford(const clifford & other);
+ const clifford & operator=(const clifford & other);
protected:
- void copy(clifford const & other);
+ void copy(const clifford & other);
void destroy(bool call_parent);
// other constructors
public:
- explicit clifford(string const & initname);
+ explicit clifford(const string & initname);
// functions overriding virtual functions from base classes
public:
void printcsrc(ostream & os, unsigned type, unsigned upper_precedence=0) const;
bool info(unsigned inf) const;
protected:
- int compare_same_type(basic const & other) const;
- ex simplify_ncmul(exvector const & v) const;
+ int compare_same_type(const basic & other) const;
+ ex simplify_ncmul(const exvector & v) const;
unsigned calchash(void) const;
// new virtual functions which can be overridden by derived classes
// non-virtual functions in this class
public:
- void setname(string const & n);
+ void setname(const string & n);
private:
string & autoname_prefix(void);
// global constants
extern const clifford some_clifford;
-extern type_info const & typeid_clifford;
+extern const type_info & typeid_clifford;
// utility functions
inline const clifford &ex_to_clifford(const ex &e)
destroy(0);
}
-color::color(color const & other)
+color::color(const color & other)
{
debugmsg("color copy constructor",LOGLEVEL_CONSTRUCT);
copy (other);
}
-color const & color::operator=(color const & other)
+const color & color::operator=(const color & other)
{
debugmsg("color operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void color::copy(color const & other)
+void color::copy(const color & other)
{
indexed::copy(other);
type=other.type;
// protected
-color::color(color_types const t, unsigned const rl) : type(t), representation_label(rl)
+color::color(color_types const t, unsigned rl) : type(t), representation_label(rl)
{
debugmsg("color constructor from color_types,unsigned",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(representation_label<MAX_REPRESENTATION_LABELS);
GINAC_ASSERT(all_of_type_coloridx());
}
-color::color(color_types const t, ex const & i1, unsigned const rl)
+color::color(color_types const t, const ex & i1, unsigned rl)
: indexed(i1), type(t), representation_label(rl)
{
debugmsg("color constructor from color_types,ex,unsigned",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(all_of_type_coloridx());
}
-color::color(color_types const t, ex const & i1, ex const & i2, unsigned const rl)
+color::color(color_types const t, const ex & i1, const ex & i2, unsigned rl)
: indexed(i1,i2), type(t), representation_label(rl)
{
debugmsg("color constructor from color_types,ex,ex,unsigned",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(all_of_type_coloridx());
}
-color::color(color_types const t, ex const & i1, ex const & i2, ex const & i3,
- unsigned const rl) : indexed(i1,i2,i3), type(t), representation_label(rl)
+color::color(color_types const t, const ex & i1, const ex & i2, const ex & i3,
+ unsigned rl) : indexed(i1,i2,i3), type(t), representation_label(rl)
{
debugmsg("color constructor from color_types,ex,ex,ex,unsigned",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(representation_label<MAX_REPRESENTATION_LABELS);
GINAC_ASSERT(all_of_type_coloridx());
}
-color::color(color_types const t, exvector const & iv, unsigned const rl)
+color::color(color_types const t, const exvector & iv, unsigned rl)
: indexed(iv), type(t), representation_label(rl)
{
debugmsg("color constructor from color_types,exvector,unsigned",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(all_of_type_coloridx());
}
-color::color(color_types const t, exvector * ivp, unsigned const rl)
+color::color(color_types const t, exvector * ivp, unsigned rl)
: indexed(ivp), type(t), representation_label(rl)
{
debugmsg("color constructor from color_types,exvector *,unsigned",LOGLEVEL_CONSTRUCT);
case color_delta8:
{
GINAC_ASSERT(seq.size()==2);
- coloridx const & idx1=ex_to_coloridx(seq[0]);
- coloridx const & idx2=ex_to_coloridx(seq[1]);
+ const coloridx & idx1=ex_to_coloridx(seq[0]);
+ const coloridx & idx2=ex_to_coloridx(seq[1]);
// check for delta8_{a,a} where a is a symbolic index, replace by 8
if ((idx1.is_symbolic())&&(idx1.is_equal_same_type(idx2))) {
// check for d_{a,a,c} (=0) when a is symbolic
{
GINAC_ASSERT(seq.size()==3);
- coloridx const & idx1=ex_to_coloridx(seq[0]);
- coloridx const & idx2=ex_to_coloridx(seq[1]);
- coloridx const & idx3=ex_to_coloridx(seq[2]);
+ const coloridx & idx1=ex_to_coloridx(seq[0]);
+ const coloridx & idx2=ex_to_coloridx(seq[1]);
+ const coloridx & idx3=ex_to_coloridx(seq[2]);
if (idx1.is_equal_same_type(idx2) && idx1.is_symbolic()) {
return _ex0();
case color_f:
{
GINAC_ASSERT(seq.size()==3);
- coloridx const & idx1=ex_to_coloridx(seq[0]);
- coloridx const & idx2=ex_to_coloridx(seq[1]);
- coloridx const & idx3=ex_to_coloridx(seq[2]);
+ const coloridx & idx1=ex_to_coloridx(seq[0]);
+ const coloridx & idx2=ex_to_coloridx(seq[1]);
+ const coloridx & idx3=ex_to_coloridx(seq[2]);
// check for three numeric indices
if (!(idx1.is_symbolic()||idx2.is_symbolic()||idx3.is_symbolic())) {
// protected
-int color::compare_same_type(basic const & other) const
+int color::compare_same_type(const basic & other) const
{
GINAC_ASSERT(other.tinfo() == TINFO_color);
const color *o = static_cast<const color *>(&other);
return type < o->type ? -1 : 1;
}
-bool color::is_equal_same_type(basic const & other) const
+bool color::is_equal_same_type(const basic & other) const
{
GINAC_ASSERT(other.tinfo() == TINFO_color);
const color *o = static_cast<const color *>(&other);
#include <iostream>
-ex color::simplify_ncmul(exvector const & v) const
+ex color::simplify_ncmul(const exvector & v) const
{
// simplifications: contract delta8_{a,b} where possible
// sort delta8,f,d,T(rl=0),T(rl=1),...,ONE(rl=0),ONE(rl=1),...
if (is_ex_exactly_of_type(*it,color) && (ex_to_color(*it).type==color_delta8)) {
color & d8=ex_to_nonconst_color(*it);
GINAC_ASSERT(d8.seq.size()==2);
- coloridx const & first_idx=ex_to_coloridx(d8.seq[0]);
- coloridx const & second_idx=ex_to_coloridx(d8.seq[1]);
+ const coloridx & first_idx=ex_to_coloridx(d8.seq[0]);
+ const coloridx & second_idx=ex_to_coloridx(d8.seq[1]);
// delta8_{a,a} should have been contracted in color::eval()
GINAC_ASSERT((!first_idx.is_equal(second_idx))||(!first_idx.is_symbolic()));
ex saved_delta8=*it; // save to restore it later
for (exvector::iterator it2=fvec.begin(); it2!=fvec.end(); ++it2) {
GINAC_ASSERT(is_ex_exactly_of_type(*it1,color));
GINAC_ASSERT(is_ex_exactly_of_type(*it2,color));
- color const & col1=ex_to_color(*it1);
- color const & col2=ex_to_color(*it2);
+ const color & col1=ex_to_color(*it1);
+ const color & col2=ex_to_color(*it2);
exvector iv_intersect=idx_intersect(col1.seq,col2.seq);
if (iv_intersect.size()>=2) return _ex0();
}
for (exvector::iterator it2=it1+1; it2!=dvec.end(); ++it2) {
GINAC_ASSERT(is_ex_exactly_of_type(*it1,color));
GINAC_ASSERT(is_ex_exactly_of_type(*it2,color));
- color const & col1=ex_to_color(*it1);
- color const & col2=ex_to_color(*it2);
+ const color & col1=ex_to_color(*it1);
+ const color & col2=ex_to_color(*it2);
exvector iv_intersect=idx_intersect(col1.seq,col2.seq);
if (iv_intersect.size()>=2) {
if (iv_intersect.size()==3) {
for (exvector::iterator it2=it1+1; it2!=fvec.end(); ++it2) {
GINAC_ASSERT(is_ex_exactly_of_type(*it1,color));
GINAC_ASSERT(is_ex_exactly_of_type(*it2,color));
- color const & col1=ex_to_color(*it1);
- color const & col2=ex_to_color(*it2);
+ const color & col1=ex_to_color(*it1);
+ const color & col2=ex_to_color(*it2);
exvector iv_intersect=idx_intersect(col1.seq,col2.seq);
if (iv_intersect.size()>=2) {
if (iv_intersect.size()==3) {
// d_{a,b,c} T_b T_c = 5/6 T_a
for (exvector::iterator it2=dvec.begin(); it2!=dvec.end(); ++it2) {
GINAC_ASSERT(is_ex_exactly_of_type(*it2,color)&&ex_to_color(*it2).type==color_d);
- color const & dref=ex_to_color(*it2);
+ const color & dref=ex_to_color(*it2);
exvector iv_intersect=idx_intersect(dref.seq,iv);
if (iv_intersect.size()==2) {
int sig; // unimportant, since symmetric
// f_{a,b,c} T_b T_c = 3/2 I T_a
for (exvector::iterator it2=fvec.begin(); it2!=fvec.end(); ++it2) {
GINAC_ASSERT(is_ex_exactly_of_type(*it2,color)&&ex_to_color(*it2).type==color_f);
- color const & fref=ex_to_color(*it2);
+ const color & fref=ex_to_color(*it2);
exvector iv_intersect=idx_intersect(fref.seq,iv);
if (iv_intersect.size()==2) {
int sig;
ONEvecs,unknownvec));
}
-ex color::thisexprseq(exvector const & v) const
+ex color::thisexprseq(const exvector & v) const
{
return color(type,v,representation_label);
}
//////////
const color some_color;
-type_info const & typeid_color=typeid(some_color);
+const type_info & typeid_color=typeid(some_color);
//////////
// friend functions
//////////
-color color_ONE(unsigned const rl)
+color color_ONE(unsigned rl)
{
return color(color::color_ONE,rl);
}
-color color_T(ex const & a, unsigned const rl)
+color color_T(const ex & a, unsigned rl)
{
return color(color::color_T,a,rl);
}
-color color_f(ex const & a, ex const & b, ex const & c)
+color color_f(const ex & a, const ex & b, const ex & c)
{
return color(color::color_f,a,b,c);
}
-color color_d(ex const & a, ex const & b, ex const & c)
+color color_d(const ex & a, const ex & b, const ex & c)
{
return color(color::color_d,a,b,c);
}
-ex color_h(ex const & a, ex const & b, ex const & c)
+ex color_h(const ex & a, const ex & b, const ex & c)
{
return color(color::color_d,a,b,c)+I*color(color::color_f,a,b,c);
}
-color color_delta8(ex const & a, ex const & b)
+color color_delta8(const ex & a, const ex & b)
{
return color(color::color_delta8,a,b);
}
-void split_color_string_in_parts(exvector const & v, exvector & delta8vec,
+void split_color_string_in_parts(const exvector & v, exvector & delta8vec,
exvector & fvec, exvector & dvec,
exvectorvector & Tvecs,
exvectorvector & ONEvecs,
return v;
}
-ex color_trace_of_one_representation_label(exvector const & v)
+ex color_trace_of_one_representation_label(const exvector & v)
{
if (v.size()==0) {
return numeric(COLOR_THREE);
v1.pop_back();
exvector v2=v1;
- ex const & last_index=ex_to_color(last_element).seq[0];
- ex const & next_to_last_index=ex_to_color(next_to_last_element).seq[0];
+ const ex & last_index=ex_to_color(last_element).seq[0];
+ const ex & next_to_last_index=ex_to_color(next_to_last_element).seq[0];
ex summation_index=coloridx();
v2.push_back(color_T(summation_index)); // don't care about the representation_label
*/
}
-ex color_trace(exvector const & v, unsigned const rl)
+ex color_trace(const exvector & v, unsigned rl)
{
GINAC_ASSERT(rl<MAX_REPRESENTATION_LABELS);
return nonsimplified_ncmul(v_rest);
}
-ex simplify_pure_color_string(ex const & e)
+ex simplify_pure_color_string(const ex & e)
{
GINAC_ASSERT(is_ex_exactly_of_type(e,ncmul));
GINAC_ASSERT(is_ex_exactly_of_type(t2,color)&&
(ex_to_color(t2).type==color::color_T)&&
(ex_to_color(t2).seq.size()==1));
- coloridx const & idx1=ex_to_coloridx(ex_to_color(t1).seq[0]);
- coloridx const & idx2=ex_to_coloridx(ex_to_color(t2).seq[0]);
+ const coloridx & idx1=ex_to_coloridx(ex_to_color(t1).seq[0]);
+ const coloridx & idx2=ex_to_coloridx(ex_to_color(t2).seq[0]);
if (idx1.is_equal(idx2) && idx1.is_symbolic()) {
exvector S;
return e;
}
-ex simplify_color(ex const & e)
+ex simplify_color(const ex & e)
{
// all simplification is done on expanded objects
ex e_expanded=e.expand();
return e_expanded;
}
-ex brute_force_sum_color_indices(ex const & e)
+ex brute_force_sum_color_indices(const ex & e)
{
exvector iv_all=e.get_indices();
exvector iv_double;
return sum;
}
-void append_exvector_to_exvector(exvector & dest, exvector const & source)
+void append_exvector_to_exvector(exvector & dest, const exvector & source)
{
for (exvector::const_iterator cit=source.begin(); cit!=source.end(); ++cit) {
dest.push_back(*cit);
{
// friends
- friend color color_ONE(unsigned const rl);
- friend color color_T(ex const & a, unsigned const rl);
- friend color color_f(ex const & a, ex const & b, ex const & c);
- friend color color_d(ex const & a, ex const & b, ex const & c);
- friend ex color_h(ex const & a, ex const & b, ex const & c);
- friend color color_delta8(ex const & a, ex const & b);
- friend unsigned subs_index_in_exvector(exvector & v, ex const & is, ex const & ir);
- friend void split_color_string_in_parts(exvector const & v, exvector & delta8vec,
+ friend color color_ONE(unsigned rl);
+ friend color color_T(const ex & a, unsigned rl);
+ friend color color_f(const ex & a, const ex & b, const ex & c);
+ friend color color_d(const ex & a, const ex & b, const ex & c);
+ friend ex color_h(const ex & a, const ex & b, const ex & c);
+ friend color color_delta8(const ex & a, const ex & b);
+ friend unsigned subs_index_in_exvector(exvector & v, const ex & is, const ex & ir);
+ friend void split_color_string_in_parts(const exvector & v, exvector & delta8vec,
exvector & fvec, exvector & dvec,
exvectorvector & Tvecs,
exvectorvector & ONEvecs,
friend exvector recombine_color_string(exvector & delta8vec, exvector & fvec,
exvector & dvec, exvectorvector & Tvecs,
exvectorvector & ONEvecs, exvector & unknownvec);
- friend ex color_trace_of_one_representation_label(exvector const & v);
- friend ex color_trace(exvector const & v, unsigned const rl);
- friend ex simplify_pure_color_string(ex const & e);
- friend ex simplify_color(ex const & e);
+ friend ex color_trace_of_one_representation_label(const exvector & v);
+ friend ex color_trace(const exvector & v, unsigned rl);
+ friend ex simplify_pure_color_string(const ex & e);
+ friend ex simplify_color(const ex & e);
// types
public:
color();
~color();
- color(color const & other);
- color const & operator=(color const & other);
+ color(const color & other);
+ const color & operator=(const color & other);
protected:
- void copy(color const & other);
+ void copy(const color & other);
void destroy(bool call_parent);
// other constructors
protected:
- color(color_types const t, unsigned const rl=0);
- color(color_types const t, ex const & i1, unsigned const rl=0);
- color(color_types const t, ex const & i1, ex const & i2, unsigned const rl=0);
- color(color_types const t, ex const & i1, ex const & i2, ex const & i3,
- unsigned const rl=0);
- color(color_types const t, exvector const & iv, unsigned const rl=0);
- color(color_types const t, exvector * ivp, unsigned const rl=0);
+ color(color_types const t, unsigned rl=0);
+ color(color_types const t, const ex & i1, unsigned rl=0);
+ color(color_types const t, const ex & i1, const ex & i2, unsigned rl=0);
+ color(color_types const t, const ex & i1, const ex & i2, const ex & i3,
+ unsigned rl=0);
+ color(color_types const t, const exvector & iv, unsigned rl=0);
+ color(color_types const t, exvector * ivp, unsigned rl=0);
// functions overriding virtual functions from base classes
public:
bool info(unsigned inf) const;
ex eval(int level=0) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
- ex simplify_ncmul(exvector const & v) const;
- ex thisexprseq(exvector const & v) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
+ ex simplify_ncmul(const exvector & v) const;
+ ex thisexprseq(const exvector & v) const;
ex thisexprseq(exvector * vp) const;
// new virtual functions which can be overridden by derived classes
// global constants
extern const color some_color;
-extern type_info const & typeid_color;
+extern const type_info & typeid_color;
// global functions
inline const color &ex_to_color(const ex &e)
return static_cast<color &>(*e.bp);
}
-color color_ONE(unsigned const rl=0);
-color color_T(ex const & a, unsigned const rl=0);
-color color_f(ex const & a, ex const & b, ex const & c);
-color color_d(ex const & a, ex const & b, ex const & c);
-ex color_h(ex const & a, ex const & b, ex const & c);
-color color_delta8(ex const & a, ex const & b);
-void split_color_string_in_parts(exvector const & v, exvector & delta8vec,
+color color_ONE(unsigned rl=0);
+color color_T(const ex & a, unsigned rl=0);
+color color_f(const ex & a, const ex & b, const ex & c);
+color color_d(const ex & a, const ex & b, const ex & c);
+ex color_h(const ex & a, const ex & b, const ex & c);
+color color_delta8(const ex & a, const ex & b);
+void split_color_string_in_parts(const exvector & v, exvector & delta8vec,
exvector & fvec, exvector & dvec,
exvectorvector & Tvecs,
exvectorvector & ONEvecs,
exvector recombine_color_string(exvector & delta8vec, exvector & fvec,
exvector & dvec, exvectorvector & Tvecs,
exvectorvector & ONEvecs, exvector & unknownvec);
-ex color_trace_of_one_representation_label(exvector const & v);
-ex color_trace(exvector const & v, unsigned const rl=0);
-ex simplify_pure_color_string(ex const & e);
-ex simplify_color(ex const & e);
+ex color_trace_of_one_representation_label(const exvector & v);
+ex color_trace(const exvector & v, unsigned rl=0);
+ex simplify_pure_color_string(const ex & e);
+ex simplify_color(const ex & e);
-ex brute_force_sum_color_indices(ex const & e);
+ex brute_force_sum_color_indices(const ex & e);
-void append_exvector_to_exvector(exvector & dest, exvector const & source);
+void append_exvector_to_exvector(exvector & dest, const exvector & source);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
destroy(0);
}
-coloridx::coloridx(coloridx const & other)
+coloridx::coloridx(const coloridx & other)
{
debugmsg("coloridx copy constructor",LOGLEVEL_CONSTRUCT);
copy(other);
}
-coloridx const & coloridx::operator=(coloridx const & other)
+const coloridx & coloridx::operator=(const coloridx & other)
{
debugmsg("coloridx operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void coloridx::copy(coloridx const & other)
+void coloridx::copy(const coloridx & other)
{
idx::copy(other);
}
tinfo_key=TINFO_coloridx;
}
-coloridx::coloridx(string const & n, bool cov) : idx(n,cov)
+coloridx::coloridx(const string & n, bool cov) : idx(n,cov)
{
debugmsg("coloridx constructor from string,bool",LOGLEVEL_CONSTRUCT);
tinfo_key=TINFO_coloridx;
}
-coloridx::coloridx(char const * n, bool cov) : idx(n,cov)
+coloridx::coloridx(const char * n, bool cov) : idx(n,cov)
{
debugmsg("coloridx constructor from char*,bool",LOGLEVEL_CONSTRUCT);
tinfo_key=TINFO_coloridx;
}
-coloridx::coloridx(unsigned const v, bool cov) : idx(v,cov)
+coloridx::coloridx(unsigned v, bool cov) : idx(v,cov)
{
debugmsg("coloridx constructor from unsigned,bool",LOGLEVEL_CONSTRUCT);
tinfo_key=TINFO_coloridx;
//////////
const coloridx some_coloridx;
-type_info const & typeid_coloridx=typeid(some_coloridx);
+const type_info & typeid_coloridx=typeid(some_coloridx);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
public:
coloridx();
~coloridx();
- coloridx (coloridx const & other);
- coloridx const & operator=(coloridx const & other);
+ coloridx (const coloridx & other);
+ const coloridx & operator=(const coloridx & other);
protected:
- void copy(coloridx const & other);
+ void copy(const coloridx & other);
void destroy(bool call_parent);
// other constructors
public:
explicit coloridx(bool cov);
- explicit coloridx(string const & n, bool cov=false);
- explicit coloridx(char const * n, bool cov=false);
- explicit coloridx(unsigned const v, bool cov=false);
+ explicit coloridx(const string & n, bool cov=false);
+ explicit coloridx(const char * n, bool cov=false);
+ explicit coloridx(unsigned v, bool cov=false);
// functions overriding virtual functions from bases classes
public:
// global constants
extern const coloridx some_coloridx;
-extern type_info const & typeid_coloridx;
+extern const type_info & typeid_coloridx;
// utility functions
inline const coloridx &ex_to_coloridx(const ex &e)
destroy(0);
}
-constant::constant(constant const & other)
+constant::constant(const constant & other)
{
debugmsg("constant copy constructor",LOGLEVEL_CONSTRUCT);
copy(other);
// protected
-void constant::copy(constant const & other)
+void constant::copy(const constant & other)
{
basic::copy(other);
name=other.name;
// public
-constant::constant(string const & initname, evalffunctype efun) :
+constant::constant(const string & initname, evalffunctype efun) :
basic(TINFO_constant), name(initname), ef(efun),
// number(0), fct_assigned(true), serial(next_serial++)
number(0), serial(next_serial++)
debugmsg("constant constructor from string, function",LOGLEVEL_CONSTRUCT);
}
-constant::constant(string const & initname, numeric const & initnumber) :
+constant::constant(const string & initname, const numeric & initnumber) :
basic(TINFO_constant), name(initname), ef(0),
number(new numeric(initnumber)), /* fct_assigned(false),*/ serial(next_serial++)
{
// protected
-int constant::compare_same_type(basic const & other) const
+int constant::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_exactly_of_type(other, constant));
- // constant const & o=static_cast<constant &>(const_cast<basic &>(other));
+ // const constant & o=static_cast<constant &>(const_cast<basic &>(other));
// return name.compare(o.name);
const constant *o = static_cast<const constant *>(&other);
if (serial==o->serial) return 0;
return serial < o->serial ? -1 : 1;
}
-bool constant::is_equal_same_type(basic const & other) const
+bool constant::is_equal_same_type(const basic & other) const
{
GINAC_ASSERT(is_exactly_of_type(other, constant));
const constant *o = static_cast<const constant *>(&other);
//////////
const constant some_constant;
-type_info const & typeid_constant=typeid(some_constant);
+const type_info & typeid_constant=typeid(some_constant);
/** Pi. (3.14159...) Diverts straight into CLN for evalf(). */
const constant Pi("Pi", PiEvalf);
public:
constant();
~constant();
- constant(constant const & other);
- // constant const & operator=(constant const & other); /* it's pervert! */
+ constant(const constant & other);
+ // const constant & operator=(const constant & other); /* it's pervert! */
protected:
- void copy(constant const & other);
+ void copy(const constant & other);
void destroy(bool call_parent);
// other constructors
public:
- constant(string const & initname, evalffunctype efun=0);
- constant(string const & initname, numeric const & initnumber);
+ constant(const string & initname, evalffunctype efun=0);
+ constant(const string & initname, const numeric & initnumber);
// functions overriding virtual functions from bases classes
public:
void printtree(ostream & os, unsigned indent) const;
void printcsrc(ostream & os, unsigned type, unsigned upper_precedence=0) const;
ex evalf(int level=0) const;
- ex diff(symbol const & s) const;
+ ex diff(const symbol & s) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
// new virtual functions which can be overridden by derived classes
// none
// global constants
extern const constant some_constant;
-extern type_info const & typeid_constant;
+extern const type_info & typeid_constant;
// extern const numeric I;
extern const constant Pi;
if ($prepend) {
$PREPEND_INTERFACE=<<END_OF_PREPEND_INTERFACE;
- virtual ${CONTAINER} & prepend(ex const & b);
+ virtual ${CONTAINER} & prepend(const ex & b);
END_OF_PREPEND_INTERFACE
$PREPEND_IMPLEMENTATION=<<END_OF_PREPEND_IMPLEMENTATION;
-${CONTAINER} & ${CONTAINER}::prepend(ex const & b)
+${CONTAINER} & ${CONTAINER}::prepend(const ex & b)
{
ensure_if_modifiable();
seq.push_front(b);
if ($let_op) {
$LET_OP_IMPLEMENTATION=<<END_OF_LET_OP_IMPLEMENTATION
-ex & ${CONTAINER}::let_op(int const i)
+ex & ${CONTAINER}::let_op(int i)
{
GINAC_ASSERT(i>=0);
GINAC_ASSERT(i<nops());
public:
${CONTAINER}(${STLT} const & s, bool discardable=0);
${CONTAINER}(${STLT} * vp); // vp will be deleted
- explicit ${CONTAINER}(ex const & e1);
- explicit ${CONTAINER}(ex const & e1, ex const & e2);
- explicit ${CONTAINER}(ex const & e1, ex const & e2, ex const & e3);
- explicit ${CONTAINER}(ex const & e1, ex const & e2, ex const & e3,
- ex const & e4);
- explicit ${CONTAINER}(ex const & e1, ex const & e2, ex const & e3,
- ex const & e4, ex const & e5);
- explicit ${CONTAINER}(ex const & e1, ex const & e2, ex const & e3,
- ex const & e4, ex const & e5, ex const & e6);
- explicit ${CONTAINER}(ex const & e1, ex const & e2, ex const & e3,
- ex const & e4, ex const & e5, ex const & e6,
- ex const & e7);
- explicit ${CONTAINER}(ex const & e1, ex const & e2, ex const & e3,
- ex const & e4, ex const & e5, ex const & e6,
- ex const & e7, ex const & e8);
- explicit ${CONTAINER}(ex const & e1, ex const & e2, ex const & e3,
- ex const & e4, ex const & e5, ex const & e6,
- ex const & e7, ex const & e8, ex const & e9);
- explicit ${CONTAINER}(ex const & e1, ex const & e2, ex const & e3,
- ex const & e4, ex const & e5, ex const & e6,
- ex const & e7, ex const & e8, ex const & e9,
- ex const &e10);
+ explicit ${CONTAINER}(const ex & e1);
+ explicit ${CONTAINER}(const ex & e1, const ex & e2);
+ explicit ${CONTAINER}(const ex & e1, const ex & e2, const ex & e3);
+ explicit ${CONTAINER}(const ex & e1, const ex & e2, const ex & e3,
+ const ex & e4);
+ explicit ${CONTAINER}(const ex & e1, const ex & e2, const ex & e3,
+ const ex & e4, const ex & e5);
+ explicit ${CONTAINER}(const ex & e1, const ex & e2, const ex & e3,
+ const ex & e4, const ex & e5, const ex & e6);
+ explicit ${CONTAINER}(const ex & e1, const ex & e2, const ex & e3,
+ const ex & e4, const ex & e5, const ex & e6,
+ const ex & e7);
+ explicit ${CONTAINER}(const ex & e1, const ex & e2, const ex & e3,
+ const ex & e4, const ex & e5, const ex & e6,
+ const ex & e7, const ex & e8);
+ explicit ${CONTAINER}(const ex & e1, const ex & e2, const ex & e3,
+ const ex & e4, const ex & e5, const ex & e6,
+ const ex & e7, const ex & e8, const ex & e9);
+ explicit ${CONTAINER}(const ex & e1, const ex & e2, const ex & e3,
+ const ex & e4, const ex & e5, const ex & e6,
+ const ex & e7, const ex & e8, const ex & e9,
+ const ex &e10);
public:
basic * duplicate() const;
void printtree(ostream & os, unsigned indent) const;
bool info(unsigned inf) const;
unsigned nops() const;
- ex & let_op(int const i);
+ ex & let_op(int i);
ex expand(unsigned options=0) const;
- bool has(ex const & other) const;
+ bool has(const ex & other) const;
ex eval(int level=0) const;
ex evalf(int level=0) const;
ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
- ex diff(symbol const & s) const;
- ex subs(lst const & ls, lst const & lr) const;
+ ex diff(const symbol & s) const;
+ ex subs(const lst & ls, const lst & lr) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
unsigned return_type(void) const;
// new virtual functions which can be overridden by derived classes
public:
- virtual ${CONTAINER} & append(ex const & b);
+ virtual ${CONTAINER} & append(const ex & b);
${PREPEND_INTERFACE}
protected:
virtual void printseq(ostream & os, char openbracket, char delim,
${STLT} evalchildren(int level) const;
${STLT} evalfchildren(int level) const;
${STLT} normalchildren(int level) const;
- ${STLT} diffchildren(symbol const & s) const;
- ${STLT} * subschildren(lst const & ls, lst const & lr) const;
+ ${STLT} diffchildren(const symbol & s) const;
+ ${STLT} * subschildren(const lst & ls, const lst & lr) const;
protected:
${STLT} seq;
// global constants
extern const ${CONTAINER} some_${CONTAINER};
-extern type_info const & typeid_${CONTAINER};
+extern const type_info & typeid_${CONTAINER};
// utility functions
inline const ${CONTAINER} &ex_to_${CONTAINER}(const ex &e)
delete vp;
}
-${CONTAINER}::${CONTAINER}(ex const & e1) : basic(TINFO_${CONTAINER})
+${CONTAINER}::${CONTAINER}(const ex & e1) : basic(TINFO_${CONTAINER})
{
debugmsg("${CONTAINER} constructor from 1 ex",
LOGLEVEL_CONSTRUCT);
seq.push_back(e1);
}
-${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2) : basic(TINFO_${CONTAINER})
+${CONTAINER}::${CONTAINER}(const ex & e1, const ex & e2) : basic(TINFO_${CONTAINER})
{
debugmsg("${CONTAINER} constructor from 2 ex",
LOGLEVEL_CONSTRUCT);
seq.push_back(e2);
}
-${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3)
+${CONTAINER}::${CONTAINER}(const ex & e1, const ex & e2, const ex & e3)
: basic(TINFO_${CONTAINER})
{
debugmsg("${CONTAINER} constructor from 3 ex",
seq.push_back(e3);
}
-${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3,
- ex const & e4) : basic(TINFO_${CONTAINER})
+${CONTAINER}::${CONTAINER}(const ex & e1, const ex & e2, const ex & e3,
+ const ex & e4) : basic(TINFO_${CONTAINER})
{
debugmsg("${CONTAINER} constructor from 4 ex",
LOGLEVEL_CONSTRUCT);
seq.push_back(e4);
}
-${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3,
- ex const & e4, ex const & e5) : basic(TINFO_${CONTAINER})
+${CONTAINER}::${CONTAINER}(const ex & e1, const ex & e2, const ex & e3,
+ const ex & e4, const ex & e5) : basic(TINFO_${CONTAINER})
{
debugmsg("${CONTAINER} constructor from 5 ex",
LOGLEVEL_CONSTRUCT);
seq.push_back(e5);
}
-${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3,
- ex const & e4, ex const & e5, ex const & e6)
+${CONTAINER}::${CONTAINER}(const ex & e1, const ex & e2, const ex & e3,
+ const ex & e4, const ex & e5, const ex & e6)
: basic(TINFO_${CONTAINER})
{
debugmsg("${CONTAINER} constructor from 6 ex",
seq.push_back(e6);
}
-${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3,
- ex const & e4, ex const & e5, ex const & e6,
- ex const & e7) : basic(TINFO_${CONTAINER})
+${CONTAINER}::${CONTAINER}(const ex & e1, const ex & e2, const ex & e3,
+ const ex & e4, const ex & e5, const ex & e6,
+ const ex & e7) : basic(TINFO_${CONTAINER})
{
debugmsg("${CONTAINER} constructor from 7 ex",
LOGLEVEL_CONSTRUCT);
seq.push_back(e7);
}
-${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3,
- ex const & e4, ex const & e5, ex const & e6,
- ex const & e7, ex const & e8) : basic(TINFO_${CONTAINER})
+${CONTAINER}::${CONTAINER}(const ex & e1, const ex & e2, const ex & e3,
+ const ex & e4, const ex & e5, const ex & e6,
+ const ex & e7, const ex & e8) : basic(TINFO_${CONTAINER})
{
debugmsg("${CONTAINER} constructor from 8 ex",
LOGLEVEL_CONSTRUCT);
seq.push_back(e8);
}
-${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3,
- ex const & e4, ex const & e5, ex const & e6,
- ex const & e7, ex const & e8, ex const & e9)
+${CONTAINER}::${CONTAINER}(const ex & e1, const ex & e2, const ex & e3,
+ const ex & e4, const ex & e5, const ex & e6,
+ const ex & e7, const ex & e8, const ex & e9)
: basic(TINFO_${CONTAINER})
{
debugmsg("${CONTAINER} constructor from 9 ex",
seq.push_back(e9);
}
-${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3,
- ex const & e4, ex const & e5, ex const & e6,
- ex const & e7, ex const & e8, ex const & e9,
- ex const &e10)
+${CONTAINER}::${CONTAINER}(const ex & e1, const ex & e2, const ex & e3,
+ const ex & e4, const ex & e5, const ex & e6,
+ const ex & e7, const ex & e8, const ex & e9,
+ const ex &e10)
: basic(TINFO_${CONTAINER})
{
debugmsg("${CONTAINER} constructor from 10 ex",
// a ${CONTAINER} 'has' an expression if it is this expression itself or a child 'has' it
-bool ${CONTAINER}::has(ex const & other) const
+bool ${CONTAINER}::has(const ex & other) const
{
GINAC_ASSERT(other.bp!=0);
if (is_equal(*other.bp)) return true;
return n.bp->basic::normal(sym_lst,repl_lst,level);
}
-ex ${CONTAINER}::diff(symbol const & s) const
+ex ${CONTAINER}::diff(const symbol & s) const
{
return this${CONTAINER}(diffchildren(s));
}
-ex ${CONTAINER}::subs(lst const & ls, lst const & lr) const
+ex ${CONTAINER}::subs(const lst & ls, const lst & lr) const
{
${STLT} * vp=subschildren(ls,lr);
if (vp==0) {
// protected
-int ${CONTAINER}::compare_same_type(basic const & other) const
+int ${CONTAINER}::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other,${CONTAINER}));
${CONTAINER} const & o=static_cast<${CONTAINER} const &>
return 1;
}
-bool ${CONTAINER}::is_equal_same_type(basic const & other) const
+bool ${CONTAINER}::is_equal_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other,${CONTAINER}));
${CONTAINER} const & o=static_cast<${CONTAINER} const &>
// public
-${CONTAINER} & ${CONTAINER}::append(ex const & b)
+${CONTAINER} & ${CONTAINER}::append(const ex & b)
{
ensure_if_modifiable();
seq.push_back(b);
return s;
}
-${STLT} ${CONTAINER}::diffchildren(symbol const & y) const
+${STLT} ${CONTAINER}::diffchildren(const symbol & y) const
{
${STLT} s;
RESERVE(s,seq.size());
}
/* obsolete subschildren
-${STLT} ${CONTAINER}::subschildren(lst const & ls, lst const & lr) const
+${STLT} ${CONTAINER}::subschildren(const lst & ls, const lst & lr) const
{
${STLT} s;
RESERVE(s,seq.size());
}
*/
-${STLT} * ${CONTAINER}::subschildren(lst const & ls, lst const & lr) const
+${STLT} * ${CONTAINER}::subschildren(const lst & ls, const lst & lr) const
{
// returns a NULL pointer if nothing had to be substituted
// returns a pointer to a newly created epvector otherwise
${STLT}::const_iterator last=seq.end();
${STLT}::const_iterator cit=seq.begin();
while (cit!=last) {
- ex const & subsed_ex=(*cit).subs(ls,lr);
+ const ex & subsed_ex=(*cit).subs(ls,lr);
if (!are_ex_trivially_equal(*cit,subsed_ex)) {
// something changed, copy seq, subs and return it
//////////
const ${CONTAINER} some_${CONTAINER};
-type_info const & typeid_${CONTAINER}=typeid(some_${CONTAINER});
+const type_info & typeid_${CONTAINER}=typeid(some_${CONTAINER});
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
/** Default implementation of ex::diff(). It prints and error message and returns a fail object.
* @see ex::diff */
-ex basic::diff(symbol const & s) const
+ex basic::diff(const symbol & s) const
{
throw(std::logic_error("differentiation not supported by this type"));
}
/** Implementation of ex::diff() for a numeric. It always returns 0.
*
* @see ex::diff */
-ex numeric::diff(symbol const & s) const
+ex numeric::diff(const symbol & s) const
{
return _ex0();
}
* It returns 1 or 0.
*
* @see ex::diff */
-ex symbol::diff(symbol const & s) const
+ex symbol::diff(const symbol & s) const
{
if (compare_same_type(s)) {
return _ex0();
/** Implementation of ex::diff() for a constant. It always returns 0.
*
* @see ex::diff */
-ex constant::diff(symbol const & s) const
+ex constant::diff(const symbol & s) const
{
return _ex0();
}
*
* @param nth order of differentiation
* @see ex::diff */
-ex symbol::diff(symbol const & s, unsigned nth) const
+ex symbol::diff(const symbol & s, unsigned nth) const
{
if (compare_same_type(s)) {
switch (nth) {
/** Implementation of ex::diff() for an indexed object. It always returns 0.
* @see ex::diff */
-ex indexed::diff(symbol const & s) const
+ex indexed::diff(const symbol & s) const
{
return _ex0();
}
/** Implementation of ex::diff() for an expairseq. It differentiates all elements of the sequence.
* @see ex::diff */
-ex expairseq::diff(symbol const & s) const
+ex expairseq::diff(const symbol & s) const
{
return thisexpairseq(diffchildren(s),overall_coeff);
}
/** Implementation of ex::diff() for a sum. It differentiates each term.
* @see ex::diff */
-ex add::diff(symbol const & s) const
+ex add::diff(const symbol & s) const
{
// D(a+b+c)=D(a)+D(b)+D(c)
return (new add(diffchildren(s)))->setflag(status_flags::dynallocated);
/** Implementation of ex::diff() for a product. It applies the product rule.
* @see ex::diff */
-ex mul::diff(symbol const & s) const
+ex mul::diff(const symbol & s) const
{
exvector new_seq;
new_seq.reserve(seq.size());
/** Implementation of ex::diff() for a non-commutative product. It always returns 0.
* @see ex::diff */
-ex ncmul::diff(symbol const & s) const
+ex ncmul::diff(const symbol & s) const
{
return _ex0();
}
/** Implementation of ex::diff() for a power.
* @see ex::diff */
-ex power::diff(symbol const & s) const
+ex power::diff(const symbol & s) const
{
if (exponent.info(info_flags::real)) {
// D(b^r) = r * b^(r-1) * D(b) (faster than the formula below)
/** Implementation of ex::diff() for functions. It applies the chain rule,
* except for the Order term function.
* @see ex::diff */
-ex function::diff(symbol const & s) const
+ex function::diff(const symbol & s) const
{
exvector new_seq;
/** Implementation of ex::diff() for a power series. It treats the series as a polynomial.
* @see ex::diff */
-ex pseries::diff(symbol const & s) const
+ex pseries::diff(const symbol & s) const
{
if (s == var) {
epvector new_seq;
* @param nth order of derivative (default 1)
* @return partial derivative as a new expression */
-ex ex::diff(symbol const & s, unsigned nth) const
+ex ex::diff(const symbol & s, unsigned nth) const
{
GINAC_ASSERT(bp!=0);
}
}
-ex::ex(ex const & other) : bp(other.bp)
+ex::ex(const ex & other) : bp(other.bp)
{
debugmsg("ex copy constructor",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(bp!=0);
++bp->refcount;
}
-ex const & ex::operator=(ex const & other)
+const ex & ex::operator=(const ex & other)
{
debugmsg("ex operator=",LOGLEVEL_ASSIGNMENT);
GINAC_ASSERT(bp!=0);
// public
#ifndef INLINE_EX_CONSTRUCTORS
-ex::ex(basic const & other)
+ex::ex(const basic & other)
{
debugmsg("ex constructor from basic",LOGLEVEL_CONSTRUCT);
construct_from_basic(other);
}
#endif
-ex::ex(int const i)
+ex::ex(int i)
{
debugmsg("ex constructor from int",LOGLEVEL_CONSTRUCT);
switch (i) { // some tiny efficiency-hack (FIXME: is this ok?)
}
}
-ex::ex(unsigned int const i)
+ex::ex(unsigned int i)
{
debugmsg("ex constructor from unsigned int",LOGLEVEL_CONSTRUCT);
construct_from_basic(numeric(i));
}
-ex::ex(long const i)
+ex::ex(long i)
{
debugmsg("ex constructor from long",LOGLEVEL_CONSTRUCT);
construct_from_basic(numeric(i));
}
-ex::ex(unsigned long const i)
+ex::ex(unsigned long i)
{
debugmsg("ex constructor from unsigned long",LOGLEVEL_CONSTRUCT);
construct_from_basic(numeric(i));
return bp->expand(options);
}
-bool ex::has(ex const & other) const
+bool ex::has(const ex & other) const
{
GINAC_ASSERT(bp!=0);
return bp->has(other);
}
-int ex::degree(symbol const & s) const
+int ex::degree(const symbol & s) const
{
GINAC_ASSERT(bp!=0);
return bp->degree(s);
}
-int ex::ldegree(symbol const & s) const
+int ex::ldegree(const symbol & s) const
{
GINAC_ASSERT(bp!=0);
return bp->ldegree(s);
}
-ex ex::coeff(symbol const & s, int const n) const
+ex ex::coeff(const symbol & s, int n) const
{
GINAC_ASSERT(bp!=0);
return bp->coeff(s,n);
return res;
}
-ex ex::collect(symbol const & s) const
+ex ex::collect(const symbol & s) const
{
GINAC_ASSERT(bp!=0);
return bp->collect(s);
return bp->evalf(level);
}
-ex ex::subs(lst const & ls, lst const & lr) const
+ex ex::subs(const lst & ls, const lst & lr) const
{
GINAC_ASSERT(bp!=0);
return bp->subs(ls,lr);
}
-ex ex::subs(ex const & e) const
+ex ex::subs(const ex & e) const
{
GINAC_ASSERT(bp!=0);
return bp->subs(e);
return bp->get_indices();
}
-ex ex::simplify_ncmul(exvector const & v) const
+ex ex::simplify_ncmul(const exvector & v) const
{
GINAC_ASSERT(bp!=0);
return bp->simplify_ncmul(v);
}
-ex ex::operator[](ex const & index) const
+ex ex::operator[](const ex & index) const
{
debugmsg("ex operator[ex]",LOGLEVEL_OPERATOR);
GINAC_ASSERT(bp!=0);
return (*bp)[index];
}
-ex ex::operator[](int const i) const
+ex ex::operator[](int i) const
{
debugmsg("ex operator[int]",LOGLEVEL_OPERATOR);
GINAC_ASSERT(bp!=0);
return (*bp)[i];
}
-ex ex::op(int const i) const
+ex ex::op(int i) const
{
debugmsg("ex op()",LOGLEVEL_MEMBER_FUNCTION);
GINAC_ASSERT(bp!=0);
return bp->op(i);
}
-ex & ex::let_op(int const i)
+ex & ex::let_op(int i)
{
debugmsg("ex let_op()",LOGLEVEL_MEMBER_FUNCTION);
makewriteable();
}
#ifndef INLINE_EX_CONSTRUCTORS
-int ex::compare(ex const & other) const
+int ex::compare(const ex & other) const
{
GINAC_ASSERT(bp!=0);
GINAC_ASSERT(other.bp!=0);
#endif // ndef INLINE_EX_CONSTRUCTORS
#ifndef INLINE_EX_CONSTRUCTORS
-bool ex::is_equal(ex const & other) const
+bool ex::is_equal(const ex & other) const
{
GINAC_ASSERT(bp!=0);
GINAC_ASSERT(other.bp!=0);
return bp->gethash();
}
-ex ex::exadd(ex const & rh) const
+ex ex::exadd(const ex & rh) const
{
return (new add(*this,rh))->setflag(status_flags::dynallocated);
}
-ex ex::exmul(ex const & rh) const
+ex ex::exmul(const ex & rh) const
{
return (new mul(*this,rh))->setflag(status_flags::dynallocated);
}
-ex ex::exncmul(ex const & rh) const
+ex ex::exncmul(const ex & rh) const
{
return (new ncmul(*this,rh))->setflag(status_flags::dynallocated);
}
GINAC_ASSERT(bp->refcount == 1);
}
-void ex::construct_from_basic(basic const & other)
+void ex::construct_from_basic(const basic & other)
{
if ((other.flags & status_flags::evaluated)==0) {
// cf. copy constructor
- ex const & tmpex = other.eval(1); // evaluate only one (top) level
+ const ex & tmpex = other.eval(1); // evaluate only one (top) level
bp = tmpex.bp;
GINAC_ASSERT(bp!=0);
GINAC_ASSERT(bp->flags & status_flags::dynallocated);
class symbol;
class lst;
-extern ex const & _ex0(void); /* FIXME: should this pollute headers? */
+extern const ex & _ex0(void); /* FIXME: should this pollute headers? */
// typedef vector<ex> exvector;
;
#endif // def INLINE_EX_CONSTRUCTORS
- ex(ex const & other)
+ ex(const ex & other)
#ifdef INLINE_EX_CONSTRUCTORS
: bp(other.bp)
{
;
#endif // def INLINE_EX_CONSTRUCTORS
- ex const & operator=(ex const & other)
+ const ex & operator=(const ex & other)
#ifdef INLINE_EX_CONSTRUCTORS
{
GINAC_ASSERT(bp!=0);
// other constructors
public:
- ex(basic const & other)
+ ex(const basic & other)
#ifdef INLINE_EX_CONSTRUCTORS
{
construct_from_basic(other);
;
#endif // def INLINE_EX_CONSTRUCTORS
- ex(int const i);
- ex(unsigned int const i);
- ex(long const i);
- ex(unsigned long const i);
+ ex(int i);
+ ex(unsigned int i);
+ ex(long i);
+ ex(unsigned long i);
ex(double const d);
// functions overriding virtual functions from bases classes
bool info(unsigned inf) const;
unsigned nops() const;
ex expand(unsigned options=0) const;
- bool has(ex const & other) const;
- int degree(symbol const & s) const;
- int ldegree(symbol const & s) const;
- ex coeff(symbol const & s, int const n=1) const;
- ex lcoeff(symbol const & s) const { return coeff(s, degree(s)); }
- ex tcoeff(symbol const & s) const { return coeff(s, ldegree(s)); }
+ bool has(const ex & other) const;
+ int degree(const symbol & s) const;
+ int ldegree(const symbol & s) const;
+ ex coeff(const symbol & s, int n=1) const;
+ ex lcoeff(const symbol & s) const { return coeff(s, degree(s)); }
+ ex tcoeff(const symbol & s) const { return coeff(s, ldegree(s)); }
ex numer(bool normalize = true) const;
ex denom(bool normalize = true) const;
ex unit(const symbol &x) const;
ex normal(int level = 0) const;
ex smod(const numeric &xi) const;
numeric max_coefficient(void) const;
- ex collect(symbol const & s) const;
+ ex collect(const symbol & s) const;
ex eval(int level = 0) const;
ex evalf(int level = 0) const;
- ex diff(symbol const & s, unsigned nth = 1) const;
- ex series(symbol const & s, ex const & point, int order = 6) const;
- ex subs(lst const & ls, lst const & lr) const;
- ex subs(ex const & e) const;
+ ex diff(const symbol & s, unsigned nth = 1) const;
+ ex series(const symbol & s, const ex & point, int order = 6) const;
+ ex subs(const lst & ls, const lst & lr) const;
+ ex subs(const ex & e) const;
exvector get_indices(void) const;
- ex simplify_ncmul(exvector const & v) const;
- ex operator[](ex const & index) const;
- ex operator[](int const i) const;
- ex op(int const i) const;
- ex & let_op(int const i);
- int compare(ex const & other) const
+ ex simplify_ncmul(const exvector & v) const;
+ ex operator[](const ex & index) const;
+ ex operator[](int i) const;
+ ex op(int i) const;
+ ex & let_op(int i);
+ int compare(const ex & other) const
#ifdef INLINE_EX_CONSTRUCTORS
{
GINAC_ASSERT(bp!=0);
#else
;
#endif // def INLINE_EX_CONSTRUCTORS
- bool is_equal(ex const & other) const
+ bool is_equal(const ex & other) const
#ifdef INLINE_EX_CONSTRUCTORS
{
GINAC_ASSERT(bp!=0);
unsigned return_type_tinfo(void) const;
unsigned gethash(void) const;
- ex exadd(ex const & rh) const;
- ex exmul(ex const & rh) const;
- ex exncmul(ex const & rh) const;
+ ex exadd(const ex & rh) const;
+ ex exmul(const ex & rh) const;
+ ex exncmul(const ex & rh) const;
private:
- void construct_from_basic(basic const & other);
+ void construct_from_basic(const basic & other);
void makewriteable();
#ifdef OBSCURE_CINT_HACK
}
// wrapper functions around member functions
-inline unsigned nops(ex const & thisex)
+inline unsigned nops(const ex & thisex)
{ return thisex.nops(); }
-inline ex expand(ex const & thisex, unsigned options = 0)
+inline ex expand(const ex & thisex, unsigned options = 0)
{ return thisex.expand(options); }
-inline bool has(ex const & thisex, ex const & other)
+inline bool has(const ex & thisex, const ex & other)
{ return thisex.has(other); }
-inline int degree(ex const & thisex, symbol const & s)
+inline int degree(const ex & thisex, const symbol & s)
{ return thisex.degree(s); }
-inline int ldegree(ex const & thisex, symbol const & s)
+inline int ldegree(const ex & thisex, const symbol & s)
{ return thisex.ldegree(s); }
-inline ex coeff(ex const & thisex, symbol const & s, int const n=1)
+inline ex coeff(const ex & thisex, const symbol & s, int n=1)
{ return thisex.coeff(s, n); }
-inline ex numer(ex const & thisex, bool normalize = true)
+inline ex numer(const ex & thisex, bool normalize = true)
{ return thisex.numer(normalize); }
-inline ex denom(ex const & thisex, bool normalize = true)
+inline ex denom(const ex & thisex, bool normalize = true)
{ return thisex.denom(normalize); }
-inline ex normal(ex const & thisex, int level=0)
+inline ex normal(const ex & thisex, int level=0)
{ return thisex.normal(level); }
-inline ex collect(ex const & thisex, symbol const & s)
+inline ex collect(const ex & thisex, const symbol & s)
{ return thisex.collect(s); }
-inline ex eval(ex const & thisex, int level = 0)
+inline ex eval(const ex & thisex, int level = 0)
{ return thisex.eval(level); }
-inline ex evalf(ex const & thisex, int level = 0)
+inline ex evalf(const ex & thisex, int level = 0)
{ return thisex.evalf(level); }
-inline ex diff(ex const & thisex, symbol const & s, unsigned nth = 1)
+inline ex diff(const ex & thisex, const symbol & s, unsigned nth = 1)
{ return thisex.diff(s, nth); }
-inline ex series(ex const & thisex, symbol const & s, ex const & point, int order = 6)
+inline ex series(const ex & thisex, const symbol & s, const ex & point, int order = 6)
{ return thisex.series(s, point, order); }
-inline ex subs(ex const & thisex, ex const & e)
+inline ex subs(const ex & thisex, const ex & e)
{ return thisex.subs(e); }
-inline ex subs(ex const & thisex, lst const & ls, lst const & lr)
+inline ex subs(const ex & thisex, const lst & ls, const lst & lr)
{ return thisex.subs(ls, lr); }
inline void swap(ex & e1, ex & e2)
public:
expair() {}
~expair() {}
- expair(expair const & other) : rest(other.rest), coeff(other.coeff)
+ expair(const expair & other) : rest(other.rest), coeff(other.coeff)
{
GINAC_ASSERT(is_ex_exactly_of_type(coeff,numeric));
}
- expair const & operator=(expair const & other)
+ const expair & operator=(const expair & other)
{
if (this != &other) {
rest=other.rest;
}
return *this;
}
- expair(ex const & r, ex const & c) : rest(r), coeff(c)
+ expair(const ex & r, const ex & c) : rest(r), coeff(c)
{
GINAC_ASSERT(is_ex_exactly_of_type(coeff,numeric));
}
(coeff.is_equal(ex(1)));
}
- bool is_equal(expair const & other) const
+ bool is_equal(const expair & other) const
{
return (rest.is_equal(other.rest) && coeff.is_equal(other.coeff));
}
- bool is_less(expair const & other) const
+ bool is_less(const expair & other) const
{
return (rest.compare(other.rest)<0) ||
(!(other.rest.compare(rest)<0) && (coeff.compare(other.coeff)<0));
}
- int compare(expair const & other) const
+ int compare(const expair & other) const
{
int cmpval=rest.compare(other.rest);
if (cmpval!=0) return cmpval;
return cmpval;
}
- bool is_less_old2(expair const & other) const
+ bool is_less_old2(const expair & other) const
{
/*
bool this_numeric_with_coeff_1=is_numeric_with_coeff_1();
(!(other.rest.compare(rest)<0) &&
(coeff.compare(other.coeff)<0));
}
- int compare_old2(expair const & other) const
+ int compare_old2(const expair & other) const
{
if (is_ex_exactly_of_type(rest,numeric) &&
is_ex_exactly_of_type(other.rest,numeric)) {
if (cmpval!=0) return cmpval;
return coeff.compare(other.coeff);
}
- bool is_less_old(expair const & other) const
+ bool is_less_old(const expair & other) const
{
return (rest.compare(other.rest)<0) ||
(!(other.rest.compare(rest)<0) && (coeff.compare(other.coeff)<0));
}
- int compare_old(expair const & other) const
+ int compare_old(const expair & other) const
{
int cmpval=rest.compare(other.rest);
if (cmpval!=0) return cmpval;
class expair_is_less
{
public:
- bool operator()(expair const & lh, expair const & rh) const
+ bool operator()(const expair & lh, const expair & rh) const
{
return lh.is_less(rh);
}
class expair_is_less_old
{
public:
- bool operator()(expair const & lh, expair const & rh) const
+ bool operator()(const expair & lh, const expair & rh) const
{
return lh.is_less_old(rh);
}
class epp_is_less
{
public:
- bool operator()(epp const & lh, epp const & rh) const
+ bool operator()(const epp & lh, const epp & rh) const
{
return (*lh).is_less(*rh);
}
// public
-expairseq::expairseq(expairseq const & other)
+expairseq::expairseq(const expairseq & other)
{
debugmsg("expairseq copy constructor",LOGLEVEL_CONSTRUCT);
copy(other);
}
-expairseq const & expairseq::operator=(expairseq const & other)
+const expairseq & expairseq::operator=(const expairseq & other)
{
debugmsg("expairseq operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void expairseq::copy(expairseq const & other)
+void expairseq::copy(const expairseq & other)
{
inherited::copy(other);
seq=other.seq;
// other constructors
//////////
-expairseq::expairseq(ex const & lh, ex const & rh) : inherited(TINFO_expairseq)
+expairseq::expairseq(const ex & lh, const ex & rh) : inherited(TINFO_expairseq)
{
debugmsg("expairseq constructor from ex,ex",LOGLEVEL_CONSTRUCT);
construct_from_2_ex(lh,rh);
GINAC_ASSERT(is_canonical());
}
-expairseq::expairseq(exvector const & v) : inherited(TINFO_expairseq)
+expairseq::expairseq(const exvector & v) : inherited(TINFO_expairseq)
{
debugmsg("expairseq constructor from exvector",LOGLEVEL_CONSTRUCT);
construct_from_exvector(v);
}
/*
-expairseq::expairseq(epvector const & v, bool do_not_canonicalize) :
+expairseq::expairseq(const epvector & v, bool do_not_canonicalize) :
inherited(TINFO_expairseq)
{
debugmsg("expairseq constructor from epvector",LOGLEVEL_CONSTRUCT);
}
*/
-expairseq::expairseq(epvector const & v, ex const & oc) :
+expairseq::expairseq(const epvector & v, const ex & oc) :
inherited(TINFO_expairseq), overall_coeff(oc)
{
debugmsg("expairseq constructor from epvector,ex",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(is_canonical());
}
-expairseq::expairseq(epvector * vp, ex const & oc) :
+expairseq::expairseq(epvector * vp, const ex & oc) :
inherited(TINFO_expairseq), overall_coeff(oc)
{
debugmsg("expairseq constructor from epvector *,ex",LOGLEVEL_CONSTRUCT);
return overall_coeff;
}
-ex & expairseq::let_op(int const i)
+ex & expairseq::let_op(int i)
{
throw(std::logic_error("let_op not defined for expairseq and derived classes (add,mul,...)"));
}
return n.bp->basic::normal(sym_lst,repl_lst,level);
}
-ex expairseq::subs(lst const & ls, lst const & lr) const
+ex expairseq::subs(const lst & ls, const lst & lr) const
{
epvector * vp=subschildren(ls,lr);
if (vp==0) {
// protected
-int expairseq::compare_same_type(basic const & other) const
+int expairseq::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other, expairseq));
- expairseq const & o=static_cast<expairseq const &>(const_cast<basic &>(other));
+ const expairseq & o=static_cast<const expairseq &>(const_cast<basic &>(other));
int cmpval;
for (unsigned i=0; i<hashtabsize; ++i) {
unsigned sz=hashtab[i].size();
if (sz>0) {
- epplist const & eppl1=hashtab[i];
- epplist const & eppl2=o.hashtab[i];
+ const epplist & eppl1=hashtab[i];
+ const epplist & eppl2=o.hashtab[i];
epplist::const_iterator it1=eppl1.begin();
epplist::const_iterator it2=eppl2.begin();
while (it1!=eppl1.end()) {
#endif // def EXPAIRSEQ_USE_HASHTAB
}
-bool expairseq::is_equal_same_type(basic const & other) const
+bool expairseq::is_equal_same_type(const basic & other) const
{
- expairseq const & o=dynamic_cast<expairseq const &>(const_cast<basic &>(other));
+ const expairseq & o=dynamic_cast<const expairseq &>(const_cast<basic &>(other));
// compare number of elements
if (seq.size() != o.seq.size()) return false;
for (unsigned i=0; i<hashtabsize; ++i) {
unsigned sz=hashtab[i].size();
if (sz>0) {
- epplist const & eppl1=hashtab[i];
- epplist const & eppl2=o.hashtab[i];
+ const epplist & eppl1=hashtab[i];
+ const epplist & eppl2=o.hashtab[i];
epplist::const_iterator it1=eppl1.begin();
epplist::const_iterator it2=eppl2.begin();
while (it1!=eppl1.end()) {
// protected
-ex expairseq::thisexpairseq(epvector const & v,ex const & oc) const
+ex expairseq::thisexpairseq(const epvector & v,const ex & oc) const
{
return expairseq(v,oc);
}
-ex expairseq::thisexpairseq(epvector * vp, ex const & oc) const
+ex expairseq::thisexpairseq(epvector * vp, const ex & oc) const
{
return expairseq(vp,oc);
}
-void expairseq::printpair(ostream & os, expair const & p, unsigned upper_precedence) const
+void expairseq::printpair(ostream & os, const expair & p, unsigned upper_precedence) const
{
os << "[[";
p.rest.bp->print(os,precedence);
if (this_precedence<=upper_precedence) os << ")";
}
-expair expairseq::split_ex_to_pair(ex const & e) const
+expair expairseq::split_ex_to_pair(const ex & e) const
{
return expair(e,_ex1());
}
-expair expairseq::combine_ex_with_coeff_to_pair(ex const & e,
- ex const & c) const
+expair expairseq::combine_ex_with_coeff_to_pair(const ex & e,
+ const ex & c) const
{
GINAC_ASSERT(is_ex_exactly_of_type(c,numeric));
return expair(e,c);
}
-expair expairseq::combine_pair_with_coeff_to_pair(expair const & p,
- ex const & c) const
+expair expairseq::combine_pair_with_coeff_to_pair(const expair & p,
+ const ex & c) const
{
GINAC_ASSERT(is_ex_exactly_of_type(p.coeff,numeric));
GINAC_ASSERT(is_ex_exactly_of_type(c,numeric));
return expair(p.rest,ex_to_numeric(p.coeff).mul_dyn(ex_to_numeric(c)));
}
-ex expairseq::recombine_pair_to_ex(expair const & p) const
+ex expairseq::recombine_pair_to_ex(const expair & p) const
{
return lst(p.rest,p.coeff);
}
return _ex0();
}
-void expairseq::combine_overall_coeff(ex const & c)
+void expairseq::combine_overall_coeff(const ex & c)
{
GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
GINAC_ASSERT(is_ex_exactly_of_type(c,numeric));
overall_coeff = ex_to_numeric(overall_coeff).add_dyn(ex_to_numeric(c));
}
-void expairseq::combine_overall_coeff(ex const & c1, ex const & c2)
+void expairseq::combine_overall_coeff(const ex & c1, const ex & c2)
{
GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
GINAC_ASSERT(is_ex_exactly_of_type(c1,numeric));
add_dyn(ex_to_numeric(c1).mul(ex_to_numeric(c2)));
}
-bool expairseq::can_make_flat(expair const & p) const
+bool expairseq::can_make_flat(const expair & p) const
{
return true;
}
// non-virtual functions in this class
//////////
-void expairseq::construct_from_2_ex_via_exvector(ex const & lh, ex const & rh)
+void expairseq::construct_from_2_ex_via_exvector(const ex & lh, const ex & rh)
{
exvector v;
v.reserve(2);
#endif // def EXPAIRSEQ_USE_HASHTAB
}
-void expairseq::construct_from_2_ex(ex const & lh, ex const & rh)
+void expairseq::construct_from_2_ex(const ex & lh, const ex & rh)
{
if (lh.bp->tinfo()==tinfo()) {
if (rh.bp->tinfo()==tinfo()) {
}
}
-void expairseq::construct_from_2_expairseq(expairseq const & s1,
- expairseq const & s2)
+void expairseq::construct_from_2_expairseq(const expairseq & s1,
+ const expairseq & s2)
{
combine_overall_coeff(s1.overall_coeff);
combine_overall_coeff(s2.overall_coeff);
int cmpval=(*first1).rest.compare((*first2).rest);
if (cmpval==0) {
// combine terms
- numeric const & newcoeff=ex_to_numeric((*first1).coeff).
+ const numeric & newcoeff=ex_to_numeric((*first1).coeff).
add(ex_to_numeric((*first2).coeff));
if (!newcoeff.is_zero()) {
seq.push_back(expair((*first1).rest,newcoeff));
}
}
-void expairseq::construct_from_expairseq_ex(expairseq const & s,
- ex const & e)
+void expairseq::construct_from_expairseq_ex(const expairseq & s,
+ const ex & e)
{
combine_overall_coeff(s.overall_coeff);
if (is_ex_exactly_of_type(e,numeric)) {
int cmpval=(*first).rest.compare(p.rest);
if (cmpval==0) {
// combine terms
- numeric const & newcoeff=ex_to_numeric((*first).coeff).
+ const numeric & newcoeff=ex_to_numeric((*first).coeff).
add(ex_to_numeric(p.coeff));
if (!newcoeff.is_zero()) {
seq.push_back(expair((*first).rest,newcoeff));
}
}
-void expairseq::construct_from_exvector(exvector const & v)
+void expairseq::construct_from_exvector(const exvector & v)
{
// simplifications: +(a,+(b,c),d) -> +(a,b,c,d) (associativity)
// +(d,b,c,a) -> +(a,b,c,d) (canonicalization)
#endif // def EXPAIRSEQ_USE_HASHTAB
}
-void expairseq::construct_from_epvector(epvector const & v)
+void expairseq::construct_from_epvector(const epvector & v)
{
// simplifications: +(a,+(b,c),d) -> +(a,b,c,d) (associativity)
// +(d,b,c,a) -> +(a,b,c,d) (canonicalization)
#include <iostream>
-void expairseq::make_flat(exvector const & v)
+void expairseq::make_flat(const exvector & v)
{
exvector::const_iterator cit, citend = v.end();
cit=v.begin();
while (cit!=citend) {
if (cit->bp->tinfo()==tinfo()) {
- expairseq const & subseqref=ex_to_expairseq(*cit);
+ const expairseq & subseqref=ex_to_expairseq(*cit);
combine_overall_coeff(subseqref.overall_coeff);
epvector::const_iterator cit_s=subseqref.seq.begin();
while (cit_s!=subseqref.seq.end()) {
*/
}
-void expairseq::make_flat(epvector const & v)
+void expairseq::make_flat(const epvector & v)
{
epvector::const_iterator cit, citend = v.end();
cit=v.begin();
while (cit!=citend) {
if ((cit->rest.bp->tinfo()==tinfo())&&can_make_flat(*cit)) {
- expairseq const & subseqref=ex_to_expairseq((*cit).rest);
+ const expairseq & subseqref=ex_to_expairseq((*cit).rest);
combine_overall_coeff(ex_to_numeric(subseqref.overall_coeff),
ex_to_numeric((*cit).coeff));
epvector::const_iterator cit_s=subseqref.seq.begin();
return size;
}
-unsigned expairseq::calc_hashindex(ex const & e) const
+unsigned expairseq::calc_hashindex(const ex & e) const
{
// calculate hashindex
unsigned hash=e.gethash();
epvector::const_iterator last=seq.end();
epvector::const_iterator cit=seq.begin();
while (cit!=last) {
- ex const & expanded_ex=(*cit).rest.expand(options);
+ const ex & expanded_ex=(*cit).rest.expand(options);
if (!are_ex_trivially_equal((*cit).rest,expanded_ex)) {
// something changed, copy seq, eval and return it
epvector::const_iterator last=seq.end();
epvector::const_iterator cit=seq.begin();
while (cit!=last) {
- ex const & evaled_ex=(*cit).rest.eval(level);
+ const ex & evaled_ex=(*cit).rest.eval(level);
if (!are_ex_trivially_equal((*cit).rest,evaled_ex)) {
// something changed, copy seq, eval and return it
return s;
}
-epvector expairseq::diffchildren(symbol const & y) const
+epvector expairseq::diffchildren(const symbol & y) const
{
epvector s;
s.reserve(seq.size());
return s;
}
-epvector * expairseq::subschildren(lst const & ls, lst const & lr) const
+epvector * expairseq::subschildren(const lst & ls, const lst & lr) const
{
// returns a NULL pointer if nothing had to be substituted
// returns a pointer to a newly created epvector otherwise
epvector::const_iterator last=seq.end();
epvector::const_iterator cit=seq.begin();
while (cit!=last) {
- ex const & subsed_ex=(*cit).rest.subs(ls,lr);
+ const ex & subsed_ex=(*cit).rest.subs(ls,lr);
if (!are_ex_trivially_equal((*cit).rest,subsed_ex)) {
// something changed, copy seq, subs and return it
//////////
const expairseq some_expairseq;
-type_info const & typeid_expairseq=typeid(some_expairseq);
+const type_info & typeid_expairseq=typeid(some_expairseq);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
{
destroy(0);
}
- expairseq(expairseq const & other);
- expairseq const & operator=(expairseq const & other);
+ expairseq(const expairseq & other);
+ const expairseq & operator=(const expairseq & other);
protected:
- void copy(expairseq const & other);
+ void copy(const expairseq & other);
void destroy(bool call_parent)
{
if (call_parent) basic::destroy(call_parent);
// other constructors
public:
- expairseq(ex const & lh, ex const & rh);
- expairseq(exvector const & v);
- expairseq(epvector const & v, ex const & oc);
- expairseq(epvector * vp, ex const & oc); // vp will be deleted
+ expairseq(const ex & lh, const ex & rh);
+ expairseq(const exvector & v);
+ expairseq(const epvector & v, const ex & oc);
+ expairseq(epvector * vp, const ex & oc); // vp will be deleted
// functions overriding virtual functions from bases classes
public:
void printtree(ostream & os, unsigned indent) const;
bool info(unsigned inf) const;
unsigned nops() const;
- ex op(int const i) const;
- ex & let_op(int const i);
+ ex op(int i) const;
+ ex & let_op(int i);
ex eval(int level=0) const;
ex evalf(int level=0) const;
ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
- ex diff(symbol const & s) const;
- ex subs(lst const & ls, lst const & lr) const;
+ ex diff(const symbol & s) const;
+ ex subs(const lst & ls, const lst & lr) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
unsigned return_type(void) const;
unsigned calchash(void) const;
ex expand(unsigned options=0) const;
// new virtual functions which can be overridden by derived classes
protected:
- virtual ex thisexpairseq(epvector const & v, ex const & oc) const;
- virtual ex thisexpairseq(epvector * vp, ex const & oc) const;
+ virtual ex thisexpairseq(const epvector & v, const ex & oc) const;
+ virtual ex thisexpairseq(epvector * vp, const ex & oc) const;
virtual void printseq(ostream & os, char delim, unsigned this_precedence,
unsigned upper_precedence) const;
- virtual void printpair(ostream & os, expair const & p,
+ virtual void printpair(ostream & os, const expair & p,
unsigned upper_precedence) const;
- virtual expair split_ex_to_pair(ex const & e) const;
- virtual expair combine_ex_with_coeff_to_pair(ex const & e,
- ex const & c) const;
- virtual expair combine_pair_with_coeff_to_pair(expair const & p,
- ex const & c) const;
- virtual ex recombine_pair_to_ex(expair const & p) const;
+ virtual expair split_ex_to_pair(const ex & e) const;
+ virtual expair combine_ex_with_coeff_to_pair(const ex & e,
+ const ex & c) const;
+ virtual expair combine_pair_with_coeff_to_pair(const expair & p,
+ const ex & c) const;
+ virtual ex recombine_pair_to_ex(const expair & p) const;
virtual bool expair_needs_further_processing(epp it);
virtual ex default_overall_coeff(void) const;
- virtual void combine_overall_coeff(ex const & c);
- virtual void combine_overall_coeff(ex const & c1, ex const & c2);
- virtual bool can_make_flat(expair const & p) const;
+ virtual void combine_overall_coeff(const ex & c);
+ virtual void combine_overall_coeff(const ex & c1, const ex & c2);
+ virtual bool can_make_flat(const expair & p) const;
// non-virtual functions in this class
protected:
- void construct_from_2_ex_via_exvector(ex const & lh, ex const & rh);
- void construct_from_2_ex(ex const & lh, ex const & rh);
- void construct_from_2_expairseq(expairseq const & s1,
- expairseq const & s2);
- void construct_from_expairseq_ex(expairseq const & s,
- ex const & e);
- void construct_from_exvector(exvector const & v);
- void construct_from_epvector(epvector const & v);
- void make_flat(exvector const & v);
- void make_flat(epvector const & v);
+ void construct_from_2_ex_via_exvector(const ex & lh, const ex & rh);
+ void construct_from_2_ex(const ex & lh, const ex & rh);
+ void construct_from_2_expairseq(const expairseq & s1,
+ const expairseq & s2);
+ void construct_from_expairseq_ex(const expairseq & s,
+ const ex & e);
+ void construct_from_exvector(const exvector & v);
+ void construct_from_epvector(const epvector & v);
+ void make_flat(const exvector & v);
+ void make_flat(const epvector & v);
epvector * bubblesort(epvector::iterator itbegin, epvector::iterator itend);
epvector * mergesort(epvector::iterator itbegin, epvector::iterator itend);
void canonicalize(void);
#ifdef EXPAIRSEQ_USE_HASHTAB
void combine_same_terms(void);
unsigned calc_hashtabsize(unsigned sz) const;
- unsigned calc_hashindex(ex const & e) const;
+ unsigned calc_hashindex(const ex & e) const;
void shrink_hashtab(void);
void remove_hashtab_entry(epvector::const_iterator element);
void move_hashtab_entry(epvector::const_iterator oldpos,
epvector * evalchildren(int level) const;
epvector evalfchildren(int level) const;
epvector normalchildren(int level) const;
- epvector diffchildren(symbol const & s) const;
- epvector * subschildren(lst const & ls, lst const & lr) const;
+ epvector diffchildren(const symbol & s) const;
+ epvector * subschildren(const lst & ls, const lst & lr) const;
// member variables
// global constants
extern const expairseq some_expairseq;
-extern type_info const & typeid_expairseq;
+extern const type_info & typeid_expairseq;
// utility functions
inline const expairseq &ex_to_expairseq(const ex &e)
return basic::info(inf);
}
-ex & exprseq::let_op(int const i)
+ex & exprseq::let_op(int i)
{
GINAC_ASSERT(i>=0);
GINAC_ASSERT(i<nops());
destroy(0);
}
-fail::fail(fail const & other)
+fail::fail(const fail & other)
{
debugmsg("fail copy constructor",LOGLEVEL_CONSTRUCT);
copy(other);
}
-fail const & fail::operator=(fail const & other)
+const fail & fail::operator=(const fail & other)
{
debugmsg("fail operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void fail::copy(fail const & other)
+void fail::copy(const fail & other)
{
inherited::copy(other);
}
// protected
-int fail::compare_same_type(basic const & other) const
+int fail::compare_same_type(const basic & other) const
{
// two fails are always identical
return 0;
//////////
const fail some_fail;
-type_info const & typeid_fail=typeid(some_fail);
+const type_info & typeid_fail=typeid(some_fail);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
public:
fail();
~fail();
- fail(fail const & other);
- fail const & operator=(fail const & other);
+ fail(const fail & other);
+ const fail & operator=(const fail & other);
protected:
- void copy(fail const & other);
+ void copy(const fail & other);
void destroy(bool call_parent);
// other constructors
void print(ostream & os, unsigned upper_precedence=0) const;
void printraw(ostream & os) const;
protected:
- int compare_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
unsigned return_type(void) const { return return_types::noncommutative_composite; };
// new virtual functions which can be overridden by derived classes
// global constants
extern const fail some_fail;
-extern type_info const & typeid_fail;
+extern const type_info & typeid_fail;
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
}
$declare_function_macro_namespace=generate(
- <<'END_OF_DECLARE_FUNCTION_MACRO_NAMESPACE','GiNaC::ex const & p${N}','p${N}');
+ <<'END_OF_DECLARE_FUNCTION_MACRO_NAMESPACE','const GiNaC::ex & p${N}','p${N}');
#define DECLARE_FUNCTION_${N}P(NAME) \\
extern const unsigned function_index_##NAME; \\
inline GiNaC::function NAME(${SEQ1}) { \\
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}');
+ <<'END_OF_DECLARE_FUNCTION_MACRO_NO_NAMESPACE','const ex & p${N}','p${N}');
#define DECLARE_FUNCTION_${N}P(NAME) \\
extern const unsigned function_index_##NAME; \\
inline function NAME(${SEQ1}) { \\
$typedef_eval_funcp=generate(
'typedef ex (* eval_funcp_${N})(${SEQ1});'."\n",
-'ex const &','');
+'const ex &','');
$typedef_evalf_funcp=generate(
'typedef ex (* evalf_funcp_${N})(${SEQ1});'."\n",
-'ex const &','');
+'const ex &','');
$typedef_diff_funcp=generate(
'typedef ex (* diff_funcp_${N})(${SEQ1}, unsigned);'."\n",
-'ex const &','');
+'const ex &','');
$typedef_series_funcp=generate(
-'typedef ex (* series_funcp_${N})(${SEQ1}, symbol const &, ex const &, int);'."\n",
-'ex const &','');
+'typedef ex (* series_funcp_${N})(${SEQ1}, const symbol &, const ex &, int);'."\n",
+'const ex &','');
$constructors_interface=generate(
' function(unsigned ser, ${SEQ1});'."\n",
-'ex const & param${N}','');
+'const ex & param${N}','');
$register_new_interface=generate(
-' static unsigned register_new(char const * nm, eval_funcp_${N} e,'."\n".
+' static unsigned register_new(const char * nm, eval_funcp_${N} e,'."\n".
' evalf_funcp_${N} ef=0, diff_funcp_${N} d=0, series_funcp_${N} s=0);'.
"\n",'','');
$constructors_implementation=generate(
- <<'END_OF_CONSTRUCTORS_IMPLEMENTATION','ex const & param${N}','param${N}');
+ <<'END_OF_CONSTRUCTORS_IMPLEMENTATION','const ex & param${N}','param${N}');
function::function(unsigned ser, ${SEQ1})
: exprseq(${SEQ2}), serial(ser)
{
$register_new_implementation=generate(
<<'END_OF_REGISTER_NEW_IMPLEMENTATION','','');
-unsigned function::register_new(char const * nm, eval_funcp_${N} e,
+unsigned function::register_new(const char * nm, eval_funcp_${N} e,
evalf_funcp_${N} ef, diff_funcp_${N} d, series_funcp_${N} s)
{
registered_function_info rfi={nm,${N},0,eval_funcp(e),
// end of generated lines
struct registered_function_info {
- char const * name;
+ const char * name;
unsigned nparams;
unsigned options;
eval_funcp e;
public:
function();
~function();
- function(function const & other);
- function const & operator=(function const & other);
+ function(const function & other);
+ const function & operator=(const function & other);
protected:
- void copy(function const & other);
+ void copy(const function & other);
void destroy(bool call_parent);
// other constructors
// the following lines have been generated for max. ${maxargs} parameters
$constructors_interface
// end of generated lines
- function(unsigned ser, exprseq const & es);
- function(unsigned ser, exvector const & v, bool discardable=0);
+ function(unsigned ser, const exprseq & es);
+ function(unsigned ser, const exvector & v, bool discardable=0);
function(unsigned ser, exvector * vp); // vp will be deleted
// functions overriding virtual functions from bases classes
ex expand(unsigned options=0) const;
ex eval(int level=0) const;
ex evalf(int level=0) const;
- ex diff(symbol const & s) const;
- ex series(symbol const & s, ex const & point, int order) const;
- ex thisexprseq(exvector const & v) const;
+ ex diff(const symbol & s) const;
+ ex series(const symbol & s, const ex & point, int order) const;
+ ex thisexprseq(const exvector & v) const;
ex thisexprseq(exvector * vp) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
unsigned return_type(void) const;
unsigned return_type_tinfo(void) const;
// global constants
extern const function some_function;
-extern type_info const & typeid_function;
+extern const type_info & typeid_function;
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
destroy(0);
}
-function::function(function const & other)
+function::function(const function & other)
{
debugmsg("function copy constructor",LOGLEVEL_CONSTRUCT);
copy(other);
}
-function const & function::operator=(function const & other)
+const function & function::operator=(const function & other)
{
debugmsg("function operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void function::copy(function const & other)
+void function::copy(const function & other)
{
exprseq::copy(other);
serial=other.serial;
$constructors_implementation
// end of generated lines
-function::function(unsigned ser, exprseq const & es) : exprseq(es), serial(ser)
+function::function(unsigned ser, const exprseq & es) : exprseq(es), serial(ser)
{
debugmsg("function constructor from unsigned,exprseq",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_function;
}
-function::function(unsigned ser, exvector const & v, bool discardable)
+function::function(unsigned ser, const exvector & v, bool discardable)
: exprseq(v,discardable), serial(ser)
{
debugmsg("function constructor from string,exvector,bool",LOGLEVEL_CONSTRUCT);
throw(std::logic_error("function::evalf(): invalid nparams"));
}
-ex function::thisexprseq(exvector const & v) const
+ex function::thisexprseq(const exvector & v) const
{
return function(serial,v);
}
/** Implementation of ex::series for functions.
* \@see ex::series */
-ex function::series(symbol const & s, ex const & point, int order) const
+ex function::series(const symbol & s, const ex & point, int order) const
{
GINAC_ASSERT(serial<registered_functions().size());
// protected
-int function::compare_same_type(basic const & other) const
+int function::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other, function));
- function const & o=static_cast<function &>(const_cast<basic &>(other));
+ const function & o=static_cast<function &>(const_cast<basic &>(other));
if (serial!=o.serial) {
return serial < o.serial ? -1 : 1;
return exprseq::compare_same_type(o);
}
-bool function::is_equal_same_type(basic const & other) const
+bool function::is_equal_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other, function));
- function const & o=static_cast<function &>(const_cast<basic &>(other));
+ const function & o=static_cast<function &>(const_cast<basic &>(other));
if (serial!=o.serial) return false;
return exprseq::is_equal_same_type(o);
//////////
const function some_function;
-type_info const & typeid_function=typeid(some_function);
+const type_info & typeid_function=typeid(some_function);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
destroy(0);
}
-idx::idx(idx const & other)
+idx::idx(const idx & other)
{
debugmsg("idx copy constructor",LOGLEVEL_CONSTRUCT);
copy(other);
}
-idx const & idx::operator=(idx const & other)
+const idx & idx::operator=(const idx & other)
{
debugmsg("idx operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void idx::copy(idx const & other)
+void idx::copy(const idx & other)
{
basic::copy(other);
serial=other.serial;
name="index"+ToString(serial);
}
-idx::idx(string const & n, bool cov) : basic(TINFO_idx),
+idx::idx(const string & n, bool cov) : basic(TINFO_idx),
symbolic(true), name(n), covariant(cov)
{
debugmsg("idx constructor from string,bool",LOGLEVEL_CONSTRUCT);
serial=next_serial++;
}
-idx::idx(char const * n, bool cov) : basic(TINFO_idx),
+idx::idx(const char * n, bool cov) : basic(TINFO_idx),
symbolic(true), name(n), covariant(cov)
{
debugmsg("idx constructor from char*,bool",LOGLEVEL_CONSTRUCT);
serial=next_serial++;
}
-idx::idx(unsigned const v, bool cov) : basic(TINFO_idx),
+idx::idx(unsigned v, bool cov) : basic(TINFO_idx),
symbolic(false), value(v), covariant(cov)
{
debugmsg("idx constructor from unsigned,bool",LOGLEVEL_CONSTRUCT);
return basic::info(inf);
}
-ex idx::subs(lst const & ls, lst const & lr) const
+ex idx::subs(const lst & ls, const lst & lr) const
{
GINAC_ASSERT(ls.nops()==lr.nops());
#ifdef DO_GINAC_ASSERT
// protected
-int idx::compare_same_type(basic const & other) const
+int idx::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other,idx));
- idx const & o=static_cast<idx const &>
+ const idx & o=static_cast<const idx &>
(const_cast<basic &>(other));
if (covariant!=o.covariant) {
return o.symbolic ? -1 : 1;
}
-bool idx::is_equal_same_type(basic const & other) const
+bool idx::is_equal_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other,idx));
- idx const & o=static_cast<idx const &>
+ const idx & o=static_cast<const idx &>
(const_cast<basic &>(other));
if (covariant!=o.covariant) return false;
// public
-bool idx::is_co_contra_pair(basic const & other) const
+bool idx::is_co_contra_pair(const basic & other) const
{
// like is_equal_same_type(), but tests for different covariant status
GINAC_ASSERT(is_of_type(other,idx));
- idx const & o=static_cast<idx const &>
+ const idx & o=static_cast<const idx &>
(const_cast<basic &>(other));
if (covariant==o.covariant) return false;
//////////
const idx some_idx;
-type_info const & typeid_idx=typeid(some_idx);
+const type_info & typeid_idx=typeid(some_idx);
//////////
// other functions
return something_changed ? sig : INT_MAX;
}
-exvector idx_intersect(exvector const & iv1, exvector const & iv2)
+exvector idx_intersect(const exvector & iv1, const exvector & iv2)
{
// build a vector of symbolic indices contained in iv1 and iv2 simultaneously
// assumes (but does not test) that each index occurs at most twice
return iv3[A]; \
}
-ex permute_free_index_to_front(exvector const & iv3, exvector const & iv2,
+ex permute_free_index_to_front(const exvector & iv3, const exvector & iv2,
bool antisymmetric, int * sig)
{
// match (return value,iv2) to iv3 by permuting indices
throw(std::logic_error("permute_free_index_to_front(): no valid permutation found"));
}
-unsigned subs_index_in_exvector(exvector & v, ex const & is, ex const & ir)
+unsigned subs_index_in_exvector(exvector & v, const ex & is, const ex & ir)
{
exvector::iterator it;
unsigned replacements=0;
return replacements;
}
-unsigned count_index(ex const & e, ex const & i)
+unsigned count_index(const ex & e, const ex & i)
{
exvector idxv=e.get_indices();
unsigned count=0;
return count;
}
-ex subs_indices(ex const & e, exvector const & idxv_subs,
- exvector const & idxv_repl)
+ex subs_indices(const ex & e, const exvector & idxv_subs,
+ const exvector & idxv_repl)
{
GINAC_ASSERT(idxv_subs.size()==idxv_repl.size());
ex res=e;
public:
idx();
~idx();
- idx (idx const & other);
- idx const & operator=(idx const & other);
+ idx (const idx & other);
+ const idx & operator=(const idx & other);
protected:
- void copy(idx const & other);
+ void copy(const idx & other);
void destroy(bool call_parent);
// other constructors
public:
explicit idx(bool cov);
- explicit idx(string const & n, bool cov=false);
- explicit idx(char const * n, bool cov=false);
- explicit idx(unsigned const v, bool cov=false);
+ explicit idx(const string & n, bool cov=false);
+ explicit idx(const char * n, bool cov=false);
+ explicit idx(unsigned v, bool cov=false);
// functions overriding virtual functions from bases classes
public:
void print(ostream & os, unsigned upper_precedence=0) const;
bool info(unsigned inf) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
unsigned calchash(void) const;
- ex subs(lst const & ls, lst const & lr) const;
+ ex subs(const lst & ls, const lst & lr) const;
// new virtual functions which can be overridden by derived classes
public:
- virtual bool is_co_contra_pair(basic const & other) const;
+ virtual bool is_co_contra_pair(const basic & other) const;
virtual ex toggle_covariant(void) const;
// non-virtual functions in this class
bool is_symbolic(void) const;
unsigned get_value(void) const;
bool is_covariant(void) const;
- void setname(string const & n) {name=n;}
+ void setname(const string & n) {name=n;}
string getname(void) const {return name;}
// member variables
// global constants
extern const idx some_idx;
-extern type_info const & typeid_idx;
+extern const type_info & typeid_idx;
// utility functions
inline const idx &ex_to_idx(const ex &e)
// typedef vector<ex> exvector;
int canonicalize_indices(exvector & iv, bool antisymmetric=false);
-exvector idx_intersect(exvector const & iv1, exvector const & iv2);
-ex permute_free_index_to_front(exvector const & iv3, exvector const & iv2,
+exvector idx_intersect(const exvector & iv1, const exvector & iv2);
+ex permute_free_index_to_front(const exvector & iv3, const exvector & iv2,
bool antisymmetric, int * sig);
-unsigned subs_index_in_exvector(exvector & v, ex const & is, ex const & ir);
-ex subs_indices(ex const & e, exvector const & idxv_contra,
- exvector const & idxv_co);
-unsigned count_index(ex const & e, ex const & i);
+unsigned subs_index_in_exvector(exvector & v, const ex & is, const ex & ir);
+ex subs_indices(const ex & e, const exvector & idxv_contra,
+ const exvector & idxv_co);
+unsigned count_index(const ex & e, const ex & i);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
destroy(0);
}
-indexed::indexed(indexed const & other)
+indexed::indexed(const indexed & other)
{
debugmsg("indexed copy constructor",LOGLEVEL_CONSTRUCT);
copy (other);
}
-indexed const & indexed::operator=(indexed const & other)
+const indexed & indexed::operator=(const indexed & other)
{
debugmsg("indexed operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void indexed::copy(indexed const & other)
+void indexed::copy(const indexed & other)
{
inherited::copy(other);
}
// public
-indexed::indexed(ex const & i1) : inherited(i1)
+indexed::indexed(const ex & i1) : inherited(i1)
{
debugmsg("indexed constructor from ex",LOGLEVEL_CONSTRUCT);
tinfo_key=TINFO_indexed;
GINAC_ASSERT(all_of_type_idx());
}
-indexed::indexed(ex const & i1, ex const & i2) : inherited(i1,i2)
+indexed::indexed(const ex & i1, const ex & i2) : inherited(i1,i2)
{
debugmsg("indexed constructor from ex,ex",LOGLEVEL_CONSTRUCT);
tinfo_key=TINFO_indexed;
GINAC_ASSERT(all_of_type_idx());
}
-indexed::indexed(ex const & i1, ex const & i2, ex const & i3)
+indexed::indexed(const ex & i1, const ex & i2, const ex & i3)
: inherited(i1,i2,i3)
{
debugmsg("indexed constructor from ex,ex,ex",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(all_of_type_idx());
}
-indexed::indexed(ex const & i1, ex const & i2, ex const & i3, ex const & i4)
+indexed::indexed(const ex & i1, const ex & i2, const ex & i3, const ex & i4)
: inherited(i1,i2,i3,i4)
{
debugmsg("indexed constructor from ex,ex,ex,ex",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(all_of_type_idx());
}
-indexed::indexed(exvector const & iv) : inherited(iv)
+indexed::indexed(const exvector & iv) : inherited(iv)
{
debugmsg("indexed constructor from exvector",LOGLEVEL_CONSTRUCT);
tinfo_key=TINFO_indexed;
// protected
-int indexed::compare_same_type(basic const & other) const
+int indexed::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other,indexed));
return inherited::compare_same_type(other);
}
-bool indexed::is_equal_same_type(basic const & other) const
+bool indexed::is_equal_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other,indexed));
return inherited::is_equal_same_type(other);
return tinfo_key;
}
-ex indexed::thisexprseq(exvector const & v) const
+ex indexed::thisexprseq(const exvector & v) const
{
return indexed(v);
}
//////////
const indexed some_indexed;
-type_info const & typeid_indexed=typeid(some_indexed);
+const type_info & typeid_indexed=typeid(some_indexed);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
public:
indexed();
~indexed();
- indexed(indexed const & other);
- indexed const & operator=(indexed const & other);
+ indexed(const indexed & other);
+ const indexed & operator=(const indexed & other);
protected:
- void copy(indexed const & other);
+ void copy(const indexed & other);
void destroy(bool call_parent);
// other constructors
public:
- indexed(ex const & i1);
- indexed(ex const & i1, ex const & i2);
- indexed(ex const & i1, ex const & i2, ex const & i3);
- indexed(ex const & i1, ex const & i2, ex const & i3, ex const & i4);
- indexed(exvector const & iv);
+ indexed(const ex & i1);
+ indexed(const ex & i1, const ex & i2);
+ indexed(const ex & i1, const ex & i2, const ex & i3);
+ indexed(const ex & i1, const ex & i2, const ex & i3, const ex & i4);
+ indexed(const exvector & iv);
indexed(exvector * iv);
// functions overriding virtual functions from base classes
void print(ostream & os, unsigned upper_precedence=0) const;
void printcsrc(ostream & os, unsigned type, unsigned upper_precedence) const;
bool info(unsigned inf) const;
- ex diff(symbol const & s) const;
+ ex diff(const symbol & s) const;
exvector get_indices(void) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
unsigned return_type(void) const;
unsigned return_type_tinfo(void) const;
- ex thisexprseq(exvector const & v) const;
+ ex thisexprseq(const exvector & v) const;
ex thisexprseq(exvector * vp) const;
// new virtual functions which can be overridden by derived classes
// global constants
extern const indexed some_indexed;
-extern type_info const & typeid_indexed;
+extern const type_info & typeid_indexed;
// utility functions
inline const indexed &ex_to_indexed(const ex &e)
// absolute value
//////////
-static ex abs_evalf(ex const & x)
+static ex abs_evalf(const ex & x)
{
BEGIN_TYPECHECK
TYPECHECK(x,numeric)
return abs(ex_to_numeric(x));
}
-static ex abs_eval(ex const & x)
+static ex abs_eval(const ex & x)
{
if (is_ex_exactly_of_type(x, numeric))
return abs(ex_to_numeric(x));
// dilogarithm
//////////
-static ex Li2_eval(ex const & x)
+static ex Li2_eval(const ex & x)
{
if (x.is_zero())
return x;
// trilogarithm
//////////
-static ex Li3_eval(ex const & x)
+static ex Li3_eval(const ex & x)
{
if (x.is_zero())
return x;
// factorial
//////////
-static ex factorial_evalf(ex const & x)
+static ex factorial_evalf(const ex & x)
{
return factorial(x).hold();
}
-static ex factorial_eval(ex const & x)
+static ex factorial_eval(const ex & x)
{
if (is_ex_exactly_of_type(x, numeric))
return factorial(ex_to_numeric(x));
// binomial
//////////
-static ex binomial_evalf(ex const & x, ex const & y)
+static ex binomial_evalf(const ex & x, const ex & y)
{
return binomial(x, y).hold();
}
-static ex binomial_eval(ex const & x, ex const &y)
+static ex binomial_eval(const ex & x, const ex &y)
{
if (is_ex_exactly_of_type(x, numeric) && is_ex_exactly_of_type(y, numeric))
return binomial(ex_to_numeric(x), ex_to_numeric(y));
// Order term function (for truncated power series)
//////////
-static ex Order_eval(ex const & x)
+static ex Order_eval(const ex & x)
{
if (is_ex_exactly_of_type(x, numeric)) {
return Order(x).hold();
}
-static ex Order_series(ex const & x, symbol const & s, ex const & point, int order)
+static ex Order_series(const ex & x, const symbol & s, const ex & point, int order)
{
// Just wrap the function into a pseries object
epvector new_seq;
// Solve linear system
//////////
-ex lsolve(ex const &eqns, ex const &symbols)
+ex lsolve(const ex &eqns, const ex &symbols)
{
// solve a system of linear equations
if (eqns.info(info_flags::relation_equal)) {
matrix solution;
try {
solution=sys.fraction_free_elim(vars,rhs);
- } catch (runtime_error const & e) {
+ } catch (const runtime_error & e) {
// probably singular matrix (or other error)
// return empty solution list
// cerr << e.what() << endl;
}
/** non-commutative power. */
-ex ncpower(ex const &basis, unsigned exponent)
+ex ncpower(const ex &basis, unsigned exponent)
{
if (exponent==0) {
return _ex1();
// overloading at work: we cannot use the macros
/** Riemann's Zeta-function. */
extern const unsigned function_index_zeta1;
-inline function zeta(ex const & p1) {
+inline function zeta(const ex & p1) {
return function(function_index_zeta1, p1);
}
/** Derivatives of Riemann's Zeta-function. */
extern const unsigned function_index_zeta2;
-inline function zeta(ex const & p1, ex const & p2) {
+inline function zeta(const ex & p1, const ex & p2) {
return function(function_index_zeta2, p1, p2);
}
// overloading at work: we cannot use the macros
/** Psi-function (aka digamma-function). */
extern const unsigned function_index_psi1;
-inline function psi(ex const & p1) {
+inline function psi(const ex & p1) {
return function(function_index_psi1, p1);
}
/** Derivatives of Psi-function (aka polygamma-functions). */
extern const unsigned function_index_psi2;
-inline function psi(ex const & p1, ex const & p2) {
+inline function psi(const ex & p1, const ex & p2) {
return function(function_index_psi2, p1, p2);
}
/** Order term function (for truncated power series). */
DECLARE_FUNCTION_1P(Order)
-ex lsolve(ex const &eqns, ex const &symbols);
+ex lsolve(const ex &eqns, const ex &symbols);
-ex ncpower(ex const &basis, unsigned exponent);
+ex ncpower(const ex &basis, unsigned exponent);
-inline bool is_order_function(ex const & e)
+inline bool is_order_function(const ex & e)
{
return is_ex_the_function(e, Order);
}
destroy(0);
}
-isospin::isospin(isospin const & other)
+isospin::isospin(const isospin & other)
{
debugmsg("isospin copy constructor",LOGLEVEL_CONSTRUCT);
copy (other);
}
-isospin const & isospin::operator=(isospin const & other)
+const isospin & isospin::operator=(const isospin & other)
{
debugmsg("isospin operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void isospin::copy(isospin const & other)
+void isospin::copy(const isospin & other)
{
indexed::copy(other);
name=other.name;
// public
-isospin::isospin(string const & initname)
+isospin::isospin(const string & initname)
{
debugmsg("isospin constructor from string",LOGLEVEL_CONSTRUCT);
name=initname;
// protected
-int isospin::compare_same_type(basic const & other) const
+int isospin::compare_same_type(const basic & other) const
{
GINAC_ASSERT(other.tinfo() == TINFO_isospin);
const isospin *o = static_cast<const isospin *>(&other);
return serial < o->serial ? -1 : 1;
}
-ex isospin::simplify_ncmul(exvector const & v) const
+ex isospin::simplify_ncmul(const exvector & v) const
{
return simplified_ncmul(v);
}
// non-virtual functions in this class
//////////
-void isospin::setname(string const & n)
+void isospin::setname(const string & n)
{
name=n;
}
//////////
const isospin some_isospin;
-type_info const & typeid_isospin=typeid(some_isospin);
+const type_info & typeid_isospin=typeid(some_isospin);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
public:
isospin();
~isospin();
- isospin(isospin const & other);
- isospin const & operator=(isospin const & other);
+ isospin(const isospin & other);
+ const isospin & operator=(const isospin & other);
protected:
- void copy(isospin const & other);
+ void copy(const isospin & other);
void destroy(bool call_parent);
// other constructors
public:
- explicit isospin(string const & initname);
+ explicit isospin(const string & initname);
// functions overriding virtual functions from base classes
public:
void printcsrc(ostream & os, unsigned type, unsigned upper_precedence=0) const;
bool info(unsigned inf) const;
protected:
- int compare_same_type(basic const & other) const;
- ex simplify_ncmul(exvector const & v) const;
+ int compare_same_type(const basic & other) const;
+ ex simplify_ncmul(const exvector & v) const;
unsigned calchash(void) const;
// new virtual functions which can be overridden by derived classes
// non-virtual functions in this class
public:
- void setname(string const & n);
+ void setname(const string & n);
private:
string & autoname_prefix(void);
// global constants
extern const isospin some_isospin;
-extern type_info const & typeid_isospin;
+extern const type_info & typeid_isospin;
// utility functions
inline const isospin &ex_to_isospin(const ex &e)
destroy(0);
}
-lorentzidx::lorentzidx(lorentzidx const & other)
+lorentzidx::lorentzidx(const lorentzidx & other)
{
debugmsg("lorentzidx copy constructor",LOGLEVEL_CONSTRUCT);
copy(other);
}
-lorentzidx const & lorentzidx::operator=(lorentzidx const & other)
+const lorentzidx & lorentzidx::operator=(const lorentzidx & other)
{
debugmsg("lorentzidx operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void lorentzidx::copy(lorentzidx const & other)
+void lorentzidx::copy(const lorentzidx & other)
{
idx::copy(other);
orthogonal_only=other.orthogonal_only;
tinfo_key=TINFO_lorentzidx;
}
-lorentzidx::lorentzidx(string const & n, bool cov, bool oonly, unsigned dimp)
+lorentzidx::lorentzidx(const string & n, bool cov, bool oonly, unsigned dimp)
: idx(n,cov), orthogonal_only(oonly), dim_parallel_space(dimp)
{
debugmsg("lorentzidx constructor from string,bool,bool,unsigned",
tinfo_key=TINFO_lorentzidx;
}
-lorentzidx::lorentzidx(char const * n, bool cov, bool oonly, unsigned dimp)
+lorentzidx::lorentzidx(const char * n, bool cov, bool oonly, unsigned dimp)
: idx(n,cov), orthogonal_only(oonly), dim_parallel_space(dimp)
{
debugmsg("lorentzidx constructor from char*,bool,bool,unsigned",
tinfo_key=TINFO_lorentzidx;
}
-lorentzidx::lorentzidx(unsigned const v, bool cov) : idx(v,cov),
+lorentzidx::lorentzidx(unsigned v, bool cov) : idx(v,cov),
orthogonal_only(false), dim_parallel_space(0)
{
debugmsg("lorentzidx constructor from unsigned,bool",LOGLEVEL_CONSTRUCT);
//////////
const lorentzidx some_lorentzidx;
-type_info const & typeid_lorentzidx=typeid(some_lorentzidx);
+const type_info & typeid_lorentzidx=typeid(some_lorentzidx);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
public:
lorentzidx();
~lorentzidx();
- lorentzidx (lorentzidx const & other);
- lorentzidx const & operator=(lorentzidx const & other);
+ lorentzidx (const lorentzidx & other);
+ const lorentzidx & operator=(const lorentzidx & other);
protected:
- void copy(lorentzidx const & other);
+ void copy(const lorentzidx & other);
void destroy(bool call_parent);
// other constructors
public:
explicit lorentzidx(bool cov, bool oonly=false, unsigned dimp=0);
- explicit lorentzidx(string const & n, bool cov=false,
+ explicit lorentzidx(const string & n, bool cov=false,
bool oonly=false, unsigned dimp=0);
- explicit lorentzidx(char const * n, bool cov=false,
+ explicit lorentzidx(const char * n, bool cov=false,
bool oonly=false, unsigned dimp=0);
- explicit lorentzidx(unsigned const v, bool cov=false);
+ explicit lorentzidx(unsigned v, bool cov=false);
// functions overriding virtual functions from bases classes
public:
// global constants
extern const lorentzidx some_lorentzidx;
-extern type_info const & typeid_lorentzidx;
+extern const type_info & typeid_lorentzidx;
// utility functions
inline const lorentzidx &ex_to_lorentzidx(const ex &e)
destroy(0);
}
-lortensor::lortensor(lortensor const & other)
+lortensor::lortensor(const lortensor & other)
{
debugmsg("lortensor copy constructor",LOGLEVEL_CONSTRUCT);
copy (other);
}
-lortensor const & lortensor::operator=(lortensor const & other)
+const lortensor & lortensor::operator=(const lortensor & other)
{
debugmsg("lortensor operator=",LOGLEVEL_ASSIGNMENT);
if (this != & other) {
//protected
-void lortensor::copy(lortensor const & other)
+void lortensor::copy(const lortensor & other)
{
indexed::copy(other);
type=other.type;
// protected
-lortensor::lortensor(lortensor_types const lt, string const & n) : type(lt), name(n)
+lortensor::lortensor(lortensor_types const lt, const string & n) : type(lt), name(n)
{
debugmsg("lortensor constructor from lortensor_types,string",LOGLEVEL_CONSTRUCT);
serial=next_serial++;
tinfo_key=TINFO_lortensor;
}
-lortensor::lortensor(lortensor_types const lt, string const & n, ex const & mu) : indexed(mu), type(lt), name(n)
+lortensor::lortensor(lortensor_types const lt, const string & n, const ex & mu) : indexed(mu), type(lt), name(n)
{
debugmsg("lortensor constructor from lortensor_types,string,ex",LOGLEVEL_CONSTRUCT);
serial=next_serial++;
tinfo_key=TINFO_lortensor;
}
-lortensor::lortensor(lortensor_types const lt, string const & n, ex const & mu, ex const & nu) : indexed(mu,nu), type(lt), name(n)
+lortensor::lortensor(lortensor_types const lt, const string & n, const ex & mu, const ex & nu) : indexed(mu,nu), type(lt), name(n)
{
debugmsg("lortensor constructor from lortensor_types,string,ex,ex",LOGLEVEL_CONSTRUCT);
serial=next_serial++;
tinfo_key=TINFO_lortensor;
}
-lortensor::lortensor(lortensor_types const lt, string const & n, ex const & mu, ex const & nu, ex const & rho) : indexed(mu,nu,rho), type(lt), name(n)
+lortensor::lortensor(lortensor_types const lt, const string & n, const ex & mu, const ex & nu, const ex & rho) : indexed(mu,nu,rho), type(lt), name(n)
{
debugmsg("lortensor constructor from lortensor_types,string,ex,ex,ex",LOGLEVEL_CONSTRUCT);
serial=next_serial++;
tinfo_key=TINFO_lortensor;
}
-lortensor::lortensor(lortensor_types const lt, string const & n, ex const & mu, ex const & nu, ex const & rho, ex const & sigma) : indexed(mu,nu,rho,sigma), type(lt), name(n)
+lortensor::lortensor(lortensor_types const lt, const string & n, const ex & mu, const ex & nu, const ex & rho, const ex & sigma) : indexed(mu,nu,rho,sigma), type(lt), name(n)
{
debugmsg("lortensor constructor from lortensor_types,string,ex,ex,ex,ex",LOGLEVEL_CONSTRUCT);
serial=next_serial++;
tinfo_key=TINFO_lortensor;
}
-lortensor::lortensor(lortensor_types const lt, string const & n, exvector const & iv) : indexed(iv), type(lt), name(n)
+lortensor::lortensor(lortensor_types const lt, const string & n, const exvector & iv) : indexed(iv), type(lt), name(n)
{
debugmsg("lortensor constructor from lortensor_types,string,exvector",LOGLEVEL_CONSTRUCT);
serial=next_serial++;
tinfo_key=TINFO_lortensor;
}
-lortensor::lortensor(lortensor_types const lt, string const & n, unsigned s, exvector const & iv) : indexed(iv), type(lt), name(n), serial(s)
+lortensor::lortensor(lortensor_types const lt, const string & n, unsigned s, const exvector & iv) : indexed(iv), type(lt), name(n), serial(s)
{
debugmsg("lortensor constructor from lortensor_types,string,unsigned,exvector",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(all_of_type_lorentzidx());
tinfo_key=TINFO_lortensor;
}
-lortensor::lortensor(lortensor_types const lt, string const & n, unsigned s, exvector *ivp) : indexed(ivp), type(lt), name(n), serial(s)
+lortensor::lortensor(lortensor_types const lt, const string & n, unsigned s, exvector *ivp) : indexed(ivp), type(lt), name(n), serial(s)
{
debugmsg("lortensor constructor from lortensor_types,string,unsigned,exvector",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(all_of_type_lorentzidx());
//something has changed while sorting indices, more evaluations later
return ex(sig) *lortensor(type,name,iv);
}
- lorentzidx const & idx1=ex_to_lorentzidx(seq[0]);
- lorentzidx const & idx2=ex_to_lorentzidx(seq[1]);
+ const lorentzidx & idx1=ex_to_lorentzidx(seq[0]);
+ const lorentzidx & idx2=ex_to_lorentzidx(seq[1]);
if ((!idx1.is_symbolic()) && (!idx2.is_symbolic())) {
//both indices are numeric
if ((idx1.get_value()==idx2.get_value())) {
//protected
-int lortensor::compare_same_type(basic const & other) const
+int lortensor::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other,lortensor));
const lortensor *o = static_cast <const lortensor *> (&other);
return type < o->type ? -1 : 1;
}
-bool lortensor::is_equal_same_type(basic const & other) const
+bool lortensor::is_equal_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other,lortensor));
const lortensor *o=static_cast<const lortensor *> (&other);
{
return tinfo_key;
}
-ex lortensor::thisexprseq(exvector const & v) const
+ex lortensor::thisexprseq(const exvector & v) const
{
return lortensor(type,name,serial,v);
}
// protected
-void lortensor::setname(string const & n)
+void lortensor::setname(const string & n)
{
name=n;
}
// friend functions
//////////
-lortensor lortensor_g(ex const & mu, ex const & nu)
+lortensor lortensor_g(const ex & mu, const ex & nu)
{
return lortensor(lortensor::lortensor_g,"",mu,nu);
}
-lortensor lortensor_epsilon(ex const & mu, ex const & nu, ex const & rho, ex const & sigma)
+lortensor lortensor_epsilon(const ex & mu, const ex & nu, const ex & rho, const ex & sigma)
{
return lortensor(lortensor::lortensor_epsilon,"",mu,nu,rho,sigma);
}
-lortensor lortensor_rank1(string const & n, ex const & mu)
+lortensor lortensor_rank1(const string & n, const ex & mu)
{
return lortensor(lortensor::lortensor_rank1,n,mu);
}
-lortensor lortensor_rank2(string const & n, ex const & mu, ex const & nu)
+lortensor lortensor_rank2(const string & n, const ex & mu, const ex & nu)
{
return lortensor(lortensor::lortensor_rank2,n,mu,nu);
}
-ex simplify_lortensor_mul(ex const & m)
+ex simplify_lortensor_mul(const ex & m)
{
GINAC_ASSERT(is_ex_exactly_of_type(m,mul));
exvector v_contracted;
// process only lor_g objects
if (is_ex_exactly_of_type(*it,lortensor) &&
(ex_to_lortensor(*it).type==lortensor::lortensor_g)) {
- lortensor const & g=ex_to_lortensor(*it);
+ const lortensor & g=ex_to_lortensor(*it);
GINAC_ASSERT(g.seq.size()==2);
- idx const & first_idx=ex_to_lorentzidx(g.seq[0]);
- idx const & second_idx=ex_to_lorentzidx(g.seq[1]);
+ const idx & first_idx=ex_to_lorentzidx(g.seq[0]);
+ const idx & second_idx=ex_to_lorentzidx(g.seq[1]);
// g_{mu,mu} should have been contracted in lortensor::eval()
GINAC_ASSERT(!first_idx.is_equal(second_idx));
ex saved_g=*it; // save to restore it later
return m;
}
-ex simplify_lortensor(ex const & e)
+ex simplify_lortensor(const ex & e)
{
// all simplification is done on expanded objects
ex e_expanded=e.expand();
class lortensor : public indexed
{
// friends
- friend lortensor lortensor_g(ex const & mu, ex const & nu);
- // friend lortensor lortensor_delta(ex const & mu, ex const & nu);
- friend lortensor lortensor_epsilon(ex const & mu, ex const & nu,
- ex const & rho, ex const & sigma);
- friend lortensor lortensor_rankn(string const & n, exvector const & iv);
- friend lortensor lortensor_rank1(string const & n, ex const & mu);
- friend lortensor lortensor_rank2(string const & n, ex const & mu, ex const & nu);
- friend ex simplify_lortensor_mul(ex const & m);
- friend ex simplify_lortensor(ex const & e);
+ friend lortensor lortensor_g(const ex & mu, const ex & nu);
+ // friend lortensor lortensor_delta(const ex & mu, const ex & nu);
+ friend lortensor lortensor_epsilon(const ex & mu, const ex & nu,
+ const ex & rho, const ex & sigma);
+ friend lortensor lortensor_rankn(const string & n, const exvector & iv);
+ friend lortensor lortensor_rank1(const string & n, const ex & mu);
+ friend lortensor lortensor_rank2(const string & n, const ex & mu, const ex & nu);
+ friend ex simplify_lortensor_mul(const ex & m);
+ friend ex simplify_lortensor(const ex & e);
// types
public:
lortensor();
~lortensor();
- lortensor(lortensor const & other);
- lortensor const & operator=(lortensor const & other);
+ lortensor(const lortensor & other);
+ const lortensor & operator=(const lortensor & other);
protected:
- void copy(lortensor const & other);
+ void copy(const lortensor & other);
void destroy(bool call_parent);
// other constructors
protected:
- lortensor(lortensor_types const lt, string const & n);
- lortensor(lortensor_types const lt, string const & n, ex const & mu);
- lortensor(lortensor_types const lt, string const & n, ex const & mu, ex const & nu);
- lortensor(lortensor_types const lt, string const & n, ex const & mu, ex const & nu,
- ex const & rho);
- lortensor(lortensor_types const lt, string const & n, ex const & mu, ex const & nu, ex const & rho, ex const & sigma);
- lortensor(lortensor_types const lt, string const & n, exvector const & iv);
- lortensor(lortensor_types const lt, string const & n, unsigned s, exvector const & iv);
- lortensor(lortensor_types const lt, string const & n, unsigned s, exvector * ivp);
+ lortensor(lortensor_types const lt, const string & n);
+ lortensor(lortensor_types const lt, const string & n, const ex & mu);
+ lortensor(lortensor_types const lt, const string & n, const ex & mu, const ex & nu);
+ lortensor(lortensor_types const lt, const string & n, const ex & mu, const ex & nu,
+ const ex & rho);
+ lortensor(lortensor_types const lt, const string & n, const ex & mu, const ex & nu, const ex & rho, const ex & sigma);
+ lortensor(lortensor_types const lt, const string & n, const exvector & iv);
+ lortensor(lortensor_types const lt, const string & n, unsigned s, const exvector & iv);
+ lortensor(lortensor_types const lt, const string & n, unsigned s, exvector * ivp);
//functions overriding virtual functions from base classes
public:
bool info(unsigned inf) const;
ex eval(int level=0) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
unsigned return_type(void) const;
unsigned return_type_tinfo(void) const;
- ex thisexprseq(exvector const & v) const;
+ ex thisexprseq(const exvector & v) const;
ex thisexprseq(exvector * vp) const;
// new virtual functions which can be overridden by derived classes
//non virtual functions in this class
public:
- void setname(string const & n);
+ void setname(const string & n);
string getname(void) const {return name;}
protected:
bool all_of_type_lorentzidx(void) const;
// global constants
extern const lortensor some_lortensor;
- extern type_info const & typeid_lortensor;
+ extern const type_info & typeid_lortensor;
// utility functions
return static_cast<lortensor &>(*e.bp);
}
-lortensor lortensor_g(ex const & mu, ex const & nu);
-ex simplify_lortensor_mul(ex const & m);
-ex simplify_lortensor(ex const & e);
+lortensor lortensor_g(const ex & mu, const ex & nu);
+ex simplify_lortensor_mul(const ex & m);
+ex simplify_lortensor(const ex & e);
ex Dim(void);
#ifndef NO_GINAC_NAMESPACE
debugmsg("matrix destructor",LOGLEVEL_DESTRUCT);
}
-matrix::matrix(matrix const & other)
+matrix::matrix(const matrix & other)
{
debugmsg("matrix copy constructor",LOGLEVEL_CONSTRUCT);
copy(other);
}
-matrix const & matrix::operator=(matrix const & other)
+const matrix & matrix::operator=(const matrix & other)
{
debugmsg("matrix operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void matrix::copy(matrix const & other)
+void matrix::copy(const matrix & other)
{
inherited::copy(other);
row=other.row;
// protected
/** Ctor from representation, for internal use only. */
-matrix::matrix(unsigned r, unsigned c, exvector const & m2)
+matrix::matrix(unsigned r, unsigned c, const exvector & m2)
: inherited(TINFO_matrix), row(r), col(c), m(m2)
{
debugmsg("matrix constructor from unsigned,unsigned,exvector",LOGLEVEL_CONSTRUCT);
}
/** returns matrix entry at position (i/col, i%col). */
-ex & matrix::let_op(int const i)
+ex & matrix::let_op(int i)
{
return m[i];
}
/** Search ocurrences. A matrix 'has' an expression if it is the expression
* itself or one of the elements 'has' it. */
-bool matrix::has(ex const & other) const
+bool matrix::has(const ex & other) const
{
GINAC_ASSERT(other.bp!=0);
// protected
-int matrix::compare_same_type(basic const & other) const
+int matrix::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_exactly_of_type(other, matrix));
- matrix const & o=static_cast<matrix &>(const_cast<basic &>(other));
+ const matrix & o=static_cast<matrix &>(const_cast<basic &>(other));
// compare number of rows
if (row != o.rows()) {
/** Sum of matrices.
*
* @exception logic_error (incompatible matrices) */
-matrix matrix::add(matrix const & other) const
+matrix matrix::add(const matrix & other) const
{
if (col != other.col || row != other.row) {
throw (std::logic_error("matrix::add(): incompatible matrices"));
/** Difference of matrices.
*
* @exception logic_error (incompatible matrices) */
-matrix matrix::sub(matrix const & other) const
+matrix matrix::sub(const matrix & other) const
{
if (col != other.col || row != other.row) {
throw (std::logic_error("matrix::sub(): incompatible matrices"));
/** Product of matrices.
*
* @exception logic_error (incompatible matrices) */
-matrix matrix::mul(matrix const & other) const
+matrix matrix::mul(const matrix & other) const
{
if (col != other.row) {
throw (std::logic_error("matrix::mul(): incompatible matrices"));
* @param ro row of element
* @param co column of element
* @exception range_error (index out of range) */
-ex const & matrix::operator() (unsigned ro, unsigned co) const
+const ex & matrix::operator() (unsigned ro, unsigned co) const
{
if (ro<0 || ro>=row || co<0 || co>=col) {
throw (std::range_error("matrix::operator(): index out of range"));
* @return characteristic polynomial as new expression
* @exception logic_error (matrix not square)
* @see matrix::determinant() */
-ex matrix::charpoly(ex const & lambda) const
+ex matrix::charpoly(const ex & lambda) const
{
if (row != col) {
throw (std::logic_error("matrix::charpoly(): matrix not square"));
* @param rhs m x p matrix
* @exception logic_error (incompatible matrices)
* @exception runtime_error (singular matrix) */
-matrix matrix::fraction_free_elim(matrix const & vars,
- matrix const & rhs) const
+matrix matrix::fraction_free_elim(const matrix & vars,
+ const matrix & rhs) const
{
if ((row != rhs.row) || (col != vars.row) || (rhs.col != vars.col)) {
throw (std::logic_error("matrix::solve(): incompatible matrices"));
}
/** Solve simultaneous set of equations. */
-matrix matrix::solve(matrix const & v) const
+matrix matrix::solve(const matrix & v) const
{
if (!(row == col && col == v.row)) {
throw (std::logic_error("matrix::solve(): incompatible matrices"));
//////////
const matrix some_matrix;
-type_info const & typeid_matrix=typeid(some_matrix);
+const type_info & typeid_matrix=typeid(some_matrix);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
public:
matrix();
~matrix();
- matrix(matrix const & other);
- matrix const & operator=(matrix const & other);
+ matrix(const matrix & other);
+ const matrix & operator=(const matrix & other);
protected:
- void copy(matrix const & other);
+ void copy(const matrix & other);
void destroy(bool call_parent);
// other constructors
public:
matrix(unsigned r, unsigned c);
- matrix(unsigned r, unsigned c, exvector const & m2);
+ matrix(unsigned r, unsigned c, const exvector & m2);
// functions overriding virtual functions from bases classes
public:
void print(ostream & os, unsigned upper_precedence=0) const;
void printraw(ostream & os) const;
unsigned nops() const;
- ex & let_op(int const i);
+ ex & let_op(int i);
ex expand(unsigned options=0) const;
- bool has(ex const & other) const;
+ bool has(const ex & other) const;
ex eval(int level=0) const;
ex evalf(int level=0) const;
- // ex subs(lst const & ls, lst const & lr) const;
+ // ex subs(const lst & ls, const lst & lr) const;
protected:
- int compare_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
unsigned return_type(void) const { return return_types::noncommutative; };
// new virtual functions which can be overridden by derived classes
// (none)
{ return row; }
unsigned cols() const //! get number of columns.
{ return col; }
- matrix add(matrix const & other) const;
- matrix sub(matrix const & other) const;
- matrix mul(matrix const & other) const;
- ex const & operator() (unsigned ro, unsigned co) const;
+ matrix add(const matrix & other) const;
+ matrix sub(const matrix & other) const;
+ matrix mul(const matrix & other) const;
+ const ex & operator() (unsigned ro, unsigned co) const;
matrix & set(unsigned ro, unsigned co, ex value);
matrix transpose(void) const;
ex determinant(bool normalized=true) const;
ex trace(void) const;
- ex charpoly(ex const & lambda) const;
+ ex charpoly(const ex & lambda) const;
matrix inverse(void) const;
- matrix fraction_free_elim(matrix const & vars, matrix const & v) const;
- matrix solve(matrix const & v) const;
+ matrix fraction_free_elim(const matrix & vars, const matrix & v) const;
+ matrix solve(const matrix & v) const;
protected:
int pivot(unsigned ro);
void ffe_swap(unsigned r1, unsigned c1, unsigned r2 ,unsigned c2);
// global constants
extern const matrix some_matrix;
-extern type_info const & typeid_matrix;
+extern const type_info & typeid_matrix;
// wrapper functions around member functions
-inline unsigned nops(matrix const & m)
+inline unsigned nops(const matrix & m)
{ return m.nops(); }
-inline ex expand(matrix const & m, unsigned options=0)
+inline ex expand(const matrix & m, unsigned options=0)
{ return m.expand(options); }
-inline bool has(matrix const & m, ex const & other)
+inline bool has(const matrix & m, const ex & other)
{ return m.has(other); }
-inline ex eval(matrix const & m, int level=0)
+inline ex eval(const matrix & m, int level=0)
{ return m.eval(level); }
-inline ex evalf(matrix const & m, int level=0)
+inline ex evalf(const matrix & m, int level=0)
{ return m.evalf(level); }
-inline unsigned rows(matrix const & m)
+inline unsigned rows(const matrix & m)
{ return m.rows(); }
-inline unsigned cols(matrix const & m)
+inline unsigned cols(const matrix & m)
{ return m.cols(); }
-inline matrix transpose(matrix const & m)
+inline matrix transpose(const matrix & m)
{ return m.transpose(); }
-inline ex determinant(matrix const & m, bool normalized=true)
+inline ex determinant(const matrix & m, bool normalized=true)
{ return m.determinant(normalized); }
-inline ex trace(matrix const & m)
+inline ex trace(const matrix & m)
{ return m.trace(); }
-inline ex charpoly(matrix const & m, ex const & lambda)
+inline ex charpoly(const matrix & m, const ex & lambda)
{ return m.charpoly(lambda); }
-inline matrix inverse(matrix const & m)
+inline matrix inverse(const matrix & m)
{ return m.inverse(); }
// utility functions
destroy(0);
}
-mul::mul(mul const & other)
+mul::mul(const mul & other)
{
debugmsg("mul copy constructor",LOGLEVEL_CONSTRUCT);
copy(other);
}
-mul const & mul::operator=(mul const & other)
+const mul & mul::operator=(const mul & other)
{
debugmsg("mul operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void mul::copy(mul const & other)
+void mul::copy(const mul & other)
{
inherited::copy(other);
}
// public
-mul::mul(ex const & lh, ex const & rh)
+mul::mul(const ex & lh, const ex & rh)
{
debugmsg("mul constructor from ex,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
GINAC_ASSERT(is_canonical());
}
-mul::mul(exvector const & v)
+mul::mul(const exvector & v)
{
debugmsg("mul constructor from exvector",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
}
/*
-mul::mul(epvector const & v, bool do_not_canonicalize)
+mul::mul(const epvector & v, bool do_not_canonicalize)
{
debugmsg("mul constructor from epvector,bool",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
}
*/
-mul::mul(epvector const & v)
+mul::mul(const epvector & v)
{
debugmsg("mul constructor from epvector",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
GINAC_ASSERT(is_canonical());
}
-mul::mul(epvector const & v, ex const & oc)
+mul::mul(const epvector & v, const ex & oc)
{
debugmsg("mul constructor from epvector,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
GINAC_ASSERT(is_canonical());
}
-mul::mul(epvector * vp, ex const & oc)
+mul::mul(epvector * vp, const ex & oc)
{
debugmsg("mul constructor from epvector *,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
GINAC_ASSERT(is_canonical());
}
-mul::mul(ex const & lh, ex const & mh, ex const & rh)
+mul::mul(const ex & lh, const ex & mh, const ex & rh)
{
debugmsg("mul constructor from ex,ex,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
typedef vector<int> intvector;
-int mul::degree(symbol const & s) const
+int mul::degree(const symbol & s) const
{
int deg_sum=0;
for (epvector::const_iterator cit=seq.begin(); cit!=seq.end(); ++cit) {
return deg_sum;
}
-int mul::ldegree(symbol const & s) const
+int mul::ldegree(const symbol & s) const
{
int deg_sum=0;
for (epvector::const_iterator cit=seq.begin(); cit!=seq.end(); ++cit) {
return deg_sum;
}
-ex mul::coeff(symbol const & s, int const n) const
+ex mul::coeff(const symbol & s, int n) const
{
exvector coeffseq;
coeffseq.reserve(seq.size()+1);
is_ex_exactly_of_type((*seq.begin()).rest,add) &&
ex_to_numeric((*seq.begin()).coeff).is_equal(_num1())) {
// *(+(x,y,...);c) -> +(*(x,c),*(y,c),...) (c numeric(), no powers of +())
- add const & addref=ex_to_add((*seq.begin()).rest);
+ const add & addref=ex_to_add((*seq.begin()).rest);
epvector distrseq;
distrseq.reserve(addref.seq.size());
for (epvector::const_iterator cit=addref.seq.begin(); cit!=addref.seq.end(); ++cit) {
return iv;
}
-ex mul::simplify_ncmul(exvector const & v) const
+ex mul::simplify_ncmul(const exvector & v) const
{
throw(std::logic_error("mul::simplify_ncmul() should never have been called!"));
}
// protected
-int mul::compare_same_type(basic const & other) const
+int mul::compare_same_type(const basic & other) const
{
return inherited::compare_same_type(other);
}
-bool mul::is_equal_same_type(basic const & other) const
+bool mul::is_equal_same_type(const basic & other) const
{
return inherited::is_equal_same_type(other);
}
return tinfo_key;
}
-ex mul::thisexpairseq(epvector const & v, ex const & oc) const
+ex mul::thisexpairseq(const epvector & v, const ex & oc) const
{
return (new mul(v,oc))->setflag(status_flags::dynallocated);
}
-ex mul::thisexpairseq(epvector * vp, ex const & oc) const
+ex mul::thisexpairseq(epvector * vp, const ex & oc) const
{
return (new mul(vp,oc))->setflag(status_flags::dynallocated);
}
-expair mul::split_ex_to_pair(ex const & e) const
+expair mul::split_ex_to_pair(const ex & e) const
{
if (is_ex_exactly_of_type(e,power)) {
- power const & powerref=ex_to_power(e);
+ const power & powerref=ex_to_power(e);
if (is_ex_exactly_of_type(powerref.exponent,numeric)) {
return expair(powerref.basis,powerref.exponent);
}
return expair(e,_ex1());
}
-expair mul::combine_ex_with_coeff_to_pair(ex const & e,
- ex const & c) const
+expair mul::combine_ex_with_coeff_to_pair(const ex & e,
+ const ex & c) const
{
// to avoid duplication of power simplification rules,
// we create a temporary power object
return split_ex_to_pair(power(e,c));
}
-expair mul::combine_pair_with_coeff_to_pair(expair const & p,
- ex const & c) const
+expair mul::combine_pair_with_coeff_to_pair(const expair & p,
+ const ex & c) const
{
// to avoid duplication of power simplification rules,
// we create a temporary power object
return split_ex_to_pair(power(recombine_pair_to_ex(p),c));
}
-ex mul::recombine_pair_to_ex(expair const & p) const
+ex mul::recombine_pair_to_ex(const expair & p) const
{
// if (p.coeff.compare(_ex1())==0) {
// if (are_ex_trivially_equal(p.coeff,_ex1())) {
return _ex1();
}
-void mul::combine_overall_coeff(ex const & c)
+void mul::combine_overall_coeff(const ex & c)
{
GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
GINAC_ASSERT(is_ex_exactly_of_type(c,numeric));
overall_coeff = ex_to_numeric(overall_coeff).mul_dyn(ex_to_numeric(c));
}
-void mul::combine_overall_coeff(ex const & c1, ex const & c2)
+void mul::combine_overall_coeff(const ex & c1, const ex & c2)
{
GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
GINAC_ASSERT(is_ex_exactly_of_type(c1,numeric));
mul_dyn(ex_to_numeric(c1).power(ex_to_numeric(c2)));
}
-bool mul::can_make_flat(expair const & p) const
+bool mul::can_make_flat(const expair & p) const
{
GINAC_ASSERT(is_ex_exactly_of_type(p.coeff,numeric));
// this assertion will probably fail somewhere
epvector * expanded_seqp=expandchildren(options);
- epvector const & expanded_seq = expanded_seqp==0 ? seq : *expanded_seqp;
+ const epvector & expanded_seq = expanded_seqp==0 ? seq : *expanded_seqp;
positions_of_adds.resize(expanded_seq.size());
number_of_add_operands.resize(expanded_seq.size());
if (is_ex_exactly_of_type((*cit).rest,add)&&
(ex_to_numeric((*cit).coeff).is_equal(_num1()))) {
positions_of_adds[number_of_adds]=current_position;
- add const & expanded_addref=ex_to_add((*cit).rest);
+ const add & expanded_addref=ex_to_add((*cit).rest);
unsigned addref_nops=expanded_addref.nops();
number_of_add_operands[number_of_adds]=addref_nops;
number_of_expanded_terms *= addref_nops;
epvector term;
term=expanded_seq;
for (l=0; l<number_of_adds; l++) {
- add const & addref=ex_to_add(expanded_seq[positions_of_adds[l]].rest);
+ const add & addref=ex_to_add(expanded_seq[positions_of_adds[l]].rest);
GINAC_ASSERT(term[positions_of_adds[l]].coeff.compare(_ex1())==0);
term[positions_of_adds[l]]=split_ex_to_pair(addref.op(k[l]));
}
epvector::const_iterator last=seq.end();
epvector::const_iterator cit=seq.begin();
while (cit!=last) {
- ex const & factor=recombine_pair_to_ex(*cit);
- ex const & expanded_factor=factor.expand(options);
+ const ex & factor=recombine_pair_to_ex(*cit);
+ const ex & expanded_factor=factor.expand(options);
if (!are_ex_trivially_equal(factor,expanded_factor)) {
// something changed, copy seq, eval and return it
//////////
const mul some_mul;
-type_info const & typeid_mul=typeid(some_mul);
+const type_info & typeid_mul=typeid(some_mul);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
public:
mul();
~mul();
- mul(mul const & other);
- mul const & operator=(mul const & other);
+ mul(const mul & other);
+ const mul & operator=(const mul & other);
protected:
- void copy(mul const & other);
+ void copy(const mul & other);
void destroy(bool call_parent);
// other constructors
public:
- mul(ex const & lh, ex const & rh);
- mul(exvector const & v);
- mul(epvector const & v);
- //mul(epvector const & v, bool do_not_canonicalize=0);
- mul(epvector const & v, ex const & oc);
- mul(epvector * vp, ex const & oc);
- mul(ex const & lh, ex const & mh, ex const & rh);
+ mul(const ex & lh, const ex & rh);
+ mul(const exvector & v);
+ mul(const epvector & v);
+ //mul(const epvector & v, bool do_not_canonicalize=0);
+ mul(const epvector & v, const ex & oc);
+ mul(epvector * vp, const ex & oc);
+ mul(const ex & lh, const ex & mh, const ex & rh);
// functions overriding virtual functions from bases classes
public:
void printraw(ostream & os) const;
void printcsrc(ostream & os, unsigned type, unsigned upper_precedence) const;
bool info(unsigned inf) const;
- int degree(symbol const & s) const;
- int ldegree(symbol const & s) const;
- ex coeff(symbol const & s, int const n=1) const;
+ int degree(const symbol & s) const;
+ int ldegree(const symbol & s) const;
+ ex coeff(const symbol & s, int n=1) const;
ex eval(int level=0) const;
- ex diff(symbol const & s) const;
- ex series(symbol const & s, ex const & point, int order) const;
+ ex diff(const symbol & s) const;
+ ex series(const symbol & s, const ex & point, int order) const;
ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
numeric integer_content(void) const;
ex smod(const numeric &xi) const;
numeric max_coefficient(void) const;
exvector get_indices(void) const;
- ex simplify_ncmul(exvector const & v) const;
+ ex simplify_ncmul(const exvector & v) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
unsigned return_type(void) const;
unsigned return_type_tinfo(void) const;
- ex thisexpairseq(epvector const & v, ex const & oc) const;
- ex thisexpairseq(epvector * vp, ex const & oc) const;
- expair split_ex_to_pair(ex const & e) const;
- expair combine_ex_with_coeff_to_pair(ex const & e,
- ex const & c) const;
- expair combine_pair_with_coeff_to_pair(expair const & p,
- ex const & c) const;
- ex recombine_pair_to_ex(expair const & p) const;
+ ex thisexpairseq(const epvector & v, const ex & oc) const;
+ ex thisexpairseq(epvector * vp, const ex & oc) const;
+ expair split_ex_to_pair(const ex & e) const;
+ expair combine_ex_with_coeff_to_pair(const ex & e,
+ const ex & c) const;
+ expair combine_pair_with_coeff_to_pair(const expair & p,
+ const ex & c) const;
+ ex recombine_pair_to_ex(const expair & p) const;
bool expair_needs_further_processing(epp it);
ex default_overall_coeff(void) const;
- void combine_overall_coeff(ex const & c);
- void combine_overall_coeff(ex const & c1, ex const & c2);
- bool can_make_flat(expair const & p) const;
+ void combine_overall_coeff(const ex & c);
+ void combine_overall_coeff(const ex & c1, const ex & c2);
+ bool can_make_flat(const expair & p) const;
ex expand(unsigned options=0) const;
// new virtual functions which can be overridden by derived classes
// global constants
extern const mul some_mul;
-extern type_info const & typeid_mul;
+extern const type_info & typeid_mul;
// utility functions
inline const mul &ex_to_mul(const ex &e)
destroy(0);
}
-ncmul::ncmul(ncmul const & other)
+ncmul::ncmul(const ncmul & other)
{
debugmsg("ncmul copy constructor",LOGLEVEL_CONSTRUCT);
copy(other);
}
-ncmul const & ncmul::operator=(ncmul const & other)
+const ncmul & ncmul::operator=(const ncmul & other)
{
debugmsg("ncmul operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void ncmul::copy(ncmul const & other)
+void ncmul::copy(const ncmul & other)
{
inherited::copy(other);
}
// public
-ncmul::ncmul(ex const & lh, ex const & rh) :
+ncmul::ncmul(const ex & lh, const ex & rh) :
inherited(lh,rh)
{
debugmsg("ncmul constructor from ex,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_ncmul;
}
-ncmul::ncmul(ex const & f1, ex const & f2, ex const & f3) :
+ncmul::ncmul(const ex & f1, const ex & f2, const ex & f3) :
inherited(f1,f2,f3)
{
debugmsg("ncmul constructor from 3 ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_ncmul;
}
-ncmul::ncmul(ex const & f1, ex const & f2, ex const & f3,
- ex const & f4) : inherited(f1,f2,f3,f4)
+ncmul::ncmul(const ex & f1, const ex & f2, const ex & f3,
+ const ex & f4) : inherited(f1,f2,f3,f4)
{
debugmsg("ncmul constructor from 4 ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_ncmul;
}
-ncmul::ncmul(ex const & f1, ex const & f2, ex const & f3,
- ex const & f4, ex const & f5) : inherited(f1,f2,f3,f4,f5)
+ncmul::ncmul(const ex & f1, const ex & f2, const ex & f3,
+ const ex & f4, const ex & f5) : inherited(f1,f2,f3,f4,f5)
{
debugmsg("ncmul constructor from 5 ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_ncmul;
}
-ncmul::ncmul(ex const & f1, ex const & f2, ex const & f3,
- ex const & f4, ex const & f5, ex const & f6) :
+ncmul::ncmul(const ex & f1, const ex & f2, const ex & f3,
+ const ex & f4, const ex & f5, const ex & f6) :
inherited(f1,f2,f3,f4,f5,f6)
{
debugmsg("ncmul constructor from 6 ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_ncmul;
}
-ncmul::ncmul(exvector const & v, bool discardable) : inherited(v,discardable)
+ncmul::ncmul(const exvector & v, bool discardable) : inherited(v,discardable)
{
debugmsg("ncmul constructor from exvector,bool",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_ncmul;
for (exvector::const_iterator cit=expanded_seq.begin(); cit!=last; ++cit) {
if (is_ex_exactly_of_type((*cit),add)) {
positions_of_adds[number_of_adds]=current_position;
- add const & expanded_addref=ex_to_add(*cit);
+ const add & expanded_addref=ex_to_add(*cit);
number_of_add_operands[number_of_adds]=expanded_addref.seq.size();
number_of_expanded_terms *= expanded_addref.seq.size();
number_of_adds++;
term=expanded_seq;
for (l=0; l<number_of_adds; l++) {
GINAC_ASSERT(is_ex_exactly_of_type(expanded_seq[positions_of_adds[l]],add));
- add const & addref=ex_to_add(expanded_seq[positions_of_adds[l]]);
+ const add & addref=ex_to_add(expanded_seq[positions_of_adds[l]]);
term[positions_of_adds[l]]=addref.recombine_pair_to_ex(addref.seq[k[l]]);
}
distrseq.push_back((new ncmul(term,1))->setflag(status_flags::dynallocated |
status_flags::expanded);
}
-int ncmul::degree(symbol const & s) const
+int ncmul::degree(const symbol & s) const
{
int deg_sum=0;
for (exvector::const_iterator cit=seq.begin(); cit!=seq.end(); ++cit) {
return deg_sum;
}
-int ncmul::ldegree(symbol const & s) const
+int ncmul::ldegree(const symbol & s) const
{
int deg_sum=0;
for (exvector::const_iterator cit=seq.begin(); cit!=seq.end(); ++cit) {
return deg_sum;
}
-ex ncmul::coeff(symbol const & s, int const n) const
+ex ncmul::coeff(const symbol & s, int n) const
{
exvector coeffseq;
coeffseq.reserve(seq.size());
return _ex0();
}
-unsigned ncmul::count_factors(ex const & e) const
+unsigned ncmul::count_factors(const ex & e) const
{
if ((is_ex_exactly_of_type(e,mul)&&(e.return_type()!=return_types::commutative))||
(is_ex_exactly_of_type(e,ncmul))) {
return 1;
}
-void ncmul::append_factors(exvector & v, ex const & e) const
+void ncmul::append_factors(exvector & v, const ex & e) const
{
if ((is_ex_exactly_of_type(e,mul)&&(e.return_type()!=return_types::commutative))||
(is_ex_exactly_of_type(e,ncmul))) {
return iv;
}
-ex ncmul::subs(lst const & ls, lst const & lr) const
+ex ncmul::subs(const lst & ls, const lst & lr) const
{
return ncmul(subschildren(ls, lr));
}
-ex ncmul::thisexprseq(exvector const & v) const
+ex ncmul::thisexprseq(const exvector & v) const
{
return (new ncmul(v))->setflag(status_flags::dynallocated);
}
// protected
-int ncmul::compare_same_type(basic const & other) const
+int ncmul::compare_same_type(const basic & other) const
{
return inherited::compare_same_type(other);
}
return s;
}
-exvector const & ncmul::get_factors(void) const
+const exvector & ncmul::get_factors(void) const
{
return seq;
}
//////////
const ncmul some_ncmul;
-type_info const & typeid_ncmul=typeid(some_ncmul);
+const type_info & typeid_ncmul=typeid(some_ncmul);
//////////
// friend functions
//////////
-ex nonsimplified_ncmul(exvector const & v)
+ex nonsimplified_ncmul(const exvector & v)
{
return (new ncmul(v))->setflag(status_flags::dynallocated);
}
-ex simplified_ncmul(exvector const & v)
+ex simplified_ncmul(const exvector & v)
{
if (v.size()==0) {
return _ex1();
GINAC_DECLARE_REGISTERED_CLASS(ncmul, exprseq)
friend class power;
- friend ex nonsimplified_ncmul(exvector const & v);
- friend ex simplified_ncmul(exvector const & v);
+ friend ex nonsimplified_ncmul(const exvector & v);
+ friend ex simplified_ncmul(const exvector & v);
// member functions
public:
ncmul();
~ncmul();
- ncmul(ncmul const & other);
- ncmul const & operator=(ncmul const & other);
+ ncmul(const ncmul & other);
+ const ncmul & operator=(const ncmul & other);
protected:
- void copy(ncmul const & other);
+ void copy(const ncmul & other);
void destroy(bool call_parent);
// other constructors
public:
- ncmul(ex const & lh, ex const & rh);
- ncmul(ex const & f1, ex const & f2, ex const & f3);
- ncmul(ex const & f1, ex const & f2, ex const & f3,
- ex const & f4);
- ncmul(ex const & f1, ex const & f2, ex const & f3,
- ex const & f4, ex const & f5);
- ncmul(ex const & f1, ex const & f2, ex const & f3,
- ex const & f4, ex const & f5, ex const & f6);
- ncmul(exvector const & v, bool discardable=false);
+ ncmul(const ex & lh, const ex & rh);
+ ncmul(const ex & f1, const ex & f2, const ex & f3);
+ ncmul(const ex & f1, const ex & f2, const ex & f3,
+ const ex & f4);
+ ncmul(const ex & f1, const ex & f2, const ex & f3,
+ const ex & f4, const ex & f5);
+ ncmul(const ex & f1, const ex & f2, const ex & f3,
+ const ex & f4, const ex & f5, const ex & f6);
+ ncmul(const exvector & v, bool discardable=false);
ncmul(exvector * vp); // vp will be deleted
// functions overriding virtual functions from bases classes
void printraw(ostream & os) const;
void printcsrc(ostream & os, unsigned upper_precedence) const;
bool info(unsigned inf) const;
- int degree(symbol const & s) const;
- int ldegree(symbol const & s) const;
+ int degree(const symbol & s) const;
+ int ldegree(const symbol & s) const;
ex expand(unsigned options=0) const;
- ex coeff(symbol const & s, int const n=1) const;
+ ex coeff(const symbol & s, int n=1) const;
ex eval(int level=0) const;
- ex diff(symbol const & s) const;
- ex subs(lst const & ls, lst const & lr) const;
+ ex diff(const symbol & s) const;
+ ex subs(const lst & ls, const lst & lr) const;
exvector get_indices(void) const;
- ex thisexprseq(exvector const & v) const;
+ ex thisexprseq(const exvector & v) const;
ex thisexprseq(exvector * vp) const;
protected:
- int compare_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
unsigned return_type(void) const;
unsigned return_type_tinfo(void) const;
// non-virtual functions in this class
protected:
- unsigned count_factors(ex const & e) const;
- void append_factors(exvector & v, ex const & e) const;
+ unsigned count_factors(const ex & e) const;
+ void append_factors(exvector & v, const ex & e) const;
exvector expandchildren(unsigned options) const;
public:
- exvector const & get_factors(void) const;
+ const exvector & get_factors(void) const;
// member variables
// global constants
extern const ncmul some_ncmul;
-extern type_info const & typeid_ncmul;
+extern const type_info & typeid_ncmul;
// friend funtions
-ex nonsimplified_ncmul(exvector const & v);
-ex simplified_ncmul(exvector const & v);
+ex nonsimplified_ncmul(const exvector & v);
+ex simplified_ncmul(const exvector & v);
// utility functions
inline const ncmul &ex_to_ncmul(const ex &e)
status_flags::hash_calculated);
}
-numeric::numeric(char const *s) : basic(TINFO_numeric)
+numeric::numeric(const char *s) : basic(TINFO_numeric)
{ // MISSING: treatment of complex and ints and rationals.
debugmsg("numeric constructor from string",LOGLEVEL_CONSTRUCT);
if (strchr(s, '.'))
// protected
-int numeric::compare_same_type(basic const & other) const
+int numeric::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_exactly_of_type(other, numeric));
const numeric & o = static_cast<numeric &>(const_cast<basic &>(other));
return compare(o);
}
-bool numeric::is_equal_same_type(basic const & other) const
+bool numeric::is_equal_same_type(const basic & other) const
{
GINAC_ASSERT(is_exactly_of_type(other,numeric));
const numeric *o = static_cast<const numeric *>(&other);
return operator=(numeric(d));
}
-const numeric & numeric::operator=(char const * s)
+const numeric & numeric::operator=(const char * s)
{
return operator=(numeric(s));
}
//////////
const numeric some_numeric;
-type_info const & typeid_numeric=typeid(some_numeric);
+const type_info & typeid_numeric=typeid(some_numeric);
/** Imaginary unit. This is not a constant but a numeric since we are
* natively handing complex numbers anyways. */
const numeric I = numeric(complex(cl_I(0),cl_I(1)));
os << digits;
}
-ostream& operator<<(ostream& os, _numeric_digits const & e)
+ostream& operator<<(ostream& os, const _numeric_digits & e)
{
e.print(os);
return os;
explicit numeric(unsigned long i);
explicit numeric(long numer, long denom);
explicit numeric(double d);
- explicit numeric(char const *);
+ explicit numeric(const char *);
numeric(cl_N const & z);
// functions overriding virtual functions from bases classes
void printcsrc(ostream & os, unsigned type, unsigned precedence=0) const;
bool info(unsigned inf) const;
ex evalf(int level=0) const;
- ex diff(symbol const & s) const;
+ ex diff(const symbol & s) const;
ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
numeric integer_content(void) const;
ex smod(const numeric &xi) const;
numeric max_coefficient(void) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
unsigned calchash(void) const {
hashvalue=HASHVALUE_NUMERIC;
return HASHVALUE_NUMERIC;
const numeric & operator=(long i);
const numeric & operator=(unsigned long i);
const numeric & operator=(double d);
- const numeric & operator=(char const * s);
+ const numeric & operator=(const char * s);
numeric inverse(void) const;
int csgn(void) const;
int compare(const numeric & other) const;
extern const numeric some_numeric;
extern const numeric I;
-extern type_info const & typeid_numeric;
+extern const type_info & typeid_numeric;
extern _numeric_digits Digits;
#define is_a_numeric_hash(x) ((x)==HASHVALUE_NUMERIC)
// binary arithmetic operators ex with ex
-ex operator+(ex const & lh, ex const & rh)
+ex operator+(const ex & lh, const ex & rh)
{
debugmsg("operator+(ex,ex)",LOGLEVEL_OPERATOR);
return lh.exadd(rh);
}
-ex operator-(ex const & lh, ex const & rh)
+ex operator-(const ex & lh, const ex & rh)
{
debugmsg("operator-(ex,ex)",LOGLEVEL_OPERATOR);
return lh.exadd(rh.exmul(_ex_1()));
}
-ex operator*(ex const & lh, ex const & rh)
+ex operator*(const ex & lh, const ex & rh)
{
debugmsg("operator*(ex,ex)",LOGLEVEL_OPERATOR);
return lh.exmul(rh);
}
-ex operator/(ex const & lh, ex const & rh)
+ex operator/(const ex & lh, const ex & rh)
{
debugmsg("operator*(ex,ex)",LOGLEVEL_OPERATOR);
return lh.exmul(power(rh,_ex_1()));
}
-ex operator%(ex const & lh, ex const & rh)
+ex operator%(const ex & lh, const ex & rh)
{
debugmsg("operator%(ex,ex)",LOGLEVEL_OPERATOR);
return lh.exncmul(rh);
// binary arithmetic operators numeric with numeric
-numeric operator+(numeric const & lh, numeric const & rh)
+numeric operator+(const numeric & lh, const numeric & rh)
{
debugmsg("operator+(numeric,numeric)",LOGLEVEL_OPERATOR);
return lh.add(rh);
}
-numeric operator-(numeric const & lh, numeric const & rh)
+numeric operator-(const numeric & lh, const numeric & rh)
{
debugmsg("operator-(numeric,numeric)",LOGLEVEL_OPERATOR);
return lh.sub(rh);
}
-numeric operator*(numeric const & lh, numeric const & rh)
+numeric operator*(const numeric & lh, const numeric & rh)
{
debugmsg("operator*(numeric,numeric)",LOGLEVEL_OPERATOR);
return lh.mul(rh);
}
-numeric operator/(numeric const & lh, numeric const & rh)
+numeric operator/(const numeric & lh, const numeric & rh)
{
debugmsg("operator/(numeric,ex)",LOGLEVEL_OPERATOR);
return lh.div(rh);
// binary arithmetic assignment operators with ex
-ex const & operator+=(ex & lh, ex const & rh)
+const ex & operator+=(ex & lh, const ex & rh)
{
debugmsg("operator+=(ex,ex)",LOGLEVEL_OPERATOR);
return (lh=lh+rh);
}
-ex const & operator-=(ex & lh, ex const & rh)
+const ex & operator-=(ex & lh, const ex & rh)
{
debugmsg("operator-=(ex,ex)",LOGLEVEL_OPERATOR);
return (lh=lh-rh);
}
-ex const & operator*=(ex & lh, ex const & rh)
+const ex & operator*=(ex & lh, const ex & rh)
{
debugmsg("operator*=(ex,ex)",LOGLEVEL_OPERATOR);
return (lh=lh*rh);
}
-ex const & operator/=(ex & lh, ex const & rh)
+const ex & operator/=(ex & lh, const ex & rh)
{
debugmsg("operator/=(ex,ex)",LOGLEVEL_OPERATOR);
return (lh=lh/rh);
}
-ex const & operator%=(ex & lh, ex const & rh)
+const ex & operator%=(ex & lh, const ex & rh)
{
debugmsg("operator%=(ex,ex)",LOGLEVEL_OPERATOR);
return (lh=lh%rh);
// binary arithmetic assignment operators with numeric
-numeric const & operator+=(numeric & lh, numeric const & rh)
+const numeric & operator+=(numeric & lh, const numeric & rh)
{
debugmsg("operator+=(numeric,numeric)",LOGLEVEL_OPERATOR);
return (lh=lh.add(rh));
}
-numeric const & operator-=(numeric & lh, numeric const & rh)
+const numeric & operator-=(numeric & lh, const numeric & rh)
{
debugmsg("operator-=(numeric,numeric)",LOGLEVEL_OPERATOR);
return (lh=lh.sub(rh));
}
-numeric const & operator*=(numeric & lh, numeric const & rh)
+const numeric & operator*=(numeric & lh, const numeric & rh)
{
debugmsg("operator*=(numeric,numeric)",LOGLEVEL_OPERATOR);
return (lh=lh.mul(rh));
}
-numeric const & operator/=(numeric & lh, numeric const & rh)
+const numeric & operator/=(numeric & lh, const numeric & rh)
{
debugmsg("operator/=(numeric,numeric)",LOGLEVEL_OPERATOR);
return (lh=lh.div(rh));
// unary operators
-ex operator+(ex const & lh)
+ex operator+(const ex & lh)
{
return lh;
}
-ex operator-(ex const & lh)
+ex operator-(const ex & lh)
{
return lh.exmul(_ex_1());
}
-numeric operator+(numeric const & lh)
+numeric operator+(const numeric & lh)
{
return lh;
}
-numeric operator-(numeric const & lh)
+numeric operator-(const numeric & lh)
{
return _num_1()*lh;
}
// binary relational operators ex with ex
-relational operator==(ex const & lh, ex const & rh)
+relational operator==(const ex & lh, const ex & rh)
{
debugmsg("operator==(ex,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::equal);
}
-relational operator!=(ex const & lh, ex const & rh)
+relational operator!=(const ex & lh, const ex & rh)
{
debugmsg("operator!=(ex,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::not_equal);
}
-relational operator<(ex const & lh, ex const & rh)
+relational operator<(const ex & lh, const ex & rh)
{
debugmsg("operator<(ex,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::less);
}
-relational operator<=(ex const & lh, ex const & rh)
+relational operator<=(const ex & lh, const ex & rh)
{
debugmsg("operator<=(ex,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::less_or_equal);
}
-relational operator>(ex const & lh, ex const & rh)
+relational operator>(const ex & lh, const ex & rh)
{
debugmsg("operator>(ex,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::greater);
}
-relational operator>=(ex const & lh, ex const & rh)
+relational operator>=(const ex & lh, const ex & rh)
{
debugmsg("operator>=(ex,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::greater_or_equal);
// binary relational operators ex with numeric
-relational operator==(ex const & lh, numeric const & rh)
+relational operator==(const ex & lh, const numeric & rh)
{
debugmsg("operator==(ex,numeric)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::equal);
}
-relational operator!=(ex const & lh, numeric const & rh)
+relational operator!=(const ex & lh, const numeric & rh)
{
debugmsg("operator!=(ex,numeric)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::not_equal);
}
-relational operator<(ex const & lh, numeric const & rh)
+relational operator<(const ex & lh, const numeric & rh)
{
debugmsg("operator<(ex,numeric)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::less);
}
-relational operator<=(ex const & lh, numeric const & rh)
+relational operator<=(const ex & lh, const numeric & rh)
{
debugmsg("operator<=(ex,numeric)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::less_or_equal);
}
-relational operator>(ex const & lh, numeric const & rh)
+relational operator>(const ex & lh, const numeric & rh)
{
debugmsg("operator>(ex,numeric)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::greater);
}
-relational operator>=(ex const & lh, numeric const & rh)
+relational operator>=(const ex & lh, const numeric & rh)
{
debugmsg("operator>=(ex,numeric)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::greater_or_equal);
// binary relational operators numeric with ex
-relational operator==(numeric const & lh, ex const & rh)
+relational operator==(const numeric & lh, const ex & rh)
{
debugmsg("operator==(numeric,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::equal);
}
-relational operator!=(numeric const & lh, ex const & rh)
+relational operator!=(const numeric & lh, const ex & rh)
{
debugmsg("operator!=(numeric,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::not_equal);
}
-relational operator<(numeric const & lh, ex const & rh)
+relational operator<(const numeric & lh, const ex & rh)
{
debugmsg("operator<(numeric,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::less);
}
-relational operator<=(numeric const & lh, ex const & rh)
+relational operator<=(const numeric & lh, const ex & rh)
{
debugmsg("operator<=(numeric,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::less_or_equal);
}
-relational operator>(numeric const & lh, ex const & rh)
+relational operator>(const numeric & lh, const ex & rh)
{
debugmsg("operator>(numeric,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::greater);
}
-relational operator>=(numeric const & lh, ex const & rh)
+relational operator>=(const numeric & lh, const ex & rh)
{
debugmsg("operator>=(numeric,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::greater_or_equal);
// input/output stream operators
-ostream & operator<<(ostream & os, ex const & e)
+ostream & operator<<(ostream & os, const ex & e)
{
e.print(os);
return os;
class relational;
// binary arithmetic operators ex with ex
-ex operator+(ex const & lh, ex const & rh);
-ex operator-(ex const & lh, ex const & rh);
-ex operator*(ex const & lh, ex const & rh);
-ex operator/(ex const & lh, ex const & rh);
-ex operator%(ex const & lh, ex const & rh); // non-commutative multiplication
+ex operator+(const ex & lh, const ex & rh);
+ex operator-(const ex & lh, const ex & rh);
+ex operator*(const ex & lh, const ex & rh);
+ex operator/(const ex & lh, const ex & rh);
+ex operator%(const ex & lh, const ex & rh); // non-commutative multiplication
// binary arithmetic operators numeric with numeric
numeric operator+(const numeric & lh, const numeric & rh);
numeric operator/(const numeric & lh, const numeric & rh);
// binary arithmetic assignment operators with ex
-ex const & operator+=(ex & lh, ex const & rh);
-ex const & operator-=(ex & lh, ex const & rh);
-ex const & operator*=(ex & lh, ex const & rh);
-ex const & operator/=(ex & lh, ex const & rh);
-ex const & operator%=(ex & lh, ex const & rh); // non-commutative multiplication
+const ex & operator+=(ex & lh, const ex & rh);
+const ex & operator-=(ex & lh, const ex & rh);
+const ex & operator*=(ex & lh, const ex & rh);
+const ex & operator/=(ex & lh, const ex & rh);
+const ex & operator%=(ex & lh, const ex & rh); // non-commutative multiplication
// binary arithmetic assignment operators with numeric
const numeric & operator+=(numeric & lh, const numeric & rh);
const numeric & operator/=(numeric & lh, const numeric & rh);
// unary operators
-ex operator+(ex const & lh);
-ex operator-(ex const & lh);
+ex operator+(const ex & lh);
+ex operator-(const ex & lh);
numeric operator+(const numeric & lh);
numeric operator-(const numeric & lh);
numeric operator--(numeric & lh, int);
// binary relational operators ex with ex
-relational operator==(ex const & lh, ex const & rh);
-relational operator!=(ex const & lh, ex const & rh);
-relational operator<(ex const & lh, ex const & rh);
-relational operator<=(ex const & lh, ex const & rh);
-relational operator>(ex const & lh, ex const & rh);
-relational operator>=(ex const & lh, ex const & rh);
+relational operator==(const ex & lh, const ex & rh);
+relational operator!=(const ex & lh, const ex & rh);
+relational operator<(const ex & lh, const ex & rh);
+relational operator<=(const ex & lh, const ex & rh);
+relational operator>(const ex & lh, const ex & rh);
+relational operator>=(const ex & lh, const ex & rh);
// input/output stream operators
-ostream & operator<<(ostream & os, ex const & e);
+ostream & operator<<(ostream & os, const ex & e);
istream & operator>>(istream & is, ex & e);
#ifndef NO_GINAC_NAMESPACE
destroy(0);
}
-power::power(power const & other)
+power::power(const power & other)
{
debugmsg("power copy constructor",LOGLEVEL_CONSTRUCT);
copy(other);
}
-power const & power::operator=(power const & other)
+const power & power::operator=(const power & other)
{
debugmsg("power operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void power::copy(power const & other)
+void power::copy(const power & other)
{
inherited::copy(other);
basis=other.basis;
// public
-power::power(ex const & lh, ex const & rh) : basic(TINFO_power), basis(lh), exponent(rh)
+power::power(const ex & lh, const ex & rh) : basic(TINFO_power), basis(lh), exponent(rh)
{
debugmsg("power constructor from ex,ex",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(basis.return_type()==return_types::commutative);
}
-power::power(ex const & lh, numeric const & rh) : basic(TINFO_power), basis(lh), exponent(rh)
+power::power(const ex & lh, const numeric & rh) : basic(TINFO_power), basis(lh), exponent(rh)
{
debugmsg("power constructor from ex,numeric",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(basis.return_type()==return_types::commutative);
return 2;
}
-ex & power::let_op(int const i)
+ex & power::let_op(int i)
{
GINAC_ASSERT(i>=0);
GINAC_ASSERT(i<2);
return i==0 ? basis : exponent;
}
-int power::degree(symbol const & s) const
+int power::degree(const symbol & s) const
{
if (is_exactly_of_type(*exponent.bp,numeric)) {
if ((*basis.bp).compare(s)==0)
return 0;
}
-int power::ldegree(symbol const & s) const
+int power::ldegree(const symbol & s) const
{
if (is_exactly_of_type(*exponent.bp,numeric)) {
if ((*basis.bp).compare(s)==0)
return 0;
}
-ex power::coeff(symbol const & s, int const n) const
+ex power::coeff(const symbol & s, int n) const
{
if ((*basis.bp).compare(s)!=0) {
// basis not equal to s
return _ex0();
}
} else if (is_exactly_of_type(*exponent.bp,numeric)&&
- (static_cast<numeric const &>(*exponent.bp).compare(numeric(n))==0)) {
+ (static_cast<const numeric &>(*exponent.bp).compare(numeric(n))==0)) {
return _ex1();
}
throw(std::runtime_error("max recursion level reached"));
}
- ex const & ebasis = level==1 ? basis : basis.eval(level-1);
- ex const & eexponent = level==1 ? exponent : exponent.eval(level-1);
+ const ex & ebasis = level==1 ? basis : basis.eval(level-1);
+ const ex & eexponent = level==1 ? exponent : exponent.eval(level-1);
bool basis_is_numerical=0;
bool exponent_is_numerical=0;
// (c1, c2 numeric(), c2 integer or -1 < c1 <= 1,
// case c1=1 should not happen, see below!)
if (exponent_is_numerical && is_ex_exactly_of_type(ebasis,power)) {
- power const & sub_power=ex_to_power(ebasis);
- ex const & sub_basis=sub_power.basis;
- ex const & sub_exponent=sub_power.exponent;
+ const power & sub_power=ex_to_power(ebasis);
+ const ex & sub_basis=sub_power.basis;
+ const ex & sub_exponent=sub_power.exponent;
if (is_ex_exactly_of_type(sub_exponent,numeric)) {
- numeric const & num_sub_exponent=ex_to_numeric(sub_exponent);
+ const numeric & num_sub_exponent=ex_to_numeric(sub_exponent);
GINAC_ASSERT(num_sub_exponent!=numeric(1));
if (num_exponent->is_integer() || abs(num_sub_exponent)<1) {
return power(sub_basis,num_sub_exponent.mul(*num_exponent));
// ^(*(...,x,c1),c2) -> ^(*(...,x;-1),c2)*(-c1)^c2 (c1, c2 numeric(), c1<0)
if (exponent_is_numerical && is_ex_exactly_of_type(ebasis,mul)) {
GINAC_ASSERT(!num_exponent->is_integer()); // should have been handled above
- mul const & mulref=ex_to_mul(ebasis);
+ const mul & mulref=ex_to_mul(ebasis);
if (!mulref.overall_coeff.is_equal(_ex1())) {
- numeric const & num_coeff=ex_to_numeric(mulref.overall_coeff);
+ const numeric & num_coeff=ex_to_numeric(mulref.overall_coeff);
if (num_coeff.is_real()) {
if (num_coeff.is_positive()>0) {
mul * mulp=new mul(mulref);
return power(ebasis,eexponent);
}
-ex power::subs(lst const & ls, lst const & lr) const
+ex power::subs(const lst & ls, const lst & lr) const
{
- ex const & subsed_basis=basis.subs(ls,lr);
- ex const & subsed_exponent=exponent.subs(ls,lr);
+ const ex & subsed_basis=basis.subs(ls,lr);
+ const ex & subsed_exponent=exponent.subs(ls,lr);
if (are_ex_trivially_equal(basis,subsed_basis)&&
are_ex_trivially_equal(exponent,subsed_exponent)) {
return power(subsed_basis, subsed_exponent);
}
-ex power::simplify_ncmul(exvector const & v) const
+ex power::simplify_ncmul(const exvector & v) const
{
return inherited::simplify_ncmul(v);
}
// protected
-int power::compare_same_type(basic const & other) const
+int power::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_exactly_of_type(other, power));
- power const & o=static_cast<power const &>(const_cast<basic &>(other));
+ const power & o=static_cast<const power &>(const_cast<basic &>(other));
int cmpval;
cmpval=basis.compare(o.basis);
}
// integer numeric exponent
- numeric const & num_exponent=ex_to_numeric(exponent);
+ const numeric & num_exponent=ex_to_numeric(exponent);
int int_exponent = num_exponent.to_int();
if (int_exponent > 0 && is_ex_exactly_of_type(expanded_basis,add)) {
// non-virtual functions in this class
//////////
-ex power::expand_add(add const & a, int const n) const
+ex power::expand_add(const add & a, int n) const
{
// expand a^n where a is an add and n is an integer
exvector term;
term.reserve(m+1);
for (l=0; l<m-1; l++) {
- ex const & b=a.op(l);
+ const ex & b=a.op(l);
GINAC_ASSERT(!is_ex_exactly_of_type(b,add));
GINAC_ASSERT(!is_ex_exactly_of_type(b,power)||
!is_ex_exactly_of_type(ex_to_power(b).exponent,numeric)||
}
}
- ex const & b=a.op(l);
+ const ex & b=a.op(l);
GINAC_ASSERT(!is_ex_exactly_of_type(b,add));
GINAC_ASSERT(!is_ex_exactly_of_type(b,power)||
!is_ex_exactly_of_type(ex_to_power(b).exponent,numeric)||
return (new add(sum))->setflag(status_flags::dynallocated);
}
-ex power::expand_add_2(add const & a) const
+ex power::expand_add_2(const add & a) const
{
// special case: expand a^2 where a is an add
// power(+(x,...,z;c),2)=power(+(x,...,z;0),2)+2*c*+(x,...,z;0)+c*c
// first part: ignore overall_coeff and expand other terms
for (epvector::const_iterator cit0=a.seq.begin(); cit0!=last; ++cit0) {
- ex const & r=(*cit0).rest;
- ex const & c=(*cit0).coeff;
+ const ex & r=(*cit0).rest;
+ const ex & c=(*cit0).coeff;
GINAC_ASSERT(!is_ex_exactly_of_type(r,add));
GINAC_ASSERT(!is_ex_exactly_of_type(r,power)||
}
for (epvector::const_iterator cit1=cit0+1; cit1!=last; ++cit1) {
- ex const & r1=(*cit1).rest;
- ex const & c1=(*cit1).coeff;
+ const ex & r1=(*cit1).rest;
+ const ex & c1=(*cit1).coeff;
sum.push_back(a.combine_ex_with_coeff_to_pair((new mul(r,r1))->setflag(status_flags::dynallocated),
_num2().mul(ex_to_numeric(c)).mul_dyn(ex_to_numeric(c1))));
}
return (new add(sum))->setflag(status_flags::dynallocated);
}
-ex power::expand_mul(mul const & m, numeric const & n) const
+ex power::expand_mul(const mul & m, const numeric & n) const
{
// expand m^n where m is a mul and n is and integer
}
/*
-ex power::expand_commutative_3(ex const & basis, numeric const & exponent,
+ex power::expand_commutative_3(const ex & basis, const numeric & exponent,
unsigned options) const
{
// obsolete
exvector distrseq;
epvector splitseq;
- add const & addref=static_cast<add const &>(*basis.bp);
+ const add & addref=static_cast<const add &>(*basis.bp);
splitseq=addref.seq;
splitseq.pop_back();
*/
/*
-ex power::expand_noncommutative(ex const & basis, numeric const & exponent,
+ex power::expand_noncommutative(const ex & basis, const numeric & exponent,
unsigned options) const
{
ex rest_power=ex(power(basis,exponent.add(_num_1()))).
//////////
const power some_power;
-type_info const & typeid_power=typeid(some_power);
+const type_info & typeid_power=typeid(some_power);
// helper function
-ex sqrt(ex const & a)
+ex sqrt(const ex & a)
{
return power(a,_ex1_2());
}
public:
power();
~power();
- power(power const & other);
- power const & operator=(power const & other);
+ power(const power & other);
+ const power & operator=(const power & other);
protected:
- void copy(power const & other);
+ void copy(const power & other);
void destroy(bool call_parent);
// other constructors
public:
- power(ex const & lh, ex const & rh);
- power(ex const & lh, numeric const & rh);
+ power(const ex & lh, const ex & rh);
+ power(const ex & lh, const numeric & rh);
// functions overriding virtual functions from bases classes
public:
void printcsrc(ostream & os, unsigned type, unsigned upper_precedence=0) const;
bool info(unsigned inf) const;
unsigned nops() const;
- ex & let_op(int const i);
- int degree(symbol const & s) const;
- int ldegree(symbol const & s) const;
- ex coeff(symbol const & s, int const n=1) const;
+ ex & let_op(int i);
+ int degree(const symbol & s) const;
+ int ldegree(const symbol & s) const;
+ ex coeff(const symbol & s, int n=1) const;
ex eval(int level=0) const;
ex evalf(int level=0) const;
- ex diff(symbol const & s) const;
- ex series(symbol const & s, ex const & point, int order) const;
- ex subs(lst const & ls, lst const & lr) const;
+ ex diff(const symbol & s) const;
+ ex series(const symbol & s, const ex & point, int order) const;
+ ex subs(const lst & ls, const lst & lr) const;
ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
- ex simplify_ncmul(exvector const & v) const;
+ ex simplify_ncmul(const exvector & v) const;
protected:
- int compare_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
unsigned return_type(void) const;
unsigned return_type_tinfo(void) const;
ex expand(unsigned options=0) const;
// non-virtual functions in this class
protected:
- ex expand_add(add const & a, int const n) const;
- ex expand_add_2(add const & a) const;
- ex expand_mul(mul const & m, numeric const & n) const;
- //ex expand_commutative_3(ex const & basis, numeric const & exponent,
+ ex expand_add(const add & a, int n) const;
+ ex expand_add_2(const add & a) const;
+ ex expand_mul(const mul & m, const numeric & n) const;
+ //ex expand_commutative_3(const ex & basis, const numeric & exponent,
// unsigned options) const;
- // ex expand_noncommutative(ex const & basis, numeric const & exponent, unsigned options) const;
+ // ex expand_noncommutative(const ex & basis, const numeric & exponent, unsigned options) const;
// member variables
// global constants
extern const power some_power;
-extern type_info const & typeid_power;
+extern const type_info & typeid_power;
// utility functions
inline const power &ex_to_power(const ex &e)
*
* @param b the basis expression
* @param e the exponent expression */
-inline ex pow(ex const & b, ex const & e)
+inline ex pow(const ex & b, const ex & e)
{ return power(b,e); }
/** Square root expression. Returns a power-object with exponent 1/2 as a new
* expression. */
-ex sqrt(ex const & a);
+ex sqrt(const ex & a);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
destroy(false);
}
-pseries::pseries(pseries const &other)
+pseries::pseries(const pseries &other)
{
debugmsg("pseries copy constructor", LOGLEVEL_CONSTRUCT);
copy(other);
}
-pseries const &pseries::operator=(pseries const & other)
+const pseries &pseries::operator=(const pseries & other)
{
debugmsg("pseries operator=", LOGLEVEL_ASSIGNMENT);
if (this != &other) {
return *this;
}
-void pseries::copy(pseries const &other)
+void pseries::copy(const pseries &other)
{
inherited::copy(other);
seq = other.seq;
* @param point_ expansion point
* @param ops_ vector of {coefficient, power} pairs (coefficient must not be zero)
* @return newly constructed pseries */
-pseries::pseries(ex const &var_, ex const &point_, epvector const &ops_)
+pseries::pseries(const ex &var_, const ex &point_, const epvector &ops_)
: basic(TINFO_pseries), seq(ops_), var(var_), point(point_)
{
debugmsg("pseries constructor from ex,ex,epvector", LOGLEVEL_CONSTRUCT);
throw (std::logic_error("let_op not defined for pseries"));
}
-int pseries::degree(symbol const &s) const
+int pseries::degree(const symbol &s) const
{
if (var.is_equal(s)) {
// Return last exponent
}
}
-int pseries::ldegree(symbol const &s) const
+int pseries::ldegree(const symbol &s) const
{
if (var.is_equal(s)) {
// Return first exponent
}
}
-ex pseries::coeff(symbol const &s, int const n) const
+ex pseries::coeff(const symbol &s, int n) const
{
if (var.is_equal(s)) {
epvector::const_iterator it = seq.begin(), itend = seq.end();
return convert_to_poly().evalf(level);
}
-ex pseries::subs(lst const & ls, lst const & lr) const
+ex pseries::subs(const lst & ls, const lst & lr) const
{
// If expansion variable is being substituted, convert the series to a
// polynomial and do the substitution there because the result might
/** Default implementation of ex::series(). This performs Taylor expansion.
* @see ex::series */
-ex basic::series(symbol const & s, ex const & point, int order) const
+ex basic::series(const symbol & s, const ex & point, int order) const
{
epvector seq;
numeric fac(1);
/** Implementation of ex::series() for symbols.
* @see ex::series */
-ex symbol::series(symbol const & s, ex const & point, int order) const
+ex symbol::series(const symbol & s, const ex & point, int order) const
{
epvector seq;
if (is_equal(s)) {
/** Implementation of ex::series() for sums. This performs series addition when
* adding pseries objects.
* @see ex::series */
-ex add::series(symbol const & s, ex const & point, int order) const
+ex add::series(const symbol & s, const ex & point, int order) const
{
ex acc; // Series accumulator
/** Implementation of ex::series() for product. This performs series
* multiplication when multiplying series.
* @see ex::series */
-ex mul::series(symbol const & s, ex const & point, int order) const
+ex mul::series(const symbol & s, const ex & point, int order) const
{
ex acc; // Series accumulator
/** Implementation of ex::series() for powers. This performs Laurent expansion
* of reciprocals of series at singularities.
* @see ex::series */
-ex power::series(symbol const & s, ex const & point, int order) const
+ex power::series(const symbol & s, const ex & point, int order) const
{
ex e;
if (!is_ex_exactly_of_type(basis, pseries)) {
* @param point expansion point
* @param order truncation order of series calculations
* @return an expression holding a pseries object */
-ex ex::series(symbol const &s, ex const &point, int order) const
+ex ex::series(const symbol &s, const ex &point, int order) const
{
GINAC_ASSERT(bp!=0);
return bp->series(s, point, order);
// Global constants
const pseries some_pseries;
-type_info const & typeid_pseries = typeid(some_pseries);
+const type_info & typeid_pseries = typeid(some_pseries);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
public:
pseries();
~pseries();
- pseries(pseries const &other);
- pseries const &operator=(pseries const &other);
+ pseries(const pseries &other);
+ const pseries &operator=(const pseries &other);
protected:
- void copy(pseries const &other);
+ void copy(const pseries &other);
void destroy(bool call_parent);
// other constructors
public:
- pseries(ex const &var_, ex const &point_, epvector const &ops_);
+ pseries(const ex &var_, const ex &point_, const epvector &ops_);
// functions overriding virtual functions from base classes
public:
unsigned nops(void) const;
ex op(int i) const;
ex &let_op(int i);
- int degree(symbol const &s) const;
- int ldegree(symbol const &s) const;
- ex coeff(symbol const &s, int const n=1) const;
+ int degree(const symbol &s) const;
+ int ldegree(const symbol &s) const;
+ ex coeff(const symbol &s, int n=1) const;
ex eval(int level=0) const;
ex evalf(int level=0) const;
ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
- ex diff(symbol const & s) const;
- ex subs(lst const & ls, lst const & lr) const;
+ ex diff(const symbol & s) const;
+ ex subs(const lst & ls, const lst & lr) const;
// non-virtual functions in this class
public:
// global constants
extern const pseries some_pseries;
-extern type_info const & typeid_pseries;
+extern const type_info & typeid_pseries;
/** Return a reference to the pseries object embedded in an expression.
* The result is undefined if the expression does not contain a pseries
destroy(0);
}
-relational::relational(relational const & other)
+relational::relational(const relational & other)
{
debugmsg("relational copy constructor",LOGLEVEL_CONSTRUCT);
copy(other);
}
-relational const & relational::operator=(relational const & other)
+const relational & relational::operator=(const relational & other)
{
debugmsg("relational operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void relational::copy(relational const & other)
+void relational::copy(const relational & other)
{
basic::copy(other);
lh=other.lh;
// public
-relational::relational(ex const & lhs, ex const & rhs, operators oper) : basic(TINFO_relational)
+relational::relational(const ex & lhs, const ex & rhs, operators oper) : basic(TINFO_relational)
{
debugmsg("relational constructor ex,ex,operator",LOGLEVEL_CONSTRUCT);
lh=lhs;
return 2;
}
-ex & relational::let_op(int const i)
+ex & relational::let_op(int i)
{
GINAC_ASSERT(i>=0);
GINAC_ASSERT(i<2);
setflag(status_flags::dynallocated);
}
-ex relational::simplify_ncmul(exvector const & v) const
+ex relational::simplify_ncmul(const exvector & v) const
{
return lh.simplify_ncmul(v);
}
// protected
-int relational::compare_same_type(basic const & other) const
+int relational::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_exactly_of_type(other, relational));
- relational const & oth=static_cast<relational const &>(const_cast<basic &>(other));
+ const relational & oth=static_cast<const relational &>(const_cast<basic &>(other));
int cmpval;
//////////
const relational some_relational;
-type_info const & typeid_relational=typeid(some_relational);
+const type_info & typeid_relational=typeid(some_relational);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
public:
relational();
~relational();
- relational(relational const & other);
- relational const & operator=(relational const & other);
+ relational(const relational & other);
+ const relational & operator=(const relational & other);
protected:
- void copy(relational const & other);
+ void copy(const relational & other);
void destroy(bool call_parent);
// other constructors
public:
- relational(ex const & lhs, ex const & rhs, operators oper=equal);
+ relational(const ex & lhs, const ex & rhs, operators oper=equal);
// functions overriding virtual functions from bases classes
public:
void printcsrc(ostream & os, unsigned type, unsigned upper_precedence=0) const;
bool info(unsigned inf) const;
unsigned nops() const;
- ex & let_op(int const i);
+ ex & let_op(int i);
ex eval(int level=0) const;
ex evalf(int level=0) const;
- ex simplify_ncmul(exvector const & v) const;
+ ex simplify_ncmul(const exvector & v) const;
protected:
- int compare_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
unsigned return_type(void) const;
unsigned return_type_tinfo(void) const;
// global constants
extern const relational some_relational;
-extern type_info const & typeid_relational;
+extern const type_info & typeid_relational;
// utility functions
inline const relational &ex_to_relational(const ex &e)
destroy(0);
}
-simp_lor::simp_lor(simp_lor const & other)
+simp_lor::simp_lor(const simp_lor & other)
{
debugmsg("simp_lor copy constructor",LOGLEVEL_CONSTRUCT);
copy (other);
}
-simp_lor const & simp_lor::operator=(simp_lor const & other)
+const simp_lor & simp_lor::operator=(const simp_lor & other)
{
debugmsg("simp_lor operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void simp_lor::copy(simp_lor const & other)
+void simp_lor::copy(const simp_lor & other)
{
indexed::copy(other);
type=other.type;
tinfo_key=TINFO_simp_lor;
}
-simp_lor::simp_lor(simp_lor_types const t, ex const & i1, ex const & i2) :
+simp_lor::simp_lor(simp_lor_types const t, const ex & i1, const ex & i2) :
indexed(i1,i2), type(t)
{
debugmsg("simp_lor constructor from simp_lor_types,ex,ex",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(all_of_type_lorentzidx());
}
-simp_lor::simp_lor(simp_lor_types const t, string const & n, ex const & i1) :
+simp_lor::simp_lor(simp_lor_types const t, const string & n, const ex & i1) :
indexed(i1), type(t), name(n)
{
debugmsg("simp_lor constructor from simp_lor_types,string,ex",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(all_of_type_lorentzidx());
}
-simp_lor::simp_lor(simp_lor_types const t, string const & n, exvector const & iv) :
+simp_lor::simp_lor(simp_lor_types const t, const string & n, const exvector & iv) :
indexed(iv), type(t), name(n)
{
debugmsg("simp_lor constructor from simp_lor_types,string,exvector",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(all_of_type_lorentzidx());
}
-simp_lor::simp_lor(simp_lor_types const t, string const & n, exvector * ivp) :
+simp_lor::simp_lor(simp_lor_types const t, const string & n, exvector * ivp) :
indexed(ivp), type(t), name(n)
{
debugmsg("simp_lor constructor from simp_lor_types,string,exvector*",LOGLEVEL_CONSTRUCT);
if (sig==0) return _ex0();
return ex(sig)*simp_lor(type,name,iv);
}
- lorentzidx const & idx1=ex_to_lorentzidx(seq[0]);
- lorentzidx const & idx2=ex_to_lorentzidx(seq[1]);
+ const lorentzidx & idx1=ex_to_lorentzidx(seq[0]);
+ const lorentzidx & idx2=ex_to_lorentzidx(seq[1]);
if ((!idx1.is_symbolic())&&(!idx2.is_symbolic())) {
// both indices are numeric
if ((idx1.get_value()==idx2.get_value())) {
// protected
-int simp_lor::compare_same_type(basic const & other) const
+int simp_lor::compare_same_type(const basic & other) const
{
GINAC_ASSERT(other.tinfo() == TINFO_simp_lor);
const simp_lor *o = static_cast<const simp_lor *>(&other);
return type < o->type ? -1 : 1;
}
-bool simp_lor::is_equal_same_type(basic const & other) const
+bool simp_lor::is_equal_same_type(const basic & other) const
{
GINAC_ASSERT(other.tinfo() == TINFO_simp_lor);
const simp_lor *o = static_cast<const simp_lor *>(&other);
return tinfo_key;
}
-ex simp_lor::thisexprseq(exvector const & v) const
+ex simp_lor::thisexprseq(const exvector & v) const
{
return simp_lor(type,name,v);
}
//////////
const simp_lor some_simp_lor;
-type_info const & typeid_simp_lor=typeid(some_simp_lor);
+const type_info & typeid_simp_lor=typeid(some_simp_lor);
//////////
// friend functions
//////////
-simp_lor lor_g(ex const & mu, ex const & nu)
+simp_lor lor_g(const ex & mu, const ex & nu)
{
return simp_lor(simp_lor::simp_lor_g,mu,nu);
}
-simp_lor lor_vec(string const & n, ex const & mu)
+simp_lor lor_vec(const string & n, const ex & mu)
{
return simp_lor(simp_lor::simp_lor_vec,n,mu);
}
-ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp)
+ex simplify_simp_lor_mul(const ex & m, const scalar_products & sp)
{
GINAC_ASSERT(is_ex_exactly_of_type(m,mul));
exvector v_contracted;
// process only lor_g objects
if (is_ex_exactly_of_type(*it,simp_lor) &&
(ex_to_simp_lor(*it).type==simp_lor::simp_lor_g)) {
- simp_lor const & g=ex_to_simp_lor(*it);
+ const simp_lor & g=ex_to_simp_lor(*it);
GINAC_ASSERT(g.seq.size()==2);
- idx const & first_idx=ex_to_lorentzidx(g.seq[0]);
- idx const & second_idx=ex_to_lorentzidx(g.seq[1]);
+ const idx & first_idx=ex_to_lorentzidx(g.seq[0]);
+ const idx & second_idx=ex_to_lorentzidx(g.seq[1]);
// g_{mu,mu} should have been contracted in simp_lor::eval()
GINAC_ASSERT(!first_idx.is_equal(second_idx));
ex saved_g=*it; // save to restore it later
while ((it2!=v_contracted.end())&&!jump_to_next) {
if (is_ex_exactly_of_type(*it2,simp_lor) &&
(ex_to_simp_lor(*it2).type==simp_lor::simp_lor_vec)) {
- simp_lor const & vec1=ex_to_simp_lor(*it1);
- simp_lor const & vec2=ex_to_simp_lor(*it2);
+ const simp_lor & vec1=ex_to_simp_lor(*it1);
+ const simp_lor & vec2=ex_to_simp_lor(*it2);
GINAC_ASSERT(vec1.seq.size()==1);
GINAC_ASSERT(vec2.seq.size()==1);
- lorentzidx const & idx1=ex_to_lorentzidx(vec1.seq[0]);
- lorentzidx const & idx2=ex_to_lorentzidx(vec2.seq[0]);
+ const lorentzidx & idx1=ex_to_lorentzidx(vec1.seq[0]);
+ const lorentzidx & idx2=ex_to_lorentzidx(vec2.seq[0]);
if (idx1.is_symbolic() &&
idx1.is_co_contra_pair(idx2) &&
sp.is_defined(vec1,vec2)) {
return m;
}
-ex simplify_simp_lor(ex const & e, scalar_products const & sp)
+ex simplify_simp_lor(const ex & e, const scalar_products & sp)
{
// all simplification is done on expanded objects
ex e_expanded=e.expand();
// helper classes
//////////
-void scalar_products::reg(simp_lor const & v1, simp_lor const & v2,
- ex const & sp)
+void scalar_products::reg(const simp_lor & v1, const simp_lor & v2,
+ const ex & sp)
{
if (v1.compare_same_type(v2)>0) {
reg(v2,v1,sp);
spm[make_key(v1,v2)]=sp;
}
-bool scalar_products::is_defined(simp_lor const & v1, simp_lor const & v2) const
+bool scalar_products::is_defined(const simp_lor & v1, const simp_lor & v2) const
{
if (v1.compare_same_type(v2)>0) {
return is_defined(v2,v1);
return spm.find(make_key(v1,v2))!=spm.end();
}
-ex scalar_products::evaluate(simp_lor const & v1, simp_lor const & v2) const
+ex scalar_products::evaluate(const simp_lor & v1, const simp_lor & v2) const
{
if (v1.compare_same_type(v2)>0) {
return evaluate(v2,v1);
{
cerr << "map size=" << spm.size() << endl;
for (spmap::const_iterator cit=spm.begin(); cit!=spm.end(); ++cit) {
- spmapkey const & k=(*cit).first;
+ const spmapkey & k=(*cit).first;
cerr << "item key=((" << k.first.first
<< "," << k.first.second << "),";
k.second.printraw(cerr);
}
}
-spmapkey scalar_products::make_key(simp_lor const & v1, simp_lor const & v2)
+spmapkey scalar_products::make_key(const simp_lor & v1, const simp_lor & v2)
{
GINAC_ASSERT(v1.type==simp_lor::simp_lor_vec);
GINAC_ASSERT(v2.type==simp_lor::simp_lor_vec);
class spmapkey_is_less
{
public:
- bool operator()(spmapkey const & lh, spmapkey const & rh) const
+ bool operator()(const spmapkey & lh, const spmapkey & rh) const
{
/*
cerr << "spmapkey_is_less" << endl;
class scalar_products
{
public:
- void reg(simp_lor const & v1, simp_lor const & v2, ex const & sp);
- bool is_defined(simp_lor const & v1, simp_lor const & v2) const;
- ex evaluate(simp_lor const & v1, simp_lor const & v2) const;
+ void reg(const simp_lor & v1, const simp_lor & v2, const ex & sp);
+ bool is_defined(const simp_lor & v1, const simp_lor & v2) const;
+ ex evaluate(const simp_lor & v1, const simp_lor & v2) const;
void debugprint(void) const;
protected:
- static spmapkey make_key(simp_lor const & v1, simp_lor const & v2);
+ static spmapkey make_key(const simp_lor & v1, const simp_lor & v2);
protected:
spmap spm;
};
// friends
friend class scalar_products;
- friend simp_lor lor_g(ex const & mu, ex const & nu);
- friend simp_lor lor_vec(string const & n, ex const & mu);
- friend ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp);
- friend ex simplify_simp_lor(ex const & e, scalar_products const & sp);
+ friend simp_lor lor_g(const ex & mu, const ex & nu);
+ friend simp_lor lor_vec(const string & n, const ex & mu);
+ friend ex simplify_simp_lor_mul(const ex & m, const scalar_products & sp);
+ friend ex simplify_simp_lor(const ex & e, const scalar_products & sp);
// types
public:
simp_lor();
~simp_lor();
- simp_lor(simp_lor const & other);
- simp_lor const & operator=(simp_lor const & other);
+ simp_lor(const simp_lor & other);
+ const simp_lor & operator=(const simp_lor & other);
protected:
- void copy(simp_lor const & other);
+ void copy(const simp_lor & other);
void destroy(bool call_parent);
// other constructors
protected:
simp_lor(simp_lor_types const t);
- simp_lor(simp_lor_types const t, ex const & i1, ex const & i2);
- simp_lor(simp_lor_types const t, string const & n, ex const & i1);
- simp_lor(simp_lor_types const t, string const & n, exvector const & iv);
- simp_lor(simp_lor_types const t, string const & n, exvector * ivp);
+ simp_lor(simp_lor_types const t, const ex & i1, const ex & i2);
+ simp_lor(simp_lor_types const t, const string & n, const ex & i1);
+ simp_lor(simp_lor_types const t, const string & n, const exvector & iv);
+ simp_lor(simp_lor_types const t, const string & n, exvector * ivp);
// functions overriding virtual functions from base classes
public:
bool info(unsigned inf) const;
ex eval(int level=0) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
unsigned return_type(void) const;
unsigned return_type_tinfo(void) const;
- ex thisexprseq(exvector const & v) const;
+ ex thisexprseq(const exvector & v) const;
ex thisexprseq(exvector * vp) const;
// new virtual functions which can be overridden by derived classes
// global constants
extern const simp_lor some_simp_lor;
-extern type_info const & typeid_simp_lor;
+extern const type_info & typeid_simp_lor;
// utility functions
inline const simp_lor &ex_to_simp_lor(const ex &e)
return static_cast<simp_lor &>(*e.bp);
}
-simp_lor lor_g(ex const & mu, ex const & nu);
-simp_lor lor_vec(string const & n, ex const & mu);
-ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp);
-ex simplify_simp_lor(ex const & e, scalar_products const & sp);
+simp_lor lor_g(const ex & mu, const ex & nu);
+simp_lor lor_vec(const string & n, const ex & mu);
+ex simplify_simp_lor_mul(const ex & m, const scalar_products & sp);
+ex simplify_simp_lor(const ex & e, const scalar_products & sp);
ex Dim(void);
#ifndef NO_GINAC_NAMESPACE
destroy(0);
}
-structure::structure(structure const & other)
+structure::structure(const structure & other)
{
debugmsg("structure copy constructor",LOGLEVEL_CONSTRUCT);
copy(other);
}
-structure const & structure::operator=(structure const & other)
+const structure & structure::operator=(const structure & other)
{
debugmsg("structure operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
// protected
-void structure::copy(structure const & other)
+void structure::copy(const structure & other)
{
basic::copy(other);
}
// protected
-int structure::compare_same_type(basic const & other) const
+int structure::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other, structure));
return 0; // all structures are the same
}
-bool structure::is_equal_same_type(basic const & other) const
+bool structure::is_equal_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other, structure));
return true; // all structures are the same
// public
-unsigned structure::register_new(char const * nm)
+unsigned structure::register_new(const char * nm)
{
registered_structure_info rsi={nm};
registered_structures().push_back(rsi);
//////////
const structure some_structure;
-type_info const & typeid_structure=typeid(some_structure);
+const type_info & typeid_structure=typeid(some_structure);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
#endif // ndef NO_GINAC_NAMESPACE
struct registered_structure_info {
- char const * name;
+ const char * name;
};
/** The class structure is used to implement user defined classes
public:
structure();
~structure();
- structure(structure const & other);
- structure const & operator=(structure const & other);
+ structure(const structure & other);
+ const structure & operator=(const structure & other);
protected:
- void copy(structure const & other);
+ void copy(const structure & other);
void destroy(bool call_parent);
// other constructors
void printtree(ostream & os, unsigned indent) const;
void printcsrc(ostream & os, unsigned type, unsigned upper_precedence=0) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
// new virtual functions which can be overridden by derived classes
// none
protected:
static vector<registered_structure_info> & registered_structures(void);
public:
- static unsigned register_new(char const * nm);
+ static unsigned register_new(const char * nm);
// member variables
// none
// global constants
extern const structure some_structure;
-extern type_info const & typeid_structure;
+extern const type_info & typeid_structure;
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC
$number_of_members=$#MEMBERS+1;
$constructor_arglist=generate('ex tmp_${MEMBER}',', ');
-$member_access_functions=generate(' ex const & ${MEMBER}(void) { return m_${MEMBER}; }',"\n");
+$member_access_functions=generate(' const ex & ${MEMBER}(void) { return m_${MEMBER}; }',"\n");
$op_access_indices_decl=generate(' static unsigned op_${MEMBER};',"\n");
$op_access_indices_def=generate('unsigned ${STRUCTURE}::op_${MEMBER}=${N}-1;',"\n");
$members=generate(' ex m_${MEMBER}; ${COMMENT}',"\n");
void print(ostream & os, unsigned upper_precedence=0) const;
void printtree(ostream & os, unsigned indent) const;
int nops() const;
- ex & let_op(int const i);
+ ex & let_op(int i);
ex expand(unsigned options=0) const;
- bool has(ex const & other) const;
+ bool has(const ex & other) const;
ex eval(int level=0) const;
ex evalf(int level=0) const;
ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
- ex diff(symbol const & s) const;
- ex subs(lst const & ls, lst const & lr) const;
+ ex diff(const symbol & s) const;
+ ex subs(const lst & ls, const lst & lr) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
unsigned return_type(void) const;
// new virtual functions which can be overridden by derived classes
// global constants
extern const ${STRUCTURE} some_${STRUCTURE};
-extern type_info const & typeid_${STRUCTURE};
+extern const type_info & typeid_${STRUCTURE};
extern const unsigned tinfo_${STRUCTURE};
// macros
return ${number_of_members};
}
-ex & ${STRUCTURE}::let_op(int const i)
+ex & ${STRUCTURE}::let_op(int i)
{
GINAC_ASSERT(i>=0);
GINAC_ASSERT(i<nops());
// a ${STRUCTURE} 'has' an expression if it is this expression itself or a child 'has' it
-bool ${STRUCTURE}::has(ex const & other) const
+bool ${STRUCTURE}::has(const ex & other) const
{
GINAC_ASSERT(other.bp!=0);
if (is_equal(*other.bp)) return true;
/** ${STRUCTURE}::diff() differentiates the children.
there is no need to check for triavially equal, since diff usually
does not return itself unevaluated. */
-ex ${STRUCTURE}::diff(symbol const & s) const
+ex ${STRUCTURE}::diff(const symbol & s) const
{
${diff_statements}
return ${STRUCTURE}(${temporary_arglist});
}
-ex ${STRUCTURE}::subs(lst const & ls, lst const & lr) const
+ex ${STRUCTURE}::subs(const lst & ls, const lst & lr) const
{
bool all_are_trivially_equal=true;
${subs_statements}
// protected
-int ${STRUCTURE}::compare_same_type(basic const & other) const
+int ${STRUCTURE}::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other,${STRUCTURE}));
${STRUCTURE} const & o=static_cast<${STRUCTURE} const &>
return 0;
}
-bool ${STRUCTURE}::is_equal_same_type(basic const & other) const
+bool ${STRUCTURE}::is_equal_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other,${STRUCTURE}));
${STRUCTURE} const & o=static_cast<${STRUCTURE} const &>
//////////
const ${STRUCTURE} some_${STRUCTURE};
-type_info const & typeid_${STRUCTURE}=typeid(some_${STRUCTURE});
+const type_info & typeid_${STRUCTURE}=typeid(some_${STRUCTURE});
const unsigned tinfo_${STRUCTURE}=structure::register_new("${STRUCTURE}");
#ifndef NO_GINAC_NAMESPACE
destroy(0);
}
-symbol::symbol(symbol const & other)
+symbol::symbol(const symbol & other)
{
debugmsg("symbol copy constructor", LOGLEVEL_CONSTRUCT);
copy(other);
}
-void symbol::copy(symbol const & other)
+void symbol::copy(const symbol & other)
{
inherited::copy(other);
name=other.name;
// public
-symbol::symbol(string const & initname) : inherited(TINFO_symbol)
+symbol::symbol(const string & initname) : inherited(TINFO_symbol)
{
debugmsg("symbol constructor from string", LOGLEVEL_CONSTRUCT);
name=initname;
return this->hold();
}
-bool symbol::has(ex const & other) const
+bool symbol::has(const ex & other) const
{
if (is_equal(*other.bp)) return true;
return false;
}
-int symbol::degree(symbol const & s) const
+int symbol::degree(const symbol & s) const
{
return compare_same_type(s)==0 ? 1 : 0;
}
-int symbol::ldegree(symbol const & s) const
+int symbol::ldegree(const symbol & s) const
{
return compare_same_type(s)==0 ? 1 : 0;
}
-ex symbol::coeff(symbol const & s, int const n) const
+ex symbol::coeff(const symbol & s, int n) const
{
if (compare_same_type(s)==0) {
return n==1 ? _ex1() : _ex0();
}
}
-ex symbol::subs(lst const & ls, lst const & lr) const
+ex symbol::subs(const lst & ls, const lst & lr) const
{
GINAC_ASSERT(ls.nops()==lr.nops());
#ifdef DO_GINAC_ASSERT
// protected
-int symbol::compare_same_type(basic const & other) const
+int symbol::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other,symbol));
const symbol *o = static_cast<const symbol *>(&other);
return serial < o->serial ? -1 : 1;
}
-bool symbol::is_equal_same_type(basic const & other) const
+bool symbol::is_equal_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other,symbol));
const symbol *o = static_cast<const symbol *>(&other);
// public
-void symbol::assign(ex const & value)
+void symbol::assign(const ex & value)
{
asexinfop->is_assigned=1;
asexinfop->assigned_expression=value;
//////////
const symbol some_symbol;
-type_info const & typeid_symbol=typeid(some_symbol);
+const type_info & typeid_symbol=typeid(some_symbol);
//////////
// subclass assigned_ex_info
public:
symbol();
~symbol();
- symbol(symbol const & other);
+ symbol(const symbol & other);
protected:
- void copy(symbol const & other);
+ void copy(const symbol & other);
void destroy(bool call_parent);
// other constructors
public:
- explicit symbol(string const & initname);
+ explicit symbol(const string & initname);
// functions overriding virtual functions from base classes
public:
void printcsrc(ostream & os, unsigned type, unsigned upper_precedence=0) const;
bool info(unsigned inf) const;
ex expand(unsigned options=0) const;
- bool has(ex const & other) const;
- int degree(symbol const & s) const;
- int ldegree(symbol const & s) const;
- ex coeff(symbol const & s, int const n = 1) const;
+ bool has(const ex & other) const;
+ int degree(const symbol & s) const;
+ int ldegree(const symbol & s) const;
+ ex coeff(const symbol & s, int n = 1) const;
ex eval(int level = 0) const;
- ex diff(symbol const & s) const;
- ex series(symbol const & s, ex const & point, int order) const;
+ ex diff(const symbol & s) const;
+ ex series(const symbol & s, const ex & point, int order) const;
ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
- ex subs(lst const & ls, lst const & lr) const;
+ ex subs(const lst & ls, const lst & lr) const;
protected:
- int compare_same_type(basic const & other) const;
- bool is_equal_same_type(basic const & other) const;
+ int compare_same_type(const basic & other) const;
+ bool is_equal_same_type(const basic & other) const;
unsigned return_type(void) const;
unsigned return_type_tinfo(void) const;
unsigned calchash(void) const;
// non-virtual functions in this class
public:
- void assign(ex const & value);
+ void assign(const ex & value);
void unassign(void);
- ex diff(symbol const & s, unsigned nth) const;
- void setname(string const & n) {name=n;}
+ ex diff(const symbol & s, unsigned nth) const;
+ void setname(const string & n) {name=n;}
string getname(void) const {return name;}
private:
string & autoname_prefix(void);
// global constants
extern const symbol some_symbol;
-extern type_info const & typeid_symbol;
+extern const type_info & typeid_symbol;
// utility functions
inline const symbol &ex_to_symbol(const ex &e)
inline void unassign(symbol & symarg)
{ return symarg.unassign(); }
-inline int degree(symbol const & a, symbol const & s)
+inline int degree(const symbol & a, const symbol & s)
{ return a.degree(s); }
-inline int ldegree(symbol const & a, symbol const & s)
+inline int ldegree(const symbol & a, const symbol & s)
{ return a.ldegree(s); }
#ifndef NO_GINAC_NAMESPACE
/** Compare two pointers (just to establish some sort of canonical order).
* @return -1, 0, or 1 */
-int compare_pointers(void const * a, void const * b)
+int compare_pointers(const void * a, const void * b)
{
if (a<b) {
return -1;
//////////
// numeric -60
-numeric const & _num_60(void)
+const numeric & _num_60(void)
{
const static ex e = ex(numeric(-60));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_60(void)
+const ex & _ex_60(void)
{
static ex * e = new ex(_num_60());
return *e;
}
// numeric -120
-numeric const & _num_120(void)
+const numeric & _num_120(void)
{
const static ex e = ex(numeric(-120));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_120(void)
+const ex & _ex_120(void)
{
static ex * e = new ex(_num_120());
return *e;
}
// numeric -30
-numeric const & _num_30(void)
+const numeric & _num_30(void)
{
const static ex e = ex(numeric(-30));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_30(void)
+const ex & _ex_30(void)
{
static ex * e = new ex(_num_30());
return *e;
}
// numeric -25
-numeric const & _num_25(void)
+const numeric & _num_25(void)
{
const static ex e = ex(numeric(-25));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_25(void)
+const ex & _ex_25(void)
{
static ex * e = new ex(_num_25());
return *e;
}
// numeric -24
-numeric const & _num_24(void)
+const numeric & _num_24(void)
{
const static ex e = ex(numeric(-24));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_24(void)
+const ex & _ex_24(void)
{
static ex * e = new ex(_num_24());
return *e;
}
// numeric -20
-numeric const & _num_20(void)
+const numeric & _num_20(void)
{
const static ex e = ex(numeric(-20));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_20(void)
+const ex & _ex_20(void)
{
static ex * e = new ex(_num_20());
return *e;
}
// numeric -18
-numeric const & _num_18(void)
+const numeric & _num_18(void)
{
const static ex e = ex(numeric(-18));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_18(void)
+const ex & _ex_18(void)
{
static ex * e = new ex(_num_18());
return *e;
}
// numeric -15
-numeric const & _num_15(void)
+const numeric & _num_15(void)
{
const static ex e = ex(numeric(-15));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_15(void)
+const ex & _ex_15(void)
{
static ex * e = new ex(_num_15());
return *e;
}
// numeric -12
-numeric const & _num_12(void)
+const numeric & _num_12(void)
{
const static ex e = ex(numeric(-12));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_12(void)
+const ex & _ex_12(void)
{
static ex * e = new ex(_num_12());
return *e;
}
// numeric -11
-numeric const & _num_11(void)
+const numeric & _num_11(void)
{
const static ex e = ex(numeric(-11));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_11(void)
+const ex & _ex_11(void)
{
static ex * e = new ex(_num_11());
return *e;
}
// numeric -10
-numeric const & _num_10(void)
+const numeric & _num_10(void)
{
const static ex e = ex(numeric(-10));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_10(void)
+const ex & _ex_10(void)
{
static ex * e = new ex(_num_10());
return *e;
}
// numeric -9
-numeric const & _num_9(void)
+const numeric & _num_9(void)
{
const static ex e = ex(numeric(-9));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_9(void)
+const ex & _ex_9(void)
{
static ex * e = new ex(_num_9());
return *e;
}
// numeric -8
-numeric const & _num_8(void)
+const numeric & _num_8(void)
{
const static ex e = ex(numeric(-8));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_8(void)
+const ex & _ex_8(void)
{
static ex * e = new ex(_num_8());
return *e;
}
// numeric -7
-numeric const & _num_7(void)
+const numeric & _num_7(void)
{
const static ex e = ex(numeric(-7));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_7(void)
+const ex & _ex_7(void)
{
static ex * e = new ex(_num_7());
return *e;
}
// numeric -6
-numeric const & _num_6(void)
+const numeric & _num_6(void)
{
const static ex e = ex(numeric(-6));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_6(void)
+const ex & _ex_6(void)
{
static ex * e = new ex(_num_6());
return *e;
}
// numeric -5
-numeric const & _num_5(void)
+const numeric & _num_5(void)
{
const static ex e = ex(numeric(-5));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_5(void)
+const ex & _ex_5(void)
{
static ex * e = new ex(_num_5());
return *e;
}
// numeric -4
-numeric const & _num_4(void)
+const numeric & _num_4(void)
{
const static ex e = ex(numeric(-4));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_4(void)
+const ex & _ex_4(void)
{
static ex * e = new ex(_num_4());
return *e;
}
// numeric -3
-numeric const & _num_3(void)
+const numeric & _num_3(void)
{
const static ex e = ex(numeric(-3));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_3(void)
+const ex & _ex_3(void)
{
static ex * e = new ex(_num_3());
return *e;
}
// numeric -2
-numeric const & _num_2(void)
+const numeric & _num_2(void)
{
const static ex e = ex(numeric(-2));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_2(void)
+const ex & _ex_2(void)
{
static ex * e = new ex(_num_2());
return *e;
}
// numeric -1
-numeric const & _num_1(void)
+const numeric & _num_1(void)
{
const static ex e = ex(numeric(-1));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_1(void)
+const ex & _ex_1(void)
{
static ex * e = new ex(_num_1());
return *e;
}
// numeric -1/2
-numeric const & _num_1_2(void)
+const numeric & _num_1_2(void)
{
const static ex e = ex(numeric(-1,2));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_1_2(void)
+const ex & _ex_1_2(void)
{
static ex * e = new ex(_num_1_2());
return *e;
}
// numeric -1/3
-numeric const & _num_1_3(void)
+const numeric & _num_1_3(void)
{
const static ex e = ex(numeric(-1,3));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_1_3(void)
+const ex & _ex_1_3(void)
{
static ex * e = new ex(_num_1_3());
return *e;
}
// numeric -1/4
-numeric const & _num_1_4(void)
+const numeric & _num_1_4(void)
{
const static ex e = ex(numeric(-1,4));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex_1_4(void)
+const ex & _ex_1_4(void)
{
static ex * e = new ex(_num_1_4());
return *e;
}
// numeric 0
-numeric const & _num0(void)
+const numeric & _num0(void)
{
const static ex e = ex(numeric(0));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex0(void)
+const ex & _ex0(void)
{
static ex * e = new ex(_num0());
return *e;
}
// numeric 1/4
-numeric const & _num1_4(void)
+const numeric & _num1_4(void)
{
const static ex e = ex(numeric(1,4));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex1_4(void)
+const ex & _ex1_4(void)
{
static ex * e = new ex(_num1_4());
return *e;
}
// numeric 1/3
-numeric const & _num1_3(void)
+const numeric & _num1_3(void)
{
const static ex e = ex(numeric(1,3));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex1_3(void)
+const ex & _ex1_3(void)
{
static ex * e = new ex(_num1_3());
return *e;
}
// numeric 1/2
-numeric const & _num1_2(void)
+const numeric & _num1_2(void)
{
const static ex e = ex(numeric(1,2));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex1_2(void)
+const ex & _ex1_2(void)
{
static ex * e = new ex(_num1_2());
return *e;
}
// numeric 1
-numeric const & _num1(void)
+const numeric & _num1(void)
{
const static ex e = ex(numeric(1));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex1(void)
+const ex & _ex1(void)
{
static ex * e = new ex(_num1());
return *e;
}
// numeric 2
-numeric const & _num2(void)
+const numeric & _num2(void)
{
const static ex e = ex(numeric(2));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex2(void)
+const ex & _ex2(void)
{
static ex * e = new ex(_num2());
return *e;
}
// numeric 3
-numeric const & _num3(void)
+const numeric & _num3(void)
{
const static ex e = ex(numeric(3));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex3(void)
+const ex & _ex3(void)
{
static ex * e = new ex(_num3());
return *e;
}
// numeric 4
-numeric const & _num4(void)
+const numeric & _num4(void)
{
const static ex e = ex(numeric(4));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex4(void)
+const ex & _ex4(void)
{
static ex * e = new ex(_num4());
return *e;
}
// numeric 5
-numeric const & _num5(void)
+const numeric & _num5(void)
{
const static ex e = ex(numeric(5));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex5(void)
+const ex & _ex5(void)
{
static ex * e = new ex(_num5());
return *e;
}
// numeric 6
-numeric const & _num6(void)
+const numeric & _num6(void)
{
const static ex e = ex(numeric(6));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex6(void)
+const ex & _ex6(void)
{
static ex * e = new ex(_num6());
return *e;
}
// numeric 7
-numeric const & _num7(void)
+const numeric & _num7(void)
{
const static ex e = ex(numeric(7));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex7(void)
+const ex & _ex7(void)
{
static ex * e = new ex(_num7());
return *e;
}
// numeric 8
-numeric const & _num8(void)
+const numeric & _num8(void)
{
const static ex e = ex(numeric(8));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex8(void)
+const ex & _ex8(void)
{
static ex * e = new ex(_num8());
return *e;
}
// numeric 9
-numeric const & _num9(void)
+const numeric & _num9(void)
{
const static ex e = ex(numeric(9));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex9(void)
+const ex & _ex9(void)
{
static ex * e = new ex(_num9());
return *e;
}
// numeric 10
-numeric const & _num10(void)
+const numeric & _num10(void)
{
const static ex e = ex(numeric(10));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex10(void)
+const ex & _ex10(void)
{
static ex * e = new ex(_num10());
return *e;
}
// numeric 11
-numeric const & _num11(void)
+const numeric & _num11(void)
{
const static ex e = ex(numeric(11));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex11(void)
+const ex & _ex11(void)
{
static ex * e = new ex(_num11());
return *e;
}
// numeric 12
-numeric const & _num12(void)
+const numeric & _num12(void)
{
const static ex e = ex(numeric(12));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex12(void)
+const ex & _ex12(void)
{
static ex * e = new ex(_num12());
return *e;
}
// numeric 15
-numeric const & _num15(void)
+const numeric & _num15(void)
{
const static ex e = ex(numeric(15));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex15(void)
+const ex & _ex15(void)
{
static ex * e = new ex(_num15());
return *e;
}
// numeric 18
-numeric const & _num18(void)
+const numeric & _num18(void)
{
const static ex e = ex(numeric(18));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex18(void)
+const ex & _ex18(void)
{
static ex * e = new ex(_num18());
return *e;
}
// numeric 20
-numeric const & _num20(void)
+const numeric & _num20(void)
{
const static ex e = ex(numeric(20));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex20(void)
+const ex & _ex20(void)
{
static ex * e = new ex(_num20());
return *e;
}
// numeric 24
-numeric const & _num24(void)
+const numeric & _num24(void)
{
const static ex e = ex(numeric(24));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex24(void)
+const ex & _ex24(void)
{
static ex * e = new ex(_num24());
return *e;
}
// numeric 25
-numeric const & _num25(void)
+const numeric & _num25(void)
{
const static ex e = ex(numeric(25));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex25(void)
+const ex & _ex25(void)
{
static ex * e = new ex(_num25());
return *e;
}
// numeric 30
-numeric const & _num30(void)
+const numeric & _num30(void)
{
const static ex e = ex(numeric(30));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex30(void)
+const ex & _ex30(void)
{
static ex * e = new ex(_num30());
return *e;
}
// numeric 60
-numeric const & _num60(void)
+const numeric & _num60(void)
{
const static ex e = ex(numeric(60));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex60(void)
+const ex & _ex60(void)
{
static ex * e = new ex(_num60());
return *e;
}
// numeric 120
-numeric const & _num120(void)
+const numeric & _num120(void)
{
const static ex e = ex(numeric(120));
const static numeric * n = static_cast<const numeric *>(e.bp);
return *n;
}
-ex const & _ex120(void)
+const ex & _ex120(void)
{
static ex * e = new ex(_num120());
return *e;
unsigned log2(unsigned n);
-int compare_pointers(void const * a, void const * b);
+int compare_pointers(const void * a, const void * b);
/** Rotate lower 31 bits of unsigned value by one bit to the left
* (upper bits get cleared). */
class numeric;
class ex;
-numeric const & _num_120(void); // -120
-ex const & _ex_120(void);
-numeric const & _num_60(void); // -60
-ex const & _ex_60(void);
-numeric const & _num_30(void); // -30
-ex const & _ex_30(void);
-numeric const & _num_25(void); // -25
-ex const & _ex_25(void);
-numeric const & _num_24(void); // -24
-ex const & _ex_24(void);
-numeric const & _num_20(void); // -20
-ex const & _ex_20(void);
-numeric const & _num_18(void); // -18
-ex const & _ex_18(void);
-numeric const & _num_15(void); // -15
-ex const & _ex_15(void);
-numeric const & _num_12(void); // -12
-ex const & _ex_12(void);
-numeric const & _num_11(void); // -11
-ex const & _ex_11(void);
-numeric const & _num_10(void); // -10
-ex const & _ex_10(void);
-numeric const & _num_9(void); // -9
-ex const & _ex_9(void);
-numeric const & _num_8(void); // -8
-ex const & _ex_8(void);
-numeric const & _num_7(void); // -7
-ex const & _ex_7(void);
-numeric const & _num_6(void); // -6
-ex const & _ex_6(void);
-numeric const & _num_5(void); // -5
-ex const & _ex_5(void);
-numeric const & _num_4(void); // -4
-ex const & _ex_4(void);
-numeric const & _num_3(void); // -3
-ex const & _ex_3(void);
-numeric const & _num_2(void); // -2
-ex const & _ex_2(void);
-numeric const & _num_1(void); // -1
-ex const & _ex_1(void);
-numeric const & _num_1_2(void); // -1/2
-ex const & _ex_1_2(void);
-numeric const & _num_1_3(void); // -1/3
-ex const & _ex_1_3(void);
-numeric const & _num_1_4(void); // -1/4
-ex const & _ex_1_4(void);
-numeric const & _num0(void); // 0
-ex const & _ex0(void);
-numeric const & _num1_4(void); // 1/4
-ex const & _ex1_4(void);
-numeric const & _num1_3(void); // 1/3
-ex const & _ex1_3(void);
-numeric const & _num1_2(void); // 1/2
-ex const & _ex1_2(void);
-numeric const & _num1(void); // 1
-ex const & _ex1(void);
-numeric const & _num2(void); // 2
-ex const & _ex2(void);
-numeric const & _num3(void); // 3
-ex const & _ex3(void);
-numeric const & _num4(void); // 4
-ex const & _ex4(void);
-numeric const & _num5(void); // 5
-ex const & _ex5(void);
-numeric const & _num6(void); // 6
-ex const & _ex6(void);
-numeric const & _num7(void); // 7
-ex const & _ex7(void);
-numeric const & _num8(void); // 8
-ex const & _ex8(void);
-numeric const & _num9(void); // 9
-ex const & _ex9(void);
-numeric const & _num10(void); // 10
-ex const & _ex10(void);
-numeric const & _num11(void); // 11
-ex const & _ex11(void);
-numeric const & _num12(void); // 12
-ex const & _ex12(void);
-numeric const & _num15(void); // 15
-ex const & _ex15(void);
-numeric const & _num18(void); // 18
-ex const & _ex18(void);
-numeric const & _num20(void); // 20
-ex const & _ex20(void);
-numeric const & _num24(void); // 24
-ex const & _ex24(void);
-numeric const & _num25(void); // 25
-ex const & _ex25(void);
-numeric const & _num30(void); // 30
-ex const & _ex30(void);
-numeric const & _num60(void); // 60
-ex const & _ex60(void);
-numeric const & _num120(void); // 120
-ex const & _ex120(void);
+const numeric & _num_120(void); // -120
+const ex & _ex_120(void);
+const numeric & _num_60(void); // -60
+const ex & _ex_60(void);
+const numeric & _num_30(void); // -30
+const ex & _ex_30(void);
+const numeric & _num_25(void); // -25
+const ex & _ex_25(void);
+const numeric & _num_24(void); // -24
+const ex & _ex_24(void);
+const numeric & _num_20(void); // -20
+const ex & _ex_20(void);
+const numeric & _num_18(void); // -18
+const ex & _ex_18(void);
+const numeric & _num_15(void); // -15
+const ex & _ex_15(void);
+const numeric & _num_12(void); // -12
+const ex & _ex_12(void);
+const numeric & _num_11(void); // -11
+const ex & _ex_11(void);
+const numeric & _num_10(void); // -10
+const ex & _ex_10(void);
+const numeric & _num_9(void); // -9
+const ex & _ex_9(void);
+const numeric & _num_8(void); // -8
+const ex & _ex_8(void);
+const numeric & _num_7(void); // -7
+const ex & _ex_7(void);
+const numeric & _num_6(void); // -6
+const ex & _ex_6(void);
+const numeric & _num_5(void); // -5
+const ex & _ex_5(void);
+const numeric & _num_4(void); // -4
+const ex & _ex_4(void);
+const numeric & _num_3(void); // -3
+const ex & _ex_3(void);
+const numeric & _num_2(void); // -2
+const ex & _ex_2(void);
+const numeric & _num_1(void); // -1
+const ex & _ex_1(void);
+const numeric & _num_1_2(void); // -1/2
+const ex & _ex_1_2(void);
+const numeric & _num_1_3(void); // -1/3
+const ex & _ex_1_3(void);
+const numeric & _num_1_4(void); // -1/4
+const ex & _ex_1_4(void);
+const numeric & _num0(void); // 0
+const ex & _ex0(void);
+const numeric & _num1_4(void); // 1/4
+const ex & _ex1_4(void);
+const numeric & _num1_3(void); // 1/3
+const ex & _ex1_3(void);
+const numeric & _num1_2(void); // 1/2
+const ex & _ex1_2(void);
+const numeric & _num1(void); // 1
+const ex & _ex1(void);
+const numeric & _num2(void); // 2
+const ex & _ex2(void);
+const numeric & _num3(void); // 3
+const ex & _ex3(void);
+const numeric & _num4(void); // 4
+const ex & _ex4(void);
+const numeric & _num5(void); // 5
+const ex & _ex5(void);
+const numeric & _num6(void); // 6
+const ex & _ex6(void);
+const numeric & _num7(void); // 7
+const ex & _ex7(void);
+const numeric & _num8(void); // 8
+const ex & _ex8(void);
+const numeric & _num9(void); // 9
+const ex & _ex9(void);
+const numeric & _num10(void); // 10
+const ex & _ex10(void);
+const numeric & _num11(void); // 11
+const ex & _ex11(void);
+const numeric & _num12(void); // 12
+const ex & _ex12(void);
+const numeric & _num15(void); // 15
+const ex & _ex15(void);
+const numeric & _num18(void); // 18
+const ex & _ex18(void);
+const numeric & _num20(void); // 20
+const ex & _ex20(void);
+const numeric & _num24(void); // 24
+const ex & _ex24(void);
+const numeric & _num25(void); // 25
+const ex & _ex25(void);
+const numeric & _num30(void); // 30
+const ex & _ex30(void);
+const numeric & _num60(void); // 60
+const ex & _ex60(void);
+const numeric & _num120(void); // 120
+const ex & _ex120(void);
#ifndef NO_GINAC_NAMESPACE
} // namespace GiNaC