Rename *ll* and *ul* to ll and ul in in-interval
[maxima.git] / share / fftpack5 / fortran / xercon.f
blob938adca686a8348d3f60c7aecad6c5d5c80c28c8
1 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3 C FFTPACK 5.0
5 C Authors: Paul N. Swarztrauber and Richard A. Valent
7 C $Id$
9 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
11 LOGICAL FUNCTION XERCON (INC,JUMP,N,LOT)
12 INTEGER INC, JUMP, N, LOT
13 INTEGER I, J, JNEW, LCM
15 C Definition: positive integers INC, JUMP, N and LOT are consistent
16 C ----------
17 C if I1*INC + J1*JUMP = I2*INC + J2*JUMP for I1,I2 < N and J1,J2
18 C < LOT implies I1=I2 and J1=J2.
20 C For multiple FFTs to execute correctly, input parameters INC,
21 C JUMP, N and LOT must be consistent ... otherwise at least one
22 C array element mistakenly is transformed more than once.
24 C XERCON = .TRUE. if and only if INC, JUMP, N and LOT are
25 C consistent.
27 C ------------------------------------------------------------------
29 C Compute I = greatest common divisor (INC, JUMP)
31 I = INC
32 J = JUMP
33 10 CONTINUE
34 IF (J .NE. 0) THEN
35 JNEW = MOD(I,J)
36 I = J
37 J = JNEW
38 GO TO 10
39 ENDIF
41 C Compute LCM = least common multiple (INC, JUMP)
43 LCM = (INC*JUMP)/I
45 C Check consistency of INC, JUMP, N, LOT
47 IF (LCM .LE. (N-1)*INC .AND. LCM .LE. (LOT-1)*JUMP) THEN
48 XERCON = .FALSE.
49 ELSE
50 XERCON = .TRUE.
51 ENDIF
53 RETURN
54 END