]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Removing try/catch-es
authorshahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Jan 2012 16:46:48 +0000 (16:46 +0000)
committershahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Jan 2012 16:46:48 +0000 (16:46 +0000)
STEER/STEER/AliMillePede2.cxx
STEER/STEER/AliMinResSolve.cxx
STEER/STEER/AliSymMatrix.cxx

index f8bedf219a10ee6b56d795e14c6628ad0f3b7b53..2b6171c134456de71758a2a865308e54c1a2af78 100644 (file)
@@ -167,34 +167,27 @@ Int_t AliMillePede2::InitMille(int nGlo, int nLoc, int lNStdDev,double lResCut,
   //
   fNGloSize = fNGloPar;
   //
-  try {
-    //
-    if (fgIsMatGloSparse) {fMatCGlo = new AliMatrixSparse(fNGloPar); fMatCGlo->SetSymmetric(kTRUE);}
-    else                   fMatCGlo = new AliSymMatrix(fNGloPar);
-    //
-    fFillIndex    = new Int_t[fNGloPar];
-    fFillValue    = new Double_t[fNGloPar];
-    //
-    fMatCLoc      = new AliSymMatrix(fNLocPar);
-    fMatCGloLoc   = new AliRectMatrix(fNGloPar,fNLocPar);
-    //
-    fParamGrID    = new Int_t[fNGloPar];
-    fProcPnt      = new Int_t[fNGloPar];
-    fVecBLoc      = new Double_t[fNLocPar];
-    fDiagCGlo     = new Double_t[fNGloPar];
-    //
-    fInitPar      = new Double_t[fNGloPar];
-    fDeltaPar     = new Double_t[fNGloPar];
-    fSigmaPar     = new Double_t[fNGloPar];
-    fIsLinear     = new Bool_t[fNGloPar];
-    //
-    fGlo2CGlo     = new Int_t[fNGloPar];
-    fCGlo2Glo     = new Int_t[fNGloPar];
-  }
-  catch(bad_alloc&) {
-    AliInfo(Form("Failed to allocate the memory for %d global and %d local parameters",fNGloPar,fNLocPar));
-    return 0;
-  }
+  if (fgIsMatGloSparse) {fMatCGlo = new AliMatrixSparse(fNGloPar); fMatCGlo->SetSymmetric(kTRUE);}
+  else                   fMatCGlo = new AliSymMatrix(fNGloPar);
+  //
+  fFillIndex    = new Int_t[fNGloPar];
+  fFillValue    = new Double_t[fNGloPar];
+  //
+  fMatCLoc      = new AliSymMatrix(fNLocPar);
+  fMatCGloLoc   = new AliRectMatrix(fNGloPar,fNLocPar);
+  //
+  fParamGrID    = new Int_t[fNGloPar];
+  fProcPnt      = new Int_t[fNGloPar];
+  fVecBLoc      = new Double_t[fNLocPar];
+  fDiagCGlo     = new Double_t[fNGloPar];
+  //
+  fInitPar      = new Double_t[fNGloPar];
+  fDeltaPar     = new Double_t[fNGloPar];
+  fSigmaPar     = new Double_t[fNGloPar];
+  fIsLinear     = new Bool_t[fNGloPar];
+  //
+  fGlo2CGlo     = new Int_t[fNGloPar];
+  fCGlo2Glo     = new Int_t[fNGloPar];
   //
   memset(fVecBLoc   ,0,fNLocPar*sizeof(Double_t));
   memset(fDiagCGlo  ,0,fNGloPar*sizeof(Double_t));
index 49d88eb11ea246b77d0d7b01b21f160bf0d7349c..82dae3ddde50a5a2337744f68ceb3438c7ebd223 100644 (file)
@@ -551,20 +551,13 @@ void AliMinResSolve::ApplyPrecon(const double* vecRHS, double* vecOut) const
 Bool_t AliMinResSolve::InitAuxMinRes()
 {
   // init auxiliary space for minres
-  try {
-    fPVecY   = new double[fSize];   
-    fPVecR1  = new double[fSize];   
-    fPVecR2  = new double[fSize];   
-    fPVecV   = new double[fSize];   
-    fPVecW   = new double[fSize];   
-    fPVecW1  = new double[fSize];   
-    fPVecW2  = new double[fSize];   
-  }
-  catch(bad_alloc&) {
-    AliInfo(Form("Failed to allocate the memory for auxialiary arrays for %d equations",fSize));
-    ClearAux();
-    return kFALSE;
-  }
+  fPVecY   = new double[fSize];   
+  fPVecR1  = new double[fSize];   
+  fPVecR2  = new double[fSize];   
+  fPVecV   = new double[fSize];   
+  fPVecW   = new double[fSize];   
+  fPVecW1  = new double[fSize];   
+  fPVecW2  = new double[fSize];   
   //
   for (int i=fSize;i--;) fPVecY[i]=fPVecR1[i]=fPVecR2[i]=fPVecV[i]=fPVecW[i]=fPVecW1[i]=fPVecW2[i]=0.0;
   //
@@ -576,26 +569,19 @@ Bool_t AliMinResSolve::InitAuxMinRes()
 Bool_t AliMinResSolve::InitAuxFGMRES(int nkrylov)
 {
   // init auxiliary space for fgmres
-  try {
-    fPvv     = new double*[nkrylov+1];
-    fPvz     = new double*[nkrylov];
-    for (int i=0; i<=nkrylov; i++) fPvv[i] = new double[fSize];
-    fPhh     = new double*[nkrylov];
-    for (int i=0; i<nkrylov; i++) {
-      fPhh[i] = new double[i+2];
-      fPvz[i]  = new double[fSize];
-    }
-    //
-    fPVecR1  = new double[nkrylov];   
-    fPVecR2  = new double[nkrylov];   
-    fPVecV   = new double[nkrylov+1];
-  }
-  catch(bad_alloc&) {
-    AliInfo(Form("Failed to allocate the memory for auxialiary arrays for %d equations",fSize));
-    ClearAux();
-    return kFALSE;
+  fPvv     = new double*[nkrylov+1];
+  fPvz     = new double*[nkrylov];
+  for (int i=0; i<=nkrylov; i++) fPvv[i] = new double[fSize];
+  fPhh     = new double*[nkrylov];
+  for (int i=0; i<nkrylov; i++) {
+    fPhh[i] = new double[i+2];
+    fPvz[i]  = new double[fSize];
   }
   //
+  fPVecR1  = new double[nkrylov];   
+  fPVecR2  = new double[nkrylov];   
+  fPVecV   = new double[nkrylov+1];
+  //
   return kTRUE;
 }
 
@@ -863,22 +849,10 @@ Int_t  AliMinResSolve::PreconILUKsymb(Int_t lofM)
   UChar_t **ulvl=0,*levls=0;
   UShort_t *jbuf=0;
   Int_t    *iw=0;
-  try {
-    ulvl = new UChar_t*[fSize];      // stores lev-fils for U part of ILU factorization
-    levls = new UChar_t[fSize];
-    jbuf = new UShort_t[fSize];
-    iw = new Int_t[fSize];
-  }
-  //
-  catch(bad_alloc&) {
-    AliInfo("Failed to allocate the memory in AliMinResSolve::PreconILUKsymb");
-    if (ulvl) delete[] ulvl;
-    if (levls) delete[] levls;
-    if (jbuf) delete[] jbuf;
-    if (iw) delete[] iw;
-    ClearAux();
-    return -1;
-  }
+  ulvl = new UChar_t*[fSize];      // stores lev-fils for U part of ILU factorization
+  levls = new UChar_t[fSize];
+  jbuf = new UShort_t[fSize];
+  iw = new Int_t[fSize];
   //
   for(int j=fSize; j--;) iw[j] = -1;           // initialize iw 
   for(int i=0; i<fSize; i++) {
@@ -998,22 +972,10 @@ Int_t  AliMinResSolve::PreconILUKsymbDense(Int_t lofM)
   UChar_t **ulvl=0,*levls=0;
   UShort_t *jbuf=0;
   Int_t    *iw=0;
-  try {
-    ulvl = new UChar_t*[fSize];      // stores lev-fils for U part of ILU factorization
-    levls = new UChar_t[fSize];
-    jbuf = new UShort_t[fSize];
-    iw = new Int_t[fSize];
-  }
-  //
-  catch(bad_alloc&) {
-    AliInfo("Failed to allocate the memory in AliMinResSolve::PreconILUKsymb");
-    if (ulvl) delete[] ulvl;
-    if (levls) delete[] levls;
-    if (jbuf) delete[] jbuf;
-    if (iw) delete[] iw;
-    ClearAux();
-    return -1;
-  }
+  ulvl = new UChar_t*[fSize];      // stores lev-fils for U part of ILU factorization
+  levls = new UChar_t[fSize];
+  jbuf = new UShort_t[fSize];
+  iw = new Int_t[fSize];
   //
   for(int j=fSize; j--;) iw[j] = -1;           // initialize iw 
   for(int i=0; i<fSize; i++) {
index 326aade1c4ac1b9227b1dc84603a9138ebe9e8b0..8e79af114fd23e521c44fe3ee40f46c9035f229c 100644 (file)
@@ -207,13 +207,7 @@ AliSymMatrix* AliSymMatrix::DecomposeChol()
   //
   if (!fgBuffer || fgBuffer->GetSizeUsed()!=GetSizeUsed()) {
     delete fgBuffer; 
-    try {
-      fgBuffer = new AliSymMatrix(*this);
-    }
-    catch(bad_alloc&) {
-      AliInfo("Failed to allocate memory for Choleski decompostions");
-      return 0;
-    }
+    fgBuffer = new AliSymMatrix(*this);
   }
   else (*fgBuffer) = *this;
   //
@@ -478,13 +472,7 @@ int AliSymMatrix::SolveSpmInv(double *vecB, Bool_t stabilize)
   //  
   if (!fgBuffer || fgBuffer->GetSizeUsed()!=GetSizeUsed()) {
     delete fgBuffer; 
-    try {
-      fgBuffer = new AliSymMatrix(*this);
-    }
-    catch(bad_alloc&) {
-      AliError("Failed to allocate memory for matrix inversion buffer");
-      return 0;
-    }
+    fgBuffer = new AliSymMatrix(*this);
   }
   else (*fgBuffer) = *this;
   //