PGROUTING
3.2
|
#include "euclideanDmatrix.h"
Public Member Functions | |
EuclideanDmatrix ()=default | |
EuclideanDmatrix (const std::vector< Coordinate_t > &data_coordinates) | |
double | comparable_distance (size_t i, size_t j) const |
double | distance (size_t i, size_t j) const |
int64_t | get_id (size_t idx) const |
idx -> original id More... | |
size_t | get_index (int64_t id) const |
original id -> idx More... | |
const std::vector< double > | get_row (size_t idx) const |
returns a row of distances More... | |
bool | has_id (int64_t id) const |
original id -> true More... | |
bool | has_no_infinity () const |
bool | is_symmetric () const |
bool | obeys_triangle_inequality () const |
void | set (size_t i, size_t j, double dist) |
sets a special value for the distance(i,j) More... | |
size_t | size () const |
|idx| More... | |
double | tourCost (const Tour &tour) const |
tour evaluation More... | |
Protected Member Functions | |
void | set_ids () |
Protected Attributes | |
std::vector< int64_t > | ids |
Private Attributes | |
size_t | column |
std::vector< Coordinate_t > | coordinates |
size_t | row |
double | special_distance |
Friends | |
std::ostream & | operator<< (std::ostream &log, const EuclideanDmatrix &matrix) |
Definition at line 40 of file euclideanDmatrix.h.
|
default |
|
explicit |
double pgrouting::tsp::EuclideanDmatrix::comparable_distance | ( | size_t | i, |
size_t | j | ||
) | const |
Definition at line 55 of file euclideanDmatrix.cpp.
References column, coordinates, row, and special_distance.
Referenced by distance().
double pgrouting::tsp::EuclideanDmatrix::distance | ( | size_t | i, |
size_t | j | ||
) | const |
Definition at line 67 of file euclideanDmatrix.cpp.
References column, comparable_distance(), row, and special_distance.
Referenced by do_pgr_euclideanTSP(), get_row(), and tourCost().
int64_t pgrouting::tsp::EuclideanDmatrix::get_id | ( | size_t | idx | ) | const |
idx -> original id
[in] | idx | - index (i-th coordinate) |
Definition at line 112 of file euclideanDmatrix.cpp.
References ids.
Referenced by do_pgr_euclideanTSP().
size_t pgrouting::tsp::EuclideanDmatrix::get_index | ( | int64_t | id | ) | const |
original id -> idx
[in] | id | - original id |
Definition at line 104 of file euclideanDmatrix.cpp.
References ids.
Referenced by do_pgr_euclideanTSP().
const std::vector< double > pgrouting::tsp::EuclideanDmatrix::get_row | ( | size_t | idx | ) | const |
returns a row of distances
[in] | idx | row index |
Definition at line 42 of file euclideanDmatrix.cpp.
References distance(), ids, and pgassert.
bool pgrouting::tsp::EuclideanDmatrix::has_id | ( | int64_t | id | ) | const |
original id -> true
[in] | id | original id |
Definition at line 96 of file euclideanDmatrix.cpp.
References ids.
Referenced by do_pgr_euclideanTSP().
bool pgrouting::tsp::EuclideanDmatrix::has_no_infinity | ( | ) | const |
Definition at line 143 of file euclideanDmatrix.cpp.
bool pgrouting::tsp::EuclideanDmatrix::is_symmetric | ( | ) | const |
Definition at line 153 of file euclideanDmatrix.cpp.
bool pgrouting::tsp::EuclideanDmatrix::obeys_triangle_inequality | ( | ) | const |
Definition at line 148 of file euclideanDmatrix.cpp.
|
inline |
sets a special value for the distance(i,j)
[in] | i | - index in matrix |
[in] | j | - index in matrix |
[in] | dist | - distance from i to j & from j to i |
Definition at line 57 of file euclideanDmatrix.h.
References column, row, and special_distance.
Referenced by do_pgr_euclideanTSP().
|
protected |
Definition at line 129 of file euclideanDmatrix.cpp.
References coordinates, ids, and pgassertwm.
Referenced by EuclideanDmatrix().
|
inline |
|idx|
Definition at line 86 of file euclideanDmatrix.h.
References ids.
Referenced by do_pgr_euclideanTSP().
double pgrouting::tsp::EuclideanDmatrix::tourCost | ( | const Tour & | tour | ) | const |
tour evaluation
[in] | tour |
Definition at line 78 of file euclideanDmatrix.cpp.
References pgrouting::tsp::Tour::cities, and distance().
Referenced by do_pgr_euclideanTSP().
|
friend |
|
private |
Definition at line 117 of file euclideanDmatrix.h.
Referenced by comparable_distance(), distance(), and set().
|
private |
Definition at line 115 of file euclideanDmatrix.h.
Referenced by comparable_distance(), EuclideanDmatrix(), pgrouting::tsp::operator<<(), and set_ids().
|
protected |
Definition at line 112 of file euclideanDmatrix.h.
Referenced by get_id(), get_index(), get_row(), has_id(), pgrouting::tsp::operator<<(), set_ids(), and size().
|
private |
Definition at line 116 of file euclideanDmatrix.h.
Referenced by comparable_distance(), distance(), and set().
|
private |
Definition at line 118 of file euclideanDmatrix.h.
Referenced by comparable_distance(), distance(), and set().