GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ewset.f
Go to the documentation of this file.
1  SUBROUTINE ewset (N, ITOL, RTOL, ATOL, YCUR, EWT)
2 CLLL. OPTIMIZE
3 C-----------------------------------------------------------------------
4 C THIS SUBROUTINE SETS THE ERROR WEIGHT VECTOR EWT ACCORDING TO
5 C EWT(I) = RTOL(I)*ABS(YCUR(I)) + ATOL(I), I = 1,...,N,
6 C WITH THE SUBSCRIPT ON RTOL AND/OR ATOL POSSIBLY REPLACED BY 1 ABOVE,
7 C DEPENDING ON THE VALUE OF ITOL.
8 C-----------------------------------------------------------------------
9  INTEGER N, ITOL
10  INTEGER I
11  DOUBLE PRECISION RTOL, ATOL, YCUR, EWT
12  dimension rtol(*), atol(*), ycur(n), ewt(n)
13 C
14  GO TO (10, 20, 30, 40), itol
15  10 CONTINUE
16  DO 15 i = 1,n
17  15 ewt(i) = rtol(1)*dabs(ycur(i)) + atol(1)
18  RETURN
19  20 CONTINUE
20  DO 25 i = 1,n
21  25 ewt(i) = rtol(1)*dabs(ycur(i)) + atol(i)
22  RETURN
23  30 CONTINUE
24  DO 35 i = 1,n
25  35 ewt(i) = rtol(i)*dabs(ycur(i)) + atol(1)
26  RETURN
27  40 CONTINUE
28  DO 45 i = 1,n
29  45 ewt(i) = rtol(i)*dabs(ycur(i)) + atol(i)
30  RETURN
31 C----------------------- END OF SUBROUTINE EWSET -----------------------
32  END
subroutine ewset(N, ITOL, RTOL, ATOL, YCUR, EWT)
Definition: ewset.f:2