Forgot to load lapack in a few examples
[maxima.git] / share / odepack / fortran / dvnorm.f
blob7da1b19f13fa2f5847592d53d15dffa6f7c4a3f4
1 *DECK DVNORM
2 DOUBLE PRECISION FUNCTION DVNORM (N, V, W)
3 C***BEGIN PROLOGUE DVNORM
4 C***SUBSIDIARY
5 C***PURPOSE Weighted root-mean-square vector norm.
6 C***TYPE DOUBLE PRECISION (SVNORM-S, DVNORM-D)
7 C***AUTHOR Hindmarsh, Alan C., (LLNL)
8 C***DESCRIPTION
10 C This function routine computes the weighted root-mean-square norm
11 C of the vector of length N contained in the array V, with weights
12 C contained in the array W of length N:
13 C DVNORM = SQRT( (1/N) * SUM( V(i)*W(i) )**2 )
15 C***SEE ALSO DLSODE
16 C***ROUTINES CALLED (NONE)
17 C***REVISION HISTORY (YYMMDD)
18 C 791129 DATE WRITTEN
19 C 890501 Modified prologue to SLATEC/LDOC format. (FNF)
20 C 890503 Minor cosmetic changes. (FNF)
21 C 930809 Renamed to allow single/double precision versions. (ACH)
22 C***END PROLOGUE DVNORM
23 C**End
24 INTEGER N, I
25 DOUBLE PRECISION V, W, SUM
26 DIMENSION V(N), W(N)
28 C***FIRST EXECUTABLE STATEMENT DVNORM
29 SUM = 0.0D0
30 DO 10 I = 1,N
31 10 SUM = SUM + (V(I)*W(I))**2
32 DVNORM = SQRT(SUM/N)
33 RETURN
34 C----------------------- END OF FUNCTION DVNORM ------------------------
35 END