Exemplo n.º 1
0
        public void Absolute()
        {
            VectorD v = new VectorD(new double[] { -1, -2, -3, -4 });
              v.Absolute();
              Assert.AreEqual(1, v[0]);
              Assert.AreEqual(2, v[1]);
              Assert.AreEqual(3, v[2]);
              Assert.AreEqual(4, v[3]);

              v = new VectorD(new double[] { 1, 2, 3, 4 });
              v.Absolute();
              Assert.AreEqual(1, v[0]);
              Assert.AreEqual(2, v[1]);
              Assert.AreEqual(3, v[2]);
              Assert.AreEqual(4, v[3]);
        }