Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap2_198111 - decus/20-0026/datsg.doc
There are 2 other files named datsg.doc in the archive. Click here to see a list.
SUBROUTINE DATSG

PURPOSE
   NDIM POINTS OF A GIVEN GENERAL TABLE ARE SELECTED AND
   ORDERED SUCH THAT ABS(ARG(I)-X).GE.ABS(ARG(J)-X) IF I.GT.J.

USAGE
   CALL DATSG (X,Z,F,WORK,IROW,ICOL,ARG,VAL,NDIM)

DESCRIPTION OF PARAMETERS
   X	  - DOUBLE PRECISION SEARCH ARGUMENT.
   Z	  - DOUBLE PRECISION VECTOR OD ARGUMENT VALUES
	    (DIMENSION IROW).
   F	  - IN CASE ICOL=1, F IS THE DOUBLE PRECISION VECTOR
	    OF FUNCTION VALUES (DIMENSION IROW).
	    IN CASE ICOL=2, F IS A DOUBLE PRECISION IROW BY 2
	    MATRIX. THE FIRST COLUMN SPECIFIES VECTOR OF FUNC-
	    TION VALUES AND THE SECOND VECTOR OF DERIVATIVES.
   WORK   - DOUBLE PRECISION WORKING STORAGE (DIMENSION IROW).
   IROW   - THE DIMENSION OF VECTORS Z AND WORK AND OF EACH
	    COLUMN IN MATRIX F.
   ICOL   - THE NUMBER OF COLUMNS IN F (I.E. 1 OR 2).
   ARG	  - RESULTING DOUBLE PRECISION VECTOR OF SELECTED AND
	    ORDERED ARGUMENT VALUES (DIMENSION NDIM).
   VAL	  - RESULTING DOUBLE PRECISION VECTOR OF SELECTED
	    FUNCTION VALUES (DIMENSION NDIM) IN CASE ICOL=1.
	    IN CASE ICOL=2, VAL IS THE DOUBLE PRECISION VECTOR
	    OF FUNCTION AND DERIVATIVE VALUES (DIMENSION
	    2*NDIM) WHICH ARE STORED IN PAIRS (I.E. EACH FUNC-
	    TION VALUE IS FOLLOWED BY ITS DERIVATIVE VALUE).
   NDIM   - THE NUMBER OF POINTS WHICH MUST BE SELECTED OUT OF
	    THE GIVEN TABLE (Z,F).

REMARKS
   NO ACTION IN CASE IROW LESS THAN 1.
   IF INPUT VALUE NDIM IS GREATER THAN IROW, THE PROGRAM
   SELECTS ONLY A MAXIMUM TABLE OF IROW POINTS.  THEREFORE THE
   USER OUGHT TO CHECK CORRESPONDENCE BETWEEN TABLE (ARG,VAL)
   AND ITS DIMENSION BY COMPARISON OF NDIM AND IROW, IN ORDER
   TO GET CORRECT RESULTS IN FURTHER WORK WITH TABLE (ARG,VAL).
   THIS TEST MAY BE DONE BEFORE OR AFTER CALLING
   SUBROUTINE DATSG.
   SUBROUTINE DATSG ESPECIALLY CAN BE USED FOR GENERATING THE
   TABLE (ARG,VAL) NEEDED IN SUBROUTINES DALI, DAHI, AND DACFI.

SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED
   NONE

METHOD
   SELECTION IS DONE BY GENERATING THE VECTOR WORK WITH
   COMPONENTS WORK(I)=ABS(Z(I)-X) AND AT EACH OF THE NDIM STEPS
   (OR IROW STEPS IF NDIM IS GREATER THAN IROW)
   SEARCHING FOR THE SUBSCRIPT OF THE SMALLEST COMPONENT, WHICH
   IS AFTERWARDS REPLACED BY A NUMBER GREATER THAN
   MAX(WORK(I)).