Skip to content

Commit ed63dca

Browse files
committed
Rm dead code; Restore performance
1 parent 4374ef8 commit ed63dca

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

inst/include/TreeDist/cost_matrix.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ class CostMatrix {
269269
}
270270
return {min_val, submin_val, min_idx, submin_idx};
271271
}
272+
272273
};
273274

274275
} // namespace TreeDist

src/lap.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,17 @@ Rcpp::List lapjv(Rcpp::NumericMatrix &x, Rcpp::NumericVector &maxX) {
100100
);
101101
}
102102

103-
namespace {
104103
inline bool nontrivially_less_than(cost a, cost b) noexcept {
105104
return a + ((a > ROUND_PRECISION) ? 8 : 0) < b;
106105
}
107-
} // anonymous namespace
108106

109107
/* This function is the jv shortest augmenting path algorithm to solve the
110108
assignment problem */
111109
namespace TreeDist {
112110

111+
#if defined(__GNUC__) && !defined(__clang__)
112+
__attribute__((optimize("align-functions=64", "align-loops=16")))
113+
#endif
113114
cost lap(const lap_row dim,
114115
CostMatrix &input_cost,
115116
std::vector<lap_col> &rowsol,

0 commit comments

Comments
 (0)