/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:33:09 */
/*FOR_C Options SET: ftn=u io=c no=p op=aimnv pf=,p_dchol2 s=dbov str=l x=f - prototypes */
#include <math.h>
#include "fcrt.h"
#include <stdio.h>
#include <stdlib.h>
#include "p_dchol2.h"
/*     program DRDCHOL2
 *>> 1996-06-17 DRDCHOL2  Krogh  Minor format change for C conversion.
 *>> 1996-05-28 DRDCHOL2  Krogh Added external statement.
 *>> 1994-10-19 DRDCHOL2  Krogh  Changes to use M77CON
 *>> 1993-02-18 DRDCHOL2  CLL.
 *>> 1992-03-04 DRDCHOL2  Krogh Initial version.
 *  Demonstration driver for DCHOL
 *     ------------------------------------------------------------------
 *--D 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;
	double pdu[LDPDU][LDPDU];
	static double 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] = ddot( M, &ab[i - 1][0], 1, &ab[j - 1][0],
			 1 );
		}
	}
	dchol( (double*)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 DCHOL, IERR = %3ld\n", ierr);
		}
	exit(0);
} /* end of function */