Exemple #1
0
        /// <summary>
        /// Computes the solution to a real system of linear equations A * X = B, where A is a general matrix.
        /// </summary>
        /// <param name="A">The square matrix.</param>
        /// <param name="B">The vector containing the right-hand side of the linear system.</param>
        /// <returns>A vector containing the solution to the linear system of equations.</returns>
        public Vector Solve(Matrix A, Vector B)
        {
            this.CheckDimensions(A, B);

            Matrix Solution = B.Clone();
            Matrix AClon    = A.Clone();

            this.SolveInplace(AClon, Solution);

            return(Solution.GetColumnVector(0));
        }