1 *> \brief <b> DGESV computes the solution to system of linear equations A * X = B for GE matrices</b>
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DGESV + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dgesv.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dgesv.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgesv.f">
21 * SUBROUTINE DGESV( N, NRHS, A, LDA, IPIV, B, LDB, INFO )
23 * .. Scalar Arguments ..
24 * INTEGER INFO, LDA, LDB, N, NRHS
26 * .. Array Arguments ..
28 * DOUBLE PRECISION A( LDA, * ), B( LDB, * )
37 *> DGESV computes the solution to a real system of linear equations
39 *> where A is an N-by-N matrix and X and B are N-by-NRHS matrices.
41 *> The LU decomposition with partial pivoting and row interchanges is
42 *> used to factor A as
44 *> where P is a permutation matrix, L is unit lower triangular, and U is
45 *> upper triangular. The factored form of A is then used to solve the
46 *> system of equations A * X = B.
55 *> The number of linear equations, i.e., the order of the
62 *> The number of right hand sides, i.e., the number of columns
63 *> of the matrix B. NRHS >= 0.
68 *> A is DOUBLE PRECISION array, dimension (LDA,N)
69 *> On entry, the N-by-N coefficient matrix A.
70 *> On exit, the factors L and U from the factorization
71 *> A = P*L*U; the unit diagonal elements of L are not stored.
77 *> The leading dimension of the array A. LDA >= max(1,N).
82 *> IPIV is INTEGER array, dimension (N)
83 *> The pivot indices that define the permutation matrix P;
84 *> row i of the matrix was interchanged with row IPIV(i).
89 *> B is DOUBLE PRECISION array, dimension (LDB,NRHS)
90 *> On entry, the N-by-NRHS matrix of right hand side matrix B.
91 *> On exit, if INFO = 0, the N-by-NRHS solution matrix X.
97 *> The leading dimension of the array B. LDB >= max(1,N).
103 *> = 0: successful exit
104 *> < 0: if INFO = -i, the i-th argument had an illegal value
105 *> > 0: if INFO = i, U(i,i) is exactly zero. The factorization
106 *> has been completed, but the factor U is exactly
107 *> singular, so the solution could not be computed.
113 *> \author Univ. of Tennessee
114 *> \author Univ. of California Berkeley
115 *> \author Univ. of Colorado Denver
118 *> \date November 2011
120 *> \ingroup doubleGEsolve
122 * =====================================================================
123 SUBROUTINE DGESV( N, NRHS, A, LDA, IPIV, B, LDB, INFO )
125 * -- LAPACK driver routine (version 3.4.0) --
126 * -- LAPACK is a software package provided by Univ. of Tennessee, --
127 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
130 * .. Scalar Arguments ..
131 INTEGER INFO, LDA, LDB, N, NRHS
133 * .. Array Arguments ..
135 DOUBLE PRECISION A( LDA, * ), B( LDB, * )
138 * =====================================================================
140 * .. External Subroutines ..
141 EXTERNAL DGETRF, DGETRS, XERBLA
143 * .. Intrinsic Functions ..
146 * .. Executable Statements ..
148 * Test the input parameters.
153 ELSE IF( NRHS.LT.0 ) THEN
155 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
157 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
161 CALL XERBLA( 'DGESV ', -INFO )
165 * Compute the LU factorization of A.
167 CALL DGETRF( N, N, A, LDA, IPIV, INFO )
170 * Solve the system A*X = B, overwriting B with X.
172 CALL DGETRS( 'No transpose', N, NRHS, A, LDA, IPIV, B, LDB,