Esempio n. 1
0
        static MatrixList <MatrixList <int> > SumMatrix(MatrixList <MatrixList <int> > matrixlist1, MatrixList <MatrixList <int> > matrixlist2, int Qnum)
        {
            MatrixList <MatrixList <int> > sum = new MatrixList <MatrixList <int> >();

            for (int i = 0; i < Qnum; i++)
            {
                MatrixList <int> act1 = matrixlist1.Prepare(i).data;
                MatrixList <int> act2 = matrixlist2.Prepare(i).data;
                MatrixList <int> Act  = new MatrixList <int>();
                for (int j = 0; j < Qnum; j++)
                {
                    Act.ElemAdd(act1.GetNumber(j) + act2.GetNumber(j));
                }
                sum.ElemAdd(Act);
            }
            return(sum);
        }