From 3c5b4cc8f23e69508eb65e8bc5f77e86e783c295 Mon Sep 17 00:00:00 2001 From: shahoian Date: Mon, 30 Jan 2012 16:46:48 +0000 Subject: [PATCH] Removing try/catch-es --- STEER/STEER/AliMillePede2.cxx | 49 ++++++++---------- STEER/STEER/AliMinResSolve.cxx | 90 ++++++++++------------------------ STEER/STEER/AliSymMatrix.cxx | 16 +----- 3 files changed, 49 insertions(+), 106 deletions(-) diff --git a/STEER/STEER/AliMillePede2.cxx b/STEER/STEER/AliMillePede2.cxx index f8bedf219a1..2b6171c1344 100644 --- a/STEER/STEER/AliMillePede2.cxx +++ b/STEER/STEER/AliMillePede2.cxx @@ -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)); diff --git a/STEER/STEER/AliMinResSolve.cxx b/STEER/STEER/AliMinResSolve.cxx index 49d88eb11ea..82dae3ddde5 100644 --- a/STEER/STEER/AliMinResSolve.cxx +++ b/STEER/STEER/AliMinResSolve.cxx @@ -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; iGetSizeUsed()!=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; // -- 2.39.3