GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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