Changeset 5109
- Timestamp:
- 12/15/10 13:53:59 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SymbolicSimplifier.cs
r4477 r5109 482 482 } else if (IsAddition(x)) { 483 483 // (x0 + x1 + .. + xn) * -1 => (-x0 + -x1 + .. + -xn) 484 foreach (var subTree in x.SubTrees) { 485 Negate(subTree); 486 } 484 for (int i = 0; i < x.SubTrees.Count; i++) 485 x.SubTrees[i] = Negate(x.SubTrees[i]); 487 486 } else if (IsMultiplication(x) || IsDivision(x)) { 488 487 // x0 * x1 * .. * xn * -1 => x0 * x1 * .. * -xn 489 Negate(x.SubTrees.Last()); // last is maybe a constant, prefer to negate the constant488 x.SubTrees[x.SubTrees.Count - 1] = Negate(x.SubTrees.Last()); // last is maybe a constant, prefer to negate the constant 490 489 } else { 491 490 // any other function
Note: See TracChangeset
for help on using the changeset viewer.