Skip to content

Commit

Permalink
Merge branch 'update/clang-15'
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoupey committed Oct 27, 2023
2 parents 862be69 + 90925dc commit 66509df
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/vroom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
vroom:
strategy:
matrix:
cxx: ['g++-12', 'clang++-14']
cxx: ['g++-12', 'clang++-15']
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vroom_libosrm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
libosrm:
strategy:
matrix:
cxx: ['g++-12', 'clang++-14']
cxx: ['g++-12', 'clang++-15']
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
- Refactor `RouteSplit` operator (#996)
- Update cxxopts to 3.1.1 (#997)
- Update gcc to version 12 in CI (#1002)
- Update clang to version 15 in CI (#1022)
- Distances in output are from internal matrices, not routing requests (#957)
- Remove unused `tw_length` member from `Job` and associated code
- Scale `TimeWindow::length` from `UserDuration` to `Duration` (#1015)
Expand Down
10 changes: 5 additions & 5 deletions scripts/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ elif [[ ${OS} = "Darwin" ]] ; then
fi

# Discover clang-format
if type clang-format-14 2> /dev/null ; then
CLANG_FORMAT=clang-format-14
if type clang-format-15 2> /dev/null ; then
CLANG_FORMAT=clang-format-15
elif type clang-format 2> /dev/null ; then
# Clang format found, but need to check version
CLANG_FORMAT=clang-format
V=$(clang-format --version)
if [[ $V != *14.0* ]] ; then
echo "clang-format is not 14.0 (returned ${V})"
if [[ $V != *15.0* ]] ; then
echo "clang-format is not 15.0 (returned ${V})"
exit 1
fi
else
echo "No appropriate clang-format found (expected clang-format-14, or clang-format)"
echo "No appropriate clang-format found (expected clang-format-15, or clang-format)"
exit 1
fi

Expand Down
2 changes: 0 additions & 2 deletions src/problems/tsp/heuristics/christofides.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ std::list<Index> christofides(const Matrix<UserCost>& sym_matrix) {
std::unordered_map<Index, Index> mwpm_final;
std::vector<Index> wrong_vertices;

unsigned total_ok = 0;
for (const auto& [source, target] : mwpm) {
if (mwpm.at(target) == source) {
mwpm_final.emplace(std::min(source, target), std::max(source, target));
++total_ok;
} else {
wrong_vertices.push_back(source);
}
Expand Down
10 changes: 0 additions & 10 deletions src/problems/tsp/heuristics/local_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ UserCost LocalSearch::relocate_step() {

UserCost LocalSearch::perform_all_relocate_steps(const Deadline& deadline) {
UserCost total_gain = 0;
unsigned relocate_iter = 0;
UserCost gain = 0;
do {
if (deadline.has_value() && deadline.value() < utils::now()) {
Expand All @@ -217,7 +216,6 @@ UserCost LocalSearch::perform_all_relocate_steps(const Deadline& deadline) {

if (gain > 0) {
total_gain += gain;
++relocate_iter;
}
} while (gain > 0);

Expand Down Expand Up @@ -360,7 +358,6 @@ UserCost LocalSearch::avoid_loop_step() {

UserCost LocalSearch::perform_all_avoid_loop_steps(const Deadline& deadline) {
UserCost total_gain = 0;
unsigned relocate_iter = 0;
UserCost gain = 0;
do {
if (deadline.has_value() && deadline.value() < utils::now()) {
Expand All @@ -371,7 +368,6 @@ UserCost LocalSearch::perform_all_avoid_loop_steps(const Deadline& deadline) {

if (gain > 0) {
total_gain += gain;
++relocate_iter;
}
} while (gain > 0);

Expand Down Expand Up @@ -619,7 +615,6 @@ UserCost LocalSearch::asym_two_opt_step() {

UserCost LocalSearch::perform_all_two_opt_steps(const Deadline& deadline) {
UserCost total_gain = 0;
unsigned two_opt_iter = 0;
UserCost gain = 0;
do {
if (deadline.has_value() && deadline.value() < utils::now()) {
Expand All @@ -630,7 +625,6 @@ UserCost LocalSearch::perform_all_two_opt_steps(const Deadline& deadline) {

if (gain > 0) {
total_gain += gain;
++two_opt_iter;
}
} while (gain > 0);

Expand All @@ -639,7 +633,6 @@ UserCost LocalSearch::perform_all_two_opt_steps(const Deadline& deadline) {

UserCost LocalSearch::perform_all_asym_two_opt_steps(const Deadline& deadline) {
UserCost total_gain = 0;
unsigned two_opt_iter = 0;
UserCost gain = 0;
do {
if (deadline.has_value() && deadline.value() < utils::now()) {
Expand All @@ -650,7 +643,6 @@ UserCost LocalSearch::perform_all_asym_two_opt_steps(const Deadline& deadline) {

if (gain > 0) {
total_gain += gain;
++two_opt_iter;
}
} while (gain > 0);

Expand Down Expand Up @@ -751,7 +743,6 @@ UserCost LocalSearch::or_opt_step() {

UserCost LocalSearch::perform_all_or_opt_steps(const Deadline& deadline) {
UserCost total_gain = 0;
unsigned or_opt_iter = 0;
UserCost gain = 0;
do {
if (deadline.has_value() && deadline.value() < utils::now()) {
Expand All @@ -761,7 +752,6 @@ UserCost LocalSearch::perform_all_or_opt_steps(const Deadline& deadline) {
gain = this->or_opt_step();
if (gain > 0) {
total_gain += gain;
++or_opt_iter;
}
} while (gain > 0);

Expand Down
2 changes: 2 additions & 0 deletions src/routing/libosrm_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ All rights reserved (see LICENSE).
*/

#include <cstdint>

#include "osrm/coordinate.hpp"
#include "osrm/json_container.hpp"
#include "osrm/route_parameters.hpp"
Expand Down

0 comments on commit 66509df

Please sign in to comment.