00001 // @(#)root/minuit2:$Id: SimplexParameters.h 21114 2007-11-29 17:16:45Z moneta $ 00002 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005 00003 00004 /********************************************************************** 00005 * * 00006 * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT * 00007 * * 00008 **********************************************************************/ 00009 00010 #ifndef ROOT_Minuit2_SimplexParameters 00011 #define ROOT_Minuit2_SimplexParameters 00012 00013 #include <cassert> 00014 00015 #include "Minuit2/MnMatrix.h" 00016 00017 #include <vector> 00018 #include <utility> 00019 00020 namespace ROOT { 00021 00022 namespace Minuit2 { 00023 00024 /** 00025 class describing the simplex set of points (f(x), x ) which evolve during the minimization 00026 iteration process. 00027 */ 00028 00029 class SimplexParameters { 00030 00031 public: 00032 00033 SimplexParameters(const std::vector<std::pair<double, MnAlgebraicVector> >& simpl, unsigned int jh, unsigned int jl) : fSimplexParameters(simpl), fJHigh(jh), fJLow(jl) {} 00034 00035 ~SimplexParameters() {} 00036 00037 void Update(double, const MnAlgebraicVector&); 00038 00039 const std::vector<std::pair<double, MnAlgebraicVector> >& Simplex() const { 00040 return fSimplexParameters; 00041 } 00042 00043 const std::pair<double, MnAlgebraicVector>& operator()(unsigned int i) const { 00044 assert(i < fSimplexParameters.size()); 00045 return fSimplexParameters[i]; 00046 } 00047 00048 unsigned int Jh() const {return fJHigh;} 00049 unsigned int Jl() const {return fJLow;} 00050 double Edm() const {return fSimplexParameters[Jh()].first - fSimplexParameters[Jl()].first;} 00051 MnAlgebraicVector Dirin() const; 00052 00053 private: 00054 00055 std::vector<std::pair<double, MnAlgebraicVector> > fSimplexParameters; 00056 unsigned int fJHigh; 00057 unsigned int fJLow; 00058 }; 00059 00060 } // namespace Minuit2 00061 00062 } // namespace ROOT 00063 00064 #endif // ROOT_Minuit2_SimplexParameters