svnorm.f

Go to the documentation of this file.
00001       REAL FUNCTION SVNORM (N, V, W)
00002 C***BEGIN PROLOGUE  SVNORM
00003 C***SUBSIDIARY
00004 C***PURPOSE  Weighted root-mean-square vector norm.
00005 C***TYPE      SINGLE PRECISION (SVNORM-S, DVNORM-D)
00006 C***AUTHOR  Hindmarsh, Alan C., (LLNL)
00007 C***DESCRIPTION
00008 C
00009 C  This function routine computes the weighted root-mean-square norm
00010 C  of the vector of length N contained in the array V, with weights
00011 C  contained in the array W of length N:
00012 C    SVNORM = SQRT( (1/N) * SUM( V(i)*W(i) )**2 )
00013 C
00014 C***SEE ALSO  SLSODE
00015 C***ROUTINES CALLED  (NONE)
00016 C***REVISION HISTORY  (YYMMDD)
00017 C   791129  DATE WRITTEN
00018 C   890501  Modified prologue to SLATEC/LDOC format.  (FNF)
00019 C   890503  Minor cosmetic changes.  (FNF)
00020 C   930809  Renamed to allow single/double precision versions. (ACH)
00021 C***END PROLOGUE  SVNORM
00022 C**End
00023       INTEGER N,   I
00024       REAL V, W,   SUM
00025       DIMENSION V(N), W(N)
00026 C
00027 C***FIRST EXECUTABLE STATEMENT  SVNORM
00028       SUM = 0.0E0
00029       DO 10 I = 1,N
00030  10     SUM = SUM + (V(I)*W(I))**2
00031       SVNORM = SQRT(SUM/N)
00032       RETURN
00033 C----------------------- END OF FUNCTION SVNORM ------------------------
00034       END
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines