Changeset 17997 for branches/3127-MRGP-VarPro-Exploration/HeuristicLab.Problems.DataAnalysis.Symbolic
- Timestamp:
- 06/27/21 15:30:17 (3 years ago)
- Location:
- branches/3127-MRGP-VarPro-Exploration
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3127-MRGP-VarPro-Exploration
- Property svn:mergeinfo changed
/trunk (added) merged: 17992-17993
- Property svn:mergeinfo changed
-
branches/3127-MRGP-VarPro-Exploration/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic (added) merged: 17993
- Property svn:mergeinfo changed
-
branches/3127-MRGP-VarPro-Exploration/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IntervalInterpreter.cs
r17963 r17997 287 287 var b = Evaluate(instructions, ref instructionCounter, nodeIntervals, variableIntervals); 288 288 // support only integer powers 289 if (b.LowerBound == b.UpperBound && Math.Truncate(b.LowerBound) == b.LowerBound) {289 if (b.LowerBound == b.UpperBound && Math.Truncate(b.LowerBound) == b.LowerBound) { 290 290 result = Interval.Power(a, (int)b.LowerBound); 291 291 } else { … … 321 321 322 322 public static bool IsCompatible(ISymbolicExpressionTree tree) { 323 var containsUnknownSymbols = ( 324 from n in tree.Root.GetSubtree(0).IterateNodesPrefix() 325 where 323 foreach (var n in tree.Root.GetSubtree(0).IterateNodesPrefix()) { 324 if ( 326 325 !(n.Symbol is Variable) && 327 326 !(n.Symbol is Constant) && … … 343 342 !(n.Symbol is Power) && 344 343 !(n.Symbol is Absolute) && 345 !(n.Symbol is AnalyticQuotient) 346 select n).Any(); 347 return !containsUnknownSymbols; 344 !(n.Symbol is AnalyticQuotient)) return false; 345 346 else if (n.Symbol is Power) { 347 // only integer exponents are supported 348 var exp = n.GetSubtree(1) as ConstantTreeNode; 349 if (exp == null || exp.Value != Math.Truncate(exp.Value)) return false; 350 } 351 } 352 return true; 348 353 } 349 354 }
Note: See TracChangeset
for help on using the changeset viewer.