Changeset 18146 for branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionCSharpFormatter.cs
- Timestamp:
- 12/16/21 14:23:48 (3 years ago)
- Location:
- branches/3136_Structural_GP
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3136_Structural_GP
- Property svn:mergeinfo changed
-
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
-
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionCSharpFormatter.cs
r17648 r18146 162 162 var varNode = node as VariableTreeNode; 163 163 strBuilder.AppendFormat("{0} * {1}", VariableName2Identifier(varNode.VariableName), varNode.Weight.ToString("g17", CultureInfo.InvariantCulture)); 164 } else if (node is ConstantTreeNode) { 165 var constNode = node as ConstantTreeNode; 166 strBuilder.Append(constNode.Value.ToString("g17", CultureInfo.InvariantCulture)); 164 } else if (node is INumericTreeNode numNode) { 165 strBuilder.Append(numNode.Value.ToString("g17", CultureInfo.InvariantCulture)); 167 166 } else if (node.Symbol is FactorVariable) { 168 167 var factorNode = node as FactorVariableTreeNode; … … 311 310 312 311 private void GenerateFactorSource(StringBuilder strBuilder) { 313 strBuilder.AppendLine("private static double EvaluateFactor(string factorValue, string[] factorValues, double[] constants) {");312 strBuilder.AppendLine("private static double EvaluateFactor(string factorValue, string[] factorValues, double[] parameters) {"); 314 313 strBuilder.AppendLine(" for(int i=0;i<factorValues.Length;i++) " + 315 " if(factorValues[i] == factorValue) return constants[i];" +314 " if(factorValues[i] == factorValue) return parameters[i];" + 316 315 " throw new ArgumentException();"); 317 316 strBuilder.AppendLine("}");
Note: See TracChangeset
for help on using the changeset viewer.