コード例 #1
0
        /**
         * Only converts the B matrix and passes that onto solve.  Te result is then copied into
         * the input 'X' matrix.
         *
         * @param B A matrix &real; <sup>m &times; p</sup>.  Not modified.
         * @param X A matrix &real; <sup>n &times; p</sup>, where the solution is written to.  Modified.
         */
        public override void solve(FMatrixRMaj B, FMatrixRMaj X)
        {
            blockB.reshape(B.numRows, B.numCols, false);
            MatrixOps_FDRB.convert(B, blockB);

            // since overwrite B is true X does not need to be passed in
            alg.solve(blockB, null);

            MatrixOps_FDRB.convert(blockB, X);
        }
コード例 #2
0
        public virtual /**/ double quality()
        {
            return(alg.quality());
        }

        /**
         * Converts B and X into block matrices and calls the block matrix solve routine.
         *
         * @param B A matrix &real; <sup>m &times; p</sup>.  Not modified.
         * @param X A matrix &real; <sup>n &times; p</sup>, where the solution is written to.  Modified.
         */
        public virtual void solve(FMatrixRMaj B, FMatrixRMaj X)
        {
            blockB.reshape(B.numRows, B.numCols, false);
            blockX.reshape(X.numRows, X.numCols, false);
            MatrixOps_FDRB.convert(B, blockB);

            alg.solve(blockB, blockX);

            MatrixOps_FDRB.convert(blockX, X);
        }
コード例 #3
0
        public virtual FMatrixRMaj getT(FMatrixRMaj T)
        {
            FMatrixRBlock T_block = ((CholeskyOuterForm_FDRB)alg).getT(null);

            if (T == null)
            {
                T = new FMatrixRMaj(T_block.numRows, T_block.numCols);
            }

            MatrixOps_FDRB.convert(T_block, T);
            // todo set zeros
            return(T);
        }
コード例 #4
0
        //@Override
        public FMatrixRMaj getR(FMatrixRMaj R, bool compact)
        {
            FMatrixRBlock Rblock;

            Rblock = ((QRDecompositionHouseholder_FDRB)alg).getR(null, compact);

            if (R == null)
            {
                R = new FMatrixRMaj(Rblock.numRows, Rblock.numCols);
            }
            MatrixOps_FDRB.convert(Rblock, R);

            return(R);
        }