12 #ifndef ROOT_TDecompSparse 13 #define ROOT_TDecompSparse 81 static void InitPivot (
const Int_t n,
const Int_t nz,TArrayI &Airn,TArrayI &Aicn,
82 TArrayI &Aiw,TArrayI &Aikeep,TArrayI &Aiw1,Int_t &nsteps,
83 const Int_t iflag,Int_t *icntl,Double_t *cntl,Int_t *info,Double_t &ops);
84 static void Factor (
const Int_t n,
const Int_t nz,TArrayI &Airn,TArrayI &Aicn,TArrayD &Aa,
85 TArrayI &Aiw,TArrayI &Aikeep,
const Int_t nsteps,Int_t &maxfrt,
86 TArrayI &Aiw1,Int_t *icntl,Double_t *cntl,Int_t *info);
87 static void Solve (
const Int_t n,TArrayD &Aa,TArrayI &Aiw,TArrayD &Aw,
const Int_t maxfrt,
88 TVectorD &
b,TArrayI &Aiw1,
const Int_t nsteps,Int_t *icntl,Int_t *info);
90 static void InitPivot_sub1 (
const Int_t n,
const Int_t nz,Int_t *irn,Int_t *icn,Int_t *iw,Int_t *ipe,
91 Int_t *iq,Int_t *flag,Int_t &iwfr,Int_t *icntl,Int_t *info);
92 static void InitPivot_sub2 (
const Int_t n,Int_t *ipe,Int_t *iw,
const Int_t lw,Int_t &iwfr,Int_t *nv,
93 Int_t *nxt,Int_t *lst,Int_t *ipd,Int_t *flag,
const Int_t iovflo,Int_t &ncmpa,
94 const Double_t fratio);
95 static void InitPivot_sub2a(
const Int_t n,Int_t *ipe,Int_t *iw,
const Int_t lw,Int_t &iwfr,Int_t &ncmpa);
96 static void InitPivot_sub3 (
const Int_t n,
const Int_t nz,Int_t *irn,Int_t *icn,Int_t *perm,Int_t *iw,
97 Int_t *ipe,Int_t *iq,Int_t *flag,Int_t &iwfr,Int_t *icntl,Int_t *info);
98 static void InitPivot_sub4 (
const Int_t n,Int_t *ipe,Int_t *iw,
const Int_t lw,Int_t &iwfr,Int_t *ips,
99 Int_t *ipv,Int_t *nv,Int_t *flag,Int_t &ncmpa);
100 static void InitPivot_sub5 (
const Int_t n,Int_t *ipe,Int_t *nv,Int_t *ips,Int_t *ne,Int_t *na,Int_t *nd,
101 Int_t &nsteps,
const Int_t nemin);
102 static void InitPivot_sub6 (
const Int_t n,
const Int_t nz,Int_t *irn,Int_t *icn,Int_t *perm,Int_t *na,
103 Int_t *ne,Int_t *nd,
const Int_t nsteps,Int_t *lstki,Int_t *lstkr,Int_t *iw,
104 Int_t *info,Double_t &ops);
106 static void Factor_sub1 (
const Int_t n,
const Int_t nz,Int_t &nz1,Double_t *a,
const Int_t la,
107 Int_t *irn,Int_t *icn,Int_t *iw,
const Int_t liw,Int_t *perm,Int_t *iw2,
108 Int_t *icntl,Int_t *info);
109 static void Factor_sub2 (
const Int_t n,
const Int_t nz,Double_t *a,
const Int_t la,Int_t *iw,
110 const Int_t liw,Int_t *perm,Int_t *nstk,
const Int_t nsteps,Int_t &maxfrt,
111 Int_t *nelim,Int_t *iw2,Int_t *icntl,Double_t *cntl,Int_t *info);
112 static void Factor_sub3 (Double_t *a,Int_t *iw,Int_t &j1,Int_t &j2,
const Int_t itop,
const Int_t ireal,
113 Int_t &ncmpbr,Int_t &ncmpbi);
115 static void Solve_sub1 (
const Int_t n,Double_t *a,Int_t *iw,Double_t *w,Double_t *rhs,Int_t *iw2,
116 const Int_t nblk,Int_t &latop,Int_t *icntl);
117 static void Solve_sub2 (
const Int_t n,Double_t *a,Int_t *iw,Double_t *w,Double_t *rhs,Int_t *iw2,
118 const Int_t nblk,
const Int_t latop,Int_t *icntl);
119 static Int_t
IDiag (Int_t ix,Int_t iy) {
return ((iy-1)*(2*ix-iy+2))/2; }
121 inline Int_t
IError () {
return fInfo[2]; }
145 TDecompSparse(Int_t row_lwb,Int_t row_upb,Int_t nr_nonZeros,Int_t verbose);
151 if (fVerbose) { fIcntl[1] = fIcntl[2] = 1; fIcntl[3] = 2; }
152 else { fIcntl[1] = fIcntl[2] = fIcntl[3] = 0; }
163 { MayNotUse(
"Solve(TMatrixDColumn &)");
return kFALSE; }
167 { MayNotUse(
"TransSolve(TMatrixDColumn &)");
return kFALSE; }
169 virtual void Det (Double_t &,Double_t &)
170 { MayNotUse(
"Det(Double_t&,Double_t&)"); }
172 void Print(Option_t *opt =
"")
const;
void SetTreatAsZero(Double_t tol)
virtual Int_t GetNcols() const
virtual Int_t GetNrows() const
virtual Bool_t TransSolve(TVectorD &b)
virtual void SetMatrix(const TMatrixDSparse &a)
Set matrix to be decomposed .
static void InitPivot_sub5(const Int_t n, Int_t *ipe, Int_t *nv, Int_t *ips, Int_t *ne, Int_t *na, Int_t *nd, Int_t &nsteps, const Int_t nemin)
Help routine for pivoting setup.
static void CopyUpperTriang(const TMatrixDSparse &a, Double_t *b)
Static function, copying the non-zero entries in the upper triangle to array b .
static void InitPivot_sub1(const Int_t n, const Int_t nz, Int_t *irn, Int_t *icn, Int_t *iw, Int_t *ipe, Int_t *iq, Int_t *flag, Int_t &iwfr, Int_t *icntl, Int_t *info)
Help routine for pivoting setup.
const Double_t kThresholdPivotingFactor
virtual Bool_t TransSolve(TMatrixDColumn &)
virtual const TMatrixDBase & GetDecompMatrix() const
void Print(Option_t *opt="") const
Print class members.
TDecompSparse()
Default constructor.
Decomposition Base class.
static void Factor_sub3(Double_t *a, Int_t *iw, Int_t &j1, Int_t &j2, const Int_t itop, const Int_t ireal, Int_t &ncmpbr, Int_t &ncmpbi)
Help routine for factorization.
TDecompSparse & operator=(const TDecompSparse &source)
Assignment operator.
virtual Bool_t Decompose()
Decomposition engine .
static Int_t IDiag(Int_t ix, Int_t iy)
static void Solve(const Int_t n, TArrayD &Aa, TArrayI &Aiw, TArrayD &Aw, const Int_t maxfrt, TVectorD &b, TArrayI &Aiw1, const Int_t nsteps, Int_t *icntl, Int_t *info)
Main routine for solving Ax=b.
static void Solve_sub1(const Int_t n, Double_t *a, Int_t *iw, Double_t *w, Double_t *rhs, Int_t *iw2, const Int_t nblk, Int_t &latop, Int_t *icntl)
Help routine for solving.
virtual void Det(Double_t &, Double_t &)
Matrix determinant det = d1*TMath::Power(2.,d2)
static void Factor(const Int_t n, const Int_t nz, TArrayI &Airn, TArrayI &Aicn, TArrayD &Aa, TArrayI &Aiw, TArrayI &Aikeep, const Int_t nsteps, Int_t &maxfrt, TArrayI &Aiw1, Int_t *icntl, Double_t *cntl, Int_t *info)
Factorization routine, the workhorse for the decomposition step.
void InitParam()
initializing control parameters
static Int_t NonZerosUpperTriang(const TMatrixDSparse &a)
Static function, returning the number of non-zero entries in the upper triangular matrix ...
static void Solve_sub2(const Int_t n, Double_t *a, Int_t *iw, Double_t *w, Double_t *rhs, Int_t *iw2, const Int_t nblk, const Int_t latop, Int_t *icntl)
Help routine for solving.
Double_t GetThresholdPivoting()
Sparse Symmetric Decomposition class.
void SetThresholdPivoting(Double_t piv)
* x
Deprecated and error prone model selection interface.
static void Factor_sub2(const Int_t n, const Int_t nz, Double_t *a, const Int_t la, Int_t *iw, const Int_t liw, Int_t *perm, Int_t *nstk, const Int_t nsteps, Int_t &maxfrt, Int_t *nelim, Int_t *iw2, Int_t *icntl, Double_t *cntl, Int_t *info)
Help routine for factorization.
virtual TVectorD TransSolve(const TVectorD &b, Bool_t &ok)
const Double_t kInitPrecision
const Double_t kThresholdPivotingMax
Double_t GetTreatAsZero()
virtual Bool_t Solve(TMatrixDColumn &)
static void InitPivot_sub2(const Int_t n, Int_t *ipe, Int_t *iw, const Int_t lw, Int_t &iwfr, Int_t *nv, Int_t *nxt, Int_t *lst, Int_t *ipd, Int_t *flag, const Int_t iovflo, Int_t &ncmpa, const Double_t fratio)
Help routine for pivoting setup.
static void InitPivot_sub4(const Int_t n, Int_t *ipe, Int_t *iw, const Int_t lw, Int_t &iwfr, Int_t *ips, Int_t *ipv, Int_t *nv, Int_t *flag, Int_t &ncmpa)
Help routine for pivoting setup.
const Double_t kInitTreatAsZero
static void InitPivot_sub2a(const Int_t n, Int_t *ipe, Int_t *iw, const Int_t lw, Int_t &iwfr, Int_t &ncmpa)
Help routine for pivoting setup.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
const Double_t kInitThresholdPivoting
virtual TVectorD Solve(const TVectorD &b, Bool_t &ok)
static void InitPivot(const Int_t n, const Int_t nz, TArrayI &Airn, TArrayI &Aicn, TArrayI &Aiw, TArrayI &Aikeep, TArrayI &Aiw1, Int_t &nsteps, const Int_t iflag, Int_t *icntl, Double_t *cntl, Int_t *info, Double_t &ops)
Setup Pivoting variables.
static void InitPivot_sub6(const Int_t n, const Int_t nz, Int_t *irn, Int_t *icn, Int_t *perm, Int_t *na, Int_t *ne, Int_t *nd, const Int_t nsteps, Int_t *lstki, Int_t *lstkr, Int_t *iw, Int_t *info, Double_t &ops)
Help routine for pivoting setup.
static void Factor_sub1(const Int_t n, const Int_t nz, Int_t &nz1, Double_t *a, const Int_t la, Int_t *irn, Int_t *icn, Int_t *iw, const Int_t liw, Int_t *perm, Int_t *iw2, Int_t *icntl, Int_t *info)
Help routine for factorization.
static void InitPivot_sub3(const Int_t n, const Int_t nz, Int_t *irn, Int_t *icn, Int_t *perm, Int_t *iw, Int_t *ipe, Int_t *iq, Int_t *flag, Int_t &iwfr, Int_t *icntl, Int_t *info)
Help routine for pivoting setup.