Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.math
Commits
c6b5da70
Commit
c6b5da70
authored
Dec 10, 2013
by
André Anjos
💬
Browse files
All xbob.math tests are now passing
parent
ff6a72d2
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
xbob/math/lp_interior_point.cpp
View file @
c6b5da70
This diff is collapsed.
Click to expand it.
xbob/math/lp_interior_point.h
View file @
c6b5da70
...
...
@@ -9,3 +9,5 @@
extern
PyTypeObject
PyBobMathLpInteriorPoint_Type
;
extern
PyTypeObject
PyBobMathLpInteriorPointShortstep_Type
;
extern
PyTypeObject
PyBobMathLpInteriorPointPredictorCorrector_Type
;
extern
PyTypeObject
PyBobMathLpInteriorPointLongstep_Type
;
xbob/math/main.cpp
View file @
c6b5da70
...
...
@@ -509,6 +509,12 @@ PyMODINIT_FUNC XBOB_EXT_ENTRY_NAME (void) {
PyBobMathLpInteriorPointShortstep_Type
.
tp_base
=
&
PyBobMathLpInteriorPoint_Type
;
if
(
PyType_Ready
(
&
PyBobMathLpInteriorPointShortstep_Type
)
<
0
)
return
;
PyBobMathLpInteriorPointPredictorCorrector_Type
.
tp_base
=
&
PyBobMathLpInteriorPoint_Type
;
if
(
PyType_Ready
(
&
PyBobMathLpInteriorPointPredictorCorrector_Type
)
<
0
)
return
;
PyBobMathLpInteriorPointLongstep_Type
.
tp_base
=
&
PyBobMathLpInteriorPoint_Type
;
if
(
PyType_Ready
(
&
PyBobMathLpInteriorPointLongstep_Type
)
<
0
)
return
;
PyObject
*
m
=
Py_InitModule3
(
XBOB_EXT_MODULE_NAME
,
module_methods
,
module_docstr
);
...
...
@@ -522,6 +528,12 @@ PyMODINIT_FUNC XBOB_EXT_ENTRY_NAME (void) {
Py_INCREF
(
&
PyBobMathLpInteriorPointShortstep_Type
);
PyModule_AddObject
(
m
,
"LPInteriorPointShortstep"
,
(
PyObject
*
)
&
PyBobMathLpInteriorPointShortstep_Type
);
Py_INCREF
(
&
PyBobMathLpInteriorPointPredictorCorrector_Type
);
PyModule_AddObject
(
m
,
"LPInteriorPointPredictorCorrector"
,
(
PyObject
*
)
&
PyBobMathLpInteriorPointPredictorCorrector_Type
);
Py_INCREF
(
&
PyBobMathLpInteriorPointLongstep_Type
);
PyModule_AddObject
(
m
,
"LPInteriorPointLongstep"
,
(
PyObject
*
)
&
PyBobMathLpInteriorPointLongstep_Type
);
/* imports the NumPy C-API */
import_array
();
...
...
xbob/math/test/test_lp_interior_point.py
View file @
c6b5da70
...
...
@@ -9,7 +9,7 @@
"""
import
os
,
sys
from
xbob.math
import
LPInteriorPointShortstep
#
, LPInteriorPointPredictorCorrector, LPInteriorPointLongstep
from
xbob.math
import
LPInteriorPointShortstep
,
LPInteriorPointPredictorCorrector
,
LPInteriorPointLongstep
import
numpy
import
nose.tools
...
...
@@ -74,8 +74,6 @@ def test_parameters():
nose
.
tools
.
eq_
(
op1
.
theta
,
0.4
)
nose
.
tools
.
eq_
(
op1
.
epsilon
,
1e-6
)
op1b
=
LPInteriorPointShortstep
(
op1
)
print
'***************************************'
print
op1b
.
m
nose
.
tools
.
eq_
(
op1
,
op1b
)
assert
not
(
op1
!=
op1b
)
op1b
.
theta
=
0.5
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment