Commit 2a8e4d9c477c4c4f26834259bcd828dbd394d000
1 parent
5ab669f9
Added an inconsequential multithreading initializer based on Eigen docs
Showing
1 changed file
with
19 additions
and
0 deletions
openbr/plugins/eigen3.cpp
| @@ -15,6 +15,7 @@ | @@ -15,6 +15,7 @@ | ||
| 15 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | 15 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
| 16 | 16 | ||
| 17 | #include <Eigen/Dense> | 17 | #include <Eigen/Dense> |
| 18 | + | ||
| 18 | #include "openbr_internal.h" | 19 | #include "openbr_internal.h" |
| 19 | 20 | ||
| 20 | #include "openbr/core/common.h" | 21 | #include "openbr/core/common.h" |
| @@ -24,6 +25,24 @@ namespace br | @@ -24,6 +25,24 @@ namespace br | ||
| 24 | { | 25 | { |
| 25 | 26 | ||
| 26 | /*! | 27 | /*! |
| 28 | + * \ingroup initializers | ||
| 29 | + * \brief Initialize Eigen | ||
| 30 | + * http://eigen.tuxfamily.org/dox/TopicMultiThreading.html | ||
| 31 | + * \author Scott Klum \cite sklum | ||
| 32 | + */ | ||
| 33 | +class EigenInitializer : public Initializer | ||
| 34 | +{ | ||
| 35 | + Q_OBJECT | ||
| 36 | + | ||
| 37 | + void initialize() const | ||
| 38 | + { | ||
| 39 | + Eigen::initParallel(); | ||
| 40 | + } | ||
| 41 | +}; | ||
| 42 | + | ||
| 43 | +BR_REGISTER(Initializer, EigenInitializer) | ||
| 44 | + | ||
| 45 | +/*! | ||
| 27 | * \ingroup transforms | 46 | * \ingroup transforms |
| 28 | * \brief Projects input into learned Principal Component Analysis subspace. | 47 | * \brief Projects input into learned Principal Component Analysis subspace. |
| 29 | * \author Brendan Klare \cite bklare | 48 | * \author Brendan Klare \cite bklare |