// @(#)root/minuit2:$Id$ // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005 /********************************************************************** * * * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT * * * **********************************************************************/ #include "Minuit2/MnPosDef.h" #include "Minuit2/MinimumState.h" #include "Minuit2/MnMachinePrecision.h" #if defined(DEBUG) || defined(WARNINGMSG) #include "Minuit2/MnPrint.h" #endif #include namespace ROOT { namespace Minuit2 { LAVector eigenvalues(const LASymMatrix&); MinimumState MnPosDef::operator()(const MinimumState& st, const MnMachinePrecision& prec) const { // interface from minimum state MinimumError err = (*this)(st.Error(), prec); return MinimumState(st.Parameters(), err, st.Gradient(), st.Edm(), st.NFcn()); } MinimumError MnPosDef::operator()(const MinimumError& e, const MnMachinePrecision& prec) const { // make error matrix positive defined returning a new corrected minimum error state MnAlgebraicSymMatrix err(e.InvHessian()); if(err.size() == 1 && err(0,0) < prec.Eps()) { err(0,0) = 1.; return MinimumError(err, MinimumError::MnMadePosDef()); } if(err.size() == 1 && err(0,0) > prec.Eps()) { return e; } // std::cout<<"MnPosDef init matrix= "<