~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to routines/randlib/setant.f

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
      SUBROUTINE setant(qvalue)
2
 
C**********************************************************************
3
 
C
4
 
C      SUBROUTINE SETANT(QVALUE)
5
 
C               SET ANTithetic
6
 
C
7
 
C     Sets whether the current generator produces antithetic values.  If
8
 
C     X   is  the value  normally returned  from  a uniform [0,1] random
9
 
C     number generator then 1  - X is the antithetic  value. If X is the
10
 
C     value  normally  returned  from a   uniform  [0,N]  random  number
11
 
C     generator then N - 1 - X is the antithetic value.
12
 
C
13
 
C     All generators are initialized to NOT generate antithetic values.
14
 
C
15
 
C     This is a transcription from Pascal to Fortran of routine
16
 
C     Set_Antithetic from the paper
17
 
C
18
 
C     L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package
19
 
C     with Splitting Facilities." ACM Transactions on Mathematical
20
 
C     Software, 17:98-111 (1991)
21
 
C
22
 
C
23
 
C                              Arguments
24
 
C
25
 
C
26
 
C     QVALUE -> .TRUE. if generator G is to generating antithetic
27
 
C                    values, otherwise .FALSE.
28
 
C                                   LOGICAL QVALUE
29
 
C
30
 
C**********************************************************************
31
 
      include '../stack.h'
32
 
C     .. Parameters ..
33
 
      INTEGER numg
34
 
      PARAMETER (numg=32)
35
 
C     ..
36
 
C     .. Scalar Arguments ..
37
 
      LOGICAL qvalue
38
 
C     ..
39
 
C     .. Scalars in Common ..
40
 
      INTEGER a1,a1vw,a1w,a2,a2vw,a2w,m1,m2
41
 
C     ..
42
 
C     .. Arrays in Common ..
43
 
      INTEGER cg1(numg),cg2(numg),ig1(numg),ig2(numg),lg1(numg),
44
 
     +        lg2(numg)
45
 
      LOGICAL qanti(numg)
46
 
C     ..
47
 
C     .. Local Scalars ..
48
 
      INTEGER g
49
 
C     ..
50
 
C     .. External Functions ..
51
 
      LOGICAL qrgnin
52
 
      EXTERNAL qrgnin
53
 
C     ..
54
 
C     .. External Subroutines ..
55
 
      EXTERNAL getcgn
56
 
C     ..
57
 
C     .. Common blocks ..
58
 
      COMMON /globe/m1,m2,a1,a2,a1w,a2w,a1vw,a2vw,ig1,ig2,lg1,lg2,cg1,
59
 
     +       cg2,qanti
60
 
C     ..
61
 
C     .. Save statement ..
62
 
      SAVE /globe/
63
 
C     ..
64
 
C     .. Executable Statements ..
65
 
C     Abort unless random number generator initialized
66
 
      IF (qrgnin()) GO TO 10
67
 
      call basout(io,wte,'SETANT called before random number generator')
68
 
      return
69
 
   10 CALL getcgn(g)
70
 
      qanti(g) = qvalue
71
 
      RETURN
72
 
 
73
 
      END