/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:33:15 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv pf=,p_schol2 s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include #include #include "p_schol2.h" /* program DRSCHOL2 *>> 1996-06-17 DRSCHOL2 Krogh Minor format change for C conversion. *>> 1996-05-28 DRSCHOL2 Krogh Added external statement. *>> 1994-10-19 DRSCHOL2 Krogh Changes to use M77CON *>> 1993-02-18 DRSCHOL2 CLL. *>> 1992-03-04 DRSCHOL2 Krogh Initial version. * Demonstration driver for SCHOL * ------------------------------------------------------------------ *--S replaces "?": DR?CHOL2, ?CHOL, ?DOT * ------------------------------------------------------------------ */ /* PARAMETER translations */ #define LDPDU 3 #define M 3 #define N 2 #define NP1 (N + 1) /* end of PARAMETER translations */ int main( ) { long int i, ierr, j, _i, _r; float pdu[LDPDU][LDPDU]; static float ab[NP1][M]; static int _aini = 1; if( _aini ){ /* Do 1 TIME INITIALIZATIONS! */ ab[0][0] = 0.7e0; ab[1][0] = 0.6e0; ab[2][0] = 1.726e0; ab[0][1] = -0.8e0; ab[1][1] = 0.5e0; ab[2][1] = -5.415e0; ab[0][2] = 0.6e0; ab[1][2] = -0.7e0; ab[2][2] = 5.183e0; _aini = 0; } /* ------------------------------------------------------------------ */ for (i = 1; i <= NP1; i++) { for (j = 1; j <= NP1; j++) { pdu[j - 1][i - 1] = sdot( M, &ab[i - 1][0], 1, &ab[j - 1][0], 1 ); } } schol( (float*)pdu, LDPDU, N, &pdu[NP1 - 1][0], &pdu[NP1 - 1][NP1 - 1], 0.0e0, &ierr ); printf(" X() = %15.6f%15.6f\n", pdu[NP1 - 1][0], pdu[NP1 - 1][1]); printf(" RNORM = %15.6f\n", pdu[NP1 - 1][NP1 - 1]); if (ierr != 0) { printf(" Matrix failed conditioning test in SCHOL, IERR = %3ld\n", ierr); } exit(0); } /* end of function */