Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
ced9f6f4
"...python/git@developer.sourcefind.cn:change/sglang.git" did not exist on "d4d0c7c367947e95d03c35e48c348c18426073d8"
Commit
ced9f6f4
authored
Dec 19, 2017
by
Davis King
Browse files
Make the global optimizer work in python3
parent
affaead6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
tools/python/src/global_optimization.cpp
tools/python/src/global_optimization.cpp
+4
-1
No files found.
tools/python/src/global_optimization.cpp
View file @
ced9f6f4
...
...
@@ -49,7 +49,10 @@ boost::python::list mat_to_list (
size_t
num_function_arguments
(
object
f
)
{
return
boost
::
python
::
extract
<
std
::
size_t
>
(
f
.
attr
(
"func_code"
).
attr
(
"co_argcount"
));
if
(
hasattr
(
f
,
"func_code"
))
return
boost
::
python
::
extract
<
std
::
size_t
>
(
f
.
attr
(
"func_code"
).
attr
(
"co_argcount"
));
else
return
boost
::
python
::
extract
<
std
::
size_t
>
(
f
.
attr
(
"__code__"
).
attr
(
"co_argcount"
));
}
double
call_func
(
object
f
,
const
matrix
<
double
,
0
,
1
>&
args
)
...
...
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