weighted root-mean-square vector norm.
this function routine computes the weighted root-mean-square norm of the vector of length n contained in the array v, with weights contained in the array w of length n:
dvnorm = sqrt( (1/n) * sum( v(i)*w(i) )**2 )
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dvode_t), | intent(inout) | :: | me | |||
integer, | intent(in) | :: | n | |||
real(kind=wp), | intent(in) | :: | v(n) | |||
real(kind=wp), | intent(in) | :: | w(n) |
real(wp) function dvnorm_default(me,n,v,w) class(dvode_t),intent(inout) :: me integer,intent(in) :: n real(wp),intent(in) :: v(n) real(wp),intent(in) :: w(n) integer :: i real(wp) :: sum sum = zero do i = 1 , n sum = sum + (v(i)*w(i))**2 enddo dvnorm_default = sqrt(sum/n) end function dvnorm_default