Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/11/10 19:18:32 (14 years ago)
Author:
abeham
Message:

#934

  • added BestKnownSolution to test functions
  • added unit tests
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/LevyEvaluator.cs

    r3376 r3781  
    6565    }
    6666
     67    public override RealVector GetBestKnownSolution(int dimension) {
     68      if (dimension < 2) throw new ArgumentException(Name + ": This function is not defined for 1 dimension.");
     69      RealVector result = new RealVector(dimension);
     70      for (int i = 0; i < dimension; i++) result[i] = 1;
     71      return result;
     72    }
    6773    /// <summary>
    6874    /// Evaluates the test function for a specific <paramref name="point"/>.
     
    8086
    8187      s = Math.Sin(Math.PI * z[0]);
     88      if (Math.Abs(s) < 1e-15) s = 0; // Math.Sin(Math.PI) == 0.00000000000000012246063538223773
    8289      s *= s;
    8390
Note: See TracChangeset for help on using the changeset viewer.