/* * ====================================================================== * Data Structures for Vector Module * ====================================================================== * Copyright (C) 1993-96 by Mark Austin and David Mazzoni. * * This software is provided "as is" without express or implied warranty. * Permission is granted to use this software on any computer system, * and to redistribute it freely, subject to the following restrictions: * * 1. The authors are not responsible for the consequences of use of * this software, even if they arise from defects in the software. * 2. The origin of this software must not be misrepresented, either * by explicit claim or by omission. * 3. Altered versions must be plainly marked as such, and must not * be misrepresented as being the original software. * 4. This notice is to remain intact. * * Written by: M.A. Austin July, 1992 - Jan, 1993 * ====================================================================== */ #ifndef VECTOR_H #define VECTOR_H /* Vector Data Structure */ typedef struct { char *cpName; int iLength; DATA_TYPE Type; union { int *ip; double *dp; } uVector; } VECTOR; #if (__STDC__ == 1) /* Function Declarations for Standard ANSI C */ VECTOR *vecAlloc( char * , DATA_TYPE , int ); VECTOR *vecAdd( VECTOR * , VECTOR * ); VECTOR *vecSub( VECTOR * , VECTOR * ); void vecPrint( VECTOR * ); void vecFree( VECTOR * ); void vecPrintInteger( VECTOR * ); void vecFreeInteger( VECTOR * ); VECTOR *vecAddInteger( VECTOR * , VECTOR * ); VECTOR *vecSubInteger( VECTOR * , VECTOR * ); int *vecAllocInteger( int ); void vecPrintDouble( VECTOR * ); void vecFreeDouble( VECTOR * ); VECTOR *vecAddDouble( VECTOR *, VECTOR *); VECTOR *vecSubDouble( VECTOR *, VECTOR *); double *vecAllocDouble( int ); VECTOR *SetupPivotVector( MATRIX * ); VECTOR *SetupScaleFactors( MATRIX * ); MATRIX *matLUDecompositionIndirect( MATRIX *, VECTOR *); MATRIX *matLUSubstitutionIndirect( VECTOR *, MATRIX *, MATRIX *); #else /* Start case not STDC */ /* Function Declarations for K&R C */ VECTOR *vecAlloc(); VECTOR *vecAdd(); VECTOR *vecSub(); void vecPrint(); void vecFree(); void vecPrintInteger(); VECTOR *vecAddInteger(); VECTOR *vecSubInteger(); int *iVectorAlloc(); void vecPrintDouble(); VECTOR *vecAddDouble(); VECTOR *vecSubDouble(); double *dVectorAlloc(); VECTOR *NaiveGaussElimination(); VECTOR *GaussElimination(); VECTOR *SetupScaleFactors(); VECTOR *SetupPivotVector(); MATRIX *matLUDecompositionIndirect(); MATRIX *matLUSubstitutionIndirect(); #endif /* End case not STDC */ #endif /* End case VECTOR_H */