Changeset 16801 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters
- Timestamp:
- 04/17/19 16:03:57 (6 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:mergeinfo changed
/trunk merged: 16729,16737,16740,16743,16757-16758,16762-16764,16768-16769,16779,16782-16784,16788,16792,16794-16799
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic merged: 16737,16740,16758,16762,16764,16768
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/DerivativeCalculator.cs
r16723 r16801 83 83 if (branch.SubtreeCount >= 2) { 84 84 var f = (ISymbolicExpressionTreeNode)branch.GetSubtree(0).Clone(); 85 var g = (ISymbolicExpressionTreeNode)branch.GetSubtree(1).Clone();86 85 var fprime = Derive(f, variableName); 87 var gprime = Derive(g, variableName); 88 var fgPrime = Sum(Product(f, gprime), Product(fprime, g)); 89 for (int i = 2; i < branch.SubtreeCount; i++) { 86 for (int i = 1; i < branch.SubtreeCount; i++) { 87 var g = (ISymbolicExpressionTreeNode)branch.GetSubtree(i).Clone(); 90 88 var fg = Product((ISymbolicExpressionTreeNode)f.Clone(), (ISymbolicExpressionTreeNode)g.Clone()); 91 var h = (ISymbolicExpressionTreeNode)branch.GetSubtree(i).Clone(); 92 var hPrime = Derive(h, variableName); 93 fgPrime = Sum(Product(fgPrime, h), Product(fg, hPrime)); 89 var gPrime = Derive(g, variableName); 90 var fgPrime = Sum(Product(fprime, g), Product(gPrime, f)); 91 // prepare for next iteration 92 f = fg; 93 fprime = fgPrime; 94 94 } 95 return f gPrime;95 return fprime; 96 96 } else 97 97 // multiplication with only one argument has no effect -> derive the argument
Note: See TracChangeset
for help on using the changeset viewer.