Changeset 229 for trunk/sources/HeuristicLab.Functions/Substraction.cs
- Timestamp:
- 05/11/08 08:55:19 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Functions/Substraction.cs
r155 r229 30 30 31 31 namespace HeuristicLab.Functions { 32 public class Substraction : FunctionBase {32 public sealed class Substraction : FunctionBase { 33 33 public override string Description { 34 34 get { … … 46 46 } 47 47 48 49 public override double Apply(Dataset dataset, int sampleIndex, double[] args) {50 if(args.Length == 1) {51 return -args[0];52 } else {53 double result = args[0];54 for(int i = 1; i < args.Length; i++) {55 result -= args[i];56 }57 return result;58 }59 }60 61 48 public override void Accept(IFunctionVisitor visitor) { 62 49 visitor.Visit(this);
Note: See TracChangeset
for help on using the changeset viewer.