Beispiel #1
0
        public void MatrixConstructors()
        {
            var m1 = new NNMatrix(2, 3);
            Assert.AreEqual(m1.NbRows, 2);
            Assert.AreEqual(m1.NbCols, 3);
            Init(m1);

            var m2 = new NNMatrix(data);
            Assert.AreEqual(m2.NbRows, 2);
            Assert.AreEqual(m2.NbCols, 3);
            Assert.AreEqual(m1.ToString(), m2.ToString());
        }
Beispiel #2
0
        public void MatrixRowCol()
        {
            var m1 = new NNMatrix(data);
            string s1 = m1.ToString();

            var m2 = new NNMatrix(2, 3);
            Init(m2);
            Assert.AreEqual(m1.ToString(), m2.ToString());

            NNMatrix M = new NNMatrix(2, 3); // 2 row * 3 Columns
            M[0, 0] = 11;
            M[0, 1] = 12;
            M[0, 2] = 13;
            M[1, 0] = 11;
            M[1, 1] = 12;
            M[1, 2] = 13;

            var s = M.ToString();

            Assert.AreEqual(2, m1.NbRows);
            Assert.AreEqual(2, M.NbRows);
            Assert.AreEqual(3, m1.NbCols);
            Assert.AreEqual(3, M.NbCols);
        }