This function computes the infinity norm distance between two points.
DISLI — Infinity norm distance between the points X and Y. (Output)
X — Vector of length max(N * |INCX|, 1). (Input)
Y — Vector of length max(N * |INCY|, 1). (Input)
N — Length of the
vectors X and
Y.
(Input)
Default: N = size
(X,1).
INCX —
Displacement between elements of X. (Input)
The I-th
element of X is
X(1 + (I - 1) *INCX) if INCX is greater than
or equal to zero or X(1 + (I - N) * INCX) if INCX is less than
zero.
Default: INCX = 1.
INCY —
Displacement between elements of Y. (Input)
The I-th
element of Y is
Y(1 + (I - 1) * INCY) if INCY is greater than
or equal to zero or Y(1 + (I - N) * INCY) if INCY is less than
zero.
Default: INCY = 1.
Generic: DISLI (X, Y [,…])
Specific: The specific interface names are S_DISLI and D_DISLI.
Single: DISLI(N, X, INCX, Y, INCY)
Double: The double precision function function name is DDISLI.
The function DISLI computes the ∞-norm distance between two points x and y. The ∞-norm distance is defined to be
Compute the ∞-norm distance between two vectors of length 4.
USE DISLI_INT
USE UMACH_INT
IMPLICIT NONE
! Declare variables
INTEGER INCX, INCY, N
PARAMETER (N=4)
!
INTEGER NOUT
REAL VAL, X(N), Y(N)
!
! Set values for X and Y
! X = ( 1.0 -1.0 0.0 2.0 )
!
! Y = ( 4.0 2.0 1.0 -3.0 )
!
DATA X/1.0, -1.0, 0.0, 2.0/
DATA Y/4.0, 2.0, 1.0, -3.0/
! Compute L-infinity distance
VAL = DISLI(X,Y)
! Print results
CALL UMACH (2, NOUT)
WRITE (NOUT,*) ' The infinity-norm distance is ', VAL
END
The infinity-norm distance is 5.00000
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |