00001
00012 #ifdef _MSC_VER
00013
00014 # pragma warning(disable:4231)
00015
00016
00017 # pragma warning(disable:4251)
00018
00019
00020 # pragma warning(disable:4275)
00021
00022
00023 # pragma warning(disable:4800)
00024 #endif
00025
00026
00027
00028 #include <boost/python.hpp>
00029
00030 #include "minimizers/StatedFCN.h"
00031
00032 #include "datasrcs/DataSource.h"
00033 #include "functions/FunctionBase.h"
00034
00035 using std::vector;
00036
00037 using namespace boost::python;
00038
00039 namespace hippodraw {
00040 namespace Python {
00041
00045 void
00046 export_StatedFCN()
00047 {
00048 #ifdef HAVE_MINUIT2
00049 class_ < StatedFCN, bases < ROOT::Minuit2::FCNBase >,
00050 #else
00051 class_ < StatedFCN, bases < FCNBase >,
00052 #endif
00053 StatedFCN, boost::noncopyable >
00054 ( "StatedFCN",
00055 "This a base class for objective function used in fitting that\n"
00056 "maintains the state of the function's parameters.",
00057 no_init )
00058
00059 .def ( "objectiveValue", &StatedFCN::objectiveValue,
00060 "objectiveValue () -> value\n"
00061 "\n"
00062 "Returns the objective value. For example, the objective\n"
00063 "might be the Chi-Squared when derived class returns it as\n"
00064 "its objective value." )
00065
00066 .def ( "degreesOfFreedom", &StatedFCN::degreesOfFreedom,
00067 "degreesOfFreedom () -> value\n"
00068 "\n"
00069 "Returns the degrees of freedom as integer." )
00070
00071 .def ( "setFunction", &StatedFCN::setFunction,
00072 "setFunction ( FunctionBase ) -> None\n"
00073 "\n"
00074 "Sets the model function." )
00075
00076 .def ( "setDataSource",
00077 ( void ( StatedFCN::* )
00078 (const DataSource * ) )
00079 &StatedFCN::setDataSource )
00080
00081 .def ( "setDataSource",
00082 ( void ( StatedFCN::* )
00083 ( const DataSource *,
00084 int dimension,
00085 const std::vector < int > & ) )
00086 &StatedFCN::setDataSource,
00087 "setDataSource ( DataSource ) -> None\n"
00088 "setDataSource ( DataSource, value, sequence ) -> None\n"
00089 "\n"
00090 "The first form sets the data source with default indexes. The\n"
00091 "second form takes in addition the dimensionality of the\n"
00092 "coordinate and a column indexes from the sequence." )
00093
00094 .def ( "setUseErrors", &StatedFCN::setUseErrors,
00095 "setUseErrors ( Boolean ) -> None\n"
00096 "\n"
00097 "Sets the FCN to use errors on the data source if they exist." )
00098
00099 ;
00100 }
00101
00102 }
00103 }