F123: Bit Vector Manipulation Package

Author(s): F. Antonelli Library: MATHLIB
Submitter: F. Carminati Submitted: 27.11.1989
Language: Fortran, IBM Assembler Revised: 16.08.1994

This package contains high performance procedures to operate with sparse arrays using Bit Vectors instead of ordinary Index Vectors to address the elements of an arrays. The routines are, at present, available only on IBM 3090 VF machines.

Structure:

SUBROUTINE and FUNCTION subprograms
User Entry Names:
YLOSB, IYLOSB, YLOXB, IYLOXB,
GTHRB, SCTTB, ANDB, XORB, NOTB, NANDB, NORB, ORB, BINVEC, ZEROB,
ONEB, CNTOB, CNTZB, RANGB, INTGB, RJCTB, SXPYB, VXPYB, SXYB, XPWZB,
DOTB, SCALB, VSETB, COPYB

Usage:

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

NW
(INTEGER) Number of elements to process. The index i below runs from 1 to NW.
Y,X,V,W
(REAL) Arrays of length NW at least.
IX,IY
(INTEGER) Arrays of length NW at least.
S,T
(REAL) Variables or expressions.
IS,IT
(INTEGER) Variables or expressions.
BV,BV1,BV2
Arrays of length tex2html_wrap_inline268 at least, used to contain the bit vectors.
IFOUND
(INTEGER) Number of elements which satisfy the condition, or set-bit count, for BV.
The expression X(BV) indicates all these elements of the vector X for which the corresponding bit is set in the bit array BV. BV(i) indicates the i-th bit of the array BV, counted across words boundaries. The expression tex2html_wrap_inline270 means that the i-th bit of the array BV is set.
Vector to scalar comparison:
Two SUBROUTINE subprograms are provided for REAL and INTEGER comparison. The subprogram YLOSB is for vectors with REAL elements and the subprogram IYLOSB for vectors with INTEGER elements.
CALL YLOSB(NW,Y,S,BV,IFOUND,'EQ') tex2html_wrap_inline272 if tex2html_wrap_inline274
CALL YLOSB(NW,Y,S,BV,IFOUND,'NE') tex2html_wrap_inline272 if tex2html_wrap_inline276
CALL YLOSB(NW,Y,S,BV,IFOUND,'GT') tex2html_wrap_inline272 if tex2html_wrap_inline278
CALL YLOSB(NW,Y,S,BV,IFOUND,'LT') tex2html_wrap_inline272 if tex2html_wrap_inline280
CALL YLOSB(NW,Y,S,BV,IFOUND,'GE') tex2html_wrap_inline272 if tex2html_wrap_inline282
CALL YLOSB(NW,Y,S,BV,IFOUND,'LE') tex2html_wrap_inline272 if tex2html_wrap_inline284
CALL IYLOSB(NW,Y,S,BV,IFOUND,'EQ') tex2html_wrap_inline272 if tex2html_wrap_inline286
CALL IYLOSB(NW,Y,S,BV,IFOUND,'NE') tex2html_wrap_inline272 if tex2html_wrap_inline288
CALL IYLOSB(NW,IY,IS,BV,IFOUND,'GT') tex2html_wrap_inline272 if tex2html_wrap_inline290
CALL IYLOSB(NW,IY,IS,BV,IFOUND,'LT') tex2html_wrap_inline272 if tex2html_wrap_inline292
CALL IYLOSB(NW,IY,IS,BV,IFOUND,'GE') tex2html_wrap_inline272 if tex2html_wrap_inline294
CALL IYLOSB(NW,IY,IS,BV,IFOUND,'LE') tex2html_wrap_inline272 if tex2html_wrap_inline296

