ROOT logo
// @(#)root/minuit2:$Id$
// Authors: M. Winkler, F. James, L. Moneta, A. Zsenei   2003-2005  

/**********************************************************************
 *                                                                    *
 * Copyright (c) 2005 LCG ROOT Math team,  CERN/PH-SFT                *
 *                                                                    *
 **********************************************************************/

#ifndef ROOT_Minuit2_MnMinimize
#define ROOT_Minuit2_MnMinimize

#include "Minuit2/MnApplication.h"
#include "Minuit2/CombinedMinimizer.h"

namespace ROOT {

   namespace Minuit2 {


class FCNBase;

/** API class for minimization using Variable Metric technology ("MIGRAD");
    allows for user interaction: set/change parameters, do minimization,
    change parameters, re-do minimization etc.; 
    also used by MnMinos and MnContours;
 */

class MnMinimize : public MnApplication {

public:

   /// construct from FCNBase + std::vector for parameters and errors
   MnMinimize(const FCNBase& fcn, const std::vector<double>& par, const std::vector<double>& err, unsigned int stra = 1) : MnApplication(fcn, MnUserParameterState(par,err), MnStrategy(stra)), fMinimizer(CombinedMinimizer()) {}

   /// construct from FCNBase + std::vector for parameters and covariance
   MnMinimize(const FCNBase& fcn, const std::vector<double>& par,  unsigned int nrow, const std::vector<double>& cov, unsigned int stra = 1) : MnApplication(fcn, MnUserParameterState(par, cov, nrow), MnStrategy(stra)), fMinimizer(CombinedMinimizer()) {}

   /// construct from FCNBase + std::vector for parameters and MnUserCovariance
   MnMinimize(const FCNBase& fcn, const std::vector<double>& par, const MnUserCovariance& cov, unsigned int stra = 1) : MnApplication(fcn, MnUserParameterState(par, cov), MnStrategy(stra)), fMinimizer(CombinedMinimizer()) {}

   /// construct from FCNBase + MnUserParameters
   MnMinimize(const FCNBase& fcn, const MnUserParameters& par, unsigned int stra = 1) : MnApplication(fcn, MnUserParameterState(par), MnStrategy(stra)), fMinimizer(CombinedMinimizer()) {}

   /// construct from FCNBase + MnUserParameters + MnUserCovariance
   MnMinimize(const FCNBase& fcn, const MnUserParameters& par, const MnUserCovariance& cov, unsigned int stra = 1) : MnApplication(fcn, MnUserParameterState(par, cov), MnStrategy(stra)), fMinimizer(CombinedMinimizer()) {}

   /// construct from FCNBase + MnUserParameterState + MnStrategy
   MnMinimize(const FCNBase& fcn, const MnUserParameterState& par, const MnStrategy& str) : MnApplication(fcn, MnUserParameterState(par), str), fMinimizer(CombinedMinimizer()) {}

   // interfaces using FCNGradientBase

   /// construct from FCNGradientBase + std::vector for parameters and errors
   MnMinimize(const FCNGradientBase& fcn, const std::vector<double>& par, const std::vector<double>& err, unsigned int stra = 1) : MnApplication(fcn, MnUserParameterState(par,err), MnStrategy(stra)), fMinimizer(CombinedMinimizer()) {}

   /// construct from FCNGradientBase + std::vector for parameters and covariance
   MnMinimize(const FCNGradientBase& fcn, const std::vector<double>& par,  unsigned int nrow, const std::vector<double>& cov, unsigned int stra = 1) : MnApplication(fcn, MnUserParameterState(par, cov, nrow), MnStrategy(stra)), fMinimizer(CombinedMinimizer()) {}

   /// construct from FCNGradientBase + std::vector for parameters and MnUserCovariance
   MnMinimize(const FCNGradientBase& fcn, const std::vector<double>& par, const MnUserCovariance& cov, unsigned int stra = 1) : MnApplication(fcn, MnUserParameterState(par, cov), MnStrategy(stra)), fMinimizer(CombinedMinimizer()) {}

   /// construct from FCNGradientBase + MnUserParameters
   MnMinimize(const FCNGradientBase& fcn, const MnUserParameters& par, unsigned int stra = 1) : MnApplication(fcn, MnUserParameterState(par), MnStrategy(stra)), fMinimizer(CombinedMinimizer()) {}

