Example #1
0
        public void ToDotNetArray1D()
        {
            var np1 = new NDArrayGeneric <double>().arange(9);

            double[] np1_ = np1.ToDotNetArray <double[]>();

            Assert.IsTrue(Enumerable.SequenceEqual(np1_, np1.Data));
        }
Example #2
0
        public void Setup()
        {
            // first array
            np1Matrix = new NDArrayGeneric <double>().arange(100 * 100 + 2, 2).reshape(100, 100);

            np1DoubleMatrix = np1Matrix.ToDotNetArray <double[][]>();

            // second array
            np2Matrix = new NDArrayGeneric <double>().arange(100 * 100 + 1, 1).reshape(100, 100);;

            np2DoubleMatrix = np2Matrix.ToDotNetArray <double[][]>();
        }
Example #3
0
        public void ToDotNetArray2D()
        {
            var np1 = new NDArrayGeneric <double>().arange(9).reshape(3, 3);

            double[][] np1_ = np1.ToDotNetArray <double[][]>();

            for (int idx = 0; idx < 3; idx++)
            {
                for (int jdx = 0; jdx < 3; jdx++)
                {
                    Assert.IsTrue(np1[idx, jdx] == np1_[idx][jdx]);
                }
            }
        }