export_StatedFCN.cxx
Go to the documentation of this file.
1 
12 #ifdef _MSC_VER
13 // nonstandard extension used 'extern' before...
14 # pragma warning(disable:4231)
15 
16 // needs to have dll-interface used by client
17 # pragma warning(disable:4251)
18 
19 // non dll-interface struct
20 # pragma warning(disable:4275)
21 
22 // 'int' : forcing value to bool 'true' or 'false' (performance warning)
23 # pragma warning(disable:4800)
24 #endif
25 
26 
27 // include first to avoid _POSIX_C_SOURCE warning.
28 #include <boost/python.hpp>
29 
30 #include "minimizers/StatedFCN.h"
31 
32 #include "datasrcs/DataSource.h"
33 #include "functions/FunctionBase.h"
34 
35 using std::vector;
36 
37 using namespace boost::python;
38 
39 namespace hippodraw {
40 namespace Python {
41 
45 void
47 {
48 #ifdef HAVE_MINUIT2
49  class_ < StatedFCN, bases < ROOT::Minuit2::FCNBase >,
50 #else
51  class_ < StatedFCN, bases < FCNBase >,
52 #endif
53  StatedFCN, boost::noncopyable >
54  ( "StatedFCN",
55  "This a base class for objective function used in fitting that\n"
56  "maintains the state of the function's parameters.",
57  no_init )
58 
59  .def ( "objectiveValue", &StatedFCN::objectiveValue,
60  "objectiveValue () -> value\n"
61  "\n"
62  "Returns the objective value. For example, the objective\n"
63  "might be the Chi-Squared when derived class returns it as\n"
64  "its objective value." )
65 
66  .def ( "degreesOfFreedom", &StatedFCN::degreesOfFreedom,
67  "degreesOfFreedom () -> value\n"
68  "\n"
69  "Returns the degrees of freedom as integer." )
70 
71  .def ( "setFunction", &StatedFCN::setFunction,
72  "setFunction ( FunctionBase ) -> None\n"
73  "\n"
74  "Sets the model function." )
75 
76  .def ( "setDataSource",
77  ( void ( StatedFCN::* ) // function pointer
78  (const DataSource * ) ) // function signature
79  &StatedFCN::setDataSource )
80 
81  .def ( "setDataSource",
82  ( void ( StatedFCN::* ) // function pointer
83  ( const DataSource *,
84  int dimension,
85  const std::vector < int > & ) ) // function signature
86  &StatedFCN::setDataSource,
87  "setDataSource ( DataSource ) -> None\n"
88  "setDataSource ( DataSource, value, sequence ) -> None\n"
89  "\n"
90  "The first form sets the data source with default indexes. The\n"
91  "second form takes in addition the dimensionality of the\n"
92  "coordinate and a column indexes from the sequence." )
93 
94  .def ( "setUseErrors", &StatedFCN::setUseErrors,
95  "setUseErrors ( Boolean ) -> None\n"
96  "\n"
97  "Sets the FCN to use errors on the data source if they exist." )
98 
99  ;
100 }
101 
102 } // namespace Python
103 } // namespace hippodraw

Generated for HippoDraw Class Library by doxygen