Esempio n. 1
0
        /// <summary>
        /// Computes the minimum-norm solution to a real linear least squares problem: minimize 2-norm(|| A*X - B||)
        /// using a complete orthogonal factorization of A.
        /// The matrix A can be rank-deficient.
        /// </summary>
        /// <param name="A">The A matrix.</param>
        /// <param name="B">The matrix containing the right-hand side of the linear system.</param>
        /// <returns>A matrix containing the solution.</returns>
        public Matrix COFSolve(Matrix A, Matrix B)
        {
            //Fortran 95 Interface Notes
            //From http://www.intel.com/software/products/mkl/docs/WebHelp/lse/functn_gelsy.html
            //rcond Default value for this element is rcond = 100*EPSILON(1.0_WP).
            DLAMCH dch   = new DLAMCH();
            double RCOND = 100 * dch.Run("Epsilon");

            return(this.COFSolve(A, B, RCOND));
        }