Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
util.h File Reference
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdint>
#include <deque>
#include <limits>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include "absl/base/macros.h"
#include "absl/container/btree_set.h"
#include "absl/container/inlined_vector.h"
#include "absl/log/check.h"
#include "absl/log/log_streamer.h"
#include "absl/numeric/int128.h"
#include "absl/random/bit_gen_ref.h"
#include "absl/random/random.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "absl/types/span.h"
#include "ortools/base/logging.h"
#include "ortools/base/mathutil.h"
#include "ortools/sat/model.h"
#include "ortools/sat/sat_base.h"
#include "ortools/sat/sat_parameters.pb.h"
#include "ortools/util/random_engine.h"
#include "ortools/util/saturated_arithmetic.h"
#include "ortools/util/sorted_interval_list.h"
#include "ortools/util/time_limit.h"

Go to the source code of this file.

Classes

class  operations_research::sat::IdentityMap< T >
 
class  operations_research::sat::CompactVectorVector< K, V >
 
class  operations_research::sat::FixedCapacityVector< T >
 
class  operations_research::sat::ModelRandomGenerator
 
class  operations_research::sat::ModelSharedTimeLimit
 The model "singleton" shared time limit. More...
 
class  operations_research::sat::MaxBoundedSubsetSum
 
class  operations_research::sat::FirstFewValues< n >
 
class  operations_research::sat::BasicKnapsackSolver
 
struct  operations_research::sat::BasicKnapsackSolver::Result
 
class  operations_research::sat::IncrementalAverage
 Manages incremental averages. More...
 
class  operations_research::sat::ExponentialMovingAverage
 
class  operations_research::sat::Percentile
 
class  operations_research::sat::TopN< Element, Score >
 

Namespaces

namespace  operations_research
 In SWIG mode, we don't want anything besides these top-level includes.
 
namespace  operations_research::sat
 

Functions

std::string operations_research::sat::FormatCounter (int64_t num)
 Prints a positive number with separators for easier reading (ex: 1'348'065).
 
std::string operations_research::sat::FormatName (absl::string_view name)
 This is used to format our table first row entry.
 
std::string operations_research::sat::FormatTable (std::vector< std::vector< std::string > > &table, int spacing)
 
int64_t operations_research::sat::ModularInverse (int64_t x, int64_t m)
 
int64_t operations_research::sat::PositiveMod (int64_t x, int64_t m)
 Just returns x % m but with a result always in [0, m).
 
int64_t operations_research::sat::ProductWithModularInverse (int64_t coeff, int64_t mod, int64_t rhs)
 
bool operations_research::sat::SolveDiophantineEquationOfSizeTwo (int64_t &a, int64_t &b, int64_t &cte, int64_t &x0, int64_t &y0)
 
int64_t operations_research::sat::FloorSquareRoot (int64_t a)
 The argument must be non-negative.
 
int64_t operations_research::sat::CeilSquareRoot (int64_t a)
 
int64_t operations_research::sat::SafeDoubleToInt64 (double value)
 
int64_t operations_research::sat::ClosestMultiple (int64_t value, int64_t base)
 
std::vector< absl::Span< int > > operations_research::sat::AtMostOneDecomposition (const std::vector< std::vector< int > > &graph, absl::BitGenRef random, std::vector< int > *buffer)
 
bool operations_research::sat::LinearInequalityCanBeReducedWithClosestMultiple (int64_t base, absl::Span< const int64_t > coeffs, absl::Span< const int64_t > lbs, absl::Span< const int64_t > ubs, int64_t rhs, int64_t *new_rhs)
 
void operations_research::sat::RandomizeDecisionHeuristic (absl::BitGenRef random, SatParameters *parameters)
 Randomizes the decision heuristic of the given SatParameters.
 
int operations_research::sat::WeightedPick (absl::Span< const double > input, absl::BitGenRef random)
 
int operations_research::sat::MoveOneUnprocessedLiteralLast (const absl::btree_set< LiteralIndex > &processed, int relevant_prefix_size, std::vector< Literal > *literals)
 
void operations_research::sat::CompressTuples (absl::Span< const int64_t > domain_sizes, std::vector< std::vector< int64_t > > *tuples)
 
std::vector< std::vector< absl::InlinedVector< int64_t, 2 > > > operations_research::sat::FullyCompressTuples (absl::Span< const int64_t > domain_sizes, std::vector< std::vector< int64_t > > *tuples)
 
bool operations_research::sat::IsNegatableInt64 (absl::int128 x)
 Tells whether a int128 can be casted to a int64_t that can be negated.
 
template<typename IntType , bool ceil>
IntType operations_research::sat::CeilOrFloorOfRatio (IntType numerator, IntType denominator)
 
template<typename IntType >
IntType operations_research::sat::CeilOfRatio (IntType numerator, IntType denominator)
 
template<typename IntType >
IntType operations_research::sat::FloorOfRatio (IntType numerator, IntType denominator)
 

Variables

constexpr int64_t operations_research::sat::kTableAnyValue = std::numeric_limits<int64_t>::min()