示例#1
0
        public void ToArrayJagged()
        {
            MatrixF m = new MatrixF(3, 4, rowMajor, MatrixOrder.RowMajor);

              float[][] array = m.ToArrayJagged();
              Assert.AreEqual(3, array.Length);
              for (int i = 0; i < 3; i++)
              {
            Assert.AreEqual(4, array[i].Length);
            for (int j = 0; j < 4; j++)
            {
              Assert.AreEqual(i * 4 + j + 1, array[i][j]);
            }
              }

              array = (float[][]) m;
              Assert.AreEqual(3, array.Length);
              for (int i = 0; i < 3; i++)
              {
            Assert.AreEqual(4, array[i].Length);
            for (int j = 0; j < 4; j++)
            {
              Assert.AreEqual(i * 4 + j + 1, array[i][j]);
            }
              }

              m = null;
              array = (float[][]) m;
              Assert.IsNull(array);
        }