PGROUTING  2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ch_edge.cpp
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 File: ch_edge.cpp
3 
4 Generated with Template by:
5 Copyright (c) 2015 pgRouting developers
6 Mail: project@pgrouting.org
7 
8 Function's developer:
9 Copyright (c) 2016 Rohith Reddy
10 Mail:
11 
12 ------
13 
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
18 
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
23 
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 
28  ********************************************************************PGR-GNU*/
29 
30 #include "./ch_edge.h"
31 
32 namespace pgrouting {
33 
34 void
36  this->cost = other.cost;
37  this->id = other.id;
39 }
40 
41 
42 bool
44  return !m_contracted_vertices.empty();
45 }
46 
49  return m_contracted_vertices;
50 }
51 
52 
53 void
55  m_contracted_vertices += vid;
58 }
59 
60 void
64 }
65 
66 std::ostream& operator <<(std::ostream& os, const CH_edge& e) {
67  os << "{id: " << e.id << ",\t"
68  << "source: " << e.source << ",\t"
69  << "target: " << e.target << ",\t"
70  << "cost: " << e.cost << ",\t"
71  << "contracted vertices: "
72  << e.contracted_vertices()
73  << "}";
74  return os;
75 }
76 
77 } // namespace pgrouting
void clear_contracted_vertices()
Definition: ch_edge.h:56
const Identifiers< int64_t > & contracted_vertices() const
Definition: ch_edge.cpp:48
std::ostream & operator<<(std::ostream &log, const Basic_vertex &v)
bool has_contracted_vertices() const
Definition: ch_edge.cpp:43
void add_contracted_edge_vertices(CH_edge &e)
Definition: ch_edge.cpp:61
int64_t target
Definition: ch_edge.h:63
void add_contracted_vertex(CH_vertex &v, int64_t vid)
Definition: ch_edge.cpp:54
void clear_contracted_vertices()
Definition: ch_vertex.h:55
void cp_members(const CH_edge &other)
Definition: ch_edge.cpp:35
int64_t source
Definition: ch_edge.h:62
Identifiers< int64_t > m_contracted_vertices
Definition: ch_edge.h:67
bool empty() const
Returns true when the set is empty.
Definition: identifiers.hpp:58
const Identifiers< int64_t > & contracted_vertices() const
Definition: ch_vertex.cpp:39