53 _ <<
"invalid SolveParameters.time_limit");
56 <<
"SolveParameters.time_limit = " <<
time_limit <<
" < 0";
62 return absl::InvalidArgumentError(absl::StrCat(
63 "SolveParameters.threads = ",
parameters.threads(),
" <= 0"));
69 return absl::InvalidArgumentError(
70 absl::StrCat(
"SolveParameters.relative_gap_tolerance = ",
77 return absl::InvalidArgumentError(
78 absl::StrCat(
"SolveParameters.absolute_gap_tolerance = ",
84 <<
"SolveParameters.node_limit = " <<
parameters.node_limit()
85 <<
" should be nonnegative.";
90 <<
"SolveParameters.solution_limit = " <<
parameters.solution_limit()
91 <<
" should be positive.";
94 if (!std::isfinite(
parameters.cutoff_limit())) {
96 <<
"SolveParameters.cutoff_limit should be finite (and not NaN) but "
100 if (std::isnan(
parameters.objective_limit())) {
101 return absl::InvalidArgumentError(
102 "SolveParameters.objective_limit was NaN");
104 if (std::isnan(
parameters.best_bound_limit())) {
105 return absl::InvalidArgumentError(
106 "SolveParameters.best_bound_limit was NaN");
111 <<
"SolveParameters.solution_pool_size must be positive if set, but "
115 if (!LPAlgorithmProto_IsValid(
parameters.lp_algorithm())) {
117 <<
"Unknown enum value for SolverParameters.lp_algorithm = "
120#define VALIDATE_EMPHASIS(property) \
122 ValidateEmphasisProtoParameter(parameters.property(), #property))
127#undef VALIDATE_EMPHASIS
128 return absl::OkStatus();