Logo ROOT   6.08/07
Reference Guide
BasicMinimumParameters.h
Go to the documentation of this file.
1 // @(#)root/minuit2:$Id$
2 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT *
7  * *
8  **********************************************************************/
9 
10 #ifndef ROOT_Minuit2_BasicMinimumParameters
11 #define ROOT_Minuit2_BasicMinimumParameters
12 
13 #include "Minuit2/MnMatrix.h"
14 
15 #include "Minuit2/StackAllocator.h"
16 
17 namespace ROOT {
18 
19  namespace Minuit2 {
20 
21 
22 //extern StackAllocator gStackAllocator;
23 
25 
26 public:
27 
28  BasicMinimumParameters(unsigned int n, double fval) : fParameters(MnAlgebraicVector(n)), fStepSize(MnAlgebraicVector(n)), fFVal(fval), fValid(false), fHasStep(false) {}
29 
30  BasicMinimumParameters(const MnAlgebraicVector& avec, double fval) :
31  fParameters(avec), fStepSize(avec.size()), fFVal(fval), fValid(true), fHasStep(false) {}
32 
33  BasicMinimumParameters(const MnAlgebraicVector& avec, const MnAlgebraicVector& dirin, double fval) : fParameters(avec), fStepSize(dirin), fFVal(fval), fValid(true), fHasStep(true) {}
34 
36 
38 
41  fStepSize = par.fStepSize;
42  fFVal = par.fFVal;
43  fValid = par.fValid;
44  fHasStep = par.fHasStep;
45  return *this;
46  }
47 
48  void* operator new(size_t nbytes) {
49  return StackAllocatorHolder::Get().Allocate(nbytes);
50  }
51 
52  void operator delete(void* p, size_t /*nbytes*/) {
54  }
55 
56  const MnAlgebraicVector& Vec() const {return fParameters;}
57  const MnAlgebraicVector& Dirin() const {return fStepSize;}
58  double Fval() const {return fFVal;}
59  bool IsValid() const {return fValid;}
60  bool HasStepSize() const {return fHasStep;}
61 
62 private:
63 
66  double fFVal;
67  bool fValid;
68  bool fHasStep;
69 };
70 
71  } // namespace Minuit2
72 
73 } // namespace ROOT
74 
75 #endif // ROOT_Minuit2_BasicMinimumParameters
double par[1]
Definition: unuranDistr.cxx:38
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
Definition: StringConv.hxx:21
BasicMinimumParameters(const MnAlgebraicVector &avec, double fval)
BasicMinimumParameters(unsigned int n, double fval)
void * Allocate(size_t nBytes)
const MnAlgebraicVector & Vec() const
BasicMinimumParameters & operator=(const BasicMinimumParameters &par)
const MnAlgebraicVector & Dirin() const
BasicMinimumParameters(const BasicMinimumParameters &par)
BasicMinimumParameters(const MnAlgebraicVector &avec, const MnAlgebraicVector &dirin, double fval)
static StackAllocator & Get()
const Int_t n
Definition: legend1.C:16