Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
Classes | |
struct | Constraint |
class | LpModel |
Typedefs | |
using | Term = std::pair<double, VariableIndex> |
Enumerations | |
enum class | Relation { kLessOrEqual , kGreaterOrEqual , kEqual } |
Functions | |
std::ostream & | operator<< (std::ostream &ostr, const Relation relation) |
std::ostream & | operator<< (std::ostream &ostr, const Constraint &constraint) |
std::ostream & | operator<< (std::ostream &ostr, const LpModel &model) |
Prints the model in LP format to ostr. | |
DEFINE_STRONG_INT_TYPE (VariableIndex, int64_t) | |
DEFINE_STRONG_INT_TYPE (ConstraintIndex, int64_t) | |
bool | ValidateCharInName (unsigned char c, bool leading) |
absl::Status | ValidateName (absl::string_view name) |
Checks if name is a valid name for a variable or constraint in an LP file. | |
LpModel | RemoveUnusedVariables (const LpModel &model) |
absl::StatusOr< LpModel > | PermuteVariables (const LpModel &model, const util_intops::StrongVector< VariableIndex, VariableIndex > &new_index_to_old_index) |
absl::StatusOr< LpModel > | PermuteVariables (const LpModel &model, const util_intops::StrongVector< VariableIndex, std::string > &order_by_name) |
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
using operations_research::lp_format::Term = std::pair<double, VariableIndex> |
Definition at line 29 of file lp_model.h.
|
strong |
Enumerator | |
---|---|
kLessOrEqual | |
kGreaterOrEqual | |
kEqual |
Definition at line 30 of file lp_model.h.
operations_research::lp_format::DEFINE_STRONG_INT_TYPE | ( | ConstraintIndex | , |
int64_t | ) |
operations_research::lp_format::DEFINE_STRONG_INT_TYPE | ( | VariableIndex | , |
int64_t | ) |
std::ostream & operations_research::lp_format::operator<< | ( | std::ostream & | ostr, |
const Constraint & | constraint ) |
Definition at line 64 of file lp_model.cc.
std::ostream & operations_research::lp_format::operator<< | ( | std::ostream & | ostr, |
const LpModel & | model ) |
Prints the model in LP format to ostr.
Definition at line 118 of file lp_model.cc.
std::ostream & operations_research::lp_format::operator<< | ( | std::ostream & | ostr, |
const Relation | relation ) |
Definition at line 48 of file lp_model.cc.
absl::StatusOr< LpModel > operations_research::lp_format::PermuteVariables | ( | const LpModel & | model, |
const util_intops::StrongVector< VariableIndex, std::string > & | order_by_name ) |
Returns a copy of model
where the variables are reordered by order_by_name
, where order_by_name
contains the name of each variable exactly one time, giving the new ordering.
Returns an error if order_by_name
does not contain the name each variable in the model exactly once.
terms
. Definition at line 111 of file model_utils.cc.
absl::StatusOr< LpModel > operations_research::lp_format::PermuteVariables | ( | const LpModel & | model, |
const util_intops::StrongVector< VariableIndex, VariableIndex > & | new_index_to_old_index ) |
Returns a copy of model
where the variables are permuted by new_index_to_old_index
(a permutation of the indices of the variables).
Returns an error if new_index_to_old_index
is not a valid permutation.
terms
. Definition at line 103 of file model_utils.cc.
Returns a copy of model
, but where the variables appearing in no constraint have been deleted (and variable order is otherwise preserved).
terms
. Definition at line 84 of file model_utils.cc.
bool operations_research::lp_format::ValidateCharInName | ( | unsigned char | c, |
bool | is_leading ) |
Returns true if c is valid character to be included the name of a variable or constraint in an LP file, where is_leading indicates if c is the first character of the name.
Definition at line 23 of file lp_name.cc.
absl::Status operations_research::lp_format::ValidateName | ( | absl::string_view | name | ) |
Checks if name
is a valid name for a variable or constraint in an LP file.
Definition at line 57 of file lp_name.cc.