diff options
author | Gael Guennebaud <g.gael@free.fr> | 2014-01-07 20:17:59 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2014-01-07 20:17:59 +0100 |
commit | ac409f51f185a4654f9a5c38ab5d1652824836f6 (patch) | |
tree | ea683be3cc788424f88043a81dc3f594160e0598 /doc | |
parent | a6a57748ddff8ffc7e00e256385bd83423f68acb (diff) |
Document the fact that Random and setRandom are not reentrant (so not thread-safe)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/Doxyfile.in | 2 | ||||
-rw-r--r-- | doc/TopicMultithreading.dox | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 1a2603b04..85af9f1d4 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -206,6 +206,7 @@ TAB_SIZE = 8 # You can put \n's in the value part of an alias to insert newlines. ALIASES = "only_for_vectors=This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column." \ + "not_reentrant=\warning This function is not re-entrant." \ "array_module=This is defined in the %Array module. \code #include <Eigen/Array> \endcode" \ "cholesky_module=This is defined in the %Cholesky module. \code #include <Eigen/Cholesky> \endcode" \ "eigenvalues_module=This is defined in the %Eigenvalues module. \code #include <Eigen/Eigenvalues> \endcode" \ @@ -223,6 +224,7 @@ ALIASES = "only_for_vectors=This is only for vectors (either row- "note_about_checking_solutions=This method just tries to find as good a solution as possible. If you want to check whether a solution exists or if it is accurate, just call this function to get a result and then compute the error of this result, or use MatrixBase::isApprox() directly, for instance like this: \code bool a_solution_exists = (A*result).isApprox(b, precision); \endcode This method avoids dividing by zero, so that the non-existence of a solution doesn't by itself mean that you'll get \c inf or \c nan values." \ "note_try_to_help_rvo=This function returns the result by value. In order to make that efficient, it is implemented as just a return statement using a special constructor, hopefully allowing the compiler to perform a RVO (return value optimization)." \ "nonstableyet=\warning This is not considered to be part of the stable public API yet. Changes may happen in future releases. See \ref Experimental \"Experimental parts of Eigen\" + ALIASES += "eigenAutoToc= " ALIASES += "eigenManualPage=\defgroup" diff --git a/doc/TopicMultithreading.dox b/doc/TopicMultithreading.dox index f7d082668..fb944af29 100644 --- a/doc/TopicMultithreading.dox +++ b/doc/TopicMultithreading.dox @@ -39,6 +39,8 @@ int main(int argc, char** argv) } \endcode +\warning note that all functions generating random matrices are \b not re-entrant nor thread-safe. Those include DenseBase::Random(), and DenseBase::setRandom() despite a call to Eigen::initParallel(). This is because these functions are based on std::rand which is not re-entrant. For thread-safe random generator, we recommend the use of boost::random of c++11 random feature. + In the case your application is parallelized with OpenMP, you might want to disable Eigen's own parallization as detailed in the previous section. */ |