   /// construct from FCNGradientBase + MnUserParameters + MnUserCovariance
   MnMinimize(const FCNGradientBase& fcn, const MnUserParameters& par, const MnUserCovariance& cov, unsigned int stra = 1) : MnApplication(fcn, MnUserParameterState(par, cov), MnStrategy(stra)), fMinimizer(CombinedMinimizer()) {}

   /// construct from FCNGradientBase + MnUserParameterState + MnStrategy
   MnMinimize(const FCNGradientBase& fcn, const MnUserParameterState& par, const MnStrategy& str) : MnApplication(fcn, MnUserParameterState(par), str), fMinimizer(CombinedMinimizer()) {}


   MnMinimize(const MnMinimize& migr) : MnApplication(migr.Fcnbase(), migr.State(), migr.Strategy(), migr.NumOfCalls()), fMinimizer(migr.fMinimizer) {}  

   ~MnMinimize() {}

   const ModularFunctionMinimizer& Minimizer() const {return fMinimizer;}

private:

   CombinedMinimizer fMinimizer;

private:

   //forbidden assignment operator
   MnMinimize& operator=(const MnMinimize&) {return *this;}
};

  }  // namespace Minuit2

}  // namespace ROOT

#endif  // ROOT_Minuit2_MnMinimize
 MnMinimize.h:1
 MnMinimize.h:2
 MnMinimize.h:3
 MnMinimize.h:4
 MnMinimize.h:5
 MnMinimize.h:6
 MnMinimize.h:7
 MnMinimize.h:8
 MnMinimize.h:9
 MnMinimize.h:10
 MnMinimize.h:11
 MnMinimize.h:12
 MnMinimize.h:13
 MnMinimize.h:14
 MnMinimize.h:15
 MnMinimize.h:16
 MnMinimize.h:17
 MnMinimize.h:18
 MnMinimize.h:19
 MnMinimize.h:20
 MnMinimize.h:21
 MnMinimize.h:22
 MnMinimize.h:23
 MnMinimize.h:24
 MnMinimize.h:25
 MnMinimize.h:26
 MnMinimize.h:27
 MnMinimize.h:28
 MnMinimize.h:29
 MnMinimize.h:30
 MnMinimize.h:31
 MnMinimize.h:32
 MnMinimize.h:33
 MnMinimize.h:34
 MnMinimize.h:35
 MnMinimize.h:36
 MnMinimize.h:37
 MnMinimize.h:38
 MnMinimize.h:39
 MnMinimize.h:40
 MnMinimize.h:41
 MnMinimize.h:42
 MnMinimize.h:43
 MnMinimize.h:44
 MnMinimize.h:45
 MnMinimize.h:46
 MnMinimize.h:47
 MnMinimize.h:48
 MnMinimize.h:49
 MnMinimize.h:50
 MnMinimize.h:51
 MnMinimize.h:52
 MnMinimize.h:53
 MnMinimize.h:54
 MnMinimize.h:55
 MnMinimize.h:56
 MnMinimize.h:57
 MnMinimize.h:58
 MnMinimize.h:59
 MnMinimize.h:60
 MnMinimize.h:61
 MnMinimize.h:62
 MnMinimize.h:63
 MnMinimize.h:64
 MnMinimize.h:65
 MnMinimize.h:66
 MnMinimize.h:67
 MnMinimize.h:68
 MnMinimize.h:69
 MnMinimize.h:70
 MnMinimize.h:71
 MnMinimize.h:72
 MnMinimize.h:73
 MnMinimize.h:74
 MnMinimize.h:75
 MnMinimize.h:76
 MnMinimize.h:77
 MnMinimize.h:78
 MnMinimize.h:79
 MnMinimize.h:80
 MnMinimize.h:81
 MnMinimize.h:82
 MnMinimize.h:83
 MnMinimize.h:84
 MnMinimize.h:85
 MnMinimize.h:86
 MnMinimize.h:87
 MnMinimize.h:88
 MnMinimize.h:89
 MnMinimize.h:90
 MnMinimize.h:91
 MnMinimize.h:92