]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliMinResSolve.cxx
Fix in composition of QAChecked output image file (Melinda S.)
[u/mrichter/AliRoot.git] / STEER / AliMinResSolve.cxx
index 740020e704332cfccade2af073d223cfeb3cfe48..49d88eb11ea246b77d0d7b01b21f160bf0d7349c 100644 (file)
@@ -478,8 +478,8 @@ Bool_t AliMinResSolve::SolveMinRes(double *VecSol,Int_t precon,int itnlim,double
     // See if any of the stopping criteria are satisfied.
     // In rare cases, istop is already -1 from above (Abar = const*I).
     //
-    AliInfo(Form("#%5d |qnrm: %+.2e Anrm:%+.2e Cnd:%+.2e Rnrm:%+.2e Ynrm:%+.2e EpsR:%+.2e EpsX:%+.2e Beta1:%+.2e",
-                itn,qrnorm, normA,condA,rnorm,ynorm,epsr,epsx,beta1));
+    AliDebug(2,Form("#%5d |qnrm: %+.2e Anrm:%+.2e Cnd:%+.2e Rnrm:%+.2e Ynrm:%+.2e EpsR:%+.2e EpsX:%+.2e Beta1:%+.2e",
+                   itn,qrnorm, normA,condA,rnorm,ynorm,epsr,epsx,beta1));
 
     if (status == 0) {
       if (itn    >= itnlim    ) {status = 5; AliInfo(Form("%d iterations limit exceeded",itnlim));}
@@ -703,7 +703,7 @@ Int_t  AliMinResSolve::BuildPreconILUK(Int_t lofM)
     }
     // copy row from csmat into L,U D
     for(int j=rowM.GetNElems(); j--;) {  // L and D part 
-      if (TMath::Abs(rowM.GetElem(j))<DBL_MIN) continue;
+      if (AliMatrixSq::IsZero(rowM.GetElem(j))) continue;
       int col = rowM.GetIndex(j);         // (the original matrix stores only lower triangle)
       if( col < i )   rowLi.GetElem(jw[col]) = rowM.GetElem(j); 
       else if(col==i) fDiagLU[i] = rowM.GetElem(j);
@@ -711,7 +711,7 @@ Int_t  AliMinResSolve::BuildPreconILUK(Int_t lofM)
     }
     if (matrix->IsSymmetric()) for (int col=i+1;col<fSize;col++) {      // part of the row I on the right of diagonal is stored as 
        double vl = matrix->Query(col,i);    // the lower part of the column I
-       if (TMath::Abs(vl)<DBL_MIN) continue;                   
+       if (AliMatrixSq::IsZero(vl)) continue;
        rowUi.GetElem(jw[col]) = vl;
       }
     //
@@ -737,7 +737,7 @@ Int_t  AliMinResSolve::BuildPreconILUK(Int_t lofM)
     jw[i] = -1;
     for(int j=rowUi.GetNElems(); j--;) jw[ rowUi.GetIndex(j) ] = -1;
     //
-    if( TMath::Abs(fDiagLU[i])<DBL_MIN ) {
+    if( AliMatrixSq::IsZero(fDiagLU[i]) ) {
       AliInfo(Form("Fatal error in ILIk: Zero diagonal found..."));
       delete[] jw;
       return -1;
@@ -802,7 +802,7 @@ Int_t  AliMinResSolve::BuildPreconILUKDense(Int_t lofM)
     // copy row from csmat into L,U D
     for(int j=fSize; j--;) {  // L and D part 
       double vl = fMatrix->Query(i,j);
-      if (TMath::Abs(vl)<DBL_MIN) continue;
+      if (AliMatrixSq::IsZero(vl)) continue;
       if( j < i )   rowLi.GetElem(jw[j]) = vl;
       else if(j==i) fDiagLU[i] = vl;
       else rowUi.GetElem(jw[j]) = vl;
@@ -829,7 +829,7 @@ Int_t  AliMinResSolve::BuildPreconILUKDense(Int_t lofM)
     jw[i] = -1;
     for(int j=rowUi.GetNElems(); j--;) jw[ rowUi.GetIndex(j) ] = -1;
     //
-    if( TMath::Abs(fDiagLU[i])<DBL_MIN ) {
+    if( AliMatrixSq::IsZero(fDiagLU[i])) {
       AliInfo(Form("Fatal error in ILIk: Zero diagonal found..."));
       delete[] jw;
       return -1;
@@ -889,7 +889,7 @@ Int_t  AliMinResSolve::PreconILUKsymb(Int_t lofM)
     // assign lof = 0 for matrix elements
     for(int j=0;j<row.GetNElems(); j++) {
       int col = row.GetIndex(j);
-      if (TMath::Abs(row.GetElem(j))<DBL_MIN) continue;  // !!!! matrix is sparse but sometimes 0 appears 
+      if (AliMatrixSq::IsZero(row.GetElem(j))) continue;  // !!!! matrix is sparse but sometimes 0 appears 
       if (col<i) {                      // L-part
        jbuf[incl] = col;
        levls[incl] = 0;
@@ -902,7 +902,7 @@ Int_t  AliMinResSolve::PreconILUKsymb(Int_t lofM)
       }
     }
     if (matrix->IsSymmetric()) for (int col=i+1;col<fSize;col++) { // U-part of symmetric matrix
-       if (TMath::Abs(matrix->Query(col,i))<DBL_MIN) continue;    // Due to the symmetry  == matrix(i,col)
+       if (AliMatrixSq::IsZero(matrix->Query(col,i))) continue;    // Due to the symmetry  == matrix(i,col)
        jbuf[incu] = col;
        levls[incu] = 0;
        iw[col] = incu++;
@@ -975,6 +975,7 @@ Int_t  AliMinResSolve::PreconILUKsymb(Int_t lofM)
   delete[] jbuf;
   for(int i=fSize; i--;) if (fMatU->GetRow(i)->GetNElems()) delete[] ulvl[i]; 
   delete[] ulvl; 
+  delete[] iw;
   //
   fMatL->SortIndices();
   fMatU->SortIndices();
@@ -1021,7 +1022,7 @@ Int_t  AliMinResSolve::PreconILUKsymbDense(Int_t lofM)
     //
     // assign lof = 0 for matrix elements
     for(int j=0;j<fSize; j++) {
-      if (TMath::Abs(fMatrix->Query(i,j))<DBL_MIN) continue;
+      if (AliMatrixSq::IsZero(fMatrix->Query(i,j))) continue;
       if (j<i) {                      // L-part
        jbuf[incl] = j;
        levls[incl] = 0;
@@ -1101,6 +1102,7 @@ Int_t  AliMinResSolve::PreconILUKsymbDense(Int_t lofM)
   delete[] jbuf;
   for(int i=fSize; i--;) if (fMatU->GetRow(i)->GetNElems()) delete[] ulvl[i]; 
   delete[] ulvl; 
+  delete[] iw;
   //
   fMatL->SortIndices();
   fMatU->SortIndices();