Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/22/20 14:10:09 (4 years ago)
Author:
chaider
Message:

#2971 Added some trigonometric function tests for IA

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/IntervalTest.cs

    r17584 r17754  
    312312    [TestCategory("Problems.DataAnalysis")]
    313313    [TestProperty("Time", "short")]
     314    public void GeometricTest() {
     315      Assert.AreEqual(new Interval(-1, -0.936456687290796), Interval.Cosine(new Interval(3, 3.5)));
     316      Assert.AreEqual(new Interval(-1, -0.936456687290796), Interval.Cosine(new Interval(-3.5, -3)));
     317      Assert.AreEqual(new Interval(-1, 1), Interval.Cosine(new Interval(-3.5, 3)));
     318      Assert.AreEqual(new Interval(-0.839071529076452, 0.843853958732493), Interval.Cosine(new Interval(10, 12)));
     319      Assert.AreEqual(new Interval(0.136737218207833, 0.907446781450197), Interval.Cosine(new Interval(13, 14)));
     320      Assert.AreEqual(new Interval(-0.839071529076452, 1), Interval.Cosine(new Interval(10, 14)));
     321      Assert.AreEqual(new Interval(-1, 0.136737218207833), Interval.Cosine(new Interval(14, 16)));
     322      Assert.AreEqual(new Interval(-0.839071529076452, 0.004425697988051), Interval.Cosine(new Interval(-11, -10)));
     323      Assert.AreEqual(new Interval(0.136737218207833, 0.907446781450197), Interval.Cosine(new Interval(-14, -13)));
     324      Assert.AreEqual(new Interval(-1, 0.136737218207833), Interval.Cosine(new Interval(-16, -14)));
     325      Assert.AreEqual(new Interval(0.101585703696621, 1), Interval.Cosine(new Interval(-102, -100)));
     326      Assert.AreEqual(new Interval(-1, 1), Interval.Cosine(new Interval(4.6e15, 4.7e15)));
     327      Assert.AreEqual(new Interval(0.87758256189037265, 0.87758256189037276), Interval.Cosine(new Interval(0.5, 0.5)));
     328      Assert.AreEqual(new Interval(-0.09904103659872825, 0.8775825618903728), Interval.Cosine(new Interval(0.5, 1.67)));
     329      Assert.AreEqual(new Interval(-1.0, 0.77556587851025016), Interval.Cosine(new Interval(2.1, 5.6)));
     330      Assert.AreEqual(new Interval(-1.0, 1.0), Interval.Cosine(new Interval(0.5, 8.5)));
     331      Assert.AreEqual(new Interval(-1.0, -0.09904103659872801), Interval.Cosine(new Interval(1.67, 3.2)));
     332
     333
     334      Assert.AreEqual(new Interval(double.NegativeInfinity, double.PositiveInfinity), Interval.Tangens(new Interval(double.NegativeInfinity, double.PositiveInfinity)));
     335      Assert.AreEqual(new Interval(0, 1.55740772465490223051), Interval.Tangens(new Interval(0, 1)));
     336      Assert.AreEqual(new Interval(-1.55740772465490223051, 0), Interval.Tangens(new Interval(-1, 0)));
     337      Assert.AreEqual(new Interval(double.NegativeInfinity, double.PositiveInfinity), Interval.Tangens(new Interval(-2, -1)));
     338      Assert.AreEqual(new Interval(double.NegativeInfinity, double.PositiveInfinity), Interval.Tangens(new Interval(202, 203)));
     339      Assert.AreEqual(new Interval(0.54630248984379048, 0.5463024898437906), Interval.Tangens(new Interval(0.5, 0.5)));
     340      Assert.AreEqual(new Interval(double.NegativeInfinity, double.PositiveInfinity), Interval.Tangens(new Interval(0.5,
     341        1.67)));
     342      //Assert.AreEqual(new Interval(-10.047182299210307, 0.5847385445957865), Interval.Tangens(new Interval(1.67, 3.2)));
     343      Assert.AreEqual(new Interval(double.NegativeInfinity, double.PositiveInfinity), Interval.Tangens(new Interval(
     344        6.638314112824137, 8.38263151220128)));
     345
     346
     347
     348      Assert.AreEqual(new Interval(0.47942553860420295, 0.47942553860420301), Interval.Sine(new Interval(0.5, 0.5)));
     349      Assert.AreEqual(new Interval(4.7942553860420295e-01, 1.0), Interval.Sine(new Interval(0.5, 1.67)));
     350      Assert.AreEqual(new Interval(-5.8374143427580093e-02, 9.9508334981018021e-01), Interval.Sine(new Interval(1.67,
     351        3.2)));
     352      Assert.AreEqual(new Interval(-1.0, 0.863209366648874), Interval.Sine(new Interval(2.1, 5.6)));
     353      Assert.AreEqual(new Interval(-1.0, 1.0), Interval.Sine(new Interval(0.5, 8.5)));
     354      Assert.AreEqual(new Interval(-1.0, 0.9775301176650971), Interval.Sine(new Interval(-4.5, 0.1)));
     355      Assert.AreEqual(new Interval(-1.0, 1.0), Interval.Sine(new Interval(1.3, 6.3)));
     356    }
     357
     358    [TestMethod]
     359    [TestCategory("Problems.DataAnalysis")]
     360    [TestProperty("Time", "short")]
    314361    public void EqualsTest() {
    315362      var interval1 = new Interval(0, 12);
Note: See TracChangeset for help on using the changeset viewer.