132 fTol = std::numeric_limits<double>::epsilon();
176 if ( ynorm1 <= inv_norm1 ) {
181 for (i = 0; i <
n; i++)
182 z(i) = (
y(i) >= 0.0 ? 1.0 : -1.0 );
187 for (i = 1; i <
n; i++) {
194 stop = (maxz <=
b*z);
201 }
while (!stop && iter);
228 for (
Int_t i = 0; (((i <
n) && (
t1 !=zero ))); i++) {
235 if ( niter2>100)
break;
241 if (niter3>100)
break;
271 Error(
"Condition()",
"Hager procedure did NOT converge");
288 for (
Int_t icol = colLwb; icol <= colUpb && status; icol++) {
326 printf(
"fTol = %.4e\n",
fTol);
327 printf(
"fDet1 = %.4e\n",
fDet1);
328 printf(
"fDet2 = %.4e\n",
fDet2);
330 printf(
"fRowLwb = %d\n",
fRowLwb);
331 printf(
"fColLwb = %d\n",
fColLwb);
339 if (
this != &source) {
362 for (i =
l; i <
n; i++)
373 for (i =
l; i <
n; i++) {
379 if (vp[lp] > 0.) vpprim = -vpprim;
381 beta = 1./(vpprim*up);
396 Error(
"ApplyHouseHolder(const TVectorD &,..,TMatrixDRow &)",
"matrix row too short");
406 for (i =
l; i < nv; i++)
407 s += cp[i*inc_c]*vp[i];
410 cp[lp*inc_c] += s*up;
411 for (i =
l; i < nv; i++)
412 cp[i*inc_c] += s*vp[i];
425 Error(
"ApplyHouseHolder(const TVectorD &,..,TMatrixDRow &)",
"matrix column too short");
435 for (i =
l; i < nv; i++)
436 s += cp[i*inc_c]*vp[i];
439 cp[lp*inc_c] += s*up;
440 for (i =
l; i < nv; i++)
441 cp[i*inc_c] += s*vp[i];
454 Error(
"ApplyHouseHolder(const TVectorD &,..,TVectorD &)",
"vector too short");
463 for (i =
l; i < nv; i++)
468 for (i =
l; i < nv; i++)
Bool_t DefHouseHolder(const TVectorD &vc, Int_t lp, Int_t l, Double_t &up, Double_t &beta, Double_t tol)
Define a Householder-transformation through the parameters up and b .
void ApplyHouseHolder(const TVectorD &vc, Double_t up, Double_t beta, Int_t lp, Int_t l, TMatrixDRow &cr)
Apply Householder-transformation.
void ApplyGivens(Double_t &z1, Double_t &z2, Double_t c, Double_t s)
Apply a Givens transformation as defined by c and s to the vector components v1 and v2 .
void DefGivens(Double_t v1, Double_t v2, Double_t &c, Double_t &s)
Defines a Givens-rotation by calculating 2 rotation parameters c and s.
void DefAplGivens(Double_t &v1, Double_t &v2, Double_t &c, Double_t &s)
Define and apply a Givens-rotation by calculating 2 rotation parameters c and s.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Decomposition Base class.
static void DiagProd(const TVectorD &diag, Double_t tol, Double_t &d1, Double_t &d2)
virtual Bool_t Decompose()=0
virtual Bool_t MultiSolve(TMatrixD &B)
Solve set of equations with RHS in columns of B.
void Print(Option_t *opt="") const
Print class members.
virtual const TMatrixDBase & GetDecompMatrix() const =0
virtual Bool_t Solve(TVectorD &b)=0
TDecompBase & operator=(const TDecompBase &source)
Assignment operator.
Int_t Hager(Double_t &est, Int_t iter=5)
virtual Double_t Condition()
Matrix condition number.
TDecompBase()
Default constructor.
virtual Bool_t TransSolve(TVectorD &b)=0
virtual void Det(Double_t &d1, Double_t &d2)
Matrix determinant det = d1*TMath::Power(2.,d2)
const TMatrixTBase< Element > * GetMatrix() const
const TMatrixTBase< Element > * GetMatrix() const
Mother of all ROOT objects.
TObject & operator=(const TObject &rhs)
TObject assignment operator.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Element * GetMatrixArray()
Short_t Max(Short_t a, Short_t b)
Double_t Sqrt(Double_t x)
Double_t Hypot(Double_t x, Double_t y)