Example #1
0
        // This can be speed up by inlining the multBlock* calls, reducing number of multiplications
        // and other stuff.  doesn't seem to have any speed advantage over mult_reorder()
        public static void mult(FMatrixRBlock A, FMatrixRBlock B, FMatrixRBlock C)
        {
            if (A.numCols != B.numRows)
            {
                throw new ArgumentException("Columns in A are incompatible with rows in B");
            }
            if (A.numRows != C.numRows)
            {
                throw new ArgumentException("Rows in A are incompatible with rows in C");
            }
            if (B.numCols != C.numCols)
            {
                throw new ArgumentException("Columns in B are incompatible with columns in C");
            }
            if (A.blockLength != B.blockLength || A.blockLength != C.blockLength)
            {
                throw new ArgumentException("Block lengths are not all the same.");
            }

            int blockLength = A.blockLength;

            FSubmatrixD1 Asub = new FSubmatrixD1(A, 0, A.numRows, 0, A.numCols);
            FSubmatrixD1 Bsub = new FSubmatrixD1(B, 0, B.numRows, 0, B.numCols);
            FSubmatrixD1 Csub = new FSubmatrixD1(C, 0, C.numRows, 0, C.numCols);

            MatrixMult_FDRB.mult(blockLength, Asub, Bsub, Csub);
        }