// @(#)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_FunctionMinimizer
#define ROOT_Minuit2_FunctionMinimizer


#include "Minuit2/MnConfig.h"
#include <vector>

namespace ROOT {

   namespace Minuit2 {


class FCNBase;
class FCNGradientBase;
class FunctionMinimum;

//_____________________________________________________________________________________
/** base class for function minimizers; user may give FCN or FCN with Gradient,
    Parameter starting values and initial Error guess (sigma) (or "step size"),
    or Parameter starting values and initial covariance matrix;
    covariance matrix is stored in Upper triangular packed storage format,
    e.g. the Elements in the array are arranged like
    {a(0,0), a(0,1), a(1,1), a(0,2), a(1,2), a(2,2), ...},
    the size is nrow*(nrow+1)/2 (see also MnUserCovariance.h);
 */

class FunctionMinimizer {

public:

   virtual ~FunctionMinimizer() {}

   //starting values for parameters and errors
   virtual FunctionMinimum Minimize(const FCNBase&, const std::vector<double>& par, const std::vector<double>& err, unsigned int strategy, unsigned int maxfcn, double toler) const = 0;

   //starting values for parameters and errors and FCN with Gradient
   virtual FunctionMinimum Minimize(const FCNGradientBase&, const std::vector<double>& par, const std::vector<double>& err, unsigned int strategy, unsigned int maxfcn, double toler) const = 0;

   //starting values for parameters and covariance matrix
   virtual FunctionMinimum Minimize(const FCNBase&, const std::vector<double>& par, unsigned int nrow, const std::vector<double>& cov, unsigned int strategy, unsigned int maxfcn, double toler) const = 0;

   //starting values for parameters and covariance matrix and FCN with Gradient
   virtual FunctionMinimum Minimize(const FCNGradientBase&, const std::vector<double>& par, unsigned int nrow, const std::vector<double>& cov, unsigned int strategy, unsigned int maxfcn, double toler) const = 0;

};

  }  // namespace Minuit2

}  // namespace ROOT

#endif  // ROOT_Minuit2_FunctionMinimizer
 FunctionMinimizer.h:1
 FunctionMinimizer.h:2
 FunctionMinimizer.h:3
 FunctionMinimizer.h:4
 FunctionMinimizer.h:5
 FunctionMinimizer.h:6
 FunctionMinimizer.h:7
 FunctionMinimizer.h:8
 FunctionMinimizer.h:9
 FunctionMinimizer.h:10
 FunctionMinimizer.h:11
 FunctionMinimizer.h:12
 FunctionMinimizer.h:13
 FunctionMinimizer.h:14
 FunctionMinimizer.h:15
 FunctionMinimizer.h:16
 FunctionMinimizer.h:17
 FunctionMinimizer.h:18
 FunctionMinimizer.h:19
 FunctionMinimizer.h:20
 FunctionMinimizer.h:21
 FunctionMinimizer.h:22
 FunctionMinimizer.h:23
 FunctionMinimizer.h:24
 FunctionMinimizer.h:25
 FunctionMinimizer.h:26
 FunctionMinimizer.h:27
 FunctionMinimizer.h:28
 FunctionMinimizer.h:29
 FunctionMinimizer.h:30
 FunctionMinimizer.h:31
 FunctionMinimizer.h:32
 FunctionMinimizer.h:33
 FunctionMinimizer.h:34
 FunctionMinimizer.h:35
 FunctionMinimizer.h:36
 FunctionMinimizer.h:37
 FunctionMinimizer.h:38
 FunctionMinimizer.h:39
 FunctionMinimizer.h:40
 FunctionMinimizer.h:41
 FunctionMinimizer.h:42
 FunctionMinimizer.h:43
 FunctionMinimizer.h:44
 FunctionMinimizer.h:45
 FunctionMinimizer.h:46
 FunctionMinimizer.h:47
 FunctionMinimizer.h:48
 FunctionMinimizer.h:49
 FunctionMinimizer.h:50
 FunctionMinimizer.h:51
 FunctionMinimizer.h:52
 FunctionMinimizer.h:53
 FunctionMinimizer.h:54
 FunctionMinimizer.h:55
 FunctionMinimizer.h:56
 FunctionMinimizer.h:57
 FunctionMinimizer.h:58
 FunctionMinimizer.h:59
 FunctionMinimizer.h:60