*
* 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
*
* 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
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-// default constructor, destructor, copy constructor assignment operator and helpers
+// default ctor, dtor, copy ctor, assignment operator and helpers
idx::idx(const ex & v, const ex & d) : inherited(TINFO_idx), value(v), dim(d)
{
idx::idx(const ex & v, const ex & d) : inherited(TINFO_idx), value(v), dim(d)
{
if (is_dim_numeric())
if (!dim.info(info_flags::posint))
throw(std::invalid_argument("dimension of space must be a positive integer"));
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)
{
varidx::varidx(const ex & v, const ex & d, bool cov) : inherited(v, d), covariant(cov)
{
tinfo_key = TINFO_varidx;
}
spinidx::spinidx(const ex & v, const ex & d, bool cov, bool dot) : inherited(v, d, cov), dotted(dot)
{
tinfo_key = TINFO_varidx;
}
spinidx::spinidx(const ex & v, const ex & d, bool cov, bool dot) : inherited(v, d, cov), dotted(dot)
{
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)
{
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)
{
n.find_bool("covariant", covariant);
}
spinidx::spinidx(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
n.find_bool("covariant", covariant);
}
spinidx::spinidx(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
{
if (is_of_type(c, print_tree)) {
c.s << std::string(level, ' ') << class_name()
if (is_of_type(c, print_tree)) {
c.s << std::string(level, ' ') << class_name()
if (is_of_type(c, print_tree)) {
c.s << std::string(level, ' ') << class_name()
if (is_of_type(c, print_tree)) {
c.s << std::string(level, ' ') << class_name()
if (is_of_type(c, print_tree)) {
c.s << std::string(level, ' ') << class_name()
if (is_of_type(c, print_tree)) {
c.s << std::string(level, ' ') << class_name()
* must be such that dummy indices lie next to each other. */
int idx::compare_same_type(const basic & other) const
{
* must be such that dummy indices lie next to each other. */
int idx::compare_same_type(const basic & other) const
{
const varidx &o = static_cast<const varidx &>(other);
int cmpval = inherited::compare_same_type(other);
const varidx &o = static_cast<const varidx &>(other);
int cmpval = inherited::compare_same_type(other);
const spinidx &o = static_cast<const spinidx &>(other);
// Check dottedness first so dummy indices will end up next to each other
const spinidx &o = static_cast<const spinidx &>(other);
// Check dottedness first so dummy indices will end up next to each other
// Substitution index->index
if (is_ex_of_type(lr.op(i), idx))
// Substitution index->index
if (is_ex_of_type(lr.op(i), idx))