subroutine icopy ( n, x, incx, y, incy ) ! !******************************************************************************* ! !! ICOPY copies one integer vector into another. ! ! ! Modified: ! ! 08 April 1999 ! ! Parameters: ! ! Input, integer N, the number of vector entries. ! ! Input, integer X(*), the vector to be copied. ! ! Input, integer INCX, the increment between successive elements of X. ! ! Output, integer Y(*), the vector containing a copy of X. ! ! Input, integer INCY, the increment between successive elements of Y. ! integer i integer incx integer incy integer ix integer iy integer n integer x(*) integer y(*) ! if ( n <= 0 ) then else if ( incx == 1 .and. incy == 1 ) then y(1:n) = x(1:n) else if ( incx >= 0 ) then ix = 1 else ix = ( - n + 1 ) * incx + 1 end if if ( incy >= 0 ) then iy = 1 else iy = ( - n + 1 ) * incy + 1 end if do i = 1, n y(iy) = x(ix) ix = ix + incx iy = iy + incy end do end if return end subroutine iinit ( n, ia, x, incx ) ! !******************************************************************************* ! !! IINIT initializes an integer vector to a constant. ! ! ! Modified: ! ! 09 April 1999 ! ! Parameters: ! ! Input, integer N, the number of entries in the vector. ! ! Input, integer IA, the constant value to be assigned to the vector. ! ! Output, integer X(*), the vector, whose entries will be assigned ! to the constant value. ! ! Input, integer INCX, the increment between successive entries of X. ! integer i integer ia integer incx integer ix integer n integer x(*) ! if ( n <= 0 ) then else if ( incx == 1 ) then x(1:n) = ia else if ( incx >= 0 ) then ix = 1 else ix = ( - n + 1 ) * incx + 1 end if do i = 1, n x(ix) = ia ix = ix + incx end do end if return end function ivsame ( n, x, y ) ! !******************************************************************************* ! !! IVSAME determines if two integer vectors are identical. ! ! ! Modified: ! ! 28 December 2000 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, integer N, the number of entries in the vectors. ! ! Input, integer X(N), Y(N), the two vectors to compare. ! ! Output, logical IVSAME, is TRUE if the vectors are identical, ! and FALSE if at least one pair of entries differ. ! integer n ! logical ivsame integer x(n) integer y(n) ! ivsame = all ( x(1:n) == y(1:n) ) return end