/* PROCEDURE covsrt /* Marquart-Levenworth Covariance Determination adapted to PL/SQL. */ CREATE OR REPLACE PROCEDURE covsrt(pCovar IN OUT IC50_ENGINE.MultiDNumTabType, pMa IN NUMBER, pIa IN IC50_ENGINE.NumTabType, pMfit IN NUMBER) AS /* pCovar is the input covariance matrix, which will be expanded and output. pMa is the total number of parameters, = 4 for IC50. pIa is the status of each of the 4 parameters, 0 = fixed and 1 = variable. pMfit is the number of variable parameters, from 1 to 4. expand the covariance matrix to use the fixed parameters, not just the variable parameters. fixed parameters have 0 covariance. */ i NUMBER; j NUMBER; k NUMBER; /* swap - only used in SWAP in book. */ BEGIN FOR i IN pMfit+1..pMa LOOP FOR j in 1..i LOOP /* pCovar(i,j) = 0 */ pCovar((i - 1) * 4 + j) := 0.0; /* pCovar(j,i) = 0 */ pCovar((j - 1) * 4 + i) := 0.0; END LOOP; END LOOP; k := pMfit; FOR j IN REVERSE 1..pMa LOOP IF pIa(j) <> 0 THEN FOR i IN 1..pMa LOOP /* pCovar(i,k) for pCovar(i,j) */ SWAP(pCovar((i - 1) * 4 + k), pCovar((i - 1) * 4 + j)); END LOOP; FOR i IN 1..pMa LOOP /* pCovar(k,i) for pCovar(j,i) */ SWAP(pCovar((k - 1) * 4 + i), pCovar((j - 1) * 4 + i)); END LOOP; k := k - 1; END IF; END LOOP; END; / SHOW ERRORS PROCEDURE covsrt;