![]() |
Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
|
#include <lp_data.h>
Public Types | |
| enum class | VariableType { CONTINUOUS , INTEGER , IMPLIED_INTEGER } |
Public Member Functions | |
| LinearProgram () | |
| LinearProgram (const LinearProgram &)=delete | |
| LinearProgram & | operator= (const LinearProgram &)=delete |
| void | Clear () |
| void | SetName (absl::string_view name) |
| const std::string & | name () const |
| ColIndex | CreateNewVariable () |
| ColIndex | CreateNewSlackVariable (bool is_integer_slack_variable, Fractional lower_bound, Fractional upper_bound, const std::string &name) |
| RowIndex | CreateNewConstraint () |
| ColIndex | FindOrCreateVariable (absl::string_view variable_id) |
| RowIndex | FindOrCreateConstraint (absl::string_view constraint_id) |
| void | SetVariableName (ColIndex col, absl::string_view name) |
| void | SetConstraintName (RowIndex row, absl::string_view name) |
| void | SetVariableType (ColIndex col, VariableType type) |
| bool | IsVariableInteger (ColIndex col) const |
| bool | IsVariableBinary (ColIndex col) const |
| void | SetVariableBounds (ColIndex col, Fractional lower_bound, Fractional upper_bound) |
| void | SetConstraintBounds (RowIndex row, Fractional lower_bound, Fractional upper_bound) |
| void | SetCoefficient (RowIndex row, ColIndex col, Fractional value) |
| void | SetObjectiveCoefficient (ColIndex col, Fractional value) |
| void | SetObjectiveOffset (Fractional objective_offset) |
| void | SetObjectiveScalingFactor (Fractional objective_scaling_factor) |
| void | SetMaximizationProblem (bool maximize) |
| void | CleanUp () |
| bool | IsCleanedUp () const |
| std::string | GetVariableName (ColIndex col) const |
| std::string | GetConstraintName (RowIndex row) const |
| VariableType | GetVariableType (ColIndex col) const |
| bool | IsMaximizationProblem () const |
| const SparseMatrix & | GetSparseMatrix () const |
| const SparseMatrix & | GetTransposeSparseMatrix () const |
| SparseMatrix * | GetMutableTransposeSparseMatrix () |
| void | UseTransposeMatrixAsReference () |
| void | ClearTransposeMatrix () |
| const SparseColumn & | GetSparseColumn (ColIndex col) const |
| SparseColumn * | GetMutableSparseColumn (ColIndex col) |
| ColIndex | num_variables () const |
| RowIndex | num_constraints () const |
| EntryIndex | num_entries () const |
| const DenseColumn & | constraint_lower_bounds () const |
| const DenseColumn & | constraint_upper_bounds () const |
| const DenseRow & | objective_coefficients () const |
| const DenseRow & | variable_lower_bounds () const |
| const DenseRow & | variable_upper_bounds () const |
| StrictITIVector< ColIndex, VariableType > | variable_types () const |
| const std::vector< ColIndex > & | IntegerVariablesList () const |
| const std::vector< ColIndex > & | BinaryVariablesList () const |
| const std::vector< ColIndex > & | NonBinaryVariablesList () const |
| Fractional | GetObjectiveCoefficientForMinimizationVersion (ColIndex col) const |
| Fractional | objective_offset () const |
| Fractional | objective_scaling_factor () const |
| bool | SolutionIsWithinVariableBounds (const DenseRow &solution, Fractional absolute_tolerance) const |
| bool | SolutionIsLPFeasible (const DenseRow &solution, Fractional absolute_tolerance) const |
| bool | SolutionIsInteger (const DenseRow &solution, Fractional absolute_tolerance) const |
| bool | SolutionIsMIPFeasible (const DenseRow &solution, Fractional absolute_tolerance) const |
| void | ComputeSlackVariableValues (DenseRow *solution) const |
| Fractional | ApplyObjectiveScalingAndOffset (Fractional value) const |
| Fractional | RemoveObjectiveScalingAndOffset (Fractional value) const |
| std::string | GetDimensionString () const |
| std::string | GetObjectiveStatsString () const |
| std::string | GetBoundsStatsString () const |
| std::string | Dump () const |
| std::string | DumpSolution (const DenseRow &variable_values) const |
| std::string | GetProblemStats () const |
| std::string | GetPrettyProblemStats () const |
| std::string | GetNonZeroStats () const |
| std::string | GetPrettyNonZeroStats () const |
| void | AddSlackVariablesWhereNecessary (bool detect_integer_constraints) |
| ColIndex | GetFirstSlackVariable () const |
| ColIndex | GetSlackVariable (RowIndex row) const |
| void | PopulateFromDual (const LinearProgram &dual, RowToColMapping *duplicated_rows) |
| void | PopulateFromLinearProgram (const LinearProgram &linear_program) |
| void | PopulateFromPermutedLinearProgram (const LinearProgram &lp, const RowPermutation &row_permutation, const ColumnPermutation &col_permutation) |
| void | PopulateFromLinearProgramVariables (const LinearProgram &linear_program) |
| void | AddConstraints (const SparseMatrix &coefficients, const DenseColumn &left_hand_sides, const DenseColumn &right_hand_sides, const StrictITIVector< RowIndex, std::string > &names) |
| void | AddConstraintsWithSlackVariables (const SparseMatrix &coefficients, const DenseColumn &left_hand_sides, const DenseColumn &right_hand_sides, const StrictITIVector< RowIndex, std::string > &names, bool detect_integer_constraints_for_slack) |
| void | Swap (LinearProgram *linear_program) |
| void | DeleteColumns (const DenseBooleanRow &columns_to_delete) |
| void | DeleteSlackVariables () |
| void | Scale (SparseMatrixScaler *scaler) |
| Fractional | ScaleObjective (GlopParameters::CostScalingAlgorithm method) |
| Fractional | ScaleBounds () |
| void | DeleteRows (const DenseBooleanColumn &rows_to_delete) |
| bool | IsValid (Fractional max_valid_magnitude=kInfinity) const |
| bool | UpdateVariableBoundsToIntersection (const DenseRow &variable_lower_bounds, const DenseRow &variable_upper_bounds) |
| bool | IsInEquationForm () const |
| bool | BoundsOfIntegerVariablesAreInteger (Fractional tolerance) const |
| bool | BoundsOfIntegerConstraintsAreInteger (Fractional tolerance) const |
| void | NotifyThatColumnsAreClean () |
| void | SetDcheckBounds (bool dcheck_bounds) |
| DenseColumn * | mutable_constraint_lower_bounds () |
| DenseColumn * | mutable_constraint_upper_bounds () |
| void | RemoveNearZeroEntries (Fractional threshold) |
Friends | |
| void | Scale (LinearProgram *lp, SparseMatrixScaler *scaler, GlopParameters::ScalingAlgorithm scaling_method) |
|
strong |
Definition at line 120 of file lp_data.cc.
|
delete |
| void operations_research::glop::LinearProgram::AddConstraints | ( | const SparseMatrix & | coefficients, |
| const DenseColumn & | left_hand_sides, | ||
| const DenseColumn & | right_hand_sides, | ||
| const StrictITIVector< RowIndex, std::string > & | names ) |
Definition at line 983 of file lp_data.cc.
| void operations_research::glop::LinearProgram::AddConstraintsWithSlackVariables | ( | const SparseMatrix & | coefficients, |
| const DenseColumn & | left_hand_sides, | ||
| const DenseColumn & | right_hand_sides, | ||
| const StrictITIVector< RowIndex, std::string > & | names, | ||
| bool | detect_integer_constraints_for_slack ) |
Definition at line 1008 of file lp_data.cc.
| void operations_research::glop::LinearProgram::AddSlackVariablesWhereNecessary | ( | bool | detect_integer_constraints | ) |
Definition at line 708 of file lp_data.cc.
| Fractional operations_research::glop::LinearProgram::ApplyObjectiveScalingAndOffset | ( | Fractional | value | ) | const |
Definition at line 559 of file lp_data.cc.
| const std::vector< ColIndex > & operations_research::glop::LinearProgram::BinaryVariablesList | ( | ) | const |
Definition at line 294 of file lp_data.cc.
| bool operations_research::glop::LinearProgram::BoundsOfIntegerConstraintsAreInteger | ( | Fractional | tolerance | ) | const |
Definition at line 1523 of file lp_data.cc.
| bool operations_research::glop::LinearProgram::BoundsOfIntegerVariablesAreInteger | ( | Fractional | tolerance | ) | const |
Definition at line 1507 of file lp_data.cc.
Definition at line 356 of file lp_data.cc.
Definition at line 143 of file lp_data.cc.
Definition at line 413 of file lp_data.cc.
| void operations_research::glop::LinearProgram::ComputeSlackVariableValues | ( | DenseRow * | solution | ) | const |
Definition at line 544 of file lp_data.cc.
|
inline |
|
inline |
Definition at line 200 of file lp_data.cc.
| ColIndex operations_research::glop::LinearProgram::CreateNewSlackVariable | ( | bool | is_integer_slack_variable, |
| Fractional | lower_bound, | ||
| Fractional | upper_bound, | ||
| const std::string & | name ) |
Definition at line 185 of file lp_data.cc.
Definition at line 171 of file lp_data.cc.
| void operations_research::glop::LinearProgram::DeleteColumns | ( | const DenseBooleanRow & | columns_to_delete | ) |
Definition at line 1076 of file lp_data.cc.
| void operations_research::glop::LinearProgram::DeleteRows | ( | const DenseBooleanColumn & | rows_to_delete | ) |
Definition at line 1269 of file lp_data.cc.
Definition at line 1125 of file lp_data.cc.
| std::string operations_research::glop::LinearProgram::Dump | ( | ) | const |
Definition at line 569 of file lp_data.cc.
| std::string operations_research::glop::LinearProgram::DumpSolution | ( | const DenseRow & | variable_values | ) | const |
Definition at line 658 of file lp_data.cc.
| RowIndex operations_research::glop::LinearProgram::FindOrCreateConstraint | ( | absl::string_view | constraint_id | ) |
Definition at line 227 of file lp_data.cc.
| ColIndex operations_research::glop::LinearProgram::FindOrCreateVariable | ( | absl::string_view | variable_id | ) |
Definition at line 214 of file lp_data.cc.
| std::string operations_research::glop::LinearProgram::GetBoundsStatsString | ( | ) | const |
Definition at line 474 of file lp_data.cc.
| std::string operations_research::glop::LinearProgram::GetConstraintName | ( | RowIndex | row | ) | const |
Definition at line 375 of file lp_data.cc.
| std::string operations_research::glop::LinearProgram::GetDimensionString | ( | ) | const |
Definition at line 434 of file lp_data.cc.
| ColIndex operations_research::glop::LinearProgram::GetFirstSlackVariable | ( | ) | const |
Definition at line 762 of file lp_data.cc.
| SparseColumn * operations_research::glop::LinearProgram::GetMutableSparseColumn | ( | ColIndex | col | ) |
Definition at line 422 of file lp_data.cc.
Definition at line 395 of file lp_data.cc.
| std::string operations_research::glop::LinearProgram::GetNonZeroStats | ( | ) | const |
Definition at line 697 of file lp_data.cc.
| Fractional operations_research::glop::LinearProgram::GetObjectiveCoefficientForMinimizationVersion | ( | ColIndex | col | ) | const |
Definition at line 428 of file lp_data.cc.
| std::string operations_research::glop::LinearProgram::GetObjectiveStatsString | ( | ) | const |
Definition at line 461 of file lp_data.cc.
| std::string operations_research::glop::LinearProgram::GetPrettyNonZeroStats | ( | ) | const |
Definition at line 701 of file lp_data.cc.
| std::string operations_research::glop::LinearProgram::GetPrettyProblemStats | ( | ) | const |
Definition at line 675 of file lp_data.cc.
| std::string operations_research::glop::LinearProgram::GetProblemStats | ( | ) | const |
Definition at line 669 of file lp_data.cc.
| ColIndex operations_research::glop::LinearProgram::GetSlackVariable | ( | RowIndex | row | ) | const |
Definition at line 766 of file lp_data.cc.
| const SparseColumn & operations_research::glop::LinearProgram::GetSparseColumn | ( | ColIndex | col | ) | const |
Definition at line 418 of file lp_data.cc.
|
inline |
Definition at line 385 of file lp_data.cc.
| std::string operations_research::glop::LinearProgram::GetVariableName | ( | ColIndex | col | ) | const |
Definition at line 369 of file lp_data.cc.
| LinearProgram::VariableType operations_research::glop::LinearProgram::GetVariableType | ( | ColIndex | col | ) | const |
Definition at line 381 of file lp_data.cc.
| const std::vector< ColIndex > & operations_research::glop::LinearProgram::IntegerVariablesList | ( | ) | const |
Definition at line 289 of file lp_data.cc.
| bool operations_research::glop::LinearProgram::IsCleanedUp | ( | ) | const |
Definition at line 363 of file lp_data.cc.
| bool operations_research::glop::LinearProgram::IsInEquationForm | ( | ) | const |
Definition at line 1494 of file lp_data.cc.
|
inline |
| bool operations_research::glop::LinearProgram::IsValid | ( | Fractional | max_valid_magnitude = kInfinity | ) | const |
Definition at line 1316 of file lp_data.cc.
| bool operations_research::glop::LinearProgram::IsVariableBinary | ( | ColIndex | col | ) | const |
Definition at line 309 of file lp_data.cc.
| bool operations_research::glop::LinearProgram::IsVariableInteger | ( | ColIndex | col | ) | const |
Definition at line 304 of file lp_data.cc.
|
inline |
|
inline |
|
inline |
| const std::vector< ColIndex > & operations_research::glop::LinearProgram::NonBinaryVariablesList | ( | ) | const |
Definition at line 299 of file lp_data.cc.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
delete |
| void operations_research::glop::LinearProgram::PopulateFromDual | ( | const LinearProgram & | dual, |
| RowToColMapping * | duplicated_rows ) |
Definition at line 775 of file lp_data.cc.
| void operations_research::glop::LinearProgram::PopulateFromLinearProgram | ( | const LinearProgram & | linear_program | ) |
Definition at line 873 of file lp_data.cc.
| void operations_research::glop::LinearProgram::PopulateFromLinearProgramVariables | ( | const LinearProgram & | linear_program | ) |
Definition at line 946 of file lp_data.cc.
| void operations_research::glop::LinearProgram::PopulateFromPermutedLinearProgram | ( | const LinearProgram & | lp, |
| const RowPermutation & | row_permutation, | ||
| const ColumnPermutation & | col_permutation ) |
Definition at line 894 of file lp_data.cc.
| void operations_research::glop::LinearProgram::RemoveNearZeroEntries | ( | Fractional | threshold | ) |
Definition at line 1561 of file lp_data.cc.
| Fractional operations_research::glop::LinearProgram::RemoveObjectiveScalingAndOffset | ( | Fractional | value | ) | const |
Definition at line 564 of file lp_data.cc.
| void operations_research::glop::LinearProgram::Scale | ( | SparseMatrixScaler * | scaler | ) |
Definition at line 1234 of file lp_data.cc.
| Fractional operations_research::glop::LinearProgram::ScaleObjective | ( | GlopParameters::CostScalingAlgorithm | method | ) |
Definition at line 1199 of file lp_data.cc.
| void operations_research::glop::LinearProgram::SetCoefficient | ( | RowIndex | row, |
| ColIndex | col, | ||
| Fractional | value ) |
Definition at line 326 of file lp_data.cc.
| void operations_research::glop::LinearProgram::SetConstraintBounds | ( | RowIndex | row, |
| Fractional | lower_bound, | ||
| Fractional | upper_bound ) |
Definition at line 318 of file lp_data.cc.
| void operations_research::glop::LinearProgram::SetConstraintName | ( | RowIndex | row, |
| absl::string_view | name ) |
Definition at line 254 of file lp_data.cc.
|
inline |
| void operations_research::glop::LinearProgram::SetMaximizationProblem | ( | bool | maximize | ) |
Definition at line 352 of file lp_data.cc.
|
inline |
| void operations_research::glop::LinearProgram::SetObjectiveCoefficient | ( | ColIndex | col, |
| Fractional | value ) |
Definition at line 335 of file lp_data.cc.
| void operations_research::glop::LinearProgram::SetObjectiveOffset | ( | Fractional | objective_offset | ) |
Definition at line 340 of file lp_data.cc.
| void operations_research::glop::LinearProgram::SetObjectiveScalingFactor | ( | Fractional | objective_scaling_factor | ) |
Definition at line 345 of file lp_data.cc.
| void operations_research::glop::LinearProgram::SetVariableBounds | ( | ColIndex | col, |
| Fractional | lower_bound, | ||
| Fractional | upper_bound ) |
Definition at line 258 of file lp_data.cc.
| void operations_research::glop::LinearProgram::SetVariableName | ( | ColIndex | col, |
| absl::string_view | name ) |
Definition at line 241 of file lp_data.cc.
| void operations_research::glop::LinearProgram::SetVariableType | ( | ColIndex | col, |
| VariableType | type ) |
Definition at line 245 of file lp_data.cc.
| bool operations_research::glop::LinearProgram::SolutionIsInteger | ( | const DenseRow & | solution, |
| Fractional | absolute_tolerance ) const |
Definition at line 526 of file lp_data.cc.
| bool operations_research::glop::LinearProgram::SolutionIsLPFeasible | ( | const DenseRow & | solution, |
| Fractional | absolute_tolerance ) const |
Definition at line 506 of file lp_data.cc.
| bool operations_research::glop::LinearProgram::SolutionIsMIPFeasible | ( | const DenseRow & | solution, |
| Fractional | absolute_tolerance ) const |
Definition at line 538 of file lp_data.cc.
| bool operations_research::glop::LinearProgram::SolutionIsWithinVariableBounds | ( | const DenseRow & | solution, |
| Fractional | absolute_tolerance ) const |
Definition at line 490 of file lp_data.cc.
| void operations_research::glop::LinearProgram::Swap | ( | LinearProgram * | linear_program | ) |
Definition at line 1042 of file lp_data.cc.
| bool operations_research::glop::LinearProgram::UpdateVariableBoundsToIntersection | ( | const DenseRow & | variable_lower_bounds, |
| const DenseRow & | variable_upper_bounds ) |
Definition at line 1017 of file lp_data.cc.
Definition at line 406 of file lp_data.cc.
|
inline |
|
inline |
|
inline |
|
friend |
Definition at line 42 of file lp_data_utils.cc.