[root] / trunk / math / mathmore / src / GSLNLSMinimizer.cxx Repository:
ViewVC logotype

Diff of /trunk/math/mathmore/src/GSLNLSMinimizer.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 25485, Mon Sep 22 07:52:52 2008 UTC revision 25486, Mon Sep 22 12:43:03 2008 UTC
# Line 32  Line 32 
32    
33  GSLNLSMinimizer::GSLNLSMinimizer( int /* ROOT::Math::EGSLNLSMinimizerType type */ ) :  GSLNLSMinimizer::GSLNLSMinimizer( int /* ROOT::Math::EGSLNLSMinimizerType type */ ) :
34     fDim(0),     fDim(0),
35     fObjFunc(0)     fObjFunc(0),
36       fCovMatrix(0)
37  {  {
38     // Constructor implementation : create GSLMultiFit wrapper object     // Constructor implementation : create GSLMultiFit wrapper object
39     fGSLMultiFit = new GSLMultiFit( /*type */ );     fGSLMultiFit = new GSLMultiFit( /*type */ );
# Line 190  Line 191 
191     if (x == 0) return false;     if (x == 0) return false;
192     std::copy(x, x +fDim, fValues.begin() );     std::copy(x, x +fDim, fValues.begin() );
193     fMinVal =  (*fObjFunc)(x);     fMinVal =  (*fObjFunc)(x);
194       fStatus = status;
195    
196       fErrors.resize(fDim);
197    
198     if (minFound) {     if (minFound) {
199        if (debugLevel >=1 ) {        if (debugLevel >=1 ) {
# Line 203  Line 206 
206           for (unsigned int i = 0; i < fDim; ++i)           for (unsigned int i = 0; i < fDim; ++i)
207              std::cout << fNames[i] << "\t  = " << fValues[i] << std::endl;              std::cout << fNames[i] << "\t  = " << fValues[i] << std::endl;
208        }        }
209          // get errors from cov matrix
210          fCovMatrix = fGSLMultiFit->CovarMatrix();
211          for (unsigned int i = 0; i < fDim; ++i)
212             fErrors[i] = std::sqrt(fCovMatrix[i*fDim + i]);
213    
214        return true;        return true;
215     }     }
216     else {     else {
# Line 222  Line 230 
230  }  }
231    
232    
233    double GSLNLSMinimizer::CovMatrix(unsigned int i , unsigned int j ) const {
234       if (!fCovMatrix) return 0;
235       if (i > fDim || j > fDim) return 0;
236       return fCovMatrix[i*fDim + j];
237    }
238    
239     } // end namespace Math     } // end namespace Math
240    
241  } // end namespace ROOT  } // end namespace ROOT

Legend:
Removed from v.25485  
changed lines
  Added in v.25486

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9