sparse2.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /**************************************************************************
  2. **
  3. ** Copyright (C) 1993 David E. Steward & Zbigniew Leyk, all rights reserved.
  4. **
  5. ** Meschach Library
  6. **
  7. ** This Meschach Library is provided "as is" without any express
  8. ** or implied warranty of any kind with respect to this software.
  9. ** In particular the authors shall not be liable for any direct,
  10. ** indirect, special, incidental or consequential damages arising
  11. ** in any way from use of the software.
  12. **
  13. ** Everyone is granted permission to copy, modify and redistribute this
  14. ** Meschach Library, provided:
  15. ** 1. All copies contain this copyright notice.
  16. ** 2. All modified copies shall carry a notice stating who
  17. ** made the last modification and the date of such modification.
  18. ** 3. No charge is made for this software or works derived from it.
  19. ** This clause shall not be construed as constraining other software
  20. ** distributed on the same medium as this software, nor is a
  21. ** distribution fee considered a charge.
  22. **
  23. ***************************************************************************/
  24. /* Sparse matrix factorise/solve header */
  25. /* RCS id: $Id: sparse2.h,v 1.4 1994/01/13 05:33:46 des Exp $ */
  26. #ifndef SPARSE2H
  27. #define SPARSE2H
  28. #include "sparse.h"
  29. #ifdef ANSI_C
  30. SPMAT *spCHfactor(SPMAT *A), *spICHfactor(SPMAT *A), *spCHsymb(SPMAT *A);
  31. VEC *spCHsolve(SPMAT *CH, const VEC *b, VEC *x);
  32. SPMAT *spLUfactor(SPMAT *A,PERM *pivot,double threshold);
  33. SPMAT *spILUfactor(SPMAT *A,double theshold);
  34. VEC *spLUsolve(const SPMAT *LU,PERM *pivot, const VEC *b,VEC *x),
  35. *spLUTsolve(SPMAT *LU,PERM *pivot, const VEC *b,VEC *x);
  36. SPMAT *spBKPfactor(SPMAT *, PERM *, PERM *, double);
  37. VEC *spBKPsolve(SPMAT *, PERM *, PERM *, const VEC *, VEC *);
  38. VEC *pccg(VEC *(*A)(),void *A_par,VEC *(*M_inv)(),void *M_par,VEC *b,
  39. double tol,VEC *x);
  40. VEC *sp_pccg(SPMAT *,SPMAT *,VEC *,double,VEC *);
  41. VEC *cgs(VEC *(*A)(),void *A_par,VEC *b,VEC *r0,double tol,VEC *x);
  42. VEC *sp_cgs(SPMAT *,VEC *,VEC *,double,VEC *);
  43. VEC *lsqr(VEC *(*A)(),VEC *(*AT)(),void *A_par,VEC *b,double tol,VEC *x);
  44. VEC *sp_lsqr(SPMAT *,VEC *,double,VEC *);
  45. int cg_set_maxiter(int);
  46. void lanczos(VEC *(*A)(),void *A_par,int m,VEC *x0,VEC *a,VEC *b,
  47. Real *beta_m1,MAT *Q);
  48. void sp_lanczos(SPMAT *,int,VEC *,VEC *,VEC *,Real *,MAT *);
  49. VEC *lanczos2(VEC *(*A)(),void *A_par,int m,VEC *x0,VEC *evals,
  50. VEC *err_est);
  51. VEC *sp_lanczos2(SPMAT *,int,VEC *,VEC *,VEC *);
  52. extern void scan_to(SPMAT *,IVEC *,IVEC *,IVEC *,int);
  53. extern row_elt *chase_col(const SPMAT *,int,int *,int *,int);
  54. extern row_elt *chase_past(const SPMAT *,int,int *,int *,int);
  55. extern row_elt *bump_col(const SPMAT *,int,int *,int *);
  56. #else
  57. extern SPMAT *spCHfactor(), *spICHfactor(), *spCHsymb();
  58. extern VEC *spCHsolve();
  59. extern SPMAT *spLUfactor();
  60. extern SPMAT *spILUfactor();
  61. extern VEC *spLUsolve(), *spLUTsolve();
  62. extern SPMAT *spBKPfactor();
  63. extern VEC *spBKPsolve();
  64. extern VEC *pccg(), *sp_pccg(), *cgs(), *sp_cgs(), *lsqr(), *sp_lsqr();
  65. extern int cg_set_maxiter();
  66. void lanczos(), sp_lanczos();
  67. VEC *lanczos2(), *sp_lanczos2();
  68. extern void scan_to();
  69. extern row_elt *chase_col();
  70. extern row_elt *chase_past();
  71. extern row_elt *bump_col();
  72. #endif
  73. #endif