Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
parameters_validation.cc File Reference
#include "ortools/sat/parameters_validation.h"
#include <stdint.h>
#include <algorithm>
#include <cmath>
#include <limits>
#include <string>
#include "absl/strings/str_cat.h"
#include "ortools/sat/cp_model_search.h"
#include "ortools/sat/sat_parameters.pb.h"

Go to the source code of this file.

Namespaces

namespace  operations_research
 In SWIG mode, we don't want anything besides these top-level includes.
 
namespace  operations_research::sat
 

Macros

#define TEST_IN_RANGE(name, min, max)
 
#define TEST_NON_NEGATIVE(name)
 
#define TEST_POSITIVE(name)
 
#define TEST_NOT_NAN(name)
 
#define TEST_IS_FINITE(name)
 

Functions

std::string operations_research::sat::ValidateParameters (const SatParameters &params)
 

Macro Definition Documentation

◆ TEST_IN_RANGE

#define TEST_IN_RANGE ( name,
min,
max )
Value:
if (params.name() < min || params.name() > max) { \
return absl::StrCat("parameter '", #name, "' should be in [", min, ",", \
max, "]. Current value is ", params.name()); \
}
int64_t max
int64_t min
const std::string name
A name for logging purposes.

Definition at line 30 of file parameters_validation.cc.

◆ TEST_IS_FINITE

#define TEST_IS_FINITE ( name)
Value:
if (!std::isfinite(params.name())) { \
return absl::StrCat("parameter '", #name, "' is NaN or not finite"); \
}

Definition at line 51 of file parameters_validation.cc.

◆ TEST_NON_NEGATIVE

#define TEST_NON_NEGATIVE ( name)
Value:
if (params.name() < 0) { \
return absl::StrCat("Parameters ", #name, " must be non-negative"); \
}

Definition at line 36 of file parameters_validation.cc.

◆ TEST_NOT_NAN

#define TEST_NOT_NAN ( name)
Value:
if (std::isnan(params.name())) { \
return absl::StrCat("parameter '", #name, "' is NaN"); \
}

Definition at line 46 of file parameters_validation.cc.

◆ TEST_POSITIVE

#define TEST_POSITIVE ( name)
Value:
if (params.name() <= 0) { \
return absl::StrCat("Parameters ", #name, " must be positive"); \
}

Definition at line 41 of file parameters_validation.cc.