Vector to vector comparison:
Two SUBROUTINE subprograms are provided for REAL and INTEGER comparison. The subprogram YLOXB is for vectors with REAL elements and the subprogram IYLOXB for vectors with INTEGER elements.
CALL YLOXB(NW,Y,X,BV,IFOUND,'EQ') tex2html_wrap_inline298 if tex2html_wrap_inline300
CALL YLOXB(NW,Y,X,BV,IFOUND,'NE') tex2html_wrap_inline298 if tex2html_wrap_inline302
CALL YLOXB(NW,Y,X,BV,IFOUND,'GT') tex2html_wrap_inline298 if tex2html_wrap_inline304
CALL YLOXB(NW,Y,X,BV,IFOUND,'LT') tex2html_wrap_inline298 if tex2html_wrap_inline306
CALL YLOXB(NW,Y,X,BV,IFOUND,'GE') tex2html_wrap_inline298 if tex2html_wrap_inline308
CALL YLOXB(NW,Y,X,BV,IFOUND,'LE') tex2html_wrap_inline298 if tex2html_wrap_inline310
CALL IYLOXB(NW,Y,X,BV,IFOUND,'EQ') tex2html_wrap_inline298 if tex2html_wrap_inline312
CALL IYLOXB(NW,Y,X,BV,IFOUND,'NE') tex2html_wrap_inline298 if tex2html_wrap_inline314
CALL IYLOXB(NW,IY,IX,BV,IFOUND,'GT') tex2html_wrap_inline298 if tex2html_wrap_inline316
CALL IYLOXB(NW,IY,IX,BV,IFOUND,'LT') tex2html_wrap_inline298 if tex2html_wrap_inline318
CALL IYLOXB(NW,IY,IX,BV,IFOUND,'GE') tex2html_wrap_inline298 if tex2html_wrap_inline320
CALL IYLOXB(NW,IY,IX,BV,IFOUND,'LE') tex2html_wrap_inline298 if tex2html_wrap_inline322

Scatter/gather operations:
    CALL GTHRB(NW,X,BV,Y)       Y=X(BV)
    CALL SCTTB(NW,Y,BV,X)       Y(BV)=X
Elements are gathered or scattered from vector X into vector Y according to the bit mask contained in BV. Only words for which the corresponding bit is set are moved.
Logical operations:
CALL ANDB(NW,BV1,BV2,BV,IFOUND) tex2html_wrap_inline324 if tex2html_wrap_inline326
CALL ORB(NW,BV1,BV2,BV,IFOUND) tex2html_wrap_inline324 if tex2html_wrap_inline328
CALL XORB(NW,BV1,BV2,BV,IFOUND) tex2html_wrap_inline324 if
tex2html_wrap_inline330
tex2html_wrap_inline332
CALL NANDB(NW,BV1,BV2,BV,IFOUND) tex2html_wrap_inline324 if tex2html_wrap_inline334
CALL NORB(NW,BV1,BV2,BV,IFOUND) tex2html_wrap_inline324 if
tex2html_wrap_inline336
tex2html_wrap_inline338
CALL NOTB(NW,BV1,BV,IFOUND) tex2html_wrap_inline324 if tex2html_wrap_inline340

Miscellaneous operations:
    CALL BINVEC(NW,BV,IVEC)
is equivalent to
    DO J = 1,NW
       IF bit J of BV is set THEN
          IVEC(IFOUND)=J
       ENDIF
    ENDDO

CALL ZEROB(NW,BV) tex2html_wrap_inline342
CALL ONEB (NW,BV) tex2html_wrap_inline344
CALL CNTOB(NW,BV,IFOUND) tex2html_wrap_inline346 Number of set bits
CALL CNTZB(NW,BV,IFOUND) tex2html_wrap_inline348 Number of clear bits
CALL RANGB(NW,Y,S,T,BV,IFOUND) tex2html_wrap_inline350 if tex2html_wrap_inline352
CALL INTGB(NW,Y,V,W,BV,IFOUND) tex2html_wrap_inline354 if tex2html_wrap_inline356

    CALL RJCTB(RAN,X,FREJ,Y,BV,NW,NWOUT,ISWTCH)
RAN
Array of random numbers uniformly distributed between zero and the maximum of the rejection function.
X
Array of points where the rejection function is computed.
FREJ
Array of values of the rejection function.
Y
Array of accepted values of X.
BV
Bit vectors of length tex2html_wrap_inline358 at least.
NW
Initial number of values to extract.
NWOUT
Current number of values left to extract.
ISWTCH
Switch to be set to 1 for the first call.
Linear algebra operations:
Let H be an tex2html_wrap_inline360 matrix. The FUNCTION subrogram DOTB is of type REAL.
CALL SXPYB(NW,BV,Y,X,S) tex2html_wrap_inline362
CALL VXPYB(NW,BV,X,Y,V) tex2html_wrap_inline364
CALL SXYB(NW,BV,X,Y,S) tex2html_wrap_inline366
CALL XYPWZB(NW,BV,S,X,Y,T,W,Z) tex2html_wrap_inline368
RES = DOTB(NW,BV,X,Y) tex2html_wrap_inline370
CALL SCALB(NW,BV,Y,S) tex2html_wrap_inline372
CALL VSETB(NW,BV,Y,S) tex2html_wrap_inline374
CALL COPYB(NW,BV,Y,X) tex2html_wrap_inline376


tex2html_wrap_inline378


Michel Goossens Wed Jun 5 05:33:39 METDST 1996