GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
dvnorm.f
Go to the documentation of this file.
1 DOUBLE PRECISION FUNCTION dvnorm (N, V, W)
2C***BEGIN PROLOGUE DVNORM
3C***SUBSIDIARY
4C***PURPOSE Weighted root-mean-square vector norm.
5C***TYPE DOUBLE PRECISION (SVNORM-S, DVNORM-D)
6C***AUTHOR Hindmarsh, Alan C., (LLNL)
7C***DESCRIPTION
8C
9C This function routine computes the weighted root-mean-square norm
10C of the vector of length N contained in the array V, with weights
11C contained in the array W of length N:
12C DVNORM = SQRT( (1/N) * SUM( V(i)*W(i) )**2 )
13C
14C***SEE ALSO DLSODE
15C***ROUTINES CALLED (NONE)
16C***REVISION HISTORY (YYMMDD)
17C 791129 DATE WRITTEN
18C 890501 Modified prologue to SLATEC/LDOC format. (FNF)
19C 890503 Minor cosmetic changes. (FNF)
20C 930809 Renamed to allow single/double precision versions. (ACH)
21C***END PROLOGUE DVNORM
22C**End
23 INTEGER n, i
24 DOUBLE PRECISION v, w, sum
25 dimension v(n), w(n)
26C
27C***FIRST EXECUTABLE STATEMENT DVNORM
28 sum = 0.0d0
29 DO 10 i = 1,n
30 10 sum = sum + (v(i)*w(i))**2
31 dvnorm = sqrt(sum/n)
32 RETURN
33C----------------------- END OF FUNCTION DVNORM ------------------------
34 END
double precision function dvnorm(n, v, w)
Definition dvnorm.f:2