Index: /trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/IntervalTest.cs
===================================================================
--- /trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/IntervalTest.cs	(revision 17583)
+++ /trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/IntervalTest.cs	(revision 17584)
@@ -1,3 +1,4 @@
 ﻿using System;
+using System.Collections.Generic;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 
@@ -141,5 +142,5 @@
     [TestProperty("Time", "short")]
     public void SquarerootIntervalTest() {
-      Assert.AreEqual<Interval>(new Interval(1, 2), Interval.SquareRoot(new Interval(1, 4)));
+      Assert.AreEqual<Interval>(new Interval(-2, 2), Interval.SquareRoot(new Interval(1, 4)));
       Assert.AreEqual<Interval>(new Interval(double.NaN, double.NaN), Interval.SquareRoot(new Interval(-4, -1)));
     }
@@ -192,15 +193,18 @@
 
       //Second interval goes over zero
-      Assert.AreEqual(new Interval(aPos.LowerBound/Math.Sqrt(17), aPos.UpperBound), Interval.AnalyticalQuotient(aPos, bZero));
-      Assert.AreEqual(new Interval(aZero.LowerBound, aZero.UpperBound), Interval.AnalyticalQuotient(aZero, bZero));
-      Assert.AreEqual(new Interval(aNeg.LowerBound, aNeg.UpperBound/Math.Sqrt(17)), Interval.AnalyticalQuotient(aNeg, bZero));
-      //Second interval is positive
-      Assert.AreEqual(new Interval(aPos.LowerBound/Math.Sqrt(17), aPos.UpperBound/Math.Sqrt(5)), Interval.AnalyticalQuotient(aPos, bPos));
-      Assert.AreEqual(new Interval(aZero.LowerBound/Math.Sqrt(5), aZero.UpperBound/Math.Sqrt(5)), Interval.AnalyticalQuotient(aZero, bPos));
-      Assert.AreEqual(new Interval(aNeg.LowerBound/Math.Sqrt(5), aNeg.UpperBound/Math.Sqrt(17)), Interval.AnalyticalQuotient(aNeg, bPos));
-      //Second interval is negative
-      Assert.AreEqual(new Interval(aPos.LowerBound/Math.Sqrt(17), aPos.UpperBound/Math.Sqrt(5)), Interval.AnalyticalQuotient(aPos, bNeg));
-      Assert.AreEqual(new Interval(aZero.LowerBound/Math.Sqrt(5), aZero.UpperBound/Math.Sqrt(5)), Interval.AnalyticalQuotient(aZero, bNeg));
-      Assert.AreEqual(new Interval(aNeg.LowerBound/Math.Sqrt(5), aNeg.UpperBound/Math.Sqrt(17)), Interval.AnalyticalQuotient(aNeg, bNeg));
+      //Assert.AreEqual(new Interval(aPos.LowerBound/Math.Sqrt(17), aPos.UpperBound), Interval.AnalyticalQuotient(aPos, bZero));
+      //Assert.AreEqual(new Interval(aZero.LowerBound, aZero.UpperBound), Interval.AnalyticalQuotient(aZero, bZero));
+      //Assert.AreEqual(new Interval(aNeg.LowerBound, aNeg.UpperBound/Math.Sqrt(17)), Interval.AnalyticalQuotient(aNeg, bZero));
+      ////Second interval is positive
+      //Assert.AreEqual(new Interval(aPos.LowerBound/Math.Sqrt(17), aPos.UpperBound/Math.Sqrt(5)), Interval.AnalyticalQuotient(aPos, bPos));
+      //Assert.AreEqual(new Interval(aZero.LowerBound/Math.Sqrt(5), aZero.UpperBound/Math.Sqrt(5)), Interval.AnalyticalQuotient(aZero, bPos));
+      //Assert.AreEqual(new Interval(aNeg.LowerBound/Math.Sqrt(5), aNeg.UpperBound/Math.Sqrt(17)), Interval.AnalyticalQuotient(aNeg, bPos));
+      ////Second interval is negative
+      //Assert.AreEqual(new Interval(aPos.LowerBound/Math.Sqrt(17), aPos.UpperBound/Math.Sqrt(5)), Interval.AnalyticalQuotient(aPos, bNeg));
+      //Assert.AreEqual(new Interval(aZero.LowerBound/Math.Sqrt(5), aZero.UpperBound/Math.Sqrt(5)), Interval.AnalyticalQuotient(aZero, bNeg));
+      //Assert.AreEqual(new Interval(aNeg.LowerBound/Math.Sqrt(5), aNeg.UpperBound/Math.Sqrt(17)), Interval.AnalyticalQuotient(aNeg, bNeg));
+      Assert.AreEqual(new Interval(double.NegativeInfinity, double.PositiveInfinity), Interval.AnalyticalQuotient(aPos, bZero));
+      Assert.AreEqual(new Interval(double.NegativeInfinity, double.PositiveInfinity), Interval.AnalyticalQuotient(aPos, bPos));
+      Assert.AreEqual(new Interval(double.NegativeInfinity, double.PositiveInfinity), Interval.AnalyticalQuotient(aZero, bNeg));
     }
 
