pgRouting  2.2
pgRouting extends the PostGIS / PostgreSQL geospatial database to provide geospatial routing functionality.
 All Classes Functions Variables Pages
Dmatrix.hpp
1 
2 #pragma once
3 
4 
5 #include "../../common/src/pgr_types.h"
6 
7 
8 #include <vector>
9 
10 
11 
12 class Dmatrix {
13  public:
14  typedef std::vector < std::vector < double > > Costs;
15  typedef std::vector < int64_t > Ids;
16 
17  Dmatrix() = default;
18  Dmatrix(const std::vector < Matrix_cell_t > &data_costs);
19 
20  bool has_no_infinity() const;
21 
22  bool obeys_triangle_inequality() const;
23  bool is_symetric() const;
24 
25  Dmatrix get_symetric() const;
26 
27  void set_ids(const std::vector<matrix_cell> &data_costs);
28 
29  size_t get_index(int64_t id) const;
30  int64_t get_id (size_t id) const;
31  size_t size() const {return ids.size();};
32  double max() const;
33  double pathCost(const Ids &path) const;
34  std::vector< double >& operator[] (size_t i) {return costs[i];}
35 
36  Costs costs;
37  Ids ids;
38 };
39