Changeset 17817 for trunk/HeuristicLab.Problems.DataAnalysis.Symbolic
- Timestamp:
- 01/05/21 11:16:48 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToAutoDiffTermConverter.cs
r17180 r17817 258 258 if (node.Symbol is CubeRoot) { 259 259 return cbrt(ConvertToAutoDiff(node.GetSubtree(0))); 260 } 261 if (node.Symbol is Power) { 262 var powerNode = node.GetSubtree(1) as ConstantTreeNode; 263 if (powerNode == null) 264 throw new NotSupportedException("Only integer powers are allowed in parameter optimization. Try to use exp() and log() instead of the power symbol."); 265 var intPower = Math.Truncate(powerNode.Value); 266 if (intPower != powerNode.Value) 267 throw new NotSupportedException("Only integer powers are allowed in parameter optimization. Try to use exp() and log() instead of the power symbol."); 268 return AutoDiff.TermBuilder.Power(ConvertToAutoDiff(node.GetSubtree(0)), intPower); 260 269 } 261 270 if (node.Symbol is Sine) { … … 340 349 !(n.Symbol is AnalyticQuotient) && 341 350 !(n.Symbol is Cube) && 342 !(n.Symbol is CubeRoot) 351 !(n.Symbol is CubeRoot) && 352 !(n.Symbol is Power) 343 353 select n).Any(); 344 354 return !containsUnknownSymbol;
Note: See TracChangeset
for help on using the changeset viewer.