@@ -247,6 +251,132 @@
       Assert.AreEqual(0, zeroInterval.LowerBound);
       Assert.AreEqual(0, zeroInterval.UpperBound);
-
-    }
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis")]
+    [TestProperty("Time", "short")]
+    public void ContaintsTest() {
+      var negativeInterval = new Interval(-10, -5);
+      var positiveInterval = new Interval(5, 10);
+      var overZeroInterval = new Interval(-5, 5);
+
+      //Tests for negative intervals
+      Assert.AreEqual(true, negativeInterval.Contains(new Interval(-9, -7)));
+      Assert.AreEqual(false, negativeInterval.Contains(new Interval(-11, -3)));
+      Assert.AreEqual(false, negativeInterval.Contains(positiveInterval));
+      Assert.AreEqual(false, negativeInterval.Contains(overZeroInterval));
+      Assert.AreEqual(true, negativeInterval.Contains(-8));
+      Assert.AreEqual(false, negativeInterval.Contains(-12));
+      Assert.AreEqual(false, negativeInterval.Contains(0));
+      //Testes for positive intervals
+      Assert.AreEqual(true, positiveInterval.Contains(new Interval(6, 10)));
+      Assert.AreEqual(false, positiveInterval.Contains(new Interval(6, 12)));
+      Assert.AreEqual(false, positiveInterval.Contains(negativeInterval));
+      Assert.AreEqual(false, positiveInterval.Contains(overZeroInterval));
+      Assert.AreEqual(true, positiveInterval.Contains(7));
+      Assert.AreEqual(false, positiveInterval.Contains(11));
+      Assert.AreEqual(false, positiveInterval.Contains(0));
+      //Tests for over zero intervals
+      Assert.AreEqual(true, overZeroInterval.Contains(new Interval(-3, 3)));
+      Assert.AreEqual(true, overZeroInterval.Contains(new Interval(-4, -1)));
+      Assert.AreEqual(true, overZeroInterval.Contains(new Interval(1, 5)));
+      Assert.AreEqual(false, overZeroInterval.Contains(new Interval(-6, 0)));
+      Assert.AreEqual(false, overZeroInterval.Contains(new Interval(0, 6)));
+      Assert.AreEqual(false, overZeroInterval.Contains(new Interval(-7, 7)));
+      Assert.AreEqual(true, overZeroInterval.Contains(-3));
+      Assert.AreEqual(true, overZeroInterval.Contains(0));
+      Assert.AreEqual(true, overZeroInterval.Contains(3));
+      Assert.AreEqual(false, overZeroInterval.Contains(12));
+      Assert.AreEqual(false, overZeroInterval.Contains(-7));
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis")]
+    [TestProperty("Time", "short")]
+    public void GetIntervalTest() {
+      var values = new List<double>() { -2.5, -9, 2, 7, 0 ,12, 12.4, 12.4, 9.29, 1002, -29.9};
+      var valuesNan = new List<double>() { double.NaN, 2, 4, 19, -2, -12.2};
+      var valuesInf = new List<double>() {double.NegativeInfinity, double.PositiveInfinity, 12, 2, -2, -12.2};
+
+      var valuesInterval = new Interval(-29.9, 1002);
+      var valuesNanInterval = new Interval(double.NaN, double.NaN);
+      var valuesInfInterval = new Interval(double.NegativeInfinity, double.PositiveInfinity);
+
+
+      Assert.AreEqual(valuesInterval, Interval.GetInterval(values));
+      Assert.AreEqual(valuesNanInterval, Interval.GetInterval(valuesNan));
+      Assert.AreEqual(valuesInfInterval, Interval.GetInterval(valuesInf));
+    }
+
+    [TestMethod]
+    [TestCategory("Problems.DataAnalysis")]
+    [TestProperty("Time", "short")]
+    public void EqualsTest() {
+      var interval1 = new Interval(0, 12);
+      var interval2 = new Interval(-12, 8);
+      var interval3 = new Interval(double.NegativeInfinity, 0);
+
+      Assert.AreEqual(true, interval1.Equals(new Interval(0, 12)));
+      Assert.AreEqual(false, interval1.Equals(interval2));
+      Assert.AreEqual(true, interval3 == new Interval(double.NegativeInfinity, 0));
+      Assert.AreEqual(true, interval1 != interval2);
+      Assert.AreEqual(false, interval2 == interval3);
+      Assert.AreEqual(false, interval1 != new Interval(0, 12));
+    }
+    //[TestMethod]
+    //[TestCategory("Problems.DataAnalysis")]
+    //[TestProperty("Time", "short")]
+    //public void RootTest() {
+    //  var posInterval = new Interval(3, 5);
+    //  var negInterval = new Interval(-6, -2);
+    //  var posIntervalConst = new Interval(5, 5);
+    //  var negIntervalConst = new Interval(-3, -3);
+    //  var zeroIntervalConst = new Interval(0, 0);
+    //  var zeroPosInterval = new Interval(0, 2);
+    //  var zeroNegInterval = new Interval(-2, 0);
+
+    //  var posRoot = new Interval(4, 4);
+    //  var negRoot = new Interval(-4, -4);
+    //  var zeroRoot = new Interval(0, 0);
+    //  var oneRoot = new Interval(1, 1);
+
+    //  Assert.AreEqual(Interval.Root(posInterval, posRoot), new Interval(Math.Pow(3, (1.0/4)), Math.Pow(5, (1.0/4))));
+    //  Assert.AreEqual(Interval.Root(posInterval, negRoot), new Interval(Math.Pow(5, -(1.0/4)), Math.Pow(3, -(1.0/4))));
+    //  Assert.AreEqual(Interval.Root(posInterval, zeroRoot), new Interval(double.NaN, double.NaN));
+    //  Assert.AreEqual(Interval.Root(posInterval, oneRoot), new Interval(3, 5));
+
+    //  Assert.AreEqual(Interval.Root(negInterval, posRoot), new Interval(Math.Pow(-6, (1.0 / 4)), Math.Pow(-2, (1.0 / 4))));
+    //  Assert.AreEqual(Interval.Root(negInterval, negRoot), new Interval(Math.Pow(-2, -(1.0 / 4)), Math.Pow(-6, -(1.0 / 4))));
+    //  Assert.AreEqual(Interval.Root(negInterval, zeroRoot), new Interval(double.NaN, double.NaN));
+    //  Assert.AreEqual(Interval.Root(negInterval, oneRoot), new Interval(-6, -2));
+
+    //  Assert.AreEqual(Interval.Root(posIntervalConst, posRoot), new Interval(Math.Pow(5, (1.0 / 4)), Math.Pow(5, (1.0 / 4))));
+    //  Assert.AreEqual(Interval.Root(posIntervalConst, negRoot), new Interval(Math.Pow(5, -(1.0 / 4)), Math.Pow(5, -(1.0 / 4))));
+    //  Assert.AreEqual(Interval.Root(posIntervalConst, zeroRoot), new Interval(double.NaN, double.NaN));
+    //  Assert.AreEqual(Interval.Root(posIntervalConst, oneRoot), new Interval(5, 5));
+
+    //  Assert.AreEqual(Interval.Root(negIntervalConst, posRoot), new Interval(Math.Pow(-3, (1.0 / 4)), Math.Pow(-3, (1.0 / 4))));
+    //  Assert.AreEqual(Interval.Root(negIntervalConst, negRoot), new Interval(Math.Pow(-3, -(1.0 / 4)), Math.Pow(-3, -(1.0 / 4))));
+    //  Assert.AreEqual(Interval.Root(negIntervalConst, zeroRoot), new Interval(double.NaN, double.NaN));
+    //  Assert.AreEqual(Interval.Root(negIntervalConst, oneRoot), new Interval(-3, -3));
+
+    //  Assert.AreEqual(Interval.Root(zeroIntervalConst, posRoot), new Interval(0, 0));
+    //  //Compley Infinity https://www.wolframalpha.com/input/?i=root%28-4%2C+0%29
+    //  Assert.AreEqual(Interval.Root(zeroIntervalConst, negRoot), new Interval(double.PositiveInfinity, double.PositiveInfinity));
+    //  Assert.AreEqual(Interval.Root(zeroIntervalConst, zeroRoot), new Interval(0, 0));
+    //  Assert.AreEqual(Interval.Root(zeroIntervalConst, oneRoot), new Interval(0, 0));
+
+    //  Assert.AreEqual(Interval.Root(zeroPosInterval, posRoot), new Interval(0, Math.Pow(2, (1.0 / 4))));
+    //  //Check for complex infinity
+    //  Assert.AreEqual(Interval.Root(zeroPosInterval, negRoot), new Interval(Math.Pow(2, -(1.0 / 4)), double.PositiveInfinity));
+    //  Assert.AreEqual(Interval.Root(zeroPosInterval, zeroRoot), new Interval(0, 0));
+    //  Assert.AreEqual(Interval.Root(zeroPosInterval, oneRoot), new Interval(0, 2));
+
+    //  Assert.AreEqual(Interval.Root(zeroNegInterval, posRoot), new Interval(Math.Pow(-2, (1.0 / 4)),0));
+    //  //Check for complex infinity
+    //  Assert.AreEqual(Interval.Root(zeroNegInterval, negRoot), new Interval(Math.Pow(-2, -(1.0 / 4)), double.PositiveInfinity));
+    //  Assert.AreEqual(Interval.Root(zeroNegInterval, zeroRoot), new Interval(double.NaN, double.NaN));
+    //  Assert.AreEqual(Interval.Root(zeroNegInterval, oneRoot), new Interval(-2, 0));
+    //}
   }
 }
