14#ifndef OR_TOOLS_LP_DATA_SCATTERED_VECTOR_H_
15#define OR_TOOLS_LP_DATA_SCATTERED_VECTOR_H_
31template <
typename IndexType>
53template <
typename Index,
87 return Iterator(this->non_zeros.data(), this->values.data(), EntryIndex(0));
89 Iterator
end()
const {
90 return Iterator(this->non_zeros.data(), this->values.data(),
119 double ratio_for_using_dense_representation)
const {
121 return static_cast<double>(
non_zeros.size()) >
122 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)
absl::Span< const double > coefficients
bool IsAllZero(const Container &input)
bool IsAllFalse(const BoolVector &v)
const ScatteredRow & TransposedView(const ScatteredColumn &c)
Collection of objects used to extend the Constraint Solver library.
static constexpr const double kDefaultRatioForUsingDenseIteration
void SortNonZerosIfNeeded()
bool non_zeros_are_sorted
void RepopulateSparseMask()
void ClearNonZerosIfTooDense()
bool ShouldUseDenseIteration(double ratio_for_using_dense_representation) const
Fractional & operator[](Index index)
size_t NumNonZerosEstimate() const
void Add(Index index, Fractional value)
void ClearNonZerosIfTooDense(double ratio_for_using_dense_representation)
bool ShouldUseDenseIteration() const
std::vector< Index > non_zeros
StrictITIVector< Index, bool > is_non_zero
StrictITIVector< Index, Fractional > values
Fractional operator[](Index index) const