14 #ifndef OR_TOOLS_LP_DATA_SCATTERED_VECTOR_H_
15 #define OR_TOOLS_LP_DATA_SCATTERED_VECTOR_H_
32 template <
typename IndexType>
54 template <
typename Index,
88 return Iterator(this->non_zeros.data(), this->values.data(), EntryIndex(0));
90 Iterator
end()
const {
91 return Iterator(this->non_zeros.data(), this->values.data(),
120 double ratio_for_using_dense_representation)
const {
122 return static_cast<double>(
non_zeros.size()) >
123 ratio_for_using_dense_representation *
#define DCHECK(condition)
ScatteredColumnEntry(const RowIndex *indices, const Fractional *coefficients, EntryIndex i)
ScatteredRowEntry(const ColIndex *indices, const Fractional *coefficients, EntryIndex i)
ScatteredVectorEntry(const Index *indices, const Fractional *coefficients, EntryIndex i)
Fractional coefficient() const
const Fractional * coefficient_
void resize(IntType size)
void assign(IntType size, const T &v)
bool IsAllZero(const Container &input)
bool IsAllFalse(const BoolVector &v)
const ScatteredRow & TransposedView(const ScatteredColumn &c)
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
std::vector< double > coefficients
void SortNonZerosIfNeeded()
bool non_zeros_are_sorted
void RepopulateSparseMask()
void ClearNonZerosIfTooDense()
bool ShouldUseDenseIteration(double ratio_for_using_dense_representation) const
constexpr static const double kDefaultRatioForUsingDenseIteration
void Add(Index index, Fractional value)
void ClearNonZerosIfTooDense(double ratio_for_using_dense_representation)
bool ShouldUseDenseIteration() const
Fractional & operator[](Index index)
std::vector< Index > non_zeros
StrictITIVector< Index, bool > is_non_zero
StrictITIVector< Index, Fractional > values
Fractional operator[](Index index) const