Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
base_solver.cc
Go to the documentation of this file.
1// Copyright 2010-2024 Google LLC
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
15
16#include <ostream>
17
18#include "absl/strings/str_cat.h"
19#include "absl/strings/string_view.h"
20
22namespace {
23
24// Returns a string describing if the input pointer-like type is == nullptr.
25template <typename Ptr>
26absl::string_view IsNullString(const Ptr& ptr) {
27 return ptr == nullptr ? "<null>" : "<not null>";
28}
29
30} // namespace
31
32std::ostream& operator<<(std::ostream& out, const BaseSolver::SolveArgs& args) {
33 out << "{ parameters: <" << absl::StrCat(args.parameters)
34 << ">, model_parameters: <" << absl::StrCat(args.model_parameters)
35 << ">, message_callback: " << IsNullString(args.message_callback)
36 << ", callback_registration: <"
37 << absl::StrCat(args.callback_registration)
38 << ">, user_cb: " << IsNullString(args.user_cb)
39 << ", interrupter: " << args.interrupter << " }";
40 return out;
41}
42
43std::ostream& operator<<(
44 std::ostream& out, const BaseSolver::ComputeInfeasibleSubsystemArgs& args) {
45 out << "{ parameters: <" << absl::StrCat(args.parameters)
46 << ">, message_callback: " << IsNullString(args.message_callback)
47 << ", interrupter: " << args.interrupter << " }";
48 return out;
49}
50
51} // namespace operations_research::math_opt
An object oriented wrapper for quadratic constraints in ModelStorage.
Definition gurobi_isv.cc:28
std::ostream & operator<<(std::ostream &ostr, const IndicatorConstraint &constraint)
Arguments used when calling ComputeInfeasibleSubsystem().
Definition base_solver.h:79
Arguments used when calling Solve() to solve the problem.
Definition base_solver.h:57