|
PGROUTING
3.2
|
Go to the documentation of this file.
41 const std::vector<double>
43 std::vector<double> result;
45 for (
size_t j = 0; j <
ids.size(); ++j) {
63 return dx * dx + dy * dy;
80 if (tour.
cities.empty())
return total_cost;
82 auto prev_id = tour.
cities.front();
83 for (
const auto &
id : tour.
cities) {
84 if (
id == tour.
cities.front())
continue;
97 for (
const auto &i :
ids) {
98 if (i ==
id)
return true;
105 for (
size_t pos = 0; pos <
ids.size(); ++pos) {
106 if (
ids[pos] ==
id)
return pos;
108 return ids.size() + 1;
120 const std::vector < Coordinate_t > &data_coordinates)
121 : coordinates(data_coordinates) {
125 {return lhs.id < rhs.id;});
132 ids.push_back(data.id);
134 std::sort(
ids.begin(),
ids.end());
136 auto total =
ids.size();
138 ids.erase(std::unique(
ids.begin(),
ids.end()),
ids.end());
158 for (
const auto id : matrix.
ids) {
163 log << row.id <<
"(" << row.x <<
"," << row.y <<
")\n";
std::vector< int64_t > ids
double comparable_distance(size_t i, size_t j) const
bool is_symmetric() const
const std::vector< double > get_row(size_t idx) const
returns a row of distances
double distance(size_t i, size_t j) const
#define pgassertwm(expr, msg)
Adds a message to the assertion.
#define pgassert(expr)
Uses the standard assert syntax.
std::ostream & operator<<(std::ostream &log, const Dmatrix &matrix)
std::vector< size_t > cities
size_t get_index(int64_t id) const
original id -> idx
An assert functionality that uses C++ throw().
int64_t get_id(size_t idx) const
idx -> original id
std::vector< Coordinate_t > coordinates
bool obeys_triangle_inequality() const
EuclideanDmatrix()=default
bool has_no_infinity() const
bool has_id(int64_t id) const
original id -> true
double tourCost(const Tour &tour) const
tour evaluation
Book keeping class for swapping orders between vehicles.