~ubuntu-branches/ubuntu/utopic/nwchem/utopic

« back to all changes in this revision

Viewing changes to src/lapack/double/dlaruv.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
*> \brief \b DLARUV returns a vector of n random real numbers from a uniform distribution.
 
2
*
 
3
*  =========== DOCUMENTATION ===========
 
4
*
 
5
* Online html documentation available at 
 
6
*            http://www.netlib.org/lapack/explore-html/ 
 
7
*
 
8
*> \htmlonly
 
9
*> Download DLARUV + dependencies 
 
10
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlaruv.f"> 
 
11
*> [TGZ]</a> 
 
12
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlaruv.f"> 
 
13
*> [ZIP]</a> 
 
14
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlaruv.f"> 
 
15
*> [TXT]</a>
 
16
*> \endhtmlonly 
 
17
*
 
18
*  Definition:
 
19
*  ===========
 
20
*
 
21
*       SUBROUTINE DLARUV( ISEED, N, X )
 
22
 
23
*       .. Scalar Arguments ..
 
24
*       INTEGER            N
 
25
*       ..
 
26
*       .. Array Arguments ..
 
27
*       INTEGER            ISEED( 4 )
 
28
*       DOUBLE PRECISION   X( N )
 
29
*       ..
 
30
*  
 
31
*
 
32
*> \par Purpose:
 
33
*  =============
 
34
*>
 
35
*> \verbatim
 
36
*>
 
37
*> DLARUV returns a vector of n random real numbers from a uniform (0,1)
 
38
*> distribution (n <= 128).
 
39
*>
 
40
*> This is an auxiliary routine called by DLARNV and ZLARNV.
 
41
*> \endverbatim
 
42
*
 
43
*  Arguments:
 
44
*  ==========
 
45
*
 
46
*> \param[in,out] ISEED
 
47
*> \verbatim
 
48
*>          ISEED is INTEGER array, dimension (4)
 
49
*>          On entry, the seed of the random number generator; the array
 
50
*>          elements must be between 0 and 4095, and ISEED(4) must be
 
51
*>          odd.
 
52
*>          On exit, the seed is updated.
 
53
*> \endverbatim
 
54
*>
 
55
*> \param[in] N
 
56
*> \verbatim
 
57
*>          N is INTEGER
 
58
*>          The number of random numbers to be generated. N <= 128.
 
59
*> \endverbatim
 
60
*>
 
61
*> \param[out] X
 
62
*> \verbatim
 
63
*>          X is DOUBLE PRECISION array, dimension (N)
 
64
*>          The generated random numbers.
 
65
*> \endverbatim
 
66
*
 
67
*  Authors:
 
68
*  ========
 
69
*
 
70
*> \author Univ. of Tennessee 
 
71
*> \author Univ. of California Berkeley 
 
72
*> \author Univ. of Colorado Denver 
 
73
*> \author NAG Ltd. 
 
74
*
 
75
*> \date September 2012
 
76
*
 
77
*> \ingroup auxOTHERauxiliary
 
78
*
 
79
*> \par Further Details:
 
80
*  =====================
 
81
*>
 
82
*> \verbatim
 
83
*>
 
84
*>  This routine uses a multiplicative congruential method with modulus
 
