49 std::function<
int(
int* indices,
double* values)> getter) {
50 CHECK(getter !=
nullptr);
54 size_ = getter(indices_.data(), values_.data());
57 CHECK_LE(size_, capacity_);
65 for (
int i = 1; i <= size_; ++i) {
66 const int index = indices_[i];
68 CHECK_LE(
index, capacity_);
69 CHECK_EQ(index_to_entry_[
index], kNotPresent) <<
"duplicated: " <<
index;
70 index_to_entry_[
index] = i;