- Timestamp:
- 01/12/11 13:19:53 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj
r5163 r5288 12 12 <AssemblyName>HeuristicLab.Problems.DataAnalysis-3.3</AssemblyName> 13 13 <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> 14 <TargetFrameworkProfile></TargetFrameworkProfile> 14 <TargetFrameworkProfile> 15 </TargetFrameworkProfile> 15 16 <FileAlignment>512</FileAlignment> 16 17 <SignAssembly>true</SignAssembly> … … 107 108 </ItemGroup> 108 109 <ItemGroup> 110 <Compile Include="Symbolic\Symbols\Power.cs" /> 109 111 <Compile Include="TableFileParser.cs" /> 110 112 <None Include="HeuristicLab.snk" /> -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/FullFunctionalExpressionGrammar.cs
r4722 r5288 53 53 var tan = new Tangent(); 54 54 var log = new Logarithm(); 55 var pow = new Power(); 55 56 var exp = new Exponential(); 56 57 var @if = new IfThenElse(); … … 67 68 laggedVariable.InitialFrequency = 0.0; 68 69 69 var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, exp, @if, gt, lt, and, or, not, constant, variableSymbol, laggedVariable };70 var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, pow, exp, @if, gt, lt, and, or, not, constant, variableSymbol, laggedVariable }; 70 71 var unaryFunctionSymbols = new List<Symbol>() { sin, cos, tan, log, exp, not }; 71 var binaryFunctionSymbols = new List<Symbol>() { gt, lt };72 var binaryFunctionSymbols = new List<Symbol>() { pow, gt, lt }; 72 73 var functionSymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or }; 73 74 var terminalSymbols = new List<Symbol>() { variableSymbol, constant, laggedVariable }; -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs
r5223 r5288 65 65 public const byte Constant = 20; 66 66 public const byte Arg = 21; 67 68 public const byte Power = 22; 67 69 } 68 70 … … 89 91 { typeof(Constant), OpCodes.Constant }, 90 92 { typeof(Argument), OpCodes.Arg }, 93 { typeof(Power),OpCodes.Power}, 91 94 }; 92 95 private const int ARGUMENT_STACK_SIZE = 1024; … … 185 188 return Math.Tan(Evaluate(dataset, ref row, code, ref pc, argumentStack, ref argStackPointer)); 186 189 } 190 case OpCodes.Power: { 191 double x = Evaluate(dataset, ref row, code, ref pc, argumentStack, ref argStackPointer); 192 double y = Evaluate(dataset, ref row, code, ref pc, argumentStack, ref argStackPointer); 193 return Math.Pow(x, y); 194 } 187 195 case OpCodes.Exp: { 188 196 return Math.Exp(Evaluate(dataset, ref row, code, ref pc, argumentStack, ref argStackPointer)); -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/Power.cs
r5287 r5288 26 26 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols { 27 27 [StorableClass] 28 [Item(" Exponential", "Symbol that represents the exponentialfunction.")]29 public sealed class Exponential: Symbol {28 [Item("Power", "Symbol that represents the power function.")] 29 public sealed class Power : Symbol { 30 30 [StorableConstructor] 31 private Exponential(bool deserializing) : base(deserializing) { }32 private Exponential(Exponentialoriginal, Cloner cloner) : base(original, cloner) { }31 private Power(bool deserializing) : base(deserializing) { } 32 private Power(Power original, Cloner cloner) : base(original, cloner) { } 33 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Exponential(this, cloner);34 return new Power(this, cloner); 35 35 } 36 public Exponential() : base("Exponential", "Symbol that represents the exponentialfunction.") { }36 public Power() : base("Power", "Symbol that represents the power function.") { } 37 37 } 38 38 }
Note: See TracChangeset
for help on using the changeset viewer.