14#ifndef OR_TOOLS_SAT_UTIL_H_
15#define OR_TOOLS_SAT_UTIL_H_
20#include "absl/random/bit_gen_ref.h"
21#include "absl/random/random.h"
28#if !defined(__PORTABLE_PLATFORM__)
29#include "google/protobuf/descriptor.h"
78 int64_t& x0, int64_t& y0);
97 :
absl::BitGenRef(deterministic_random_) {
99 deterministic_random_.seed(params.random_seed());
100 if (params.use_absl_random()) {
101 absl_random_ = absl::BitGen(absl::SeedSeq({params.random_seed()}));
102 absl::BitGenRef::operator=(absl::BitGenRef(absl_random_));
115 absl::BitGen absl_random_;
150 int relevant_prefix_size,
151 std::vector<Literal>* literals);
162 : average_(initial_average) {}
166 void Reset(
double reset_value);
171 void AddData(
double new_record);
174 double average_ = 0.0;
175 int64_t num_records_ = 0;
185 : decaying_factor_(decaying_factor) {
196 void AddData(
double new_record);
199 double average_ = 0.0;
200 int64_t num_records_ = 0;
201 const double decaying_factor_;
214 explicit Percentile(
int record_limit) : record_limit_(record_limit) {}
225 std::deque<double> records_;
226 const int record_limit_;
236void CompressTuples(absl::Span<const int64_t> domain_sizes, int64_t any_value,
237 std::vector<std::vector<int64_t>>* tuples);
#define DCHECK_LE(val1, val2)
#define DCHECK_GE(val1, val2)
A simple class to enforce both an elapsed time limit and a deterministic time limit in the same threa...
void AddData(double new_record)
int64_t NumRecords() const
ExponentialMovingAverage(double decaying_factor)
double CurrentAverage() const
void AddData(double new_record)
int64_t NumRecords() const
IncrementalAverage(double initial_average)
double CurrentAverage() const
void Reset(double reset_value)
Class that owns everything related to a particular optimization model.
ModelRandomGenerator(Model *model)
ModelSharedTimeLimit(Model *model)
double GetPercentile(double percent)
int64_t NumRecords() const
Percentile(int record_limit)
void AddRecord(double record)
void RandomizeDecisionHeuristic(absl::BitGenRef random, SatParameters *parameters)
int MoveOneUnprocessedLiteralLast(const std::set< LiteralIndex > &processed, int relevant_prefix_size, std::vector< Literal > *literals)
void CompressTuples(absl::Span< const int64_t > domain_sizes, int64_t any_value, std::vector< std::vector< int64_t > > *tuples)
int64_t PositiveMod(int64_t x, int64_t m)
int64_t CeilSquareRoot(int64_t a)
bool SolveDiophantineEquationOfSizeTwo(int64_t &a, int64_t &b, int64_t &cte, int64_t &x0, int64_t &y0)
int64_t FloorSquareRoot(int64_t a)
int64_t ModularInverse(int64_t x, int64_t m)
int64_t ProductWithModularInverse(int64_t coeff, int64_t mod, int64_t rhs)
Collection of objects used to extend the Constraint Solver library.
std::mt19937 random_engine_t