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);
s.reserve(v.size());
// Remove superfluous ONEs
- exvector::const_iterator cit = v.begin(), citend = v.end();
- while (cit != citend) {
- if (!is_a<clifford>(*cit) || !is_a<diracone>(cit->op(0)))
- s.push_back(*cit);
- cit++;
+ for (auto & it : v) {
+ if (!is_a<clifford>(it) || !is_a<diracone>(it.op(0)))
+ s.push_back(it);
}
bool something_changed = false;
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;
}
if (ind_vec.size() > 0) {
found_dummy = true;
- exvector::const_iterator it = ind_vec.begin(), itend = ind_vec.end();
- while (it != itend) {
- ex curridx = *it;
+ for (auto & it : ind_vec) {
+ ex curridx = it;
ex curridx_toggle = is_a<varidx>(curridx)
? ex_to<varidx>(curridx).toggle_variance()
: curridx;
S = S * e.op(j).subs(lst(curridx == ival,
curridx_toggle == ival), subs_options::no_pattern);
- ++it;
}
} else
S = S * e.op(j);