18#include "absl/log/check.h"
29 : column_(num_rows, 0.0), changed_(num_rows,
false), row_change_() {}
31RandomAccessSparseColumn::~RandomAccessSparseColumn() =
default;
33void RandomAccessSparseColumn::Clear() {
34 const size_t num_changes = row_change_.size();
35 for (
int i = 0; i < num_changes; ++i) {
36 const RowIndex
row = row_change_[i];
38 changed_[
row] =
false;
43void RandomAccessSparseColumn::Resize(RowIndex num_rows) {
44 if (num_rows <= column_.size()) {
47 column_.resize(num_rows, 0.0);
48 changed_.resize(num_rows,
false);
51void RandomAccessSparseColumn::PopulateFromSparseColumn(
54 for (
const SparseColumn::Entry e : sparse_column) {
55 SetCoefficient(e.row(), e.coefficient());
59void RandomAccessSparseColumn::PopulateSparseColumn(
63 sparse_column->Clear();
64 const size_t num_changes = row_change_.size();
65 for (
int change_id = 0; change_id < num_changes; ++change_id) {
66 const RowIndex
row = row_change_[change_id];
70 sparse_column->SetCoefficient(
row,
value);
73 DCHECK(sparse_column->CheckNoDuplicates());
RandomAccessSparseColumn(RowIndex num_rows)
For infeasible and unbounded see Not checked if options check_solutions_if_inf_or_unbounded and the If options first_solution_only is false
problem is infeasible or unbounded (default).
In SWIG mode, we don't want anything besides these top-level includes.
#define RETURN_IF_NULL(x)