예제 #1
0
 public void SetSubvectorException3()
 {
     VectorF v = new VectorF(5);
       v.SetSubvector(1, new VectorF(new float[] { 1, 2, 3, 4, 5 }));
 }
예제 #2
0
 public void SetSubvectorException4()
 {
     VectorF v = new VectorF(5);
       v.SetSubvector(1, null);
 }
예제 #3
0
        public void SetSubvector()
        {
            VectorF v = new VectorF(5);
              v.SetSubvector(0, new VectorF(new float[] { 1, 2, 3, 4, 5 }));
              Assert.AreEqual(1, v[0]);
              Assert.AreEqual(2, v[1]);
              Assert.AreEqual(3, v[2]);
              Assert.AreEqual(4, v[3]);
              Assert.AreEqual(5, v[4]);

              v = new VectorF(5);
              v.SetSubvector(0, new VectorF(new float[] { 1, 2, 3, 4 }));
              Assert.AreEqual(1, v[0]);
              Assert.AreEqual(2, v[1]);
              Assert.AreEqual(3, v[2]);
              Assert.AreEqual(4, v[3]);
              Assert.AreEqual(0, v[4]);

              v = new VectorF(5);
              v.SetSubvector(2, new VectorF(new float[] { 1, 2, 3 }));
              Assert.AreEqual(0, v[0]);
              Assert.AreEqual(0, v[1]);
              Assert.AreEqual(1, v[2]);
              Assert.AreEqual(2, v[3]);
              Assert.AreEqual(3, v[4]);
        }