bool something_changed = false;
int sign = 1;
- // Anticommute gamma5/L/R's to the front
+ // Anticommutate gamma5/L/R's to the front
if (s.size() >= 2) {
exvector::iterator first = s.begin(), next_to_last = s.end() - 2;
while (true) {
}
container(const ex & p1, const ex & p2, const ex & p3,
- const ex & p4) : inherited(get_tinfo())
+ const ex & p4) : inherited(get_tinfo())
{
setflag(get_default_flags());
reserve(this->seq, 4);
unsigned mul::return_type() const
{
if (seq.empty()) {
- // mul without factors: should not happen, but commutes
+ // mul without factors: should not happen, but commutates
return return_types::commutative;
}
int ncmul::degree(const ex & s) const
{
+ if (is_equal(ex_to<basic>(s)))
+ return 1;
+
// Sum up degrees of factors
int deg_sum = 0;
exvector::const_iterator i = seq.begin(), end = seq.end();
int ncmul::ldegree(const ex & s) const
{
+ if (is_equal(ex_to<basic>(s)))
+ return 1;
+
// Sum up degrees of factors
int deg_sum = 0;
exvector::const_iterator i = seq.begin(), end = seq.end();
ex ncmul::coeff(const ex & s, int n) const
{
+ if (is_equal(ex_to<basic>(s)))
+ return n==1 ? _ex1 : _ex0;
+
exvector coeffseq;
coeffseq.reserve(seq.size());
++i;
}
// all factors checked
- GINAC_ASSERT(!all_commutative); // not all factors should commute, because this is a ncmul();
+ GINAC_ASSERT(!all_commutative); // not all factors should commutate, because this is a ncmul();
return all_commutative ? return_types::commutative : return_types::noncommutative;
}