very minor rewrites/cleanups
This commit is contained in:
@@ -228,10 +228,10 @@ objs/util/sorted_interval_list.$O: ortools/util/sorted_interval_list.cc \
|
||||
$(CCC) $(CFLAGS) -c $(SRC_DIR)$Sortools$Sutil$Ssorted_interval_list.cc $(OBJ_OUT)$(OBJ_DIR)$Sutil$Ssorted_interval_list.$O
|
||||
|
||||
objs/util/stats.$O: ortools/util/stats.cc ortools/util/stats.h \
|
||||
ortools/base/timer.h ortools/base/basictypes.h \
|
||||
ortools/base/macros.h ortools/base/timer.h ortools/base/basictypes.h \
|
||||
ortools/base/integral_types.h ortools/base/logging.h \
|
||||
ortools/base/macros.h ortools/base/stl_util.h ortools/port/sysinfo.h \
|
||||
ortools/port/utf8.h ortools/base/encodingutils.h | $(OBJ_DIR)/util
|
||||
ortools/base/stl_util.h ortools/port/sysinfo.h ortools/port/utf8.h \
|
||||
ortools/base/encodingutils.h | $(OBJ_DIR)/util
|
||||
$(CCC) $(CFLAGS) -c $(SRC_DIR)$Sortools$Sutil$Sstats.cc $(OBJ_OUT)$(OBJ_DIR)$Sutil$Sstats.$O
|
||||
|
||||
objs/util/time_limit.$O: ortools/util/time_limit.cc \
|
||||
@@ -3780,3 +3780,4 @@ $(GEN_DIR)/ortools/constraint_solver/solver_parameters.pb.h: \
|
||||
$(OBJ_DIR)/constraint_solver/solver_parameters.pb.$O: \
|
||||
$(GEN_DIR)/ortools/constraint_solver/solver_parameters.pb.cc | $(OBJ_DIR)/constraint_solver
|
||||
$(CCC) $(CFLAGS) -c $(GEN_PATH)$Sortools$Sconstraint_solver$Ssolver_parameters.pb.cc $(OBJ_OUT)$(OBJ_DIR)$Sconstraint_solver$Ssolver_parameters.pb.$O
|
||||
|
||||
|
||||
@@ -226,6 +226,10 @@ void CpModelProtoWithMapping::FillConstraint(const fz::Constraint& fz_ct,
|
||||
for (const int var : LookupVars(fz_ct.arguments[1])) {
|
||||
arg->add_literals(FalseLiteral(var));
|
||||
}
|
||||
} else if (fz_ct.type == "bool_xor") {
|
||||
auto* arg = ct->mutable_bool_xor();
|
||||
arg->add_literals(TrueLiteral(LookupVar(fz_ct.arguments[0])));
|
||||
arg->add_literals(TrueLiteral(LookupVar(fz_ct.arguments[1])));
|
||||
} else if (fz_ct.type == "array_bool_or") {
|
||||
auto* arg = ct->mutable_bool_or();
|
||||
for (const int var : LookupVars(fz_ct.arguments[0])) {
|
||||
@@ -950,9 +954,7 @@ void SolveFzWithCpModelProto(const fz::Model& fz_model,
|
||||
m.TranslateSearchAnnotations(fz_model.search_annotations());
|
||||
|
||||
// Print model statistics.
|
||||
if (!FLAGS_use_flatzinc_format) {
|
||||
LOG(INFO) << CpModelStats(m.proto);
|
||||
} else if (p.verbose_logging) {
|
||||
if (FLAGS_use_flatzinc_format && p.verbose_logging) {
|
||||
LogInFlatzincFormat(CpModelStats(m.proto));
|
||||
}
|
||||
|
||||
@@ -1041,8 +1043,6 @@ void SolveFzWithCpModelProto(const fz::Model& fz_model,
|
||||
if (p.display_statistics) {
|
||||
LogInFlatzincFormat(CpSolverResponseStats(response));
|
||||
}
|
||||
} else {
|
||||
LOG(INFO) << CpSolverResponseStats(response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ namespace {
|
||||
// Priority queue element
|
||||
class Element {
|
||||
public:
|
||||
Element() : heap_index_(-1), distance_(0), node_(-1) {}
|
||||
bool operator<(const Element& other) const {
|
||||
return distance_ > other.distance_;
|
||||
return distance_ != other.distance_ ? distance_ > other.distance_
|
||||
: node_ > other.node_;
|
||||
}
|
||||
void SetHeapIndex(int h) { heap_index_ = h; }
|
||||
int GetHeapIndex() const { return heap_index_; }
|
||||
@@ -38,9 +38,9 @@ class Element {
|
||||
int node() const { return node_; }
|
||||
|
||||
private:
|
||||
int heap_index_;
|
||||
int64 distance_;
|
||||
int node_;
|
||||
int64 distance_ = 0;
|
||||
int heap_index_ = -1;
|
||||
int node_ = -1;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
||||
@@ -70,11 +70,14 @@
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#ifdef HAS_PERF_SUBSYSTEM
|
||||
#include "absl/strings/str_replace.h"
|
||||
#include "exegesis/exegesis/itineraries/perf_subsystem.h"
|
||||
#include "ortools/util/time_limit.h"
|
||||
#endif // HAS_PERF_SUBSYSTEM
|
||||
|
||||
#include "ortools/base/macros.h"
|
||||
#include "ortools/base/timer.h"
|
||||
|
||||
namespace operations_research {
|
||||
|
||||
Reference in New Issue
Block a user