85
*>  2**48 and multiplier 33952834046453 (see G.S.Fishman,
 
86
*>  'Multiplicative congruential random number generators with modulus
 
87
*>  2**b: an exhaustive analysis for b = 32 and a partial analysis for
 
88
*>  b = 48', Math. Comp. 189, pp 331-344, 1990).
 
89
*>
 
90
*>  48-bit integers are stored in 4 integer array elements with 12 bits
 
91
*>  per element. Hence the routine is portable across machines with
 
92
*>  integers of 32 bits or more.
 
93
*> \endverbatim
 
94
*>
 
95
*  =====================================================================
1
96
      SUBROUTINE DLARUV( ISEED, N, X )
2
97
*
3
 
*  -- LAPACK auxiliary routine (version 2.0) --
4
 
*     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
5
 
*     Courant Institute, Argonne National Lab, and Rice University
6
 
*     October 31, 1992
 
98
*  -- LAPACK auxiliary routine (version 3.4.2) --
 
99
*  -- LAPACK is a software package provided by Univ. of Tennessee,    --
 
100
*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
 
101
*     September 2012
7
102
*
8
103
*     .. Scalar Arguments ..
9
104
      INTEGER            N
13
108
      DOUBLE PRECISION   X( N )
14
109
*     ..
15
110
*
16
 
c
17
 
* $Id: dlaruv.f 19697 2010-10-29 16:57:34Z d3y133 $
18
 
c
19
 
*  Purpose
20
 
*  =======
21
 
*
22
 
*  DLARUV returns a vector of n random real numbers from a uniform (0,1)
23
 
*  distribution (n <= 128).
24
 
*
25
 
*  This is an auxiliary routine called by DLARNV and ZLARNV.
26
 
*
27
 
*  Arguments
28
 
*  =========
29
 
*
30
 
*  ISEED   (input/output) INTEGER array, dimension (4)
31
 
*          On entry, the seed of the random number generator; the array
32
 
*          elements must be between 0 and 4095, and ISEED(4) must be
33
 
*          odd.
34
 
*          On exit, the seed is updated.
35
 
*
36
 
*  N       (input) INTEGER
37
 
*          The number of random numbers to be generated. N <= 128.
38
 
*
39
 
*  X       (output) DOUBLE PRECISION array, dimension (N)
40
 
*          The generated random numbers.
41
 
*
42
 
*  Further Details
43
 
*  ===============
44
 
*
45
 
*  This routine uses a multiplicative congruential method with modulus
46
 
*  2**48 and multiplier 33952834046453 (see G.S.Fishman,
47
 
*  'Multiplicative congruential random number generators with modulus
48
 
*  2**b: an exhaustive analysis for b = 32 and a partial analysis for
49
 
*  b = 48', Math. Comp. 189, pp 331-344, 1990).
50
 
*
51
 
*  48-bit integers are stored in 4 integer array elements with 12 bits
52
 
*  per element. Hence the routine is portable across machines with
53
 
*  integers of 32 bits or more.
54
 
*
55
111
*  =====================================================================
56
112
*
57
113
*     .. Parameters ..
335
391
      I3 = ISEED( 3 )
336
392
      I4 = ISEED( 4 )
337
393
*
338
 
*   The following lines are to take care of compiler warnings
339
 
*
340
 
      IT1 = ISEED( 1 )
341
 
      IT2 = ISEED( 2 )
342
 
      IT3 = ISEED( 3 )
343
 
      IT4 = ISEED( 4 )
344
 
*
345
394
      DO 10 I = 1, MIN( N, LV )
 
395
*         
 
396
  20     CONTINUE
346
397
*
347
398
*        Multiply the seed by i-th power of the multiplier modulo 2**48
348
399
*
363
414
*
364
415
         X( I ) = R*( DBLE( IT1 )+R*( DBLE( IT2 )+R*( DBLE( IT3 )+R*
365
416
     $            DBLE( IT4 ) ) ) )
 
417
*
 
418
         IF (X( I ).EQ.1.0D0) THEN
 
419
*           If a real number has n bits of precision, and the first
 
420
*           n bits of the 48-bit integer above happen to be all 1 (which
 
421
*           will occur about once every 2**n calls), then X( I ) will
 
422
*           be rounded to exactly 1.0. 
 
423
*           Since X( I ) is not supposed to return exactly 0.0 or 1.0,
 
424
*           the statistically correct thing to do in this situation is
 
425
*           simply to iterate again.
 
426
*           N.B. the case X( I ) = 0.0 should not be possible.  
 
427
            I1 = I1 + 2
 
428
            I2 = I2 + 2
 
429
            I3 = I3 + 2
 
430
            I4 = I4 + 2
 
431
            GOTO 20
 
432
         END IF
 
433
*
366
434
   10 CONTINUE
367
435
*
368
436
*     Return final value of seed