Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.learn.boosting
Commits
1daf64db
Commit
1daf64db
authored
Feb 11, 2017
by
André Anjos
💬
Browse files
Merge branch 'gcc421' into 'master'
Improve compatibility with gcc-4.2.1 See merge request
!5
parents
469d9088
bf9de2e6
Pipeline
#7074
passed with stages
in 17 minutes and 43 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/learn/boosting/lut_machine.cpp
View file @
1daf64db
#include "main.h"
#include <boost/type_index.hpp>
#include <boost/functional/hash.hpp>
static
auto
lutMachine_doc
=
bob
::
extension
::
ClassDoc
(
"LUTMachine"
,
...
...
@@ -408,7 +410,7 @@ bool init_LUTMachine(PyObject* module)
LUTMachineType
.
tp_methods
=
lutMachine_Methods
;
// register machine
if
(
!
registerMachineType
(
typeid
(
bob
::
learn
::
boosting
::
LUTMachine
).
hash_code
(),
&
lutMachineCreate
))
if
(
!
registerMachineType
(
boost
::
typeindex
::
type_id
<
bob
::
learn
::
boosting
::
LUTMachine
>
(
).
hash_code
(),
&
lutMachineCreate
))
return
false
;
// check that everyting is fine
...
...
bob/learn/boosting/stump_machine.cpp
View file @
1daf64db
#include "main.h"
#include <boost/type_index.hpp>
#include <boost/functional/hash.hpp>
static
auto
stumpMachine_doc
=
bob
::
extension
::
ClassDoc
(
"StumpMachine"
,
...
...
@@ -410,7 +412,7 @@ bool init_StumpMachine(PyObject* module)
StumpMachineType
.
tp_methods
=
stumpMachine_Methods
;
// register machine
if
(
!
registerMachineType
(
typeid
(
bob
::
learn
::
boosting
::
StumpMachine
).
hash_code
(),
&
stumpMachineCreate
))
if
(
!
registerMachineType
(
boost
::
typeindex
::
type_id
<
bob
::
learn
::
boosting
::
StumpMachine
>
(
).
hash_code
(),
&
stumpMachineCreate
))
return
false
;
// check that everyting is fine
...
...
bob/learn/boosting/weak_machine.cpp
View file @
1daf64db
#include "main.h"
#include <boost/type_index.hpp>
#include <boost/functional/hash.hpp>
static
std
::
map
<
size_t
,
CreateFunction
>
machineFactory
;
...
...
@@ -13,7 +15,7 @@ bool registerMachineType(size_t type_hash, CreateFunction creator_function){
}
PyObject
*
createMachine
(
boost
::
shared_ptr
<
bob
::
learn
::
boosting
::
WeakMachine
>
machine
){
size_t
type_hash
=
typeid
(
*
machine
).
hash_code
();
size_t
type_hash
=
boost
::
typeindex
::
type_id_runtime
(
*
machine
).
hash_code
();
if
(
machineFactory
.
find
(
type_hash
)
==
machineFactory
.
end
()){
PyErr_Format
(
PyExc_TypeError
,
"The given machine hash %zu has not been registered."
,
type_hash
);
return
NULL
;
...
...
@@ -60,7 +62,7 @@ bool init_WeakMachine(PyObject* module){
// register creator function
// register machine
if
(
!
registerMachineType
(
typeid
(
bob
::
learn
::
boosting
::
WeakMachine
).
hash_code
(),
&
weakMachineCreate
))
if
(
!
registerMachineType
(
boost
::
typeindex
::
type_id
<
bob
::
learn
::
boosting
::
WeakMachine
>
(
).
hash_code
(),
&
weakMachineCreate
))
return
false
;
// check that everyting is fine
...
...
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