Changeset 155 for trunk/sources/HeuristicLab.Functions/Power.cs
- Timestamp:
- 04/22/08 18:05:14 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Functions/Power.cs
r2 r155 31 31 public class Power : FunctionBase { 32 32 public override string Description { 33 get { return "Returns the result of the first sub- operator to the power of the second sub-operator(power(x, y))."; }33 get { return "Returns the result of the first sub-tree to the power of the second sub-tree (power(x, y))."; } 34 34 } 35 35 … … 40 40 } 41 41 42 public Power(Power source, IDictionary<Guid, object> clonedObjects)43 : base(source, clonedObjects) {42 public override double Apply(Dataset dataset, int sampleIndex, double[] args) { 43 return Math.Pow(args[0], args[1]); 44 44 } 45 46 47 public override double Evaluate(Dataset dataset, int sampleIndex) {48 return Math.Pow(SubFunctions[0].Evaluate(dataset, sampleIndex), SubFunctions[1].Evaluate(dataset, sampleIndex));49 }50 51 public override object Clone(IDictionary<Guid, object> clonedObjects) {52 Power clone = new Power(this, clonedObjects);53 clonedObjects.Add(clone.Guid, clone);54 return clone;55 }56 57 45 58 46 public override void Accept(IFunctionVisitor visitor) {
Note: See TracChangeset
for help on using the changeset viewer.