Skip to content

Commit

Permalink
[math expression] Allow to seed the random generator
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Aug 14, 2024
1 parent f48994c commit c602962
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion 3rdparty/rnd
Submodule rnd updated 1 files
+52 −53 include/rnd/random.hpp
4 changes: 4 additions & 0 deletions src/ossia/math/math_expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ math_expression::~math_expression()
delete impl;
}

void math_expression::seed_random(uint64_t seed1, uint64_t seed2)
{
impl->random.engine.seed(seed1, seed2);
}
void math_expression::add_variable(const std::string& var, double& value)
{
impl->syms.add_variable(var, value);
Expand Down
1 change: 1 addition & 0 deletions src/ossia/math/math_expression.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class OSSIA_EXPORT math_expression
math_expression();
~math_expression();

void seed_random(uint64_t seed1, uint64_t seed2);
void add_variable(const std::string& var, double& value);
void add_constant(const std::string& var, double& value);
void add_vector(const std::string& var, std::vector<double>& value);
Expand Down

0 comments on commit c602962

Please sign in to comment.