normal.cpp numeric.cpp operators.cpp power.cpp registrar.cpp relational.cpp \
symbol.cpp pseries.cpp utils.cpp ncmul.cpp structure.cpp exprseq_suppl.cpp \
lst.cpp lst_suppl.cpp input_parser.yy input_lexer.ll input_lexer.h \
- remember.h remember.cpp debugmsg.h utils.h idx.cpp indexed.cpp tensor.cpp \
- color.cpp clifford.cpp wildcard.cpp symmetry.cpp fderivative.cpp tostring.h
+ remember.h remember.cpp utils.h idx.cpp indexed.cpp tensor.cpp color.cpp \
+ clifford.cpp wildcard.cpp symmetry.cpp fderivative.cpp tostring.h
libginac_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-release $(LT_RELEASE)
ginacincludedir = $(includedir)/ginac
#include "mul.h"
#include "matrix.h"
#include "archive.h"
-#include "debugmsg.h"
#include "utils.h"
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(add, expairseq)
//////////
-// default constructor, destructor, copy constructor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
add::add()
{
- debugmsg("add default constructor",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_add;
}
add::add(const ex & lh, const ex & rh)
{
- debugmsg("add constructor from ex,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_add;
overall_coeff = _ex0;
construct_from_2_ex(lh,rh);
add::add(const exvector & v)
{
- debugmsg("add constructor from exvector",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_add;
overall_coeff = _ex0;
construct_from_exvector(v);
add::add(const epvector & v)
{
- debugmsg("add constructor from epvector",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_add;
overall_coeff = _ex0;
construct_from_epvector(v);
add::add(const epvector & v, const ex & oc)
{
- debugmsg("add constructor from epvector,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_add;
overall_coeff = oc;
construct_from_epvector(v);
add::add(epvector * vp, const ex & oc)
{
- debugmsg("add constructor from epvector *,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_add;
GINAC_ASSERT(vp!=0);
overall_coeff = oc;
void add::print(const print_context & c, unsigned level) const
{
- debugmsg("add print", LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
inherited::print(c, level);
* @param level cut-off in recursive evaluation */
ex add::eval(int level) const
{
- debugmsg("add eval",LOGLEVEL_MEMBER_FUNCTION);
-
epvector *evaled_seqp = evalchildren(level);
if (evaled_seqp) {
// do more evaluation later
sum = sum.add(ex_to<matrix>(m));
} else
all_matrices = false;
- it++;
+ ++it;
}
if (all_matrices) {
#include "print.h"
#include "archive.h"
#include "utils.h"
-#include "debugmsg.h"
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS_NO_CTORS(basic, void)
//////////
-// default ctor, dtor, copy ctor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
// public
basic::basic(const basic & other) : tinfo_key(TINFO_basic), flags(0), refcount(0)
{
- debugmsg("basic copy ctor", LOGLEVEL_CONSTRUCT);
copy(other);
}
const basic & basic::operator=(const basic & other)
{
- debugmsg("basic operator=", LOGLEVEL_ASSIGNMENT);
if (this != &other) {
destroy(true);
copy(other);
/** Construct object from archive_node. */
basic::basic(const archive_node &n, const lst &sym_lst) : flags(0), refcount(0)
{
- debugmsg("basic ctor from archive_node", LOGLEVEL_CONSTRUCT);
-
// Reconstruct tinfo_key from class name
std::string class_name;
if (n.find_string("class", class_name))
* level for placing parentheses and formatting */
void basic::print(const print_context & c, unsigned level) const
{
- debugmsg("basic print", LOGLEVEL_PRINT);
-
if (is_of_type(c, print_tree)) {
c.s << std::string(level, ' ') << class_name()
* construction of an ex from a basic. */
basic * basic::duplicate() const
{
- debugmsg("basic duplicate",LOGLEVEL_DUPLICATE);
return new basic(*this);
}
#include "tinfos.h"
#include "assertion.h"
#include "registrar.h"
-/*#include "debugmsg.h"*/
namespace GiNaC {
friend class ex;
- // default ctor, dtor, copy ctor assignment operator and helpers
+ // default ctor, dtor, copy ctor, assignment operator and helpers
public:
- basic() : tinfo_key(TINFO_basic), flags(0), refcount(0)
- {
- /* debugmsg("basic default ctor", LOGLEVEL_CONSTRUCT); */
- }
+ basic() : tinfo_key(TINFO_basic), flags(0), refcount(0) {}
/** basic dtor, virtual because class ex will delete objects via ptr. */
virtual ~basic()
{
- /* debugmsg("basic dtor", LOGLEVEL_DESTRUCT); */
destroy(false);
GINAC_ASSERT((!(flags & status_flags::dynallocated))||(refcount==0));
}
// other ctors
/** ctor with specified tinfo_key */
- basic(unsigned ti) : tinfo_key(ti), flags(0), refcount(0)
- {
- /* debugmsg("basic ctor with tinfo_key", LOGLEVEL_CONSTRUCT); */
- }
+ basic(unsigned ti) : tinfo_key(ti), flags(0), refcount(0) {}
// new virtual functions which can be overridden by derived classes
public: // only const functions please (may break reference counting)
#include "mul.h"
#include "print.h"
#include "archive.h"
-#include "debugmsg.h"
#include "utils.h"
#include <stdexcept>
GINAC_IMPLEMENT_REGISTERED_CLASS(diracgamma5, tensor)
//////////
-// default constructor, destructor, copy constructor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
clifford::clifford() : representation_label(0)
{
- debugmsg("clifford default constructor", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_clifford;
}
* @see dirac_ONE */
clifford::clifford(const ex & b, unsigned char rl) : inherited(b), representation_label(rl)
{
- debugmsg("clifford constructor from ex", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_clifford;
}
* @see dirac_gamma */
clifford::clifford(const ex & b, const ex & mu, unsigned char rl) : inherited(b, mu), representation_label(rl)
{
- debugmsg("clifford constructor from ex,ex", LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(is_a<varidx>(mu));
tinfo_key = TINFO_clifford;
}
clifford::clifford(unsigned char rl, const exvector & v, bool discardable) : inherited(sy_none(), v, discardable), representation_label(rl)
{
- debugmsg("clifford constructor from unsigned char,exvector", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_clifford;
}
clifford::clifford(unsigned char rl, exvector * vp) : inherited(sy_none(), vp), representation_label(rl)
{
- debugmsg("clifford constructor from unsigned char,exvector *", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_clifford;
}
clifford::clifford(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("clifford constructor from archive_node", LOGLEVEL_CONSTRUCT);
unsigned rl;
n.find_unsigned("label", rl);
representation_label = rl;
#include "symbol.h"
#include "print.h"
#include "archive.h"
-#include "debugmsg.h"
#include "utils.h"
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(su3d, tensor)
//////////
-// default constructor, destructor, copy constructor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
color::color() : representation_label(0)
{
- debugmsg("color default constructor", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_color;
}
* @see color_ONE */
color::color(const ex & b, unsigned char rl) : inherited(b), representation_label(rl)
{
- debugmsg("color constructor from ex,unsigned char", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_color;
}
* @see color_T */
color::color(const ex & b, const ex & i1, unsigned char rl) : inherited(b, i1), representation_label(rl)
{
- debugmsg("color constructor from ex,ex,unsigned char", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_color;
}
color::color(unsigned char rl, const exvector & v, bool discardable) : inherited(sy_none(), v, discardable), representation_label(rl)
{
- debugmsg("color constructor from unsigned char,exvector", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_color;
}
color::color(unsigned char rl, exvector * vp) : inherited(sy_none(), vp), representation_label(rl)
{
- debugmsg("color constructor from unsigned char,exvector *", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_color;
}
color::color(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("color constructor from archive_node", LOGLEVEL_CONSTRUCT);
unsigned rl;
n.find_unsigned("label", rl);
representation_label = rl;
#include "ex.h"
#include "print.h"
#include "archive.h"
-#include "debugmsg.h"
#include "utils.h"
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(constant, basic)
//////////
-// default ctor, dtor, copy ctor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
// public
-constant::constant() : basic(TINFO_constant), ef(0), number(0), serial(next_serial++)
-{
- debugmsg("constant default ctor",LOGLEVEL_CONSTRUCT);
-}
+constant::constant() : basic(TINFO_constant), ef(0), number(0), serial(next_serial++) {}
// protected
constant::constant(const std::string & initname, evalffunctype efun, const std::string & texname)
: basic(TINFO_constant), name(initname), ef(efun), number(0), serial(next_serial++)
{
- debugmsg("constant ctor from string, function",LOGLEVEL_CONSTRUCT);
if (texname.empty())
TeX_name = "\\mbox{" + name + "}";
else
constant::constant(const std::string & initname, const numeric & initnumber, const std::string & texname)
: basic(TINFO_constant), name(initname), ef(0), number(new numeric(initnumber)), serial(next_serial++)
{
- debugmsg("constant ctor from string, numeric",LOGLEVEL_CONSTRUCT);
if (texname.empty())
TeX_name = "\\mbox{" + name + "}";
else
// archiving
//////////
-constant::constant(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
-{
- debugmsg("constant ctor from archive_node", LOGLEVEL_CONSTRUCT);
-}
+constant::constant(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst) {}
ex constant::unarchive(const archive_node &n, const lst &sym_lst)
{
void constant::print(const print_context & c, unsigned level) const
{
- debugmsg("constant print", LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
c.s << std::string(level, ' ') << name << " (" << class_name() << ")"
<< std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec
<<'END_OF_CONSTRUCTORS_IMPLEMENTATION','const ex & param${N}',', ',' seq.push_back(param${N});',"\n");
${CONTAINER}::${CONTAINER}(${SEQ1}) : basic(TINFO_${CONTAINER})
{
- debugmsg(\"${CONTAINER} ctor from ${N}*ex\",LOGLEVEL_CONSTRUCT);
RESERVE(seq,${N});
${SEQ2}
}
#include "ex.h"
#include "print.h"
#include "archive.h"
-#include "debugmsg.h"
namespace GiNaC {
${RESERVE_IMPLEMENTATION}
//////////
-// default ctor, dtor, copy ctor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
// public
-${CONTAINER}::${CONTAINER}() : basic(TINFO_${CONTAINER})
-{
- debugmsg("${CONTAINER} default ctor",LOGLEVEL_CONSTRUCT);
-}
+${CONTAINER}::${CONTAINER}() : basic(TINFO_${CONTAINER}) {}
// protected
${CONTAINER}::${CONTAINER}(${STLT} const & s, bool discardable) : basic(TINFO_${CONTAINER})
{
- debugmsg("${CONTAINER} ctor from ${STLT}", LOGLEVEL_CONSTRUCT);
if (discardable) {
seq.swap(const_cast<${STLT} &>(s));
} else {
${CONTAINER}::${CONTAINER}(${STLT} * vp) : basic(TINFO_${CONTAINER})
{
- debugmsg("${CONTAINER} ctor from ${STLT} *",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(vp!=0);
seq.swap(*vp);
delete vp;
/** Construct object from archive_node. */
${CONTAINER}::${CONTAINER}(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("${CONTAINER} ctor from archive_node", LOGLEVEL_CONSTRUCT);
for (unsigned int i=0; true; i++) {
ex e;
if (n.find_ex("seq", e, sym_lst, i))
void ${CONTAINER}::print(const print_context & c, unsigned level) const
{
- debugmsg("${CONTAINER} print", LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
c.s << std::string(level, ' ') << class_name()
+++ /dev/null
-/** @file debugmsg.h
- *
- * Utilities needed for debugging only. */
-
-/*
- * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __GINAC_DEBUGMSG_H__
-#define __GINAC_DEBUGMSG_H__
-
-#include <iostream>
-
-#ifdef _DEBUG
-#define VERBOSE
-#define DO_GINAC_ASSERT (VERBOSE||DEBUG)
-#endif
-
-#define LOGLEVEL_CONSTRUCT 0x0001
-#define LOGLEVEL_DESTRUCT 0x0002
-#define LOGLEVEL_ASSIGNMENT 0x0004
-#define LOGLEVEL_DUPLICATE 0x0008
-#define LOGLEVEL_PRINT 0x0010
-#define LOGLEVEL_OPERATOR 0x0020
-#define LOGLEVEL_MEMBER_FUNCTION 0x4000
-#define LOGLEVEL_NONMEMBER_FUNCTION 0x8000
-#define LOGLEVEL_ALL 0xffff
-
-#define LOGMASK (LOGLEVEL_PRINT)
-// #define LOGMASK (LOGLEVEL_PRINT | LOGLEVEL_ASSIGNMENT | LOGLEVEL_OPERATOR | LOGLEVEL_DUPLICATE | LOGLEVEL_OPERATOR | LOGLEVEL_MEMBER_FUNCTION | LOGLEVEL_NONMEMBER_FUNCTION)
-
-#ifdef VERBOSE
-#define debugmsg(msg, loglevel) if ((loglevel) & ~LOGMASK) std::clog << (msg) << std::endl;
-#else
-#define debugmsg(msg, loglevel)
-#endif // def VERBOSE
-
-#endif // ndef __GINAC_DEBUGMSG_H__
#include "lst.h"
#include "relational.h"
#include "input_lexer.h"
-#include "debugmsg.h"
#include "utils.h"
namespace GiNaC {
/** Efficiently swap the contents of two expressions. */
void ex::swap(ex & other)
{
- debugmsg("ex swap",LOGLEVEL_MEMBER_FUNCTION);
-
GINAC_ASSERT(bp!=0);
GINAC_ASSERT(bp->flags & status_flags::dynallocated);
GINAC_ASSERT(other.bp!=0);
* @see print_context */
void ex::print(const print_context & c, unsigned level) const
{
- debugmsg("ex print", LOGLEVEL_PRINT);
GINAC_ASSERT(bp!=0);
bp->print(c, level);
}
/** Print expression to stream in a tree-like format suitable for debugging. */
void ex::printtree(std::ostream & os) const
{
- debugmsg("ex printtree", LOGLEVEL_PRINT);
GINAC_ASSERT(bp!=0);
bp->print(print_tree(os));
}
/** Little wrapper arount print to be called within a debugger. */
void ex::dbgprint(void) const
{
- debugmsg("ex dbgprint", LOGLEVEL_PRINT);
GINAC_ASSERT(bp!=0);
bp->dbgprint();
}
/** Little wrapper arount printtree to be called within a debugger. */
void ex::dbgprinttree(void) const
{
- debugmsg("ex dbgprinttree", LOGLEVEL_PRINT);
GINAC_ASSERT(bp!=0);
bp->dbgprinttree();
}
ex ex::operator[](const ex & index) const
{
- debugmsg("ex operator[ex]",LOGLEVEL_OPERATOR);
GINAC_ASSERT(bp!=0);
return (*bp)[index];
}
ex ex::operator[](int i) const
{
- debugmsg("ex operator[int]",LOGLEVEL_OPERATOR);
GINAC_ASSERT(bp!=0);
return (*bp)[i];
}
/** Return modifyable operand/member at position i. */
ex & ex::let_op(int i)
{
- debugmsg("ex let_op()",LOGLEVEL_MEMBER_FUNCTION);
makewriteable();
GINAC_ASSERT(bp!=0);
return bp->let_op(i);
/** Left hand side of relational expression. */
ex ex::lhs(void) const
{
- debugmsg("ex lhs()",LOGLEVEL_MEMBER_FUNCTION);
if (!is_ex_of_type(*this,relational))
throw std::runtime_error("ex::lhs(): not a relation");
return (*static_cast<relational *>(bp)).lhs();
/** Right hand side of relational expression. */
ex ex::rhs(void) const
{
- debugmsg("ex rhs()",LOGLEVEL_MEMBER_FUNCTION);
if (!is_ex_of_type(*this,relational))
throw std::runtime_error("ex::rhs(): not a relation");
return (*static_cast<relational *>(bp)).rhs();
* unlinking the object and creating an unshared copy of it. */
void ex::makewriteable()
{
- debugmsg("ex makewriteable",LOGLEVEL_MEMBER_FUNCTION);
GINAC_ASSERT(bp!=0);
GINAC_ASSERT(bp->flags & status_flags::dynallocated);
if (bp->refcount > 1) {
// member functions
- // default ctor, dtor, copy ctor assignment operator and helpers
+ // default ctor, dtor, copy ctor, assignment operator and helpers
public:
ex();
~ex();
inline
ex::ex()
{
- /* debugmsg("ex default ctor",LOGLEVEL_CONSTRUCT); */
extern const class numeric *_num0_p;
bp = (basic*)_num0_p;
GINAC_ASSERT(bp!=0);
inline
ex::~ex()
{
- /*debugmsg("ex dtor",LOGLEVEL_DESTRUCT);*/
GINAC_ASSERT(bp!=0);
GINAC_ASSERT(bp->flags & status_flags::dynallocated);
if (--bp->refcount == 0)
inline
ex::ex(const ex & other) : bp(other.bp)
{
- /*debugmsg("ex copy ctor",LOGLEVEL_CONSTRUCT);*/
GINAC_ASSERT(bp!=0);
GINAC_ASSERT((bp->flags) & status_flags::dynallocated);
++bp->refcount;
inline
ex & ex::operator=(const ex & other)
{
- /*debugmsg("ex operator=",LOGLEVEL_ASSIGNMENT);*/
GINAC_ASSERT(bp!=0);
GINAC_ASSERT(bp->flags & status_flags::dynallocated);
GINAC_ASSERT(other.bp!=0);
inline
ex::ex(const basic & other)
{
- /*debugmsg("ex ctor from basic",LOGLEVEL_CONSTRUCT);*/
construct_from_basic(other);
#ifdef OBSCURE_CINT_HACK
update_last_created_or_assigned_bp();
inline
ex::ex(int i)
{
- /*debugmsg("ex ctor from int",LOGLEVEL_CONSTRUCT);*/
construct_from_int(i);
#ifdef OBSCURE_CINT_HACK
update_last_created_or_assigned_bp();
inline
ex::ex(unsigned int i)
{
- /*debugmsg("ex ctor from unsigned int",LOGLEVEL_CONSTRUCT);*/
construct_from_uint(i);
#ifdef OBSCURE_CINT_HACK
update_last_created_or_assigned_bp();
inline
ex::ex(long i)
{
- /*debugmsg("ex ctor from long",LOGLEVEL_CONSTRUCT);*/
construct_from_long(i);
#ifdef OBSCURE_CINT_HACK
update_last_created_or_assigned_bp();
inline
ex::ex(unsigned long i)
{
- /*debugmsg("ex ctor from unsigned long",LOGLEVEL_CONSTRUCT);*/
construct_from_ulong(i);
#ifdef OBSCURE_CINT_HACK
update_last_created_or_assigned_bp();
inline
ex::ex(double const d)
{
- /*debugmsg("ex ctor from double",LOGLEVEL_CONSTRUCT);*/
construct_from_double(d);
#ifdef OBSCURE_CINT_HACK
update_last_created_or_assigned_bp();
inline
ex::ex(const std::string &s, const ex &l)
{
- /*debugmsg("ex ctor from string,lst",LOGLEVEL_CONSTRUCT);*/
construct_from_string_and_lst(s, l);
#ifdef OBSCURE_CINT_HACK
update_last_created_or_assigned_bp();
#include "wildcard.h"
#include "print.h"
#include "archive.h"
-#include "debugmsg.h"
#include "utils.h"
#if EXPAIRSEQ_USE_HASHTAB
};
//////////
-// default ctor, dtor, copy ctor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
// public
expairseq::expairseq(const expairseq &other)
{
- debugmsg("expairseq copy ctor",LOGLEVEL_CONSTRUCT);
copy(other);
}
const expairseq &expairseq::operator=(const expairseq &other)
{
- debugmsg("expairseq operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
destroy(true);
copy(other);
expairseq::expairseq(const ex &lh, const ex &rh) : inherited(TINFO_expairseq)
{
- debugmsg("expairseq ctor from ex,ex",LOGLEVEL_CONSTRUCT);
construct_from_2_ex(lh,rh);
GINAC_ASSERT(is_canonical());
}
expairseq::expairseq(const exvector &v) : inherited(TINFO_expairseq)
{
- debugmsg("expairseq ctor from exvector",LOGLEVEL_CONSTRUCT);
construct_from_exvector(v);
GINAC_ASSERT(is_canonical());
}
expairseq::expairseq(const epvector &v, const ex &oc)
: inherited(TINFO_expairseq), overall_coeff(oc)
{
- debugmsg("expairseq ctor from epvector,ex",LOGLEVEL_CONSTRUCT);
construct_from_epvector(v);
GINAC_ASSERT(is_canonical());
}
expairseq::expairseq(epvector *vp, const ex &oc)
: inherited(TINFO_expairseq), overall_coeff(oc)
{
- debugmsg("expairseq ctor from epvector *,ex",LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(vp!=0);
construct_from_epvector(*vp);
delete vp;
, hashtabsize(0)
#endif
{
- debugmsg("expairseq ctor from archive_node", LOGLEVEL_CONSTRUCT);
for (unsigned int i=0; true; i++) {
ex rest;
ex coeff;
basic *expairseq::duplicate() const
{
- debugmsg("expairseq duplicate",LOGLEVEL_DUPLICATE);
return new expairseq(*this);
}
void expairseq::print(const print_context &c, unsigned level) const
{
- debugmsg("expairseq print",LOGLEVEL_PRINT);
-
if (is_of_type(c, print_tree)) {
unsigned delta_indent = static_cast<const print_tree &>(c).delta_indent;
// member functions
- // default ctor, dtor, copy ctor assignment operator and helpers
+ // default ctor, dtor, copy ctor, assignment operator and helpers
public:
expairseq() : basic(TINFO_expairseq)
#if EXPAIRSEQ_USE_HASHTAB
#include "fail.h"
#include "print.h"
#include "archive.h"
-#include "debugmsg.h"
#include "utils.h"
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(fail, basic)
//////////
-// default ctor, dtor, copy ctor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
DEFAULT_CTORS(fail)
#include "fderivative.h"
#include "print.h"
#include "archive.h"
-#include "debugmsg.h"
#include "utils.h"
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(fderivative, function)
//////////
-// default constructor, destructor, copy constructor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
fderivative::fderivative()
{
- debugmsg("fderivative default constructor", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_fderivative;
}
fderivative::fderivative(unsigned ser, unsigned param, const exvector & args) : function(ser, args)
{
- debugmsg("fderivative constructor from unsigned,unsigned,exvector", LOGLEVEL_CONSTRUCT);
parameter_set.insert(param);
tinfo_key = TINFO_fderivative;
}
fderivative::fderivative(unsigned ser, const paramset & params, const exvector & args) : function(ser, args), parameter_set(params)
{
- debugmsg("fderivative constructor from unsigned,paramset,exvector", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_fderivative;
}
fderivative::fderivative(unsigned ser, const paramset & params, exvector * vp) : function(ser, vp), parameter_set(params)
{
- debugmsg("fderivative constructor from unsigned,paramset,exvector *", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_fderivative;
}
fderivative::fderivative(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("fderivative constructor from archive_node", LOGLEVEL_CONSTRUCT);
unsigned i = 0;
while (true) {
unsigned u;
parameter_set.insert(u);
else
break;
- i++;
+ ++i;
}
}
void fderivative::print(const print_context & c, unsigned level) const
{
- debugmsg("fderivative print", LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
c.s << std::string(level, ' ') << class_name() << " "
function::function(unsigned ser, ${SEQ1})
: exprseq(${SEQ2}), serial(ser)
{
- debugmsg(\"function ctor from unsigned,${N}*ex\",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_function;
}
END_OF_CONSTRUCTORS_IMPLEMENTATION
#include "inifcns.h"
#include "tostring.h"
#include "utils.h"
-#include "debugmsg.h"
#include "remember.h"
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(function, exprseq)
//////////
-// default ctor, dtor, copy ctor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
// public
function::function() : serial(0)
{
- debugmsg("function default ctor",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_function;
}
function::function(unsigned ser) : serial(ser)
{
- debugmsg("function ctor from unsigned",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_function;
}
function::function(unsigned ser, const exprseq & es) : exprseq(es), serial(ser)
{
- debugmsg("function ctor from unsigned,exprseq",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_function;
}
function::function(unsigned ser, const exvector & v, bool discardable)
: exprseq(v,discardable), serial(ser)
{
- debugmsg("function ctor from string,exvector,bool",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_function;
}
function::function(unsigned ser, exvector * vp)
: exprseq(vp), serial(ser)
{
- debugmsg("function ctor from unsigned,exvector *",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_function;
}
/** Construct object from archive_node. */
function::function(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("function ctor from archive_node", LOGLEVEL_CONSTRUCT);
-
// Find serial number by function name
std::string s;
if (n.find_string("name", s)) {
void function::print(const print_context & c, unsigned level) const
{
- debugmsg("function print", LOGLEVEL_PRINT);
-
GINAC_ASSERT(serial<registered_functions().size());
if (is_of_type(c, print_tree)) {
#include "print.h"
#include "archive.h"
#include "utils.h"
-#include "debugmsg.h"
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(spinidx, varidx)
//////////
-// default constructor, destructor, copy constructor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
-idx::idx() : inherited(TINFO_idx)
-{
- debugmsg("idx default constructor", LOGLEVEL_CONSTRUCT);
-}
+idx::idx() : inherited(TINFO_idx) {}
varidx::varidx() : covariant(false)
{
- debugmsg("varidx default constructor", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_varidx;
}
spinidx::spinidx() : dotted(false)
{
- debugmsg("spinidx default constructor", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_spinidx;
}
idx::idx(const ex & v, const ex & d) : inherited(TINFO_idx), value(v), dim(d)
{
- debugmsg("idx constructor from ex,ex", LOGLEVEL_CONSTRUCT);
if (is_dim_numeric())
if (!dim.info(info_flags::posint))
throw(std::invalid_argument("dimension of space must be a positive integer"));
varidx::varidx(const ex & v, const ex & d, bool cov) : inherited(v, d), covariant(cov)
{
- debugmsg("varidx constructor from ex,ex,bool", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_varidx;
}
spinidx::spinidx(const ex & v, const ex & d, bool cov, bool dot) : inherited(v, d, cov), dotted(dot)
{
- debugmsg("spinidx constructor from ex,ex,bool,bool", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_spinidx;
}
idx::idx(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("idx constructor from archive_node", LOGLEVEL_CONSTRUCT);
n.find_ex("value", value, sym_lst);
n.find_ex("dim", dim, sym_lst);
}
varidx::varidx(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("varidx constructor from archive_node", LOGLEVEL_CONSTRUCT);
n.find_bool("covariant", covariant);
}
spinidx::spinidx(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("spinidx constructor from archive_node", LOGLEVEL_CONSTRUCT);
n.find_bool("dotted", dotted);
}
void idx::print(const print_context & c, unsigned level) const
{
- debugmsg("idx print", LOGLEVEL_PRINT);
-
if (is_of_type(c, print_tree)) {
c.s << std::string(level, ' ') << class_name()
void varidx::print(const print_context & c, unsigned level) const
{
- debugmsg("varidx print", LOGLEVEL_PRINT);
-
if (is_of_type(c, print_tree)) {
c.s << std::string(level, ' ') << class_name()
void spinidx::print(const print_context & c, unsigned level) const
{
- debugmsg("spinidx print", LOGLEVEL_PRINT);
-
if (is_of_type(c, print_tree)) {
c.s << std::string(level, ' ') << class_name()
#include "print.h"
#include "archive.h"
#include "utils.h"
-#include "debugmsg.h"
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(indexed, exprseq)
//////////
-// default constructor, destructor, copy constructor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
indexed::indexed() : symtree(sy_none())
{
- debugmsg("indexed default constructor", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_indexed;
}
indexed::indexed(const ex & b) : inherited(b), symtree(sy_none())
{
- debugmsg("indexed constructor from ex", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_indexed;
validate();
}
indexed::indexed(const ex & b, const ex & i1) : inherited(b, i1), symtree(sy_none())
{
- debugmsg("indexed constructor from ex,ex", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_indexed;
validate();
}
indexed::indexed(const ex & b, const ex & i1, const ex & i2) : inherited(b, i1, i2), symtree(sy_none())
{
- debugmsg("indexed constructor from ex,ex,ex", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_indexed;
validate();
}
indexed::indexed(const ex & b, const ex & i1, const ex & i2, const ex & i3) : inherited(b, i1, i2, i3), symtree(sy_none())
{
- debugmsg("indexed constructor from ex,ex,ex,ex", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_indexed;
validate();
}
indexed::indexed(const ex & b, const ex & i1, const ex & i2, const ex & i3, const ex & i4) : inherited(b, i1, i2, i3, i4), symtree(sy_none())
{
- debugmsg("indexed constructor from ex,ex,ex,ex,ex", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_indexed;
validate();
}
indexed::indexed(const ex & b, const symmetry & symm, const ex & i1, const ex & i2) : inherited(b, i1, i2), symtree(symm)
{
- debugmsg("indexed constructor from ex,symmetry,ex,ex", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_indexed;
validate();
}
indexed::indexed(const ex & b, const symmetry & symm, const ex & i1, const ex & i2, const ex & i3) : inherited(b, i1, i2, i3), symtree(symm)
{
- debugmsg("indexed constructor from ex,symmetry,ex,ex,ex", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_indexed;
validate();
}
indexed::indexed(const ex & b, const symmetry & symm, const ex & i1, const ex & i2, const ex & i3, const ex & i4) : inherited(b, i1, i2, i3, i4), symtree(symm)
{
- debugmsg("indexed constructor from ex,symmetry,ex,ex,ex,ex", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_indexed;
validate();
}
indexed::indexed(const ex & b, const exvector & v) : inherited(b), symtree(sy_none())
{
- debugmsg("indexed constructor from ex,exvector", LOGLEVEL_CONSTRUCT);
seq.insert(seq.end(), v.begin(), v.end());
tinfo_key = TINFO_indexed;
validate();
indexed::indexed(const ex & b, const symmetry & symm, const exvector & v) : inherited(b), symtree(symm)
{
- debugmsg("indexed constructor from ex,symmetry,exvector", LOGLEVEL_CONSTRUCT);
seq.insert(seq.end(), v.begin(), v.end());
tinfo_key = TINFO_indexed;
validate();
indexed::indexed(const symmetry & symm, const exprseq & es) : inherited(es), symtree(symm)
{
- debugmsg("indexed constructor from symmetry,exprseq", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_indexed;
}
indexed::indexed(const symmetry & symm, const exvector & v, bool discardable) : inherited(v, discardable), symtree(symm)
{
- debugmsg("indexed constructor from symmetry,exvector", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_indexed;
}
indexed::indexed(const symmetry & symm, exvector * vp) : inherited(vp), symtree(symm)
{
- debugmsg("indexed constructor from symmetry,exvector *", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_indexed;
}
indexed::indexed(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("indexed constructor from archive_node", LOGLEVEL_CONSTRUCT);
if (!n.find_ex("symmetry", symtree, sym_lst)) {
// GiNaC versions <= 0.9.0 had an unsigned "symmetry" property
unsigned symm = 0;
void indexed::print(const print_context & c, unsigned level) const
{
- debugmsg("indexed print", LOGLEVEL_PRINT);
GINAC_ASSERT(seq.size() > 0);
if (is_of_type(c, print_tree)) {
#include "print.h"
#include "archive.h"
#include "utils.h"
-#include "debugmsg.h"
namespace GiNaC {
/** Default ctor. Initializes to 1 x 1-dimensional zero-matrix. */
matrix::matrix() : inherited(TINFO_matrix), row(1), col(1)
{
- debugmsg("matrix default ctor",LOGLEVEL_CONSTRUCT);
m.push_back(_ex0);
}
matrix::matrix(unsigned r, unsigned c)
: inherited(TINFO_matrix), row(r), col(c)
{
- debugmsg("matrix ctor from unsigned,unsigned",LOGLEVEL_CONSTRUCT);
m.resize(r*c, _ex0);
}
/** Ctor from representation, for internal use only. */
matrix::matrix(unsigned r, unsigned c, const exvector & m2)
- : inherited(TINFO_matrix), row(r), col(c), m(m2)
-{
- debugmsg("matrix ctor from unsigned,unsigned,exvector",LOGLEVEL_CONSTRUCT);
-}
+ : inherited(TINFO_matrix), row(r), col(c), m(m2) {}
/** Construct matrix from (flat) list of elements. If the list has fewer
* elements than the matrix, the remaining matrix elements are set to zero.
matrix::matrix(unsigned r, unsigned c, const lst & l)
: inherited(TINFO_matrix), row(r), col(c)
{
- debugmsg("matrix ctor from unsigned,unsigned,lst",LOGLEVEL_CONSTRUCT);
m.resize(r*c, _ex0);
for (unsigned i=0; i<l.nops(); i++) {
matrix::matrix(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("matrix ctor from archive_node", LOGLEVEL_CONSTRUCT);
if (!(n.find_unsigned("row", row)) || !(n.find_unsigned("col", col)))
throw (std::runtime_error("unknown matrix dimensions in archive"));
m.reserve(row * col);
void matrix::print(const print_context & c, unsigned level) const
{
- debugmsg("matrix print", LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
inherited::print(c, level);
/** Evaluate matrix entry by entry. */
ex matrix::eval(int level) const
{
- debugmsg("matrix eval",LOGLEVEL_MEMBER_FUNCTION);
-
// check if we have to do anything at all
if ((level==1)&&(flags & status_flags::evaluated))
return *this;
#include "power.h"
#include "matrix.h"
#include "archive.h"
-#include "debugmsg.h"
#include "utils.h"
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(mul, expairseq)
//////////
-// default ctor, dctor, copy ctor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
mul::mul()
{
- debugmsg("mul default ctor",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
}
mul::mul(const ex & lh, const ex & rh)
{
- debugmsg("mul ctor from ex,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
overall_coeff = _ex1;
construct_from_2_ex(lh,rh);
mul::mul(const exvector & v)
{
- debugmsg("mul ctor from exvector",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
overall_coeff = _ex1;
construct_from_exvector(v);
mul::mul(const epvector & v)
{
- debugmsg("mul ctor from epvector",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
overall_coeff = _ex1;
construct_from_epvector(v);
mul::mul(const epvector & v, const ex & oc)
{
- debugmsg("mul ctor from epvector,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
overall_coeff = oc;
construct_from_epvector(v);
mul::mul(epvector * vp, const ex & oc)
{
- debugmsg("mul ctor from epvector *,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
GINAC_ASSERT(vp!=0);
overall_coeff = oc;
mul::mul(const ex & lh, const ex & mh, const ex & rh)
{
- debugmsg("mul ctor from ex,ex,ex",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_mul;
exvector factors;
factors.reserve(3);
void mul::print(const print_context & c, unsigned level) const
{
- debugmsg("mul print", LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
inherited::print(c, level);
* @param level cut-off in recursive evaluation */
ex mul::eval(int level) const
{
- debugmsg("mul eval",LOGLEVEL_MEMBER_FUNCTION);
-
epvector *evaled_seqp = evalchildren(level);
if (evaled_seqp) {
// do more evaluation later
#include "matrix.h"
#include "print.h"
#include "archive.h"
-#include "debugmsg.h"
#include "utils.h"
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(ncmul, exprseq)
//////////
-// default constructor, destructor, copy constructor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
ncmul::ncmul()
{
- debugmsg("ncmul default constructor",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_ncmul;
}
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(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(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(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(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(const exvector & v, bool discardable) : inherited(v,discardable)
{
- debugmsg("ncmul constructor from exvector,bool",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_ncmul;
}
ncmul::ncmul(exvector * vp) : inherited(vp)
{
- debugmsg("ncmul constructor from exvector *",LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_ncmul;
}
void ncmul::print(const print_context & c, unsigned level) const
{
- debugmsg("ncmul print", LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
inherited::print(c, level);
#include "ex.h"
#include "print.h"
#include "archive.h"
-#include "debugmsg.h"
#include "tostring.h"
#include "utils.h"
GINAC_IMPLEMENT_REGISTERED_CLASS(numeric, basic)
//////////
-// default ctor, dtor, copy ctor assignment
-// operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
/** default ctor. Numerically it initializes to an integer zero. */
numeric::numeric() : basic(TINFO_numeric)
{
- debugmsg("numeric default ctor", LOGLEVEL_CONSTRUCT);
value = cln::cl_I(0);
setflag(status_flags::evaluated | status_flags::expanded);
}
numeric::numeric(int i) : basic(TINFO_numeric)
{
- debugmsg("numeric ctor from int",LOGLEVEL_CONSTRUCT);
// Not the whole int-range is available if we don't cast to long
// first. This is due to the behaviour of the cl_I-ctor, which
// emphasizes efficiency. However, if the integer is small enough,
numeric::numeric(unsigned int i) : basic(TINFO_numeric)
{
- debugmsg("numeric ctor from uint",LOGLEVEL_CONSTRUCT);
// Not the whole uint-range is available if we don't cast to ulong
// first. This is due to the behaviour of the cl_I-ctor, which
// emphasizes efficiency. However, if the integer is small enough,
numeric::numeric(long i) : basic(TINFO_numeric)
{
- debugmsg("numeric ctor from long",LOGLEVEL_CONSTRUCT);
value = cln::cl_I(i);
setflag(status_flags::evaluated | status_flags::expanded);
}
numeric::numeric(unsigned long i) : basic(TINFO_numeric)
{
- debugmsg("numeric ctor from ulong",LOGLEVEL_CONSTRUCT);
value = cln::cl_I(i);
setflag(status_flags::evaluated | status_flags::expanded);
}
* @exception overflow_error (division by zero) */
numeric::numeric(long numer, long denom) : basic(TINFO_numeric)
{
- debugmsg("numeric ctor from long/long",LOGLEVEL_CONSTRUCT);
if (!denom)
throw std::overflow_error("division by zero");
value = cln::cl_I(numer) / cln::cl_I(denom);
numeric::numeric(double d) : basic(TINFO_numeric)
{
- debugmsg("numeric ctor from double",LOGLEVEL_CONSTRUCT);
// We really want to explicitly use the type cl_LF instead of the
// more general cl_F, since that would give us a cl_DF only which
// will not be promoted to cl_LF if overflow occurs:
* notation like "2+5*I". */
numeric::numeric(const char *s) : basic(TINFO_numeric)
{
- debugmsg("numeric ctor from string",LOGLEVEL_CONSTRUCT);
cln::cl_N ctorval = 0;
// parse complex numbers (functional but not completely safe, unfortunately
// std::string does not understand regexpese):
* only. */
numeric::numeric(const cln::cl_N &z) : basic(TINFO_numeric)
{
- debugmsg("numeric ctor from cl_N", LOGLEVEL_CONSTRUCT);
value = z;
setflag(status_flags::evaluated | status_flags::expanded);
}
numeric::numeric(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("numeric ctor from archive_node", LOGLEVEL_CONSTRUCT);
cln::cl_N ctorval = 0;
// Read number as string
* @see print_real_number() */
void numeric::print(const print_context & c, unsigned level) const
{
- debugmsg("numeric print", LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
c.s << std::string(level, ' ') << cln::the<cln::cl_N>(value)
/** Append global Digits object to ostream. */
void _numeric_digits::print(std::ostream &os) const
{
- debugmsg("_numeric_digits print", LOGLEVEL_PRINT);
os << digits;
}
#include "ncmul.h"
#include "relational.h"
#include "print.h"
-#include "debugmsg.h"
#include "utils.h"
namespace GiNaC {
const ex operator+(const ex & lh, const ex & rh)
{
- debugmsg("operator+(ex,ex)",LOGLEVEL_OPERATOR);
return exadd(lh, rh);
}
const ex operator-(const ex & lh, const ex & rh)
{
- debugmsg("operator-(ex,ex)",LOGLEVEL_OPERATOR);
return exadd(lh, exminus(rh));
}
const ex operator*(const ex & lh, const ex & rh)
{
- debugmsg("operator*(ex,ex)",LOGLEVEL_OPERATOR);
return exmul(lh, rh);
}
const ex operator/(const ex & lh, const ex & rh)
{
- debugmsg("operator/(ex,ex)",LOGLEVEL_OPERATOR);
return exmul(lh, power(rh,_ex_1));
}
const numeric operator+(const numeric & lh, const numeric & rh)
{
- debugmsg("operator+(numeric,numeric)",LOGLEVEL_OPERATOR);
return lh.add(rh);
}
const numeric operator-(const numeric & lh, const numeric & rh)
{
- debugmsg("operator-(numeric,numeric)",LOGLEVEL_OPERATOR);
return lh.sub(rh);
}
const numeric operator*(const numeric & lh, const numeric & rh)
{
- debugmsg("operator*(numeric,numeric)",LOGLEVEL_OPERATOR);
return lh.mul(rh);
}
const numeric operator/(const numeric & lh, const numeric & rh)
{
- debugmsg("operator/(numeric,ex)",LOGLEVEL_OPERATOR);
return lh.div(rh);
}
ex & operator+=(ex & lh, const ex & rh)
{
- debugmsg("operator+=(ex,ex)",LOGLEVEL_OPERATOR);
return lh = exadd(lh, rh);
}
ex & operator-=(ex & lh, const ex & rh)
{
- debugmsg("operator-=(ex,ex)",LOGLEVEL_OPERATOR);
return lh = exadd(lh, exminus(rh));
}
ex & operator*=(ex & lh, const ex & rh)
{
- debugmsg("operator*=(ex,ex)",LOGLEVEL_OPERATOR);
return lh = exmul(lh, rh);
}
ex & operator/=(ex & lh, const ex & rh)
{
- debugmsg("operator/=(ex,ex)",LOGLEVEL_OPERATOR);
return lh = exmul(lh, power(rh,_ex_1));
}
numeric & operator+=(numeric & lh, const numeric & rh)
{
- debugmsg("operator+=(numeric,numeric)",LOGLEVEL_OPERATOR);
lh = lh.add(rh);
return lh;
}
numeric & operator-=(numeric & lh, const numeric & rh)
{
- debugmsg("operator-=(numeric,numeric)",LOGLEVEL_OPERATOR);
lh = lh.sub(rh);
return lh;
}
numeric & operator*=(numeric & lh, const numeric & rh)
{
- debugmsg("operator*=(numeric,numeric)",LOGLEVEL_OPERATOR);
lh = lh.mul(rh);
return lh;
}
numeric & operator/=(numeric & lh, const numeric & rh)
{
- debugmsg("operator/=(numeric,numeric)",LOGLEVEL_OPERATOR);
lh = lh.div(rh);
return lh;
}
const ex operator+(const ex & lh)
{
- debugmsg("operator+(ex)",LOGLEVEL_OPERATOR);
return lh;
}
const ex operator-(const ex & lh)
{
- debugmsg("operator-(ex)",LOGLEVEL_OPERATOR);
return exminus(lh);
}
const numeric operator+(const numeric & lh)
{
- debugmsg("operator+(numeric)",LOGLEVEL_OPERATOR);
return lh;
}
const numeric operator-(const numeric & lh)
{
- debugmsg("operator-(numeric)",LOGLEVEL_OPERATOR);
return _num_1.mul(lh);
}
/** Expression prefix increment. Adds 1 and returns incremented ex. */
ex & operator++(ex & rh)
{
- debugmsg("operator++(ex)",LOGLEVEL_OPERATOR);
return rh = exadd(rh, _ex1);
}
/** Expression prefix decrement. Subtracts 1 and returns decremented ex. */
ex & operator--(ex & rh)
{
- debugmsg("operator--(ex)",LOGLEVEL_OPERATOR);
return rh = exadd(rh, _ex_1);
}
* incremented by 1. */
const ex operator++(ex & lh, int)
{
- debugmsg("operator++(ex,int)",LOGLEVEL_OPERATOR);
ex tmp(lh);
lh = exadd(lh, _ex1);
return tmp;
* decremented by 1. */
const ex operator--(ex & lh, int)
{
- debugmsg("operator--(ex,int)",LOGLEVEL_OPERATOR);
ex tmp(lh);
lh = exadd(lh, _ex_1);
return tmp;
/** Numeric prefix increment. Adds 1 and returns incremented number. */
numeric& operator++(numeric & rh)
{
- debugmsg("operator++(numeric)",LOGLEVEL_OPERATOR);
rh = rh.add(_num1);
return rh;
}
/** Numeric prefix decrement. Subtracts 1 and returns decremented number. */
numeric& operator--(numeric & rh)
{
- debugmsg("operator--(numeric)",LOGLEVEL_OPERATOR);
rh = rh.add(_num_1);
return rh;
}
* incremented by 1. */
const numeric operator++(numeric & lh, int)
{
- debugmsg("operator++(numeric,int)",LOGLEVEL_OPERATOR);
numeric tmp(lh);
lh = lh.add(_num1);
return tmp;
* decremented by 1. */
const numeric operator--(numeric & lh, int)
{
- debugmsg("operator--(numeric,int)",LOGLEVEL_OPERATOR);
numeric tmp(lh);
lh = lh.add(_num_1);
return tmp;
const relational operator==(const ex & lh, const ex & rh)
{
- debugmsg("operator==(ex,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::equal);
}
const relational operator!=(const ex & lh, const ex & rh)
{
- debugmsg("operator!=(ex,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::not_equal);
}
const relational operator<(const ex & lh, const ex & rh)
{
- debugmsg("operator<(ex,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::less);
}
const relational operator<=(const ex & lh, const ex & rh)
{
- debugmsg("operator<=(ex,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::less_or_equal);
}
const relational operator>(const ex & lh, const ex & rh)
{
- debugmsg("operator>(ex,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::greater);
}
const relational operator>=(const ex & lh, const ex & rh)
{
- debugmsg("operator>=(ex,ex)",LOGLEVEL_OPERATOR);
return relational(lh,rh,relational::greater_or_equal);
}
#include "symbol.h"
#include "print.h"
#include "archive.h"
-#include "debugmsg.h"
#include "utils.h"
namespace GiNaC {
typedef std::vector<int> intvector;
//////////
-// default ctor, dtor, copy ctor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
-power::power() : inherited(TINFO_power)
-{
- debugmsg("power default ctor",LOGLEVEL_CONSTRUCT);
-}
+power::power() : inherited(TINFO_power) { }
void power::copy(const power & other)
{
power::power(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("power ctor from archive_node", LOGLEVEL_CONSTRUCT);
n.find_ex("basis", basis, sym_lst);
n.find_ex("exponent", exponent, sym_lst);
}
void power::print(const print_context & c, unsigned level) const
{
- debugmsg("power print", LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
inherited::print(c, level);
* @param level cut-off in recursive evaluation */
ex power::eval(int level) const
{
- debugmsg("power eval",LOGLEVEL_MEMBER_FUNCTION);
-
if ((level==1) && (flags & status_flags::evaluated))
return *this;
else if (level == -max_recursion_level)
ex power::evalf(int level) const
{
- debugmsg("power evalf",LOGLEVEL_MEMBER_FUNCTION);
-
ex ebasis;
ex eexponent;
throw(std::runtime_error("max recursion level reached"));
} else {
ebasis = basis.evalf(level-1);
- if (!is_ex_exactly_of_type(exponent,numeric))
+ if (!is_exactly_a<numeric>(exponent))
eexponent = exponent.evalf(level-1);
else
eexponent = exponent;
#include "print.h"
#include "archive.h"
#include "utils.h"
-#include "debugmsg.h"
namespace GiNaC {
* Default ctor, dtor, copy ctor, assignment operator and helpers
*/
-pseries::pseries() : basic(TINFO_pseries)
-{
- debugmsg("pseries default ctor", LOGLEVEL_CONSTRUCT);
-}
+pseries::pseries() : inherited(TINFO_pseries) { }
void pseries::copy(const pseries &other)
{
* @return newly constructed pseries */
pseries::pseries(const ex &rel_, const epvector &ops_) : basic(TINFO_pseries), seq(ops_)
{
- debugmsg("pseries ctor from ex,epvector", LOGLEVEL_CONSTRUCT);
GINAC_ASSERT(is_exactly_a<relational>(rel_));
GINAC_ASSERT(is_exactly_a<symbol>(rel_.lhs()));
point = rel_.rhs();
pseries::pseries(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("pseries ctor from archive_node", LOGLEVEL_CONSTRUCT);
for (unsigned int i=0; true; ++i) {
ex rest;
ex coeff;
void pseries::print(const print_context & c, unsigned level) const
{
- debugmsg("pseries print", LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
c.s << std::string(level, ' ') << class_name()
GINAC_DECLARE_REGISTERED_CLASS_NO_CTORS(classname, supername) \
public: \
classname(); \
- ~classname() { /*debugmsg(#classname " dtor", LOGLEVEL_DESTRUCT);*/ destroy(false); } \
+ ~classname() { destroy(false); } \
classname(const classname & other); \
const classname & operator=(const classname & other); \
basic * duplicate() const; \
* from 'basic' (such as the assignment operator). */
#define GINAC_IMPLEMENT_REGISTERED_CLASS(classname, supername) \
GINAC_IMPLEMENT_REGISTERED_CLASS_NO_CTORS(classname, supername) \
-classname::classname(const classname & other) \
-{ \
- /*debugmsg(#classname " copy ctor", LOGLEVEL_CONSTRUCT);*/ \
- copy(other); \
-} \
+classname::classname(const classname & other) { copy(other); } \
const classname & classname::operator=(const classname & other) \
{ \
- /*debugmsg(#classname " operator=", LOGLEVEL_ASSIGNMENT);*/ \
if (this != &other) { \
destroy(true); \
copy(other); \
return *this; \
} \
basic * classname::duplicate() const { \
- /*debugmsg(#classname " duplicate", LOGLEVEL_DUPLICATE);*/ \
return new classname(*this); \
}
#include "print.h"
#include "archive.h"
#include "utils.h"
-#include "debugmsg.h"
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(relational, basic)
//////////
-// default ctor, dtor, copy ctor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
-relational::relational() : basic(TINFO_relational)
-{
- debugmsg("relational default ctor",LOGLEVEL_CONSTRUCT);
-}
+relational::relational() : basic(TINFO_relational) {}
void relational::copy(const relational & other)
{
// public
-relational::relational(const ex & lhs, const ex & rhs, operators oper) : basic(TINFO_relational)
-{
- debugmsg("relational ctor ex,ex,operator",LOGLEVEL_CONSTRUCT);
- lh=lhs;
- rh=rhs;
- o=oper;
-}
+relational::relational(const ex & lhs, const ex & rhs, operators oper) : basic(TINFO_relational), lh(lhs), rh(rhs), o(oper) {}
//////////
// archiving
relational::relational(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("relational ctor from archive_node", LOGLEVEL_CONSTRUCT);
unsigned int opi;
if (!(n.find_unsigned("op", opi)))
throw (std::runtime_error("unknown relational operator in archive"));
void relational::print(const print_context & c, unsigned level) const
{
- debugmsg("relational print",LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
inherited::print(c, level);
#include "structure.h"
#include "archive.h"
-#include "debugmsg.h"
#include "utils.h"
#include "print.h"
GINAC_IMPLEMENT_REGISTERED_CLASS(structure, basic)
//////////
-// default ctor, dtor, copy ctor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
DEFAULT_CTORS(structure)
void structure::print(const print_context & c, unsigned level) const
{
- debugmsg("structure print",LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
c.s << std::string(level, ' ') << class_name()
{
// member functions
- // default ctor, dtor, copy ctor assignment operator and helpers
+ // default ctor, dtor, copy ctor, assignment operator and helpers
public:
${STRUCTURE}();
~${STRUCTURE}();
${STRUCTURE}::${STRUCTURE}()
{
- debugmsg("${STRUCTURE} default ctor",LOGLEVEL_CONSTRUCT);
tinfo_key=tinfo_${STRUCTURE};
}
${STRUCTURE}::~${STRUCTURE}()
{
- debugmsg("${STRUCTURE} destructor",LOGLEVEL_DESTRUCT);
destroy(false);
}
${STRUCTURE}::${STRUCTURE}(${STRUCTURE} const & other)
{
- debugmsg("${STRUCTURE} copy ctor",LOGLEVEL_CONSTRUCT);
copy(other);
}
${STRUCTURE} const & ${STRUCTURE}::operator=(${STRUCTURE} const & other)
{
- debugmsg("${STRUCTURE} operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
destroy(true);
copy(other);
${STRUCTURE}::${STRUCTURE}(${constructor_arglist})
: ${constructor_statements}
{
- debugmsg("${STRUCTURE} ctor from children", LOGLEVEL_CONSTRUCT);
tinfo_key=tinfo_${STRUCTURE};
}
basic * ${STRUCTURE}::duplicate() const
{
- debugmsg("${STRUCTURE} duplicate",LOGLEVEL_DUPLICATE);
return new ${STRUCTURE}(*this);
}
void ${STRUCTURE}::print(const print_context & c, unsigned level) const
{
- debugmsg("${STRUCTURE} print", LOGLEVEL_PRINT);
c.s << class_name() << "()";
}
#include "lst.h"
#include "print.h"
#include "archive.h"
-#include "debugmsg.h"
#include "tostring.h"
#include "utils.h"
GINAC_IMPLEMENT_REGISTERED_CLASS_NO_CTORS(symbol, basic)
//////////
-// default ctor, dtor, copy ctor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
symbol::symbol() : inherited(TINFO_symbol), serial(next_serial++)
{
- debugmsg("symbol default ctor", LOGLEVEL_CONSTRUCT);
name = TeX_name = autoname_prefix()+ToString(serial);
asexinfop = new assigned_ex_info;
setflag(status_flags::evaluated | status_flags::expanded);
symbol::symbol(const symbol & other)
{
- debugmsg("symbol copy ctor", LOGLEVEL_CONSTRUCT);
copy(other);
}
symbol::symbol(const std::string & initname) : inherited(TINFO_symbol)
{
- debugmsg("symbol ctor from string", LOGLEVEL_CONSTRUCT);
name = initname;
TeX_name = default_TeX_name();
serial = next_serial++;
symbol::symbol(const std::string & initname, const std::string & texname) : inherited(TINFO_symbol)
{
- debugmsg("symbol ctor from string", LOGLEVEL_CONSTRUCT);
name = initname;
TeX_name = texname;
serial = next_serial++;
/** Construct object from archive_node. */
symbol::symbol(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("symbol ctor from archive_node", LOGLEVEL_CONSTRUCT);
serial = next_serial++;
if (!(n.find_string("name", name)))
name = autoname_prefix() + ToString(serial);
basic *symbol::duplicate() const
{
- debugmsg("symbol duplicate", LOGLEVEL_DUPLICATE);
return new symbol(*this);
}
void symbol::print(const print_context & c, unsigned level) const
{
- debugmsg("symbol print", LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
c.s << std::string(level, ' ') << name << " (" << class_name() << ")"
// member functions
- // default ctor, dtor, copy ctor assignment operator and helpers
+ // default ctor, dtor, copy ctor, assignment operator and helpers
public:
symbol();
- ~symbol()
- {
- /*debugmsg("symbol dtor", LOGLEVEL_DESTRUCT);*/
- destroy(false);
- }
+ ~symbol() { destroy(false); }
symbol(const symbol & other);
protected:
void copy(const symbol & other);
#include "print.h"
#include "archive.h"
#include "utils.h"
-#include "debugmsg.h"
namespace GiNaC {
*/
//////////
-// default constructor, destructor, copy constructor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
symmetry::symmetry() : type(none)
{
- debugmsg("symmetry default constructor", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_symmetry;
}
symmetry::symmetry(unsigned i) : type(none)
{
- debugmsg("symmetry constructor from unsigned", LOGLEVEL_CONSTRUCT);
indices.insert(i);
tinfo_key = TINFO_symmetry;
}
symmetry::symmetry(symmetry_type t, const symmetry &c1, const symmetry &c2) : type(t)
{
- debugmsg("symmetry constructor from symmetry_type,symmetry &,symmetry &", LOGLEVEL_CONSTRUCT);
add(c1); add(c2);
tinfo_key = TINFO_symmetry;
}
/** Construct object from archive_node. */
symmetry::symmetry(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("symmetry ctor from archive_node", LOGLEVEL_CONSTRUCT);
-
unsigned t;
if (!(n.find_unsigned("type", t)))
throw (std::runtime_error("unknown symmetry type in archive"));
void symmetry::print(const print_context & c, unsigned level) const
{
- debugmsg("symmetry print", LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
c.s << std::string(level, ' ') << class_name()
#include "print.h"
#include "archive.h"
#include "utils.h"
-#include "debugmsg.h"
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(tensepsilon, tensor)
//////////
-// default constructor, destructor, copy constructor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
-tensor::tensor(unsigned ti) : inherited(ti)
-{
- debugmsg("tensor constructor from unsigned", LOGLEVEL_CONSTRUCT); \
-}
-
DEFAULT_CTORS(tensor)
DEFAULT_CTORS(tensdelta)
DEFAULT_CTORS(tensmetric)
minkmetric::minkmetric() : pos_sig(false)
{
- debugmsg("minkmetric default constructor", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_minkmetric;
}
spinmetric::spinmetric()
{
- debugmsg("spinmetric default constructor", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_spinmetric;
}
minkmetric::minkmetric(bool ps) : pos_sig(ps)
{
- debugmsg("minkmetric constructor from bool", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_minkmetric;
}
tensepsilon::tensepsilon() : minkowski(false), pos_sig(false)
{
- debugmsg("tensepsilon default constructor", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_tensepsilon;
}
tensepsilon::tensepsilon(bool mink, bool ps) : minkowski(mink), pos_sig(ps)
{
- debugmsg("tensepsilon constructor from bool,bool", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_tensepsilon;
}
minkmetric::minkmetric(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("minkmetric constructor from archive_node", LOGLEVEL_CONSTRUCT);
n.find_bool("pos_sig", pos_sig);
}
tensepsilon::tensepsilon(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("tensepsilon constructor from archive_node", LOGLEVEL_CONSTRUCT);
n.find_bool("minkowski", minkowski);
n.find_bool("pos_sig", pos_sig);
}
// other constructors
protected:
- tensor(unsigned ti);
+ tensor(unsigned ti) : inherited(ti) {}
// functions overriding virtual functions from base classes
protected:
// member functions
- // default ctor, dtor, copy ctor assignment operator and helpers
+ // default ctor, dtor, copy ctor, assignment operator and helpers
// none
// other ctors
//////////
-// default ctor, dtor, copy ctor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
// public
}
#define DEFAULT_CTORS(classname) \
-classname::classname() : inherited(TINFO_##classname) \
-{ \
- debugmsg(#classname " default constructor", LOGLEVEL_CONSTRUCT); \
-} \
+classname::classname() : inherited(TINFO_##classname) {} \
DEFAULT_COPY(classname) \
DEFAULT_DESTROY(classname)
}
#define DEFAULT_ARCHIVING(classname) \
-classname::classname(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst) \
-{ \
- debugmsg(#classname " constructor from archive_node", LOGLEVEL_CONSTRUCT); \
-} \
+classname::classname(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst) {} \
DEFAULT_UNARCHIVE(classname) \
void classname::archive(archive_node &n) const \
{ \
#define DEFAULT_PRINT(classname, text) \
void classname::print(const print_context & c, unsigned level) const \
{ \
- debugmsg(#classname " print", LOGLEVEL_PRINT); \
if (is_a<print_tree>(c)) \
inherited::print(c, level); \
else \
#define DEFAULT_PRINT_LATEX(classname, text, latex) \
void classname::print(const print_context & c, unsigned level) const \
{ \
- debugmsg(#classname " print", LOGLEVEL_PRINT); \
if (is_a<print_tree>(c)) \
inherited::print(c, level); \
else if (is_a<print_latex>(c)) \
#include "print.h"
#include "archive.h"
#include "utils.h"
-#include "debugmsg.h"
namespace GiNaC {
GINAC_IMPLEMENT_REGISTERED_CLASS(wildcard, basic)
//////////
-// default constructor, destructor, copy constructor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
//////////
wildcard::wildcard() : label(0)
{
- debugmsg("wildcard default constructor", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_wildcard;
}
wildcard::wildcard(unsigned l) : label(l)
{
- debugmsg("wildcard constructor from unsigned", LOGLEVEL_CONSTRUCT);
tinfo_key = TINFO_wildcard;
}
wildcard::wildcard(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
- debugmsg("wildcard constructor from archive_node", LOGLEVEL_CONSTRUCT);
n.find_unsigned("label", label);
}
void wildcard::print(const print_context & c, unsigned level) const
{
- debugmsg("wildcard print", LOGLEVEL_PRINT);
-
if (is_a<print_tree>(c)) {
c.s << std::string(level, ' ') << class_name() << " (" << label << ")"
<< std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec