// other constructors
//////////
-indexed::indexed(const ex & b) : inherited(b), symtree(not_symmetric())
+indexed::indexed(const ex & b) : inherited{b}, symtree(not_symmetric())
{
validate();
}
-indexed::indexed(const ex & b, const ex & i1) : inherited(b, i1), symtree(not_symmetric())
+indexed::indexed(const ex & b, const ex & i1) : inherited{b, i1}, symtree(not_symmetric())
{
validate();
}
-indexed::indexed(const ex & b, const ex & i1, const ex & i2) : inherited(b, i1, i2), symtree(not_symmetric())
+indexed::indexed(const ex & b, const ex & i1, const ex & i2) : inherited{b, i1, i2}, symtree(not_symmetric())
{
validate();
}
-indexed::indexed(const ex & b, const ex & i1, const ex & i2, const ex & i3) : inherited(b, i1, i2, i3), symtree(not_symmetric())
+indexed::indexed(const ex & b, const ex & i1, const ex & i2, const ex & i3) : inherited{b, i1, i2, i3}, symtree(not_symmetric())
{
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(not_symmetric())
+indexed::indexed(const ex & b, const ex & i1, const ex & i2, const ex & i3, const ex & i4) : inherited{b, i1, i2, i3, i4}, symtree(not_symmetric())
{
validate();
}
-indexed::indexed(const ex & b, const symmetry & symm, const ex & i1, const ex & i2) : inherited(b, i1, i2), symtree(symm)
+indexed::indexed(const ex & b, const symmetry & symm, const ex & i1, const ex & i2) : inherited{b, i1, i2}, symtree(symm)
{
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)
+indexed::indexed(const ex & b, const symmetry & symm, const ex & i1, const ex & i2, const ex & i3) : inherited{b, i1, i2, i3}, symtree(symm)
{
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)
+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)
{
validate();
}
-indexed::indexed(const ex & b, const exvector & v) : inherited(b), symtree(not_symmetric())
+indexed::indexed(const ex & b, const exvector & v) : inherited{b}, symtree(not_symmetric())
{
seq.insert(seq.end(), v.begin(), v.end());
validate();
}
-indexed::indexed(const ex & b, const symmetry & symm, const exvector & v) : inherited(b), symtree(symm)
+indexed::indexed(const ex & b, const symmetry & symm, const exvector & v) : inherited{b}, symtree(symm)
{
seq.insert(seq.end(), v.begin(), v.end());
validate();
/*
* N.B. we don't want to use
*
- * e = e.subs(lst(
+ * e = e.subs(lst{
* *it2 == ex_to<varidx>(*it2).toggle_variance(),
* ex_to<varidx>(*it2).toggle_variance() == *it2
- * ), subs_options::no_pattern);
+ * }, subs_options::no_pattern);
*
* since this can trigger non-trivial repositioning of indices,
* e.g. due to non-trivial symmetry properties of e, thus
}
// Add all resulting terms
- ex sum_symm = (new add(result))->setflag(status_flags::dynallocated);
+ ex sum_symm = dynallocate<add>(result);
if (sum_symm.is_zero())
free_indices.clear();
return sum_symm;
exvector common_indices;
set_intersection(va.begin(), va.end(), vb.begin(), vb.end(), std::back_insert_iterator<exvector>(common_indices), ex_is_less());
if (common_indices.empty()) {
- return lst(lst(), lst());
+ return lst{lst{}, lst{}};
} else {
exvector new_indices, old_indices;
old_indices.reserve(2*common_indices.size());
new_indices.reserve(2*common_indices.size());
exvector::const_iterator ip = common_indices.begin(), ipend = common_indices.end();
while (ip != ipend) {
- ex newsym=(new symbol)->setflag(status_flags::dynallocated);
+ ex newsym = dynallocate<symbol>();
ex newidx;
if(is_exactly_a<spinidx>(*ip))
- newidx = (new spinidx(newsym, ex_to<spinidx>(*ip).get_dim(),
- ex_to<spinidx>(*ip).is_covariant(),
- ex_to<spinidx>(*ip).is_dotted()))
- -> setflag(status_flags::dynallocated);
+ newidx = dynallocate<spinidx>(newsym, ex_to<spinidx>(*ip).get_dim(),
+ ex_to<spinidx>(*ip).is_covariant(),
+ ex_to<spinidx>(*ip).is_dotted());
else if (is_exactly_a<varidx>(*ip))
- newidx = (new varidx(newsym, ex_to<varidx>(*ip).get_dim(),
- ex_to<varidx>(*ip).is_covariant()))
- -> setflag(status_flags::dynallocated);
+ newidx = dynallocate<varidx>(newsym, ex_to<varidx>(*ip).get_dim(),
+ ex_to<varidx>(*ip).is_covariant());
else
- newidx = (new idx(newsym, ex_to<idx>(*ip).get_dim()))
- -> setflag(status_flags::dynallocated);
+ newidx = dynallocate<idx>(newsym, ex_to<idx>(*ip).get_dim());
old_indices.push_back(*ip);
new_indices.push_back(newidx);
if(is_a<varidx>(*ip)) {
}
++ip;
}
- return lst(lst(old_indices.begin(), old_indices.end()), lst(new_indices.begin(), new_indices.end()));
+ return lst{lst(old_indices.begin(), old_indices.end()), lst(new_indices.begin(), new_indices.end())};
}
}
for (int i=0; i < idim; i++) {
if (subs_idx && is_a<varidx>(nu)) {
ex other = ex_to<varidx>(nu).toggle_variance();
- en += result.subs(lst(
+ en += result.subs(lst{
nu == idx(i, idim),
other == idx(i, idim)
- ));
+ });
} else {
en += result.subs( nu.op(0) == i );
}