/* stagen.h supposed to be included earlier */ #if DEB_MEM #define DEBPAR , char *file, int line #define DEBARG ,file,line #else #define DEBPAR #define DEBARG #endif typedef FloatHiPtr Vector; typedef FloatHiPtr *Matrix; #define VAR FloatHi typedef EntryPtr(void,PrintVectorPtr,(Vector vp, CharPtr t)); typedef EntryPtr(void,PrintMatrixPtr,(Matrix mp, CharPtr t, Int2 level)); typedef EntryPtr(Vector,CreateVectorPtr,(int n DEBPAR)); typedef EntryPtr(Vector,DestroyVectorPtr,(Vector vp)); typedef EntryPtr(Int2,GetVectorDimPtr,(Vector vp)); typedef EntryPtr(Vector,CopyVectorPtr,(Vector from, Vector to DEBPAR)); typedef EntryPtr(void,ClearVectorPtr,(Vector vp)); typedef EntryPtr(VAR,ScalProdPtr,(Vector a, Vector b)); typedef EntryPtr(VAR,NormOfVectorPtr,(Vector a)); typedef EntryPtr(Int2,NormalizeVectorPtr,(Vector wp)); typedef EntryPtr(Vector,AddScaledVectorPtr,(Vector vp1, Vector vp2, FloatHi h, Vector vpres DEBPAR)); typedef EntryPtr(Vector,MultiplyVectorScalarPtr,(Vector vp, VAR scalar, Vector vpres DEBPAR)); typedef EntryPtr(void,CopyVectorElementsPtr,(Vector from, Int2 frompos, Vector to, Int2 topos, Int2 stuk)); typedef EntryPtr(Matrix,CreateMatrixPtr,(int n, int m DEBPAR)); typedef EntryPtr(Matrix,DestroyMatrixPtr,(Matrix mp)); typedef EntryPtr(Matrix,CopyMatrixPtr,(Matrix from, Matrix to DEBPAR)); typedef EntryPtr(Int2,GetRowNumPtr,(Matrix mp)); typedef EntryPtr(Int2,GetColNumPtr,(Matrix mp)); typedef EntryPtr(void,ClearMatrixPtr,(Matrix mp)); typedef EntryPtr(Vector,MultiplyMatrixVectorPtr,(Matrix mp, Vector vp, Vector vpres DEBPAR)); typedef EntryPtr(Vector,MultiplyMatrixArrayPtr,(Matrix mp, VAR *vp, Vector vpres DEBPAR)); typedef EntryPtr(Matrix,AppendMatrixVectorPtr,(Matrix mp, Vector vp, Matrix mpres DEBPAR)); typedef EntryPtr(Matrix,GetMatrixDataPtr,(Matrix mp, FloatHiPtr det, FloatHiPtr cond)); typedef EntryPtr(Int2,DiffFun,(Vector xx, Vector yy)); /* any differentiable function */ typedef EntryPtr(Int2,DerPtr,(DiffFun fun, int n, Vector x, VAR d, Matrix a DEBPAR)); typedef EntryPtr(Int2,DerAPtr,(DiffFun fun, int n, VAR *x, VAR d, Matrix a DEBPAR)); typedef EntryPtr(void,SolvePtr,(Matrix AA, Vector BB)); typedef EntryPtr(Int2,DecompPtr,(Matrix AA DEBPAR)); typedef EntryPtr(Int2,SngSolvePtr,(Matrix AA, FloatHi EPS, Vector BB)); typedef EntryPtr(Int2,CharPolyCoeffsPtr,(Matrix AA, Vector BB DEBPAR)); typedef EntryPtr(Matrix,TransposeMatrixPtr,(Matrix from, Matrix to DEBPAR)); typedef EntryPtr(Int2,NormalizeVectorRelativePtr,(Vector wp, Vector vp)); typedef EntryPtr(Int2,dbalanPtr,(Matrix AA, int *l, int *h)); typedef EntryPtr(Int2,delmhePtr,(Matrix AA, int l, int h)); typedef EntryPtr(Int2,dhqrPtr,(Matrix AA, int l, int h, Vector Re, Vector Im)); typedef EntryPtr(Int2,EigenValuesPtr,(Matrix AA, Vector Re, Vector Im)); typedef EntryPtr(void,CopyMatrixBlockPtr,(Matrix from, Int2 frow, Int2 fcol, Matrix to, Int2 trow, Int2 tcol, Int2 nrow, Int2 ncol)); typedef EntryPtr(void,CopyVectorMatrixRowPtr,(Vector from, Matrix to, Int2 trow)); typedef EntryPtr(void,CopyMatrixRowVectorPtr,(Matrix from, Int2 frow, Vector to)); typedef EntryPtr(Matrix,MultiplyMatrixMatrixPtr,(Matrix mpa, Matrix mpb, Matrix mpc DEBPAR)); typedef EntryPtr(Matrix,AddScaledMatrixPtr,(Matrix mpa, Matrix mpb, FloatHi h, Matrix mpc DEBPAR)); typedef EntryPtr(Matrix,SolveMatrixPtr,(Matrix AA, Matrix BB, Matrix XX, Vector work DEBPAR)); /* The number and order of fields must be the same as in /stdlinalg partition in *.con files */ typedef struct { PrintVectorPtr PrintVector; PrintMatrixPtr PrintMatrix; CreateVectorPtr CreateVector; DestroyVectorPtr DestroyVector; GetVectorDimPtr GetVectorDim; CopyVectorPtr CopyVector; ClearVectorPtr ClearVector; ScalProdPtr ScalProd; NormOfVectorPtr NormOfVector; NormalizeVectorPtr NormalizeVector; AddScaledVectorPtr AddScaledVector; MultiplyVectorScalarPtr MultiplyVectorScalar; CopyVectorElementsPtr CopyVectorElements; CreateMatrixPtr CreateMatrix; DestroyMatrixPtr DestroyMatrix; CopyMatrixPtr CopyMatrix; GetRowNumPtr GetRowNum; GetColNumPtr GetColNum; ClearMatrixPtr ClearMatrix; MultiplyMatrixVectorPtr MultiplyMatrixVector; MultiplyMatrixArrayPtr MultiplyMatrixArray; AppendMatrixVectorPtr AppendMatrixVector; DerPtr Der; DerAPtr DerA; SolvePtr Solve; DecompPtr Decomp; GetMatrixDataPtr GetMatrixData; SngSolvePtr SngSolve; TransposeMatrixPtr TransposeMatrix; NormalizeVectorRelativePtr NormalizeVectorRelative; CopyMatrixBlockPtr CopyMatrixBlock; CopyVectorMatrixRowPtr CopyVectorMatrixRow; CopyMatrixRowVectorPtr CopyMatrixRowVector; CharPolyCoeffsPtr CharPolyCoeffs; dbalanPtr dbalan; delmhePtr delmhe; dhqrPtr dhqr; EigenValuesPtr EigenValues; MultiplyMatrixMatrixPtr MultiplyMatrixMatrix; AddScaledMatrixPtr AddScaledMatrix; SolveMatrixPtr SolveMatrix; } StdLinAlgData, PNTR StdLinAlgDataPtr; #if DEB_MEM #define CreateVector(n) CreateVector(n,__FILE__,__LINE__) #define CopyVector(from,to) CopyVector(from,to,__FILE__,__LINE__) #define AddScaledVector(vp1,vp2,h,vpres) AddScaledVector(vp1,vp2,h,vpres,__FILE__,__LINE__) #define MultiplyVectorScalar(vp,scalar,vpres) MultiplyVectorScalar(vp,scalar,vpres,__FILE__,__LINE__) #define MultiplyMatrixVector(mp,vp,vpres) MultiplyMatrixVector(mp,vp,vpres,__FILE__,__LINE__) #define MultiplyMatrixArray(mp,vp,vpres) MultiplyMatrixArray(mp,vp,vpres,__FILE__,__LINE__) #define Der(fun,n,x,d,a) Der(fun,n,x,d,a,__FILE__,__LINE__) #define DerA(fun,n,x,d,a) DerA(fun,n,x,d,a,__FILE__,__LINE__) #define SolveMatrix(AA,BB,XX,work) SolveMatrix(AA,BB,XX,work,__FILE__,__LINE__) #define Decomp(AA) Decomp(AA,__FILE__,__LINE__) #define CharPolyCoeffs(AA,BB) CharPolyCoeffs(AA,BB,__FILE__,__LINE__) #define CreateMatrix(n,m) CreateMatrix(n,m,__FILE__,__LINE__) #define CopyMatrix(from,to) CopyMatrix(from,to,__FILE__,__LINE__) #define TransposeMatrix(from,to) TransposeMatrix(from,to,__FILE__,__LINE__) #define AppendMatrixVector(mp,vp,mpres) AppendMatrixVector(mp,vp,mpres,__FILE__,__LINE__) #define MultiplyMatrixMatrix(mpa,mpb,mpc) MultiplyMatrixMatrix(mpa,mpb,mpc,__FILE__,__LINE__) #define AddScaledMatrix(mpa,mpb,h,mpc) AddScaledMatrix(mpa,mpb,h,mpc,__FILE__,__LINE__) #endif