GINAC_ASSERT(is_a<idx>(mu));
}
-clifford::clifford(unsigned char rl, const ex & metr, int comm_sign, const exvector & v, bool discardable) : inherited(not_symmetric(), v, discardable), representation_label(rl), metric(metr), commutator_sign(comm_sign)
+clifford::clifford(unsigned char rl, const ex & metr, int comm_sign, const exvector & v) : inherited(not_symmetric(), v), representation_label(rl), metric(metr), commutator_sign(comm_sign)
{
}
if (std::find_if(self + 1, other, is_not_a_clifford()) != other)
return false;
- *self = ncmul(exvector(std::reverse_iterator<exvector::const_iterator>(other), std::reverse_iterator<exvector::const_iterator>(self + 1)), true);
+ *self = ncmul(exvector(std::reverse_iterator<exvector::const_iterator>(other), std::reverse_iterator<exvector::const_iterator>(self + 1)));
std::fill(self + 1, other, _ex1);
*other = _ex_2;
return true;
return false;
exvector::iterator next_to_last = other - 1;
- ex S = ncmul(exvector(self + 1, next_to_last), true);
- ex SR = ncmul(exvector(std::reverse_iterator<exvector::const_iterator>(next_to_last), std::reverse_iterator<exvector::const_iterator>(self + 1)), true);
+ ex S = ncmul(exvector(self + 1, next_to_last));
+ ex SR = ncmul(exvector(std::reverse_iterator<exvector::const_iterator>(next_to_last), std::reverse_iterator<exvector::const_iterator>(self + 1)));
*self = (*next_to_last) * S + SR * (*next_to_last);
std::fill(self + 1, other, _ex1);
return false;
exvector::iterator next_to_last = other - 1;
- ex S = ncmul(exvector(self + 1, next_to_last), true);
+ ex S = ncmul(exvector(self + 1, next_to_last));
*self = 2 * (*next_to_last) * S - (*self) * S * (*other) * (*next_to_last);
std::fill(self + 1, other + 1, _ex1);
return false;
}
- ex S = ncmul(exvector(self + 1, before_other), true);
+ ex S = ncmul(exvector(self + 1, before_other));
if (is_a<clifford>(*before_other) && ex_to<clifford>(*before_other).get_representation_label() == rl) {
*self = 2 * (*self) * S * unit.get_metric(alpha, mu_toggle, true) - (*self) * S * (*other) * (*before_other);
ex sum = ncmul(v);
it[0] = save1;
it[1] = save0;
- sum += ex_to<clifford>(save0).get_commutator_sign() * ncmul(v, true);
+ sum += ex_to<clifford>(save0).get_commutator_sign() * ncmul(std::move(v));
i->second = canonicalize_clifford(sum);
goto next_sym;
}
clifford(const ex & b, const ex & mu, const ex & metr, unsigned char rl = 0, int comm_sign = -1);
// internal constructors
- clifford(unsigned char rl, const ex & metr, int comm_sign, const exvector & v, bool discardable = false);
+ clifford(unsigned char rl, const ex & metr, int comm_sign, const exvector & v);
clifford(unsigned char rl, const ex & metr, int comm_sign, exvector && v);
// functions overriding virtual functions from base classes
{
}
-color::color(unsigned char rl, const exvector & v, bool discardable) : inherited(not_symmetric(), v, discardable), representation_label(rl)
+color::color(unsigned char rl, const exvector & v) : inherited(not_symmetric(), v), representation_label(rl)
{
}
color(const ex & b, const ex & i1, unsigned char rl = 0);
// internal constructors
- color(unsigned char rl, const exvector & v, bool discardable = false);
+ color(unsigned char rl, const exvector & v);
color(unsigned char rl, exvector && v);
void archive(archive_node& n) const;
void read_archive(const archive_node& n, lst& sym_lst);
// constructors
public:
- container(STLT const & s, bool discardable = false)
+ container(STLT const & s)
{
setflag(get_default_flags());
-
- if (discardable)
- this->seq.swap(const_cast<STLT &>(s));
- else
- this->seq = s;
+ this->seq = s;
}
explicit container(STLT && v)
clearflag(status_flags::evaluated);
}
-function::function(unsigned ser, const exvector & v, bool discardable)
- : exprseq(v,discardable), serial(ser)
+function::function(unsigned ser, const exvector & v)
+ : exprseq(v), serial(ser)
{
}
---
// end of generated lines
function(unsigned ser, const exprseq & es);
- function(unsigned ser, const exvector & v, bool discardable = false);
+ function(unsigned ser, const exvector & v);
function(unsigned ser, exvector && v);
// functions overriding virtual functions from base classes
{
}
-indexed::indexed(const symmetry & symm, const exvector & v, bool discardable) : inherited(v, discardable), symtree(symm)
+indexed::indexed(const symmetry & symm, const exvector & v) : inherited(v), symtree(symm)
{
}
// the product
bool is_a_product = (is_exactly_a<mul>(*it1) || is_exactly_a<ncmul>(*it1)) &&
(is_exactly_a<mul>(*it2) || is_exactly_a<ncmul>(*it2));
- ex r = (non_commutative ? ex(ncmul(v, true)) : ex(mul(v)));
+ ex r = (non_commutative ? ex(ncmul(std::move(v))) : ex(mul(std::move(v))));
// If new expression is a product we can call this function again,
// otherwise we need to pass argument to simplify_indexed() to be expanded
ex r;
if (something_changed)
- r = non_commutative ? ex(ncmul(v, true)) : ex(mul(v));
+ r = non_commutative ? ex(ncmul(std::move(v))) : ex(mul(std::move(v)));
else
r = e;
// internal constructors
indexed(const symmetry & symm, const exprseq & es);
- indexed(const symmetry & symm, const exvector & v, bool discardable = false);
+ indexed(const symmetry & symm, const exvector & v);
indexed(const symmetry & symm, exvector && v);
// functions overriding virtual functions from base classes
{
}
-ncmul::ncmul(const exvector & v, bool discardable) : inherited(v,discardable)
+ncmul::ncmul(const exvector & v) : inherited(v)
{
}
term[positions_of_adds[i]] = rename_dummy_indices_uniquely(va, expanded_seq[positions_of_adds[i]].op(k[i]), true);
}
- distrseq.push_back((new ncmul(term, true))->
+ distrseq.push_back((new ncmul(std::move(term)))->
setflag(status_flags::dynallocated | (options == 0 ? status_flags::expanded : 0)));
// increment k[]
// if a non-zero power of s is found, the resulting product will be 0
for (auto & it : seq)
coeffseq.push_back(it.coeff(s,n));
- return (new ncmul(std::move(coeffseq),1))->setflag(status_flags::dynallocated);
+ return (new ncmul(std::move(coeffseq)))->setflag(status_flags::dynallocated);
}
bool coeff_found = false;
}
if (coeff_found)
- return (new ncmul(std::move(coeffseq), 1))->setflag(status_flags::dynallocated);
+ return (new ncmul(std::move(coeffseq)))->setflag(status_flags::dynallocated);
return _ex0;
}
else
noncommutativeseq.push_back(assocseq[i]);
}
- commutativeseq.push_back((new ncmul(noncommutativeseq,1))->setflag(status_flags::dynallocated));
- return (new mul(commutativeseq))->setflag(status_flags::dynallocated);
+ commutativeseq.push_back((new ncmul(std::move(noncommutativeseq)))->setflag(status_flags::dynallocated));
+ return (new mul(std::move(commutativeseq)))->setflag(status_flags::dynallocated);
}
// ncmul(x1,y1,x2,y2) -> *(ncmul(x1,x2),ncmul(y1,y2))
--i;
ev.push_back(i->conjugate());
}
- return (new ncmul(std::move(ev), true))->setflag(status_flags::dynallocated).eval();
+ return (new ncmul(std::move(ev)))->setflag(status_flags::dynallocated).eval();
}
ex ncmul::real_part() const
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(const exvector & v);
ncmul(exvector && v);
// functions overriding virtual functions from base classes
if (num_exponent->is_pos_integer() &&
ebasis.return_type() != return_types::commutative &&
!is_a<matrix>(ebasis)) {
- return ncmul(exvector(num_exponent->to_int(), ebasis), true);
+ return ncmul(exvector(num_exponent->to_int(), ebasis));
}
}