~ubuntu-branches/ubuntu/trusty/nwchem/trusty-proposed

« back to all changes in this revision

Viewing changes to src/tools/ga-5-2/LinAlg/lapack+blas/dgetrs.f

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      SUBROUTINE GAL_DGETRS( TRANS, N, NRHS, A, LDA, IPIV, B, LDB,
 
2
     $                       INFO )
 
3
*
 
4
*  -- LAPACK routine (version 1.1) --
 
5
*     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
 
6
*     Courant Institute, Argonne National Lab, and Rice University
 
7
*     March 31, 1993
 
8
*
 
9
*     .. Scalar Arguments ..
 
10
      CHARACTER          TRANS
 
11
      INTEGER            INFO, LDA, LDB, N, NRHS
 
12
*     ..
 
13
*     .. Array Arguments ..
 
14
      INTEGER            IPIV( * )
 
15
      DOUBLE PRECISION   A( LDA, * ), B( LDB, * )
 
16
*     ..
 
17
*
 
18
*  Purpose
 
19
*  =======
 
20
*
 
21
*  GAL_DGETRS solves a system of linear equations
 
22
*     A * X = B  or  A' * X = B
 
23
*  with a general N-by-N matrix A using the LU factorization computed
 
24
*  by GAL_DGETRF.
 
25
*
 
26
*  Arguments
 
27
*  =========
 
28
*
 
29
*  TRANS   (input) CHARACTER*1
 
30
*          Specifies the form of the system of equations:
 
31
*          = 'N':  A * X = B  (No transpose)
 
32
*          = 'T':  A'* X = B  (Transpose)
 
33
*          = 'C':  A'* X = B  (Conjugate transpose = Transpose)
 
34
*
 
35
*  N       (input) INTEGER
 
36
*          The order of the matrix A.  N >= 0.
 
37
*
 
38
*  NRHS    (input) INTEGER
 
39
*          The number of right hand sides, i.e., the number of columns
 
40
*          of the matrix B.  NRHS >= 0.
 
41
*
 
42
*  A       (input) DOUBLE PRECISION array, dimension (LDA,N)
 
43
*          The factors L and U from the factorization A = P*L*U
 
44
*          as computed by GAL_DGETRF.
 
45
*
 
46
*  LDA     (input) INTEGER
 
47
*          The leading dimension of the array A.  LDA >= max(1,N).
 
48
*
 
49
*  IPIV    (input) INTEGER array, dimension (N)
 
50
*          The pivot indices from GAL_DGETRF; for 1<=i<=N, row i of the
 
51
*          matrix was interchanged with row IPIV(i).
 
52
*
 
53
*  B       (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS)
 
54
*          On entry, the right hand side matrix B.
 
55
*          On exit, the solution matrix X.
 
56
*
 
57
*  LDB     (input) INTEGER
 
58
*          The leading dimension of the array B.  LDB >= max(1,N).
 
59
*
 
60
*  INFO    (output) INTEGER
 
61
*          = 0:  successful exit
 
62
*          < 0:  if INFO = -i, the i-th argument had an illegal value
 
63
*
 
64
*  =====================================================================
 
65
*
 
66
*     .. Parameters ..
 
67
      DOUBLE PRECISION   ONE
 
68
      PARAMETER          ( ONE = 1.0D+0 )
 
69
*     ..
 
70
*     .. Local Scalars ..
 
71
      LOGICAL            NOTRAN
 
72
*     ..
 
73
*     .. External Functions ..
 
74
      LOGICAL            GAL_LSAME
 
75
      EXTERNAL           GAL_LSAME
 
76
*     ..
 
77
*     .. External Subroutines ..
 
78
      EXTERNAL           GAL_DLASWP, GAL_DTRSM, GAL_XERBLA
 
79
*     ..
 
80
*     .. Intrinsic Functions ..
 
81
      INTRINSIC          MAX
 
82
*     ..
 
83
*     .. Executable Statements ..
 
84
*
 
85
*     Test the input parameters.
 
86
*
 
87
      INFO = 0
 
88
      NOTRAN = GAL_LSAME( TRANS, 'N' )
 
89
      IF( .NOT.NOTRAN .AND. .NOT.GAL_LSAME( TRANS, 'T' ) .AND. .NOT.
 
90
     $    GAL_LSAME( TRANS, 'C' ) ) THEN
 
91
         INFO = -1
 
92
      ELSE IF( N.LT.0 ) THEN
 
93
         INFO = -2
 
94
      ELSE IF( NRHS.LT.0 ) THEN
 
95
         INFO = -3
 
96
      ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
 
97
         INFO = -5
 
98
      ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
 
99
         INFO = -8
 
100
      END IF
 
101
      IF( INFO.NE.0 ) THEN
 
102
         CALL GAL_XERBLA( 'GAL_DGETRS', -INFO )
 
103
         RETURN
 
104
      END IF
 
105
*
 
106
*     Quick return if possible
 
107
*
 
108
      IF( N.EQ.0 .OR. NRHS.EQ.0 )
 
109
     $   RETURN
 
110
*
 
111
      IF( NOTRAN ) THEN
 
112
*
 
113
*        Solve A * X = B.
 
114
*
 
115
*        Apply row interchanges to the right hand sides.
 
116
*
 
117
         CALL GAL_DLASWP( NRHS, B, LDB, 1, N, IPIV, 1 )
 
118
*
 
119
*        Solve L*X = B, overwriting B with X.
 
120
*
 
121
         CALL GAL_DTRSM( 'Left', 'Lower', 'No transpose', 'Unit', N,
 
122
     $               NRHS, ONE, A, LDA, B, LDB )
 
123
*
 
124
*        Solve U*X = B, overwriting B with X.
 
125
*
 
126
         CALL GAL_DTRSM( 'Left', 'Upper', 'No transpose', 'Non-unit', N,
 
127
     $               NRHS, ONE, A, LDA, B, LDB )
 
128
      ELSE
 
129
*
 
130
*        Solve A' * X = B.
 
131
*
 
132
*        Solve U'*X = B, overwriting B with X.
 
133
*
 
134
         CALL GAL_DTRSM( 'Left', 'Upper', 'Transpose', 'Non-unit', N,
 
135
     $               NRHS, ONE, A, LDA, B, LDB )
 
136
*
 
137
*        Solve L'*X = B, overwriting B with X.
 
138
*
 
139
         CALL GAL_DTRSM( 'Left', 'Lower', 'Transpose', 'Unit', N, NRHS,
 
140
     $               ONE, A, LDA, B, LDB )
 
141
*
 
142
*        Apply row interchanges to the solution vectors.
 
143
*
 
144
         CALL GAL_DLASWP( NRHS, B, LDB, 1, N, IPIV, -1 )
 
145
      END IF
 
146
*
 
147
      RETURN
 
148
*
 
149
*     End of GAL_DGETRS
 
150
*
 
151
      END