14#ifndef OR_TOOLS_SET_COVER_CAPACITY_MODEL_H_
15#define OR_TOOLS_SET_COVER_CAPACITY_MODEL_H_
22#include "absl/log/check.h"
70 CHECK(min_capacity_ != std::numeric_limits<CapacityWeight>::min() ||
71 max_capacity_ != std::numeric_limits<CapacityWeight>::max());
75 return CapacityModel(min, std::numeric_limits<CapacityWeight>::max());
79 return CapacityModel(std::numeric_limits<CapacityWeight>::min(), max);
86 util_intops::StrongIntRange<CapacityTermIndex>
TermRange()
const {
87 return util_intops::StrongIntRange<CapacityTermIndex>(
96 return elements_[term];
99 return subsets_[term];
102 return weights_[term];
151 std::vector<CapacityTermIndex> CanonicalIndexing();
CapacityConstraintProto ExportModelAsProto()
CapacityModel(CapacityWeight min, CapacityWeight max)
BaseInt num_terms() const
Returns the current number of terms in the constraint.
static CapacityModel WithMaximumWeight(CapacityWeight max)
CapacityWeight GetMinimumCapacity() const
Returns the lower/upper bounds for the constraint.
void ImportModelFromProto(const CapacityConstraintProto &proto)
Imports the model from a CapacityConstraintProto.
ElementIndex GetTermElementIndex(CapacityTermIndex term) const
Returns the element, subset, or capacity of the given term.
CapacityWeight GetTermCapacityWeight(CapacityTermIndex term) const
CapacityWeight GetMaximumCapacity() const
util_intops::StrongIntRange< CapacityTermIndex > TermRange() const
Returns the range of terms.
static CapacityModel WithMinimumWeight(CapacityWeight min)
SubsetIndex GetTermSubsetIndex(CapacityTermIndex term) const
void ReserveNumTerms(CapacityTermIndex num_terms)
bool ComputeFeasibility() const
void SetMaximumCapacity(CapacityWeight max_capacity)
void ReserveNumTerms(BaseInt num_terms)
Reserves num_terms terms in the model.
void SetMinimumCapacity(CapacityWeight min_capacity)
void AddTerm(SubsetIndex subset, ElementIndex element, CapacityWeight weight)
Adds a new term to the constraint.
In SWIG mode, we don't want anything besides these top-level includes.
util_intops::StrongVector< CapacityTermIndex, ElementIndex > CapacityElements
int64_t CapacityWeight
Basic type for weights. For now, the same as Cost for the set covering.
util_intops::StrongVector< CapacityTermIndex, CapacityWeight > CapacityWeights
util_intops::StrongVector< CapacityTermIndex, SubsetIndex > CapacitySubsets
#define DEFINE_STRONG_INT_TYPE(type_name, value_type)