PGROUTING  3.2
pgrouting::functions::Pgr_LTDTree< G > Class Template Reference

#include "pgr_lengauerTarjanDominatorTree_driver.hpp"

Inheritance diagram for pgrouting::functions::Pgr_LTDTree< G >:
Collaboration diagram for pgrouting::functions::Pgr_LTDTree< G >:

Public Types

typedef G::E_i E_i
 
typedef G::V_i V_i
 
typedef G::V Vertex
 

Public Member Functions

void clear ()
 clear More...
 
std::string get_error () const
 get_error More...
 
std::string get_log () const
 get_log More...
 
std::string get_notice () const
 get_notice More...
 
bool has_error () const
 get_error More...
 
std::vector< pgr_ltdtree_rtpgr_ltdtree (G &graph, int64_t root)
 

Public Attributes

std::ostringstream error
 Stores the error information. More...
 
std::ostringstream log
 Stores the hint information. More...
 
std::ostringstream notice
 Stores the notice information. More...
 

Detailed Description

template<class G>
class pgrouting::functions::Pgr_LTDTree< G >

Definition at line 53 of file pgr_lengauerTarjanDominatorTree_driver.hpp.

Member Typedef Documentation

◆ E_i

template<class G >
typedef G::E_i pgrouting::functions::Pgr_LTDTree< G >::E_i

Definition at line 56 of file pgr_lengauerTarjanDominatorTree_driver.hpp.

◆ V_i

template<class G >
typedef G::V_i pgrouting::functions::Pgr_LTDTree< G >::V_i

Definition at line 57 of file pgr_lengauerTarjanDominatorTree_driver.hpp.

◆ Vertex

template<class G >
typedef G::V pgrouting::functions::Pgr_LTDTree< G >::Vertex

Definition at line 55 of file pgr_lengauerTarjanDominatorTree_driver.hpp.

Member Function Documentation

◆ clear()

void pgrouting::Pgr_messages::clear ( )
inherited

clear

Clears All the messages

Definition at line 59 of file pgr_messages.cpp.

59  {
60  log.str("");
61  log.clear();
62 
63  notice.str("");
64  notice.clear();
65 
66  error.str("");
67  error.clear();
68 }

References pgrouting::Pgr_messages::error, pgrouting::Pgr_messages::log, and pgrouting::Pgr_messages::notice.

Referenced by do_pgr_pickDeliver().

◆ get_error()

std::string pgrouting::Pgr_messages::get_error ( ) const
inherited

get_error

Returns
the current contents of the log and clears the log

Definition at line 53 of file pgr_messages.cpp.

53  {
54  auto str = error.str();
55  return str;
56 }

References pgrouting::Pgr_messages::error.

Referenced by do_pgr_many_withPointsDD(), do_pgr_pickDeliver(), do_pgr_pickDeliverEuclidean(), do_pgr_withPoints(), do_pgr_withPointsKsp(), and pgrouting::vrp::Pgr_pickDeliver::Pgr_pickDeliver().

◆ get_log()

std::string pgrouting::Pgr_messages::get_log ( ) const
inherited

◆ get_notice()

std::string pgrouting::Pgr_messages::get_notice ( ) const
inherited

get_notice

Returns
the current contents of the log and clears the log

Definition at line 42 of file pgr_messages.cpp.

42  {
43  auto str = notice.str();
44  return str;
45 }

References pgrouting::Pgr_messages::notice.

◆ has_error()

bool pgrouting::Pgr_messages::has_error ( ) const
inherited

get_error

Returns
the current contents of the log and clears the log

Definition at line 48 of file pgr_messages.cpp.

48  {
49  return !error.str().empty();
50 }

References pgrouting::Pgr_messages::error.

Referenced by do_pgr_many_withPointsDD(), do_pgr_withPoints(), and do_pgr_withPointsKsp().

◆ pgr_ltdtree()

template<class G >
std::vector<pgr_ltdtree_rt> pgrouting::functions::Pgr_LTDTree< G >::pgr_ltdtree ( G &  graph,
int64_t  root 
)
inline

Definition at line 58 of file pgr_lengauerTarjanDominatorTree_driver.hpp.

61  {
62  std::vector<pgr_ltdtree_rt> results;
63  std::vector<int64_t> idoms = std::vector<int64_t>(boost::num_vertices(graph.graph), -1);
64  auto dominatorTree =
65  make_iterator_property_map
66  (idoms.begin(), boost::get(boost::vertex_index, graph.graph));
67  /* abort in case of an interruption occurs (e.g. the query is being cancelled) */
68  CHECK_FOR_INTERRUPTS();
69  try {
70  // calling the boost function
71  boost::lengauer_tarjan_dominator_tree(graph.graph, graph.get_V(root), dominatorTree);
72  } catch (boost::exception const& ex) {
73  (void)ex;
74  throw;
75  } catch (std::exception &e) {
76  (void)e;
77  throw;
78  } catch (...) {
79  throw;
80  }
81 
82  V_i v, vend;
83  for (boost::tie(v, vend) = vertices(graph.graph); v != vend; ++v) {
84  int64_t vid = graph[*v].id;
85  results.push_back({vid, (idoms[*v] != -1 ? (idoms[*v]+1) : 0) });
86  }
87 
88  return results;
89  }

Referenced by do_pgr_LTDTree().

Member Data Documentation

◆ error

◆ log

◆ notice

std::ostringstream pgrouting::Pgr_messages::notice
mutableinherited

Stores the notice information.

Definition at line 83 of file pgr_messages.h.

Referenced by pgrouting::Pgr_messages::clear(), and pgrouting::Pgr_messages::get_notice().


The documentation for this class was generated from the following file:
pgrouting::Pgr_messages::error
std::ostringstream error
Stores the error information.
Definition: pgr_messages.h:85
pgrouting::Pgr_messages::log
std::ostringstream log
Stores the hint information.
Definition: pgr_messages.h:81
pgrouting::functions::Pgr_LTDTree::V_i
G::V_i V_i
Definition: pgr_lengauerTarjanDominatorTree_driver.hpp:57
pgrouting::Pgr_messages::notice
std::ostringstream notice
Stores the notice information.
Definition: pgr_messages.h:83