![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
Inline implementations
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.
Inlined functions
Classes | |
class | ArrowOperatorProxy |
class | IncrementalSolverImpl |
Incremental solve of a model. More... | |
class | SosConstraintData |
struct | VariablesEquality |
Typedefs | |
using | BaseSolverFactory |
Functions | |
template<typename SosConstraint> | |
std::string | SosConstraintToString (SosConstraint constraint, absl::string_view sos_type_name) |
absl::Status | CheckIdsRangeAndStrictlyIncreasing2 (absl::Span< const int64_t > ids) |
template<typename DataProto> | |
absl::Status | UpdateBiMapFromMappedData (const absl::Span< const int64_t > deleted_ids, const google::protobuf::Map< int64_t, DataProto > &proto_map, IdNameBiMap &bimap) |
absl::Status | ValidateInitArgs (const Solver::InitArgs &init_args, const SolverTypeProto solver_type) |
absl::Status | CheckModelStorage (const NullableModelStorageCPtr storage, const ModelStorageCPtr expected_storage) |
absl::StatusOr< SolveResult > | SolveImpl (const BaseSolverFactory solver_factory, const Model &model, const SolverType solver_type, const SolveArguments &solve_args, const SolveInterrupter *const user_canceller, const bool remove_names) |
absl::StatusOr< ComputeInfeasibleSubsystemResult > | ComputeInfeasibleSubsystemImpl (const BaseSolverFactory solver_factory, const Model &model, const SolverType solver_type, const ComputeInfeasibleSubsystemArguments &compute_args, const SolveInterrupter *const user_canceller, const bool remove_names) |
template<typename LeftIterable, typename RightIterable, typename Expression> | |
void | AddInnerProduct (const LeftIterable &left, const RightIterable &right, Expression &expr) |
template<typename ConstraintData> | |
ConstraintData::IdType | AddAtomicConstraint (const ConstraintData &data, Elemental &elemental) |
template<ElementType e> | |
AtomicConstraintTraits< ElementId< e > >::ConstraintData | GetAtomicConstraint (ElementId< e > id, const Elemental &elemental) |
template<> | |
QuadraticConstraintId | AddAtomicConstraint (const QuadraticConstraintData &data, Elemental &elemental) |
template<> | |
QuadraticConstraintData | GetAtomicConstraint (QuadraticConstraintId id, const Elemental &elemental) |
template<> | |
IndicatorConstraintId | AddAtomicConstraint (const IndicatorConstraintData &data, Elemental &elemental) |
template<> | |
IndicatorConstraintData | GetAtomicConstraint (IndicatorConstraintId id, const Elemental &elemental) |
void | FormatModelStorageElement (std::ostream &ostr, ElementType element_type, absl::string_view name, int64_t id) |
template<typename RowId, typename ColumnId> | |
SparseDoubleMatrixProto | EntriesToMatrixProto (std::vector< std::tuple< RowId, ColumnId, double > > entries) |
entries must have unique (row, column) values but can be in any order. |
Variables | |
std::atomic< int64_t > | debug_num_solver = 0 |
constexpr absl::string_view | kKeyHasNullModelStorage |
The CHECK message to use when a KeyType::storage() is nullptr. | |
constexpr absl::string_view | kObjectsFromOtherModelStorage |
constexpr absl::string_view | kInputFromInvalidModelStorage |
constexpr absl::string_view | kModelIsDestroyed |
constexpr double | kZerosCleanup = 1.0 / 3.0 |
A factory of solver.
The local_canceller is a local interrupter that exists in the scope of SolveImpl(), ComputeInfeasibleSubsystemImpl() or IncrementalSolverImpl. It is triggered:
Solvers that don't support cancellation (i.e. in-process solving) should ignore the local_canceller: this use case won't have a user_canceller and the CallbackResultProto.terminate will terminate the solve as soon as possible if the CallbackResultProto is invalid.
Definition at line 50 of file solve_impl.h.
ConstraintData::IdType operations_research::math_opt::internal::AddAtomicConstraint | ( | const ConstraintData & | data, |
Elemental & | elemental ) |
|
inline |
Indicator constraints
Definition at line 101 of file atomic_constraints_v2.h.
|
inline |
Quadratic constraints
Definition at line 47 of file atomic_constraints_v2.h.
void operations_research::math_opt::internal::AddInnerProduct | ( | const LeftIterable & | left, |
const RightIterable & | right, | ||
Expression & | expr ) |
Definition at line 1609 of file variable_and_expressions.h.
absl::Status operations_research::math_opt::internal::CheckIdsRangeAndStrictlyIncreasing2 | ( | absl::Span< const int64_t > | ids | ) |
Definition at line 40 of file model_summary.cc.
|
inline |
Returns a failure when the input pointer is not nullptr and points to a different model storage than expected_storage.
Failure message is kInputFromInvalidModelStorage.
This is not allowed by the contract, but let's be safe.
Definition at line 169 of file key_types.h.
absl::StatusOr< ComputeInfeasibleSubsystemResult > operations_research::math_opt::internal::ComputeInfeasibleSubsystemImpl | ( | BaseSolverFactory | solver_factory, |
const Model & | model, | ||
SolverType | solver_type, | ||
const ComputeInfeasibleSubsystemArguments & | compute_args, | ||
const SolveInterrupter * | user_canceller, | ||
bool | remove_names ) |
ComputeInfeasibleSubsystems the input model in a subprocess.
The user_canceller parameter is optional.
Definition at line 138 of file solve_impl.cc.
SparseDoubleMatrixProto operations_research::math_opt::internal::EntriesToMatrixProto | ( | std::vector< std::tuple< RowId, ColumnId, double > > | entries | ) |
entries must have unique (row, column) values but can be in any order.
Definition at line 279 of file sparse_matrix.h.
void operations_research::math_opt::internal::FormatModelStorageElement | ( | std::ostream & | ostr, |
ElementType | element_type, | ||
absl::string_view | name, | ||
int64_t | id ) |
Definition at line 25 of file model_storage_item.cc.
AtomicConstraintTraits< ElementId< e > >::ConstraintData operations_research::math_opt::internal::GetAtomicConstraint | ( | ElementId< e > | id, |
const Elemental & | elemental ) |
|
inline |
Definition at line 122 of file atomic_constraints_v2.h.
|
inline |
Definition at line 67 of file atomic_constraints_v2.h.
absl::StatusOr< SolveResult > operations_research::math_opt::internal::SolveImpl | ( | BaseSolverFactory | solver_factory, |
const Model & | model, | ||
SolverType | solver_type, | ||
const SolveArguments & | solve_args, | ||
const SolveInterrupter * | user_canceller, | ||
bool | remove_names ) |
Solves the input model.
The user_canceller parameter is optional.
Definition at line 124 of file solve_impl.cc.
std::string operations_research::math_opt::internal::SosConstraintToString | ( | SosConstraint | constraint, |
absl::string_view | sos_type_name ) |
This method can only be called with a parameter of either Sos1Constraint or Sos2Constraint.
Tested in sos1_constraint_test and sos2_constraint_test, as the ToString() member functions are thin wrappers around this function.
Inline function implementations
absl::Status operations_research::math_opt::internal::UpdateBiMapFromMappedData | ( | const absl::Span< const int64_t > | deleted_ids, |
const google::protobuf::Map< int64_t, DataProto > & | proto_map, | ||
IdNameBiMap & | bimap ) |
Definition at line 245 of file model_summary.h.
absl::Status operations_research::math_opt::internal::ValidateInitArgs | ( | const Solver::InitArgs & | init_args, |
SolverTypeProto | solver_type ) |
OR_DLL std::atomic< int64_t > operations_research::math_opt::internal::debug_num_solver = 0 |
The number of Solver instances that currently exist.
This variable is intended to be used by MathOpt unit tests in other languages to test the proper garbage collection. It should never be used in any other context.
Definition at line 23 of file solver_debug.cc.
|
inlineconstexpr |
The Status message to use when an input KeyType is from an unexpected storage().
Definition at line 162 of file key_types.h.
|
inlineconstexpr |
The CHECK message to use when a KeyType::storage() is nullptr.
Definition at line 152 of file key_types.h.
|
constexpr |
The failure message used when a function of UpdateTracker is called after the destruction of the model..
Definition at line 110 of file update_tracker.h.
|
inlineconstexpr |
The CHECK message to use when two KeyType with different storage() are used in the same collection.
Definition at line 157 of file key_types.h.
|
constexpr |
When the fraction of entries in values_ with value 0.0 is larger than kZerosCleanup, we compact the data structure and remove all zero entries.
Definition at line 257 of file sparse_matrix.h.