00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #include <boost/python.hpp>
00033 #include <boost/python/class.hpp>
00034 #include <boost/python/module.hpp>
00035 #include <boost/python/def.hpp>
00036
00037 namespace Modelib {
00038
00039
00040 void export_Model()
00041 {
00042 using namespace boost::python;
00043 class_<Model>("Model",init<>())
00044 .def("Add", &Model::Add)
00045 .def("Maximize", &Model::Maximize)
00046 .def("Minimize", &Model::Minimize)
00047 .def("IsRelaxed", &Model::IsRelaxed)
00048 .def("SetRelaxed", &Model::SetRelaxed)
00049 .def("RelaxInt2Float", &Model::RelaxInt2Float)
00050 .def("RelaxBool2Float", &Model::RelaxBool2Float)
00051 .def("SetNumVarValues", &Model::SetNumVarValues)
00052 .def("SetConstraintValues", &Model::SetConstraintValues)
00053 .def("GetInfluentLagrangianParam", &Model::GetInfluentLagrangianParam)
00054
00055 .def("GetAllLagrangianParams", &Model::GetAllLagrangianParams)
00056 .def("EvalueConstraint", &Model::EvalueConstraint)
00057
00058
00059 .def("Out",&Model::Out,return_internal_reference<>())
00060 .def("OutDimensions",&Model::OutDimensions,return_internal_reference<>())
00061 .def("OutNumVarValues", &Model::OutNumVarValues,return_internal_reference<>())
00062 .def("OutConstraintValues", &Model::OutConstraintValues,return_internal_reference<>())
00063
00064 .def("__str__", &Model::ostr,return_internal_reference<>())
00065 .def("GetConstraint", &Model::GetConstraint_1)
00066 .def("GetConstraint", &Model::GetConstraint_2)
00067 .def("RelaxConstraint", &Model::RelaxConstraint)
00068 .def("Relax", &Model::Relax)
00069 .def("RenameConstraint", &Model::RenameConstraint)
00070 .def("LoadLP", &Model::LoadLP)
00071 .def("RemoveVariable", &Model::RemoveVariable)
00072 .def("RemoveConstraint", &Model::RemoveConstraint)
00073 .def("AddToConstraint", &Model::AddToConstraint)
00074
00075
00076 .def("InitSolver", &Model::InitSolver)
00077 .def("Solve", &Model::Solve)
00078 .def("SolveInfos", &Model::SolveInfos)
00079 .def("SetAPI", &Model::SetAPI)
00080 .def("PushOptions", &Model::PushOptions)
00081 .def("RemoveOptions", &Model::RemoveOptions)
00082 .def("MatriceOccupation", &Model::MatriceOccupation)
00083 .def("ShowMe", &Model::ShowMe)
00084 .def("PrintFraction", &Model::PrintFraction)
00085 .def("EndFraction", &Model::EndFraction)
00086
00087
00088 #ifdef USE_HTML_FORMAT
00089 .def("SortieHTML", &Model::SortieHTML)
00090 #endif
00091 #ifdef USE_LATEX_FORMAT
00092 .def("SortieLATEX", &Model::SortieLATEX)
00093 #endif
00094 #ifdef EXPORT_SPARSE_MATRIX_PNG
00095 .def("ExportSparseMatrixPNG", &Model::ExportSparseMatrixPNG)
00096 #endif
00097 ;
00098 }
00099
00100 }