Changeset 12233 for branches/DataAnalysis.ComplexityAnalyzer
- Timestamp:
- 03/22/15 22:18:35 (10 years ago)
- Location:
- branches/DataAnalysis.ComplexityAnalyzer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic merged: 12227
- Property svn:mergeinfo changed
-
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimplifier.cs
r12130 r12233 299 299 // simplify expressions x0..xn 300 300 // make multiplication (x0 * 1/(x1 * x1 * .. * xn)) 301 var simplifiedTrees = original.Subtrees.Select( x => GetSimplifiedTree(x));301 var simplifiedTrees = original.Subtrees.Select(GetSimplifiedTree).ToArray(); 302 302 return 303 MakeProduct(simplifiedTrees.First(), Invert(simplifiedTrees.Skip(1).Aggregate( (a, b) => MakeProduct(a, b))));303 MakeProduct(simplifiedTrees.First(), Invert(simplifiedTrees.Skip(1).Aggregate(MakeProduct))); 304 304 } 305 305 } … … 310 310 } else { 311 311 return original.Subtrees 312 .Select( x => GetSimplifiedTree(x))313 .Aggregate( (a, b) => MakeProduct(a, b));312 .Select(GetSimplifiedTree).ToArray() 313 .Aggregate(MakeProduct); 314 314 } 315 315 } … … 321 321 // simplify expressions x0..xn 322 322 // make addition (x0,-x1..-xn) 323 var simplifiedTrees = original.Subtrees.Select( x => GetSimplifiedTree(x));323 var simplifiedTrees = original.Subtrees.Select(GetSimplifiedTree).ToArray(); 324 324 return simplifiedTrees.Take(1) 325 .Concat(simplifiedTrees.Skip(1).Select( x => Negate(x)))326 .Aggregate( (a, b) => MakeSum(a, b));325 .Concat(simplifiedTrees.Skip(1).Select(Negate)) 326 .Aggregate(MakeSum); 327 327 } 328 328 } … … 335 335 // make addition (x0..xn) 336 336 return original.Subtrees 337 .Select( x => GetSimplifiedTree(x))338 .Aggregate( (a, b) => MakeSum(a, b));337 .Select(GetSimplifiedTree).ToArray() 338 .Aggregate(MakeSum); 339 339 } 340 340 }
Note: See TracChangeset
for help on using the changeset viewer.