16 #ifndef OR_TOOLS_LP_DATA_LP_TYPES_H_
17 #define OR_TOOLS_LP_DATA_LP_TYPES_H_
24 #include <type_traits>
67 #if defined(__ANDROID__)
73 static inline double ToDouble(
double f) {
return f; }
75 static inline double ToDouble(
long double f) {
return static_cast<double>(f); }
88 constexpr
double kInfinity = std::numeric_limits<double>::infinity();
91 constexpr
double kEpsilon = std::numeric_limits<double>::epsilon();
256 template <
typename IntType,
typename T>
266 return data_[
static_cast<size_t>(i.value())];
269 IntType
size()
const {
return size_; }
273 auto begin()
const {
return data_; }
274 auto end()
const {
return data_ +
static_cast<size_t>(size_.value()); }
286 template <
typename IntType,
typename T>
296 #if !defined(__ANDROID__) && (!defined(_MSC_VER) || (_MSC_VER >= 1800))
303 template <
typename InputIteratorType>
325 DCHECK_GE(
size, IntType(0));
397 template <
typename EntryType>
413 return this->i_ < other.i_;
422 const double kConversionFactor = 2e-9;
423 return kConversionFactor *
static_cast<double>(n);
void assign(size_type n, const value_type &val)
void resize(size_type new_size)
void reserve(size_type n)
size_type capacity() const
std::vector< T, Alloc > ParentType
reference operator[](IntType i) const
StrictITISpan(T *data, IntType size)
StrictITIVector(InputIteratorType first, InputIteratorType last)
StrictITISpan< IntType, T > View
StrictITIVector(IntType size)
void AssignToZero(IntType size)
void resize(IntType size)
StrictITIVector(std::initializer_list< T > init_list)
ConstView const_view() const
void resize(IntType size, const T &v)
StrictITISpan< IntType, const T > ConstView
void reserve(IntType size)
void resize_down(IntType size)
StrictITIVector(IntType size, const T &v)
void assign(IntType size, const T &v)
absl::StrongVector< IntType, T > ParentType
typename EntryType::Index Index
bool operator!=(const VectorIterator &other) const
VectorIterator(const Index *indices, const Fractional *coefficients, EntryIndex i)
const Entry & operator*() const
absl::Span< const double > coefficients
constexpr ColIndex kInvalidCol(-1)
Bitset64< RowIndex > DenseBitColumn
std::vector< ColIndex > ColIndexVector
constexpr double kEpsilon
StrictITIVector< ColIndex, VariableType > VariableTypeRow
@ UPPER_AND_LOWER_BOUNDED
StrictITIVector< ColIndex, Fractional > DenseRow
std::string GetProblemStatusString(ProblemStatus problem_status)
DEFINE_STRONG_INDEX_TYPE(ColIndex)
DEFINE_STRONG_INT64_TYPE(EntryIndex)
Index ColToIntIndex(ColIndex col)
constexpr double kInfinity
std::string GetConstraintStatusString(ConstraintStatus status)
StrictITIVector< ColIndex, VariableStatus > VariableStatusRow
constexpr double kRangeMax
std::ostream & operator<<(std::ostream &os, ProblemStatus status)
StrictITIVector< RowIndex, RowIndex > RowMapping
StrictITIVector< RowIndex, ConstraintStatus > ConstraintStatusColumn
@ INFEASIBLE_OR_UNBOUNDED
ColIndex RowToColIndex(RowIndex row)
bool IsFinite(Fractional value)
constexpr RowIndex kInvalidRow(-1)
Bitset64< ColIndex > DenseBitRow
RowIndex ColToRowIndex(ColIndex col)
ConstraintStatus VariableToConstraintStatus(VariableStatus status)
std::vector< RowIndex > RowIndexVector
StrictITIVector< ColIndex, bool > DenseBooleanRow
StrictITIVector< ColIndex, RowIndex > ColToRowMapping
StrictITIVector< RowIndex, ColIndex > RowToColMapping
std::string GetVariableTypeString(VariableType variable_type)
StrictITIVector< RowIndex, Fractional > DenseColumn
StrictITIVector< RowIndex, bool > DenseBooleanColumn
static double DeterministicTimeForFpOperations(int64_t n)
std::string GetVariableStatusString(VariableStatus status)
Index RowToIntIndex(RowIndex row)
StrictITIVector< ColIndex, ColIndex > ColMapping
static double ToDouble(double f)
Collection of objects used to extend the Constraint Solver library.