public void AddPairException4()
        {
            ShepardInterpolationF shepard = new ShepardInterpolationF();

            shepard.Add(new Pair <VectorF, VectorF>(new VectorF(1, 2), new VectorF(1, 3)));
            shepard.Add(new Pair <VectorF, VectorF>(new VectorF(3, 2), new VectorF(1, 3))); // Invalid dimension.
        }
 public void GetYException()
 {
     ShepardInterpolationF shepard = new ShepardInterpolationF();
       shepard.Add(new Pair<VectorF, VectorF>(new VectorF(1, 2), new VectorF(1, 3)));
       shepard.Add(new Pair<VectorF, VectorF>(new VectorF(1, 4), new VectorF(1, 5))); // Invalid dimension.
       shepard.GetY(-1);
 }
        public void Test1()
        {
            float[] xValues = new float[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
            float[] yValues = new float[] { 0, 4, 5, 3, 1, 2, 3, 7, 8, 9 };

            // Setup scattered interpolation with Shepard's method.
            ShepardInterpolationF shepard = new ShepardInterpolationF();

            for (int i = 0; i < xValues.Length; i++)
            {
                shepard.Add(new Pair <VectorF, VectorF>(new VectorF(1, xValues[i]), new VectorF(1, yValues[i])));
            }
            shepard.Power = 3f;

            Assert.IsTrue(Numeric.AreEqual(yValues[0], shepard.Compute(new VectorF(1, 0))[0]));
            Assert.IsTrue(Numeric.AreEqual(yValues[2], shepard.Compute(new VectorF(1, 2))[0]));
            Assert.IsTrue(Numeric.AreEqual(yValues[3], shepard.Compute(new VectorF(1, 3))[0]));
            Assert.IsTrue(Numeric.AreEqual(yValues[4], shepard.Compute(new VectorF(1, 4))[0]));
            Assert.IsTrue(Numeric.AreEqual(yValues[8], shepard.Compute(new VectorF(1, 8))[0]));

            // Test clear and reuse object.
            shepard.Clear();
            for (int i = 0; i < xValues.Length; i++)
            {
                shepard.Add(new Pair <VectorF, VectorF>(new VectorF(1, xValues[i]), new VectorF(1, yValues[i])));
            }
            Assert.IsTrue(Numeric.AreEqual(yValues[0], shepard.Compute(new VectorF(1, 0))[0]));
        }
        public void GetYException2()
        {
            ShepardInterpolationF shepard = new ShepardInterpolationF();

            shepard.Add(new Pair <VectorF, VectorF>(new VectorF(1, 2), new VectorF(1, 3)));
            shepard.Add(new Pair <VectorF, VectorF>(new VectorF(1, 4), new VectorF(1, 5))); // Invalid dimension.
            shepard.GetY(2);
        }
        public void Test1()
        {
            float[] xValues = new float[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
              float[] yValues = new float[] { 0, 4, 5, 3, 1, 2, 3, 7, 8, 9 };

              // Setup scattered interpolation with Shepard's method.
              ShepardInterpolationF shepard = new ShepardInterpolationF();
              for (int i = 0; i < xValues.Length; i++)
            shepard.Add(new Pair<VectorF, VectorF>(new VectorF(1, xValues[i]), new VectorF(1, yValues[i])));
              shepard.Power = 3f;

              Assert.IsTrue(Numeric.AreEqual(yValues[0], shepard.Compute(new VectorF(1, 0))[0]));
              Assert.IsTrue(Numeric.AreEqual(yValues[2], shepard.Compute(new VectorF(1, 2))[0]));
              Assert.IsTrue(Numeric.AreEqual(yValues[3], shepard.Compute(new VectorF(1, 3))[0]));
              Assert.IsTrue(Numeric.AreEqual(yValues[4], shepard.Compute(new VectorF(1, 4))[0]));
              Assert.IsTrue(Numeric.AreEqual(yValues[8], shepard.Compute(new VectorF(1, 8))[0]));

              // Test clear and reuse object.
              shepard.Clear();
              for (int i = 0; i < xValues.Length; i++)
            shepard.Add(new Pair<VectorF, VectorF>(new VectorF(1, xValues[i]), new VectorF(1, yValues[i])));
              Assert.IsTrue(Numeric.AreEqual(yValues[0], shepard.Compute(new VectorF(1, 0))[0]));
        }
        public void SetupException()
        {
            ShepardInterpolationF shepard = new ShepardInterpolationF();

            shepard.Setup(); // No data.
        }
        public void AddPairException2()
        {
            ShepardInterpolationF shepard = new ShepardInterpolationF();

            shepard.Add(new Pair <VectorF, VectorF>(new VectorF(1, 2), null));
        }
        public void ComputeException()
        {
            ShepardInterpolationF shepard = new ShepardInterpolationF();

            shepard.Compute(null); // No data.
        }
 public void SetupException()
 {
     ShepardInterpolationF shepard = new ShepardInterpolationF();
       shepard.Setup(); // No data.
 }
 public void ComputeException()
 {
     ShepardInterpolationF shepard = new ShepardInterpolationF();
       shepard.Compute(null); // No data.
 }
 public void AddPairException4()
 {
     ShepardInterpolationF shepard = new ShepardInterpolationF();
       shepard.Add(new Pair<VectorF, VectorF>(new VectorF(1, 2), new VectorF(1, 3)));
       shepard.Add(new Pair<VectorF, VectorF>(new VectorF(3, 2), new VectorF(1, 3))); // Invalid dimension.
 }
 public void AddPairException2()
 {
     ShepardInterpolationF shepard = new ShepardInterpolationF();
       shepard.Add(new Pair<VectorF, VectorF>(new VectorF(1, 2), null));
 }