Index: /trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/IntervalInterpreterTest.cs
===================================================================
--- /trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/IntervalInterpreterTest.cs	(revision 17583)
+++ /trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/IntervalInterpreterTest.cs	(revision 17584)
@@ -40,5 +40,5 @@
       Interval result;
       if (variableRanges == null)
-        result = interpreter.GetSymbolicExpressionTreeInterval(tree, problemData.Dataset, problemData.AllIndices);
+        result = interpreter.GetSymbolicExpressionTreeInterval(tree, problemData.Dataset, rows:problemData.AllIndices);
       else
         result = interpreter.GetSymbolicExpressionTreeInterval(tree, variableRanges);
@@ -163,18 +163,4 @@
     }
 
-    [TestMethod]
-    [TestCategory("Problems.DataAnalysis.Symbolic")]
-    [TestProperty("Time", "short")]
-    public void TestIntervalInterpreterExpRoot() {
-      EvaluateTest("exp(root(x1*x2, 2))", new Interval(Math.Exp(Math.Sqrt(6)), Math.Exp(Math.Sqrt(48))));
-      EvaluateTest("exp(root(x1*x2, 2))", new Interval(Math.Exp(Math.Sqrt(4)), Math.Exp(Math.Sqrt(60))), variableRanges);
-    }
-
-    [TestMethod]
-    [TestCategory("Problems.DataAnalysis.Symbolic")]
-    [TestProperty("Time", "short")]
-    public void TestIntervalInterpreterPower() {
-      EvaluateTest("pow(x1, 2)", new Interval(Math.Pow(3, 1), Math.Pow(8, 3)));
-    }
   }
 }
