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
Matthias Mayr
limbo
Commits
03736a60
Commit
03736a60
authored
May 16, 2016
by
Jean-Baptiste Mouret
Browse files
add 'tools::make_vector' to make it easier to optimize functions with a 1D output
parent
c2e05629
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/limbo/tools/random_generator.hpp
View file @
03736a60
...
...
@@ -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
>
;
...
...
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