mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-18 00:27:02 +08:00
chore: add clang-format and pre-commit configuration
This commit is contained in:
@@ -1,30 +1,23 @@
|
||||
#include <Cubed/tools/cubed_random.hpp>
|
||||
|
||||
#include <Cubed/tools/log.hpp>
|
||||
#include "Cubed/tools/cubed_random.hpp"
|
||||
|
||||
#include "Cubed/tools/log.hpp"
|
||||
|
||||
namespace Cubed {
|
||||
|
||||
Random::Random() {
|
||||
|
||||
}
|
||||
Random::Random() {}
|
||||
|
||||
bool Random::random_bool(double probability) {
|
||||
std::bernoulli_distribution dist(probability);
|
||||
return dist(m_engine);
|
||||
}
|
||||
|
||||
std::mt19937& Random::engine() {
|
||||
return m_engine;
|
||||
}
|
||||
std::mt19937& Random::engine() { return m_engine; }
|
||||
|
||||
unsigned Random::seed() {
|
||||
return m_seed;
|
||||
}
|
||||
unsigned Random::seed() { return m_seed; }
|
||||
|
||||
void Random::init(unsigned seed) {
|
||||
m_seed = seed;
|
||||
m_engine.seed(seed);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace Cubed
|
||||
Reference in New Issue
Block a user