CP Solver: small code cleanups.
This commit is contained in:
@@ -380,7 +380,7 @@ class DemonProfiler : public PropagationMonitor {
|
||||
runtimes.push_back(demon_time);
|
||||
}
|
||||
// Compute mean.
|
||||
if (runtimes.size()) {
|
||||
if (!runtimes.empty()) {
|
||||
*mean_demon_runtime = (1.0L * *total_demon_runtime) / runtimes.size();
|
||||
|
||||
// Compute median.
|
||||
|
||||
@@ -2356,7 +2356,8 @@ class PositiveBooleanScalProdEqCst : public Constraint {
|
||||
|
||||
class ExprLinearizer : public ModelParser {
|
||||
public:
|
||||
ExprLinearizer(hash_map<IntVar*, int64>* const variables_to_coefficients)
|
||||
explicit ExprLinearizer(
|
||||
hash_map<IntVar*, int64>* const variables_to_coefficients)
|
||||
: variables_to_coefficients_(variables_to_coefficients), constant_(0) {}
|
||||
|
||||
~ExprLinearizer() override {}
|
||||
@@ -3042,7 +3043,7 @@ IntExpr* MakeSumArrayAux(Solver* const solver, const std::vector<IntVar*>& vars,
|
||||
}
|
||||
}
|
||||
|
||||
IntExpr* MakeSumAux(Solver* const solver, const std::vector<IntVar*> vars,
|
||||
IntExpr* MakeSumAux(Solver* const solver, const std::vector<IntVar*>& vars,
|
||||
int64 constant) {
|
||||
const int size = vars.size();
|
||||
if (size == 0) {
|
||||
|
||||
@@ -432,7 +432,7 @@ class TreeNode {
|
||||
tree_writer->AddAttribute("value", "0");
|
||||
} else {
|
||||
// Use the original size of the first child if available
|
||||
const DomainMap& domain = parent_ && parent_->children_.size()
|
||||
const DomainMap& domain = parent_ && !parent_->children_.empty()
|
||||
? parent_->children_[0]->domain()
|
||||
: domain_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user