16#include "absl/log/check.h"
33 for (ColIndex col(0); col <
input.num_variables(); ++col) {
45 for (RowIndex row(0); row <
input.num_constraints(); ++row) {
65 for (
int i = 0; i <
input.variable_size(); ++i) {
75 for (
int j = 0; j <
input.constraint_size(); ++j) {
void set_name(Arg_ &&arg, Args_... args)
double lower_bound() const
const ::std::string & name() const
int var_index_size() const
repeated int32 var_index = 6 [packed = true];
void set_lower_bound(double value)
int coefficient_size() const
repeated double coefficient = 7 [packed = true];
void add_coefficient(double value)
void set_upper_bound(double value)
double coefficient(int index) const
void add_var_index(::int32_t value)
::int32_t var_index(int index) const
double upper_bound() const
void set_maximize(bool value)
::operations_research::MPConstraintProto *PROTOBUF_NONNULL add_constraint()
::operations_research::MPVariableProto *PROTOBUF_NONNULL add_variable()
void set_objective_offset(double value)
ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL
void set_name(Arg_ &&arg, Args_... args)
void set_upper_bound(double value)
void set_name(Arg_ &&arg, Args_... args)
void set_is_integer(bool value)
void set_objective_coefficient(double value)
double lower_bound() const
double upper_bound() const
void set_lower_bound(double value)
const ::std::string & name() const
double objective_coefficient() const
void SetName(absl::string_view name)
Name setter and getter.
void Clear()
Clears, i.e. reset the object to its initial value.
void SetConstraintName(RowIndex row, absl::string_view name)
@ INTEGER
The variable must only take integer values.
void SetObjectiveOffset(Fractional objective_offset)
void SetObjectiveCoefficient(ColIndex col, Fractional value)
void SetVariableBounds(ColIndex col, Fractional lower_bound, Fractional upper_bound)
void SetVariableType(ColIndex col, VariableType type)
Set the type of the variable.
void SetConstraintBounds(RowIndex row, Fractional lower_bound, Fractional upper_bound)
void SetCoefficient(RowIndex row, ColIndex col, Fractional value)
Defines the coefficient for col / row.
void SetVariableName(ColIndex col, absl::string_view name)
RowIndex CreateNewConstraint()
ColIndex CreateNewVariable()
void SetMaximizationProblem(bool maximize)
const SparseColumn & column(ColIndex col) const
Access the underlying sparse columns.
void PopulateFromTranspose(const Matrix &input)
Instantiate needed templates.
void LinearProgramToMPModelProto(const LinearProgram &input, MPModelProto *output)
Converts a LinearProgram to a MPModelProto.
ColIndex RowToColIndex(RowIndex row)
Get the ColIndex corresponding to the column # row.
void MPModelProtoToLinearProgram(const MPModelProto &input, LinearProgram *output)
Converts a MPModelProto to a LinearProgram.
In SWIG mode, we don't want anything besides these top-level includes.
static int input(yyscan_t yyscanner)