Exemple #1
0
 public void SetRowException2()
 {
     Matrix44D m = new Matrix44D(rowMajor, MatrixOrder.RowMajor);
       m.SetRow(4, Vector4D.One);
 }
Exemple #2
0
        public void SetRow()
        {
            Matrix44D m = new Matrix44D(rowMajor, MatrixOrder.RowMajor);
              m.SetRow(0, new Vector4D(0.1, 0.2, 0.3, 0.4));
              Assert.AreEqual(new Vector4D(0.1, 0.2, 0.3, 0.4), m.GetRow(0));
              Assert.AreEqual(new Vector4D(5.0, 6.0, 7.0, 8.0), m.GetRow(1));
              Assert.AreEqual(new Vector4D(9.0, 10.0, 11.0, 12.0), m.GetRow(2));
              Assert.AreEqual(new Vector4D(13.0, 14.0, 15.0, 16.0), m.GetRow(3));

              m.SetRow(1, new Vector4D(0.4, 0.5, 0.6, 0.7));
              Assert.AreEqual(new Vector4D(0.1, 0.2, 0.3, 0.4), m.GetRow(0));
              Assert.AreEqual(new Vector4D(0.4, 0.5, 0.6, 0.7), m.GetRow(1));
              Assert.AreEqual(new Vector4D(9.0, 10.0, 11.0, 12.0), m.GetRow(2));
              Assert.AreEqual(new Vector4D(13.0, 14.0, 15.0, 16.0), m.GetRow(3));

              m.SetRow(2, new Vector4D(0.7, 0.8, 0.9, 1.0));
              Assert.AreEqual(new Vector4D(0.1, 0.2, 0.3, 0.4), m.GetRow(0));
              Assert.AreEqual(new Vector4D(0.4, 0.5, 0.6, 0.7), m.GetRow(1));
              Assert.AreEqual(new Vector4D(0.7, 0.8, 0.9, 1.0), m.GetRow(2));
              Assert.AreEqual(new Vector4D(13.0, 14.0, 15.0, 16.0), m.GetRow(3));

              m.SetRow(3, new Vector4D(1.7, 1.8, 1.9, 1.3));
              Assert.AreEqual(new Vector4D(0.1, 0.2, 0.3, 0.4), m.GetRow(0));
              Assert.AreEqual(new Vector4D(0.4, 0.5, 0.6, 0.7), m.GetRow(1));
              Assert.AreEqual(new Vector4D(0.7, 0.8, 0.9, 1.0), m.GetRow(2));
              Assert.AreEqual(new Vector4D(1.7, 1.8, 1.9, 1.3), m.GetRow(3));
        }