pure function dmnorm(n, v, w)
This function routine computes the weighted max-norm
of the vector of length N contained in the array V, with weights
contained in the array w of length N:
DMNORM = MAX(i=1,…,N) ABS(V(i))*W(i)
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
integer,
|
intent(in) |
|
|
:: |
n |
|
real(kind=dp),
|
intent(in) |
|
|
:: |
v(n) |
|
real(kind=dp),
|
intent(in) |
|
|
:: |
w(n) |
|
Return Value
real(kind=dp)
Variables
Type |
Visibility | Attributes |
|
Name |
| Initial | |
integer,
|
public |
|
:: |
i |
|
|
|
real(kind=dp),
|
public |
|
:: |
vm |
|
|
|
Source Code
pure function dmnorm (n, v, w)
integer,intent(in) :: n
real(kind=dp),intent(in) :: v(n)
real(kind=dp),intent(in) :: w(n)
real(kind=dp) :: dmnorm
integer :: i
real(kind=dp) :: vm
vm = 0.0d0
do i = 1,n
vm = max(vm,abs(v(i))*w(i))
enddo
dmnorm = vm
end function dmnorm