Commit 92926619 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Fixed issue #4

parent 8a408beb
......@@ -98,7 +98,7 @@ static int PyBobLearnEMEMPCATrainer_init(PyBobLearnEMEMPCATrainerObject* self, P
return -1;
}
}
BOB_CATCH_MEMBER("cannot create EMPCATrainer", 0)
BOB_CATCH_MEMBER("cannot create EMPCATrainer", -1)
return 0;
}
......
......@@ -130,7 +130,7 @@ static int PyBobLearnEMGMMMachine_init(PyBobLearnEMGMMMachineObject* self, PyObj
GMMMachine_doc.print_usage();
return -1;
}
BOB_CATCH_MEMBER("cannot create GMMMachine", 0)
BOB_CATCH_MEMBER("cannot create GMMMachine", -1)
return 0;
}
......
......@@ -134,7 +134,7 @@ static int PyBobLearnEMGMMStats_init(PyBobLearnEMGMMStatsObject* self, PyObject*
GMMStats_doc.print_usage();
return -1;
}
BOB_CATCH_MEMBER("cannot create GMMStats", 0)
BOB_CATCH_MEMBER("cannot create GMMStats", -1)
return 0;
}
......
......@@ -126,7 +126,7 @@ static int PyBobLearnEMISVBase_init(PyBobLearnEMISVBaseObject* self, PyObject* a
ISVBase_doc.print_usage();
return -1;
}
BOB_CATCH_MEMBER("cannot create ISVBase", 0)
BOB_CATCH_MEMBER("cannot create ISVBase", -1)
return 0;
}
......
......@@ -116,7 +116,7 @@ static int PyBobLearnEMISVMachine_init(PyBobLearnEMISVMachineObject* self, PyObj
return -1;
}
BOB_CATCH_MEMBER("cannot create ISVMachine", 0)
BOB_CATCH_MEMBER("cannot create ISVMachine", -1)
return 0;
}
......
......@@ -173,7 +173,7 @@ static int PyBobLearnEMISVTrainer_init(PyBobLearnEMISVTrainerObject* self, PyObj
return -1;
}
}
BOB_CATCH_MEMBER("cannot create ISVTrainer", 0)
BOB_CATCH_MEMBER("cannot create ISVTrainer", -1)
return 0;
}
......@@ -329,7 +329,7 @@ int PyBobLearnEMISVTrainer_set_X(PyBobLearnEMISVTrainerObject* self, PyObject* v
}
return 0;
BOB_CATCH_MEMBER("__X__ could not be written", 0)
BOB_CATCH_MEMBER("__X__ could not be written", -1)
}
......@@ -359,7 +359,7 @@ int PyBobLearnEMISVTrainer_set_Z(PyBobLearnEMISVTrainerObject* self, PyObject* v
}
return 0;
BOB_CATCH_MEMBER("__Z__ could not be written", 0)
BOB_CATCH_MEMBER("__Z__ could not be written", -1)
}
......
......@@ -131,7 +131,7 @@ static int PyBobLearnEMIVectorMachine_init(PyBobLearnEMIVectorMachineObject* sel
return -1;
}
BOB_CATCH_MEMBER("cannot create IVectorMachine", 0)
BOB_CATCH_MEMBER("cannot create IVectorMachine", -1)
return 0;
}
......
......@@ -117,7 +117,7 @@ static int PyBobLearnEMIVectorTrainer_init(PyBobLearnEMIVectorTrainerObject* sel
return -1;
}
}
BOB_CATCH_MEMBER("cannot create IVectorTrainer", 0)
BOB_CATCH_MEMBER("cannot create IVectorTrainer", -1)
return 0;
}
......
......@@ -132,7 +132,7 @@ static int PyBobLearnEMJFABase_init(PyBobLearnEMJFABaseObject* self, PyObject* a
JFABase_doc.print_usage();
return -1;
}
BOB_CATCH_MEMBER("cannot create JFABase", 0)
BOB_CATCH_MEMBER("cannot create JFABase", -1)
return 0;
}
......
......@@ -116,7 +116,7 @@ static int PyBobLearnEMJFAMachine_init(PyBobLearnEMJFAMachineObject* self, PyObj
return -1;
}
BOB_CATCH_MEMBER("cannot create JFAMachine", 0)
BOB_CATCH_MEMBER("cannot create JFAMachine", -1)
return 0;
}
......
......@@ -138,7 +138,7 @@ static int PyBobLearnEMJFATrainer_init(PyBobLearnEMJFATrainerObject* self, PyObj
return -1;
}
}
BOB_CATCH_MEMBER("cannot create JFATrainer", 0)
BOB_CATCH_MEMBER("cannot create JFATrainer", -1)
return 0;
}
......@@ -471,7 +471,7 @@ int PyBobLearnEMJFATrainer_set_X(PyBobLearnEMJFATrainerObject* self, PyObject* v
}
return 0;
BOB_CATCH_MEMBER("__X__ could not be written", 0)
BOB_CATCH_MEMBER("__X__ could not be written", -1)
}
......@@ -502,7 +502,7 @@ int PyBobLearnEMJFATrainer_set_Y(PyBobLearnEMJFATrainerObject* self, PyObject* v
}
return 0;
BOB_CATCH_MEMBER("__Y__ could not be written", 0)
BOB_CATCH_MEMBER("__Y__ could not be written", -1)
}
......@@ -533,7 +533,7 @@ int PyBobLearnEMJFATrainer_set_Z(PyBobLearnEMJFATrainerObject* self, PyObject* v
}
return 0;
BOB_CATCH_MEMBER("__Z__ could not be written", 0)
BOB_CATCH_MEMBER("__Z__ could not be written", -1)
}
......
......@@ -130,7 +130,7 @@ static int PyBobLearnEMKMeansMachine_init(PyBobLearnEMKMeansMachineObject* self,
KMeansMachine_doc.print_usage();
return -1;
}
BOB_CATCH_MEMBER("cannot create KMeansMachine", 0)
BOB_CATCH_MEMBER("cannot create KMeansMachine", -1)
return 0;
}
......
......@@ -108,7 +108,6 @@ static int PyBobLearnEMKMeansTrainer_init(PyBobLearnEMKMeansTrainerObject* self,
return PyBobLearnEMKMeansTrainer_init_copy(self, args, kwargs);
else if(PyString_Check(arg))
return PyBobLearnEMKMeansTrainer_init_str(self, args, kwargs);
//return PyBobLearnEMKMeansTrainer_init_str(self, arg);
}
default:{
PyErr_Format(PyExc_RuntimeError, "number of arguments mismatch - %s requires 0 or 1 arguments, but you provided %d (see help)", Py_TYPE(self)->tp_name, nargs);
......@@ -116,7 +115,7 @@ static int PyBobLearnEMKMeansTrainer_init(PyBobLearnEMKMeansTrainerObject* self,
return -1;
}
}
BOB_CATCH_MEMBER("cannot create KMeansTrainer", 0)
BOB_CATCH_MEMBER("cannot create KMeansTrainer", -1)
return 0;
}
......@@ -182,7 +181,7 @@ int PyBobLearnEMKMeansTrainer_setInitializationMethod(PyBobLearnEMKMeansTrainerO
self->cxx->setInitializationMethod(string2IM(PyString_AS_STRING(value)));
return 0;
BOB_CATCH_MEMBER("initialization method could not be set", 0)
BOB_CATCH_MEMBER("initialization method could not be set", -1)
}
......@@ -264,7 +263,7 @@ int PyBobLearnEMKMeansTrainer_setAverageMinDistance(PyBobLearnEMKMeansTrainerObj
self->cxx->setAverageMinDistance(PyFloat_AS_DOUBLE(value));
return 0;
BOB_CATCH_MEMBER("Average Min Distance could not be set", 0)
BOB_CATCH_MEMBER("Average Min Distance could not be set", -1)
}
......
......@@ -113,18 +113,6 @@ bool init_BobLearnEMKMeansTrainer(PyObject* module);
int PyBobLearnEMKMeansTrainer_Check(PyObject* o);
// GMMBaseTrainer
/*
typedef struct {
PyObject_HEAD
boost::shared_ptr<bob::learn::em::GMMBaseTrainer> cxx;
} PyBobLearnEMGMMBaseTrainerObject;
extern PyTypeObject PyBobLearnEMGMMBaseTrainer_Type;
bool init_BobLearnEMGMMBaseTrainer(PyObject* module);
int PyBobLearnEMGMMBaseTrainer_Check(PyObject* o);
*/
// ML_GMMTrainer
typedef struct {
PyObject_HEAD
......
......@@ -151,7 +151,7 @@ static int PyBobLearnEMMAPGMMTrainer_init(PyBobLearnEMMAPGMMTrainerObject* self,
return PyBobLearnEMMAPGMMTrainer_init_base_trainer(self, args, kwargs);
}
BOB_CATCH_MEMBER("cannot create MAP_GMMTrainer", 0)
BOB_CATCH_MEMBER("cannot create MAP_GMMTrainer", -1)
return 0;
}
......@@ -214,7 +214,7 @@ int PyBobLearnEMMAPGMMTrainer_setRelevanceFactor(PyBobLearnEMMAPGMMTrainerObject
self->cxx->setRelevanceFactor(PyFloat_AS_DOUBLE(value));
return 0;
BOB_CATCH_MEMBER("relevance_factor could not be set", 0)
BOB_CATCH_MEMBER("relevance_factor could not be set", -1)
}
......@@ -240,7 +240,7 @@ int PyBobLearnEMMAPGMMTrainer_setAlpha(PyBobLearnEMMAPGMMTrainerObject* self, Py
self->cxx->setAlpha(PyFloat_AS_DOUBLE(value));
return 0;
BOB_CATCH_MEMBER("alpha could not be set", 0)
BOB_CATCH_MEMBER("alpha could not be set", -1)
}
......
......@@ -103,7 +103,7 @@ static int PyBobLearnEMMLGMMTrainer_init(PyBobLearnEMMLGMMTrainerObject* self, P
else
return PyBobLearnEMMLGMMTrainer_init_base_trainer(self, args, kwargs);
}
BOB_CATCH_MEMBER("cannot create GMMBaseTrainer_init_bool", 0)
BOB_CATCH_MEMBER("cannot create GMMBaseTrainer_init_bool", -1)
return 0;
}
......
......@@ -146,7 +146,7 @@ static int PyBobLearnEMPLDABase_init(PyBobLearnEMPLDABaseObject* self, PyObject*
PLDABase_doc.print_usage();
return -1;
}
BOB_CATCH_MEMBER("cannot create PLDABase", 0)
BOB_CATCH_MEMBER("cannot create PLDABase", -1)
return 0;
}
......
......@@ -120,7 +120,7 @@ static int PyBobLearnEMPLDAMachine_init(PyBobLearnEMPLDAMachineObject* self, PyO
PLDAMachine_doc.print_usage();
return -1;
}
BOB_CATCH_MEMBER("cannot create PLDAMachine", 0)
BOB_CATCH_MEMBER("cannot create PLDAMachine", -1)
return 0;
}
......
......@@ -174,7 +174,7 @@ static int PyBobLearnEMPLDATrainer_init(PyBobLearnEMPLDATrainerObject* self, PyO
return -1;
}
BOB_CATCH_MEMBER("cannot create PLDATrainer", 0)
BOB_CATCH_MEMBER("cannot create PLDATrainer", -1)
return 0;
}
......@@ -278,7 +278,7 @@ int PyBobLearnEMPLDATrainer_setFMethod(PyBobLearnEMPLDATrainerObject* self, PyOb
self->cxx->setInitFMethod(string2FMethod(PyString_AS_STRING(value)));
return 0;
BOB_CATCH_MEMBER("init_f_method method could not be set", 0)
BOB_CATCH_MEMBER("init_f_method method could not be set", -1)
}
......@@ -304,7 +304,7 @@ int PyBobLearnEMPLDATrainer_setGMethod(PyBobLearnEMPLDATrainerObject* self, PyOb
self->cxx->setInitGMethod(string2GMethod(PyString_AS_STRING(value)));
return 0;
BOB_CATCH_MEMBER("init_g_method method could not be set", 0)
BOB_CATCH_MEMBER("init_g_method method could not be set", -1)
}
/***** init_sigma_method *****/
......@@ -329,7 +329,7 @@ int PyBobLearnEMPLDATrainer_setSigmaMethod(PyBobLearnEMPLDATrainerObject* self,
self->cxx->setInitSigmaMethod(string2SigmaMethod(PyString_AS_STRING(value)));
return 0;
BOB_CATCH_MEMBER("init_sigma_method method could not be set", 0)
BOB_CATCH_MEMBER("init_sigma_method method could not be set", -1)
}
......@@ -354,7 +354,7 @@ int PyBobLearnEMPLDATrainer_setUseSumSecondOrder(PyBobLearnEMPLDATrainerObject*
self->cxx->setUseSumSecondOrder(f(value));
return 0;
BOB_CATCH_MEMBER("use_sum_second_order method could not be set", 0)
BOB_CATCH_MEMBER("use_sum_second_order method could not be set", -1)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment