Commit 03736a60 authored by Jean-Baptiste Mouret's avatar Jean-Baptiste Mouret
Browse files

add 'tools::make_vector' to make it easier to optimize functions with a 1D output

parent c2e05629
......@@ -53,6 +53,16 @@ namespace limbo {
return ((Eigen::VectorXd::Random(size)).array() + 1.0) / 2.0;
}
/// @ingroup tools
/// make a 1-D vector from a double (useful when we need to return vectors)
Eigen::VectorXd make_vector(double x)
{
Eigen::VectorXd res(1);
res(0) = x;
return res;
}
/// @ingroup tools
/// a mt19937-based random generator (mutex-protected)
///
......@@ -84,7 +94,7 @@ namespace limbo {
/// @ingroup tools
/// Double random number generator
using rgen_double_t = RandomGenerator<rdist_double_t>;
///@ingroup tools
///integer random number generator
using rgen_int_t = RandomGenerator<rdist_int_t>;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment