00001
00047 #ifndef _WHB_H
00048 #define _WHB_H
00049
00050 #include <mc/mc_base.h>
00051
00052 #include <mc/bam.h>
00053
00059 typedef enum HBMATtype {
00060 ZERO_TYPE,
00061 AMIN_TYPE,
00062 ANOR_TYPE,
00063 GHB_TYPE,
00064 GWM_TYPE
00065 } HBMATtype;
00066
00067
00068
00075 struct sHBmat {
00076
00078 Vmem *vmem;
00080 int iMadeVmem;
00081
00088 HBMATtype type;
00089
00091 int numB;
00092
00094 Bmat *A12;
00096 Bmat *A21;
00098 Bmat *A22;
00099
00101 struct sHBmat *next;
00102
00103 };
00104
00110 typedef struct sHBmat HBmat;
00111
00118 struct sHBvec {
00119
00121 Vmem *vmem;
00123 int iMadeVmem;
00125 int state;
00126
00128 int numB;
00129
00131 Bvec *bv;
00133 Bvec *bv2;
00134
00136 struct sHBvec *next;
00137
00138 };
00139
00145 typedef struct sHBvec HBvec;
00146
00153 struct sBchar {
00155 Vmem *vmem;
00157 int iMadeVmem;
00158
00160 char name[10];
00162 int n;
00164 char *uflat;
00165
00167 struct sBchar *coarse;
00168
00170 int numB;
00172 int numR[MAXV];
00174 char *u[MAXV];
00175
00176 };
00177
00183 typedef struct sBchar Bchar;
00184
00185
00186
00187
00188
00189
00190
00191 #if !defined(VINLINE_WHB)
00192 #else
00193 #endif
00194
00195
00196
00197
00198
00199
00200
00288 void HBvec_hbVcyc(HBvec *dd, HBmat *Ahb, HBvec *rr,
00289 HBmat *Ghb, HBvec *ww, int key, int csolv);
00290
00318 void HBvec_initStructure(HBvec *thee, HBmat *Ahb);
00319
00328 void HBvec_killStructure(HBvec *thee);
00329
00369 void HBmat_initG(HBmat *thee, Bmat *Ppro, Bmat *Mlink, int meth);
00370
00400 void HBmat_initA(HBmat *Ahb, HBmat *Ghb, Bmat *Alink);
00401
00410 void HBmat_killStructure(HBmat *thee);
00411
00412
00413
00414
00415
00416
00438 void Bvec_hlmethod(Bvec *thee, Bmat *A, Bvec *f, Bvec *r, Bvec *ut,
00439 int key, int flag, int itmax, double etol, int prec, int cycle, Bmat *P,
00440 Bmat *M, int meth);
00441
00470 void Bvec_hb(Bvec *thee, Bmat *A, Bvec *f, Bvec *r, Bvec *ut,
00471 int key, int flag, int itmax, double etol, int meth, Bmat *Ppro, Bmat *M);
00472
00503 void Bvec_hcg(Bvec *thee, Bmat *A, Bvec *f, Bvec *r, Bvec *ut,
00504 int key, int flag, int itmax, double etol, int prec, Bmat *P, Bmat *M,
00505 Bvec *p, Bvec *ap, Bvec *bap, Bvec *po, Bvec *apo, Bvec *tp);
00506
00542 void Bvec_hbcg(Bvec *thee, Bmat *A, Bvec *f, Bvec *r, Bvec *ut,
00543 int key, int flag, int itmax, double etol, int prec, Bmat *P, Bmat *M,
00544 Bvec *s,
00545 Bvec *p, Bvec *ap, Bvec *bap, Bvec *po, Bvec *apo,
00546 Bvec *q, Bvec *atq, Bvec *btatq, Bvec *qo, Bvec *atqo);
00547
00607 void HBmat_initMulti( HBmat **Ahb, HBmat **Ghb,
00608 Bmat *A, Bmat *M, Bmat *Ppro, int meth );
00609
00619 void HBmat_killMulti( HBmat **Ahb, HBmat **Ghb );
00620
00621
00622
00623
00624
00625
00626
00637 HBmat* HBmat_ctor(Vmem *vmem, const char *bname, int pnumB);
00638
00647 void HBmat_dtor(HBmat **thee);
00648
00659 HBvec* HBvec_ctor(Vmem *vmem, const char *bname, int pnumB);
00660
00669 void HBvec_dtor(HBvec **thee);
00670
00682 Bvec * Bvec_ctorPoint(Bvec *v, const char *name, int *ibase, int *numR);
00683
00692 void Bvec_dtorPoint(Bvec **thee);
00693
00705 Vec * Vec_ctorPoint(Vec *v, const char *name, int sep, int numR);
00706
00715 void Vec_dtorPoint(Vec **thee);
00716
00728 Bmat *Bmat_ctorPoint(Bmat *P,
00729 const char *name, int *ibase, int *numR);
00730
00739 void Bmat_dtorPoint(Bmat **thee);
00740
00752 Mat *Mat_ctorPoint(Mat *P, const char *name, int ibase, int numR);
00753
00762 void Mat_dtorPoint(Mat **thee);
00763
00774 void HBmat_printSp(HBmat *thee, char *fname, int pflag);
00775
00786 void Bmat_printDiriSp(Bmat *thee, char *fname, int pflag);
00787
00798 void Mat_printDiriSp(Mat *thee, char *fname, int pflag);
00799
00810 Mat *Bmat_AD(Bmat *thee, int p, int q);
00811
00828 void HBvec_matvec(HBvec *thee, HBmat *Gmat, int key, Bvec *work);
00829
00839 double Bmat_lnDet(Bmat *thee);
00840
00841
00842
00843
00844
00845
00846
00857 void BXLN_copyBmat(Bmat *thee, Bmat *Amat);
00858
00868 void Bmat_copyBXLN(Bmat *thee, Bmat *Alink);
00869
00910 void BXLN_hbTriple(Bmat *thee, HBmat *G);
00911
00936 void BXLN_copyBlocks(Bmat *A, Bmat *A12, Bmat *A21, Bmat *A22);
00937
00965 void BXLN_shrinkLogical(Bmat *A, Bmat *A12, Bmat *A21);
00966
00999 void HBmat_GHB2WMHB(HBmat *thee, Bmat *M);
01000
01001
01002
01003
01004
01005
01006
01052 void XLN_hbTriple(Mat *thee,
01053 Mat *GL21, Mat *GL12, Mat *GL22, Mat *GR21, Mat *GR12, Mat *GR22 );
01054
01074 void XLN_matmatContrib(Mat *thee,
01075 Mat *Ablock1, int ibase, int flag1, Mat *Ablock2, int jbase, int flag2);
01076
01100 void XLN_copySubblock(Mat *thee, Mat *Amat, int flag);
01101
01126 void XLN_copyBlocks(Mat *Ablock, Mat *A12, Mat *A21, Mat *A22);
01127
01155 void XLN_shrinkLogical(Mat *A, Mat *A12, Mat *A21);
01156
01191 void Mat_initGWMHB(Mat *G12, Mat *G22, Mat *G21, Mat *Mblock);
01192
01193
01194
01195
01196
01197
01198
01219 void Bvec_submethod(Bvec *thee, Bmat *A, Bvec *f, Bvec *r, Bvec *ut,
01220 int key, int flag, int itmax, double etol, int prec, int cycle, Bmat *P,
01221 int meth);
01222
01290 void Bvec_fsmooth(Bvec *thee, Bmat *amat, Bvec *f, Bvec *w,
01291 int key, int ioflag, int meth, int adj, int itmax, Bchar *fc);
01292
01304 Bchar* Bchar_ctor(Vmem *vmem,
01305 const char *name, int pnumB, int pnumR[MAXV]);
01306
01315 void Bchar_dtor(Bchar **thee);
01316
01331 void Bchar_assem(Bchar *thee, int key, Bmat *Ppro);
01332
01333
01349 void Bchar_assem2(Bchar *thee, int key, Bmat *amat, Bmat *Ppro);
01350
01351 #endif
01352