C++ Reference

C++ Reference: CP-SAT

operations_research Namespace Reference

Namespaces

 sat
 

Classes

struct  ClosedInterval
 Represents a closed interval [start, end]. More...
 
class  Domain
 We call domain any subset of Int64 = [kint64min, kint64max]. More...
 
class  NestedTimeLimit
 Provides a way to nest time limits for algorithms where a certain part of the computation is bounded not just by the overall time limit, but also by a stricter time limit specific just for this particular part. More...
 
class  SharedTimeLimit
 
class  SortedDisjointIntervalList
 This class represents a sorted list of disjoint, closed intervals. More...
 
class  TimeLimit
 A simple class to enforce both an elapsed time limit and a deterministic time limit in the same thread as a program. More...
 

Functions

std::ostream & operator<< (std::ostream &out, const ClosedInterval &interval)
 
std::ostream & operator<< (std::ostream &out, const std::vector< ClosedInterval > &intervals)
 
bool IntervalsAreSortedAndNonAdjacent (absl::Span< const ClosedInterval > intervals)
 Returns true iff we have: More...
 
std::ostream & operator<< (std::ostream &out, const Domain &domain)
 
int64 SumOfKMinValueInDomain (const Domain &domain, int k)
 
int64 SumOfKMaxValueInDomain (const Domain &domain, int k)
 

Function Documentation

◆ IntervalsAreSortedAndNonAdjacent()

bool operations_research::IntervalsAreSortedAndNonAdjacent ( absl::Span< const ClosedInterval intervals)

Returns true iff we have:

  • The intervals appear in increasing order.
  • for all i: intervals[i].start <= intervals[i].end (should always be true, by construction, but bad intervals can in practice escape detection in opt mode).
  • for all i but the last: intervals[i].end + 1 < intervals[i+1].start

◆ operator<<() [1/3]

std::ostream& operations_research::operator<< ( std::ostream &  out,
const ClosedInterval interval 
)

◆ operator<<() [2/3]

std::ostream& operations_research::operator<< ( std::ostream &  out,
const Domain domain 
)

◆ operator<<() [3/3]

std::ostream& operations_research::operator<< ( std::ostream &  out,
const std::vector< ClosedInterval > &  intervals 
)

◆ SumOfKMaxValueInDomain()

int64 operations_research::SumOfKMaxValueInDomain ( const Domain domain,
int  k 
)

◆ SumOfKMinValueInDomain()

int64 operations_research::SumOfKMinValueInDomain ( const Domain domain,
int  k 
)