25 index_to_entry_(
capacity + 1, kNotPresent),
33 for (
int i = 1; i <= size_; ++i) {
34 index_to_entry_[indices_[i]] = kNotPresent;
39 for (
int i = 1; i <= size_; ++i) {
48 std::function<
int(
int* indices,
double* values)> getter) {
49 CHECK(getter !=
nullptr);
53 size_ = getter(indices_.data(), values_.data());
56 CHECK_LE(size_, capacity_);
64 for (
int i = 1; i <= size_; ++i) {
65 const int index = indices_[i];
67 CHECK_LE(
index, capacity_);
68 CHECK_EQ(index_to_entry_[
index], kNotPresent) <<
"duplicated: " <<
index;
69 index_to_entry_[
index] = i;
GlpkSparseVector(const int capacity)
void Load(std::function< int(int *indices, double *values)> getter)