Google
 

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

PURPOSE
   DERIVE A SUBSET VECTOR INDICATING WHICH OBSERVATIONS IN A
   SET HAVE SATISFIED CERTAIN CONDITIONS ON THE VARIABLES.

USAGE
   CALL SUBST (A,C,R,B,S,NO,NV,NC)
   PARAMETER B MUST BE DEFINED BY AN EXTERNAL STATEMENT IN THE
   CALLING PROGRAM

DESCRIPTION OF PARAMETERS
   A  - OBSERVATION MATRIX, NO BY NV
   C  - INPUT MATRIX, 3 BY NC, OF CONDITIONS TO BE CONSIDERED.
	THE FIRST ELEMENT OF EACH COLUMN OF C REPRESENTS THE
	NUMBER OF THE VARIABLE (COLUMN OF THE MATRIX A) TO BE
	TESTED, THE SECOND ELEMENT OF EACH COLUMN IS A
	RELATIONAL CODE AS FOLLOWS
	     1. FOR LT (LESS THAN)
	     2. FOR LE (LESS THAN OR EQUAL TO)
	     3. FOR EQ (EQUAL TO)
	     4. FOR NE (NOT EQUAL TO)
	     5. FOR GE (GREATER THAN OR EQUAL TO)
	     6. FOR GT (GREATER THAN)
	THE THIRD ELEMENT OF EACH COLUMN IS A QUANTITY TO BE
	USED FOR COMPARISON WITH THE OBSERVATION VALUES. FOR
	EXAMPLE, THE FOLLOWING COLUMN IN C
		  2.
		  5.
		 92.5
	CAUSES THE SECOND VARIABLE TO BE TESTED FOR GREATER
	THAN OR EQUAL TO 92.5
   R  - WORKING VECTOR USED TO STORE INTERMEDIATE RESULTS OF
	ABOVE TESTS ON A SINGLE OBSERVATION. IF CONDITION IS
	SATISFIED, R(I) IS SET TO 1. IF IT IS NOT, R(I) IS SET
	TO 0. VECTOR LENGTH IS NC.
   B  - NAME OF SUBROUTINE TO BE SUPPLIED BY THE USER. IT
	CONSISTS OF A BOOLEAN EXPRESSION LINKING THE
	INTERMEDIATE VALUES STORED IN VECTOR R. THE BOOLEAN
	OPERATORS ARE '*' FOR'AND', '+' FOR 'OR'. EXAMPLE
	     SUBROUTINE BOOL(R,T)
	     DIMENSION R(3)
	     T=R(1)*(R(2)+R(3))
	     RETURN
	     END
	THE ABOVE EXPRESSION IS TESTED FOR
	     R(1).AND.(R(2).OR.R(3))
   S  - OUTPUT VECTOR INDICATING, FOR EACH OBSERVATION,
	WHETHER OR NOT PROPOSITION B IS SATISFIED. IF IT IS,
	S(I) IS NON-ZERO. IF IT IS NOT, S(I) IS ZERO. VECTOR
	LENGTH IS NO.
   NO - NUMBER OF OBSERVATIONS. NO MUST BE > OR = TO 1.
   NV - NUMBER OF VARIABLES. NV MUST BE > OR = TO 1.
   NC - NUMBER OF BASIC CONDITIONS TO BE SATISFIED. NC MUST BE
	GREATER THAN OR EQUAL TO 1.

REMARKS
   NONE

SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED
   B  THE NAME OF ACTUAL SUBROUTINE SUPPLIED BY THE USER MAY
      BE DIFFERENT (E.G., BOOL), BUT SUBROUTINE SUBST ALWAYS
      CALLS IT AS B.  IN ORDER FOR SUBROUTINE SUBST TO DO THIS,
      THE NAME OF THE USER-SUPPLIED SUBROUTINE MUST BE
      DEFINED BY AN EXTERNAL STATEMENT IN THE CALLING PROGRAM.
      THE NAME MUST ALSO BE LISTED IN THE ''CALL SUBST''
      STATEMENT.  (SEE USAGE ABOVE)

METHOD
   THE FOLLOWING IS DONE FOR EACH OBSERVATION.
   CONDITION MATRIX IS ANALYZED TO DETERMINE WHICH VARIABLES
   ARE TO BE EXAMINED. INTERMEDIATE VECTOR R IS FORMED. THE
   BOOLEAN EXPRESSION (IN SUBROUTINE B) IS THEN EVALUATED TO
   DERIVE THE ELEMENT IN SUBSET VECTOR S CORRESPONDING TO THE
   OBSERVATION.