Changeset 13039 for branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic
- Timestamp:
- 10/19/15 18:17:34 (9 years ago)
- Location:
- branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs
r12807 r13039 148 148 case OpCodes.UserDefinedFunction: 149 149 { 150 var binarySymbol = (FunctionSymbol)node.Symbol;151 return Expression.Call( binarySymbol.MethodInfo, node.Subtrees.Select(x => MakeExpr(x, variableIndices, row, columns)));150 var functionSymbol = (FunctionSymbol)node.Symbol; 151 return Expression.Call(functionSymbol.MethodInfo, node.Subtrees.Select(x => MakeExpr(x, variableIndices, row, columns))); 152 152 } 153 153 case OpCodes.Constant: -
branches/HeuristicLab.LinqExpressionTreeInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/FunctionSymbol.cs
r12807 r13039 26 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 28 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 29 30 [StorableClass] 30 [Item("FunctionSymbol", "Symbol that wraps a user-defined binary operation.")]31 [Item("FunctionSymbol", "Symbol that wraps a user-defined function.")] 31 32 public sealed class FunctionSymbol : Symbol { 32 private int minimumArity = 2;33 private int maximumArity = 2;33 private readonly int minimumArity; 34 private readonly int maximumArity; 34 35 35 36 public override int MinimumArity { … … 57 58 } 58 59 59 public FunctionSymbol(string name, Func<double, double> f) : base(name, "Symbol that wraps a user-defined unary operation.") {60 public FunctionSymbol(string name, Func<double, double> f) : base(name, "Symbol that wraps a user-defined unary function.") { 60 61 MethodInfo = f.GetMethodInfo(); 61 62 minimumArity = maximumArity = 1; 62 63 } 63 64 64 public FunctionSymbol(string name, Func<double, double, double> f) : base(name, "Symbol that wraps a user-defined binary operation.") {65 public FunctionSymbol(string name, Func<double, double, double> f) : base(name, "Symbol that wraps a user-defined binary function.") { 65 66 MethodInfo = f.GetMethodInfo(); 66 67 minimumArity = maximumArity = 2; 67 68 } 68 69 69 public FunctionSymbol(string name, Func<double, double, double, double> f) : base(name, "Symbol that wraps a user-defined tertiary operation.") {70 public FunctionSymbol(string name, Func<double, double, double, double> f) : base(name, "Symbol that wraps a user-defined tertiary function.") { 70 71 MethodInfo = f.GetMethodInfo(); 71 72 minimumArity = maximumArity = 3; 72 73 } 73 74 74 public FunctionSymbol(string name, Func<double, double, double, double, double> f) : base(name, "Symbol that wraps a user-defined quaternary operation.") {75 public FunctionSymbol(string name, Func<double, double, double, double, double> f) : base(name, "Symbol that wraps a user-defined quaternary function.") { 75 76 MethodInfo = f.GetMethodInfo(); 76 77 minimumArity = maximumArity = 4;
Note: See TracChangeset
for help on using the changeset viewer.