#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()