next up previous index
Next: F123 Bit Vector Up: CERNLIB Previous: F121 Vector Algebra

F122 Search Operations on Sparse Vectors

Routine ID: F122
Author(s): F. AntonelliLibrary: MATHLIB
Submitter: F. CarminatiSubmitted: 29.05.1989
Language: Fortran (IBM: Assembler)Revised:

Performs logical search and data movement operations on sparse vectors. On Cray systems these routines are part of the default libraries (scilib). An optimized Assembler version is provided for IBM 3090 with Vector Facilities. Fortran code is used on the other systems.

Structure:

SUBROUTINE and FUNCTION subprograms
User Entry Names:
IILZ, ILSUM, SCATTER, GATHER, WHENEQ, WHENNE, WHENFLT,
WHENFGT, WHENFLE, WHENFGE, WHENILT, WHENIGT, WHENILE, WHENIGE

Usage:

The arguments in the calling sequences below are defined as follows:

A,B
( REAL) One-dimensional arrays.
IA,INDX
( INTEGER) One-dimensional arrays.
LA
( LOGICAL) One-dimensional array.
NW,INC
( INTEGER) Variables or expressions.
TARG
( REAL) Variable or expression.
ITARG,NFOUND
( INTEGER) Variables.
In any arithmetic expression,
    IILZ(NW,A,INC)
represents the INTEGER number of leading zero elements in
LA(1),LA(INC+1),LA(2*INC+1),...,LA((NW-1)*INC+1) ;
    ILSUM(NW,LA,INC)
represents the INTEGER number of .TRUE. elements in
LA(1),LA(INC+1),LA(2*INC+1),...,LA((NW-1)*INC+1) .
    CALL SCATTER(NW,A,INDX,B)
    CALL GATHER(NW,A,B,INDX)
set A(INDX(I))=B(I),(I=1,2,...,NW)

and A(I)=B(INDX(I)),(I=1,2,...,NW) , respectively.

    CALL WHENFxx(NW,A,INC,TARG,INDX,NFOUND)
searches A(1),A(INC+1),A(2*INC+1),...,A((NW-1)*INC+1) for elements which satisfy the relation A(.).xx.TARG where xx=LT,LE,GT,GE . On exit, INDX(1),...,INDX(NFOUND) will contain the indices of the NFOUND elements which satisfy the relation specified.

    CALL WHENIxx(NW,IA,INC,ITARG,INDX,NFOUND)
performes the same task as WHENFxx but for INTEGER draw and target.
    CALL WHENEQ(NW,a,INC,targ,INDX,NFOUND)
    CALL WHENNE(NW,a,INC,targ,INDX,NFOUND)
performs the same task as WHENFxx or WHENIxx, but for xx=EQ,NE , and REAL draw a and REAL target targ, or INTEGER draw a and INTEGER target targ, respectively.

F123



next up previous index
Next: F123 Bit Vector Up: CERNLIB Previous: F121 Vector Algebra


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995