export_Fitter.cxx

Go to the documentation of this file.
00001 
00012 #ifdef _MSC_VER
00013 // nonstandard extension used 'extern' before...
00014 # pragma warning(disable:4231)  
00015 
00016 // needs to have dll-interface used by client
00017 # pragma warning(disable:4251)  
00018 
00019 // non dll-interface struct
00020 # pragma warning(disable:4275)  
00021 
00022 // 'int' : forcing value to bool 'true' or 'false' (performance warning)
00023 # pragma warning(disable:4800)  
00024 #endif
00025 
00026 // include first to avoid _POSIX_C_SOURCE warning.
00027 #include <boost/python.hpp>
00028 
00029 #include "functions/FunctionBase.h"
00030 #include "minimizers/Fitter.h"
00031 #include "minimizers/StatedFCN.h"
00032 
00033 using std::vector;
00034 using namespace boost::python;
00035 
00036 namespace hippodraw {
00037 namespace Python {
00038 
00039 void
00040 export_Fitter()
00041 {
00042   class_ < Fitter, bases<>,
00043     Fitter, boost::noncopyable >
00044     ( "Fitter",
00045       "Provides an interface to objective function minimizers.",
00046       no_init )
00047 
00048     .add_property ( "degreesOfFreedom", 
00049                     &Fitter::calcDegreesOfFreedom )
00050 
00051     .add_property ( "objectiveValue",
00052                     &Fitter::objectiveValue )
00053 
00054     .def ( "name", &Fitter::name,
00055            return_value_policy < copy_const_reference > (),
00056            "name () -> string\n"
00057            "\n"
00058            "Returns the minimizer name." )
00059 
00060     .def ( "getFCN", &Fitter::getFCN,
00061            return_value_policy < reference_existing_object > (),
00062            "getFCN () -> FCNBase\n"
00063            "\n"
00064            "Returns the objective function." )
00065 
00066     .def ( "minimize", &Fitter::calcBestFit,
00067            "minimize () -> Boolean\n"
00068            "\n"
00069            "Attempts to do a minimization, returns True if successful." )
00070 
00071     .def ( "setFixedFlags", &Fitter::setFixedFlags,
00072            "setFixedFlags ( sequence ) -> None\n"
00073            "\n"
00074            "Sets which parameters that should be fixed during a fit.   A\n"
00075            "`1' in the sequence indicates corresponding parameters is fixed." )
00076 
00077     .def ( "setLimits",
00078            ( void ( Fitter::* ) // function pointer cast
00079              ( unsigned int, double, double ) ) // signature
00080            &Fitter::setLimits )
00081 
00082     .def ( "setLimits",
00083            ( void ( Fitter::* ) // function pointer cast
00084              ( const std::string &, double, double ) ) // signature
00085            &Fitter::setLimits,
00086            "setLimits ( name, low, high ) -> None\n"
00087            "setLimits ( index, low, high ) -> None\n"
00088            "\n"
00089            "Sets the limits on a model function parameter.  Only minimizers\n"
00090            "based on Minuit support this feature, others throw an exception." )
00091 
00092     .def ( "setStepSize",
00093            ( void ( Fitter::* ) // function pointer cast
00094              ( unsigned int, double ) ) // signature
00095            &Fitter::setStepSize )
00096 
00097     .def ( "setStepSize",
00098            ( void ( Fitter::* ) // function pointer cast
00099              ( const std::string &, double ) ) // signature
00100            &Fitter::setStepSize,
00101            "setStepSize ( name, value ) -> None\n"
00102            "setStepSize ( index, value ) -> None\n"
00103            "\n"
00104            "Sets the step size for the model function parameter.   Only\n"
00105            "minimizers based on Minuit support this function, others\n"
00106            "throw an exception." )
00107 
00108    ;
00109 }
00110 
00111 } // namespace Python
00112 } // namespace hippodraw

Generated for HippoDraw Class Library by doxygen