Changeset 21200 for lang/cplusplus/boostsupplement
 Timestamp:
 10/13/08 00:29:21 (7 years ago)
 Location:
 lang/cplusplus/boostsupplement/trunk
 Files:

 3 modified
Legend:
 Unmodified
 Added
 Removed

lang/cplusplus/boostsupplement/trunk/ChangeLog
r17469 r21200 1 20081012 Kenta Murata <mrkn@mrkn.jp> 2 3 * boost_supplement/graph/detail/line_input_iterator.hpp: 4 line_input_iterator::operator++ must return *this. 5 6 * boost_supplement/graph/read_lgl.hpp: change the name of the 7 member variables according to google coding standard. 8 9 20081010 Kenta Murata <mrkn@mrkn.jp> 10 11 * boost_supplement/graph/read_lgl.hpp (lgl_reader): VertexNameMap 12 and EdgeWeightMap are kept by now reference. 13 1 14 20080812 Kenta Murata <muraken@gmail.com> 2 15 
lang/cplusplus/boostsupplement/trunk/boost_supplement/graph/detail/line_input_iterator.hpp
r17466 r21200 66 66 { 67 67 if (in_ != 0) next_line(); 68 return *this; 68 69 } 69 70 … … 82 83 line_input_iterator<IS> const& b); 83 84 }; 84 85 }}86 85 87 86 template<class InputStream> … … 108 107 } 109 108 109 }} 110 110 111 #endif // ifndef BOOST_SUPPLEMENT_GRAPH_DETAIL_LINE_INPUT_ITERATOR_HPP_INCLUDED 
lang/cplusplus/boostsupplement/trunk/boost_supplement/graph/read_lgl.hpp
r17467 r21200 23 23 24 24 const boost::char_separator<char> SEP; 25 Graph* m_graph;26 VertexNameMap m_vnm;27 EdgeWeightMap m_ewm;28 NameVertexMap m_nvm;29 std::string m_base;25 Graph* graph_; 26 VertexNameMap* vnm_; 27 EdgeWeightMap* ewm_; 28 NameVertexMap nvm_; 29 std::string base_; 30 30 31 31 Vertex name_to_vertex(std::string const& n) 32 32 { 33 typename NameVertexMap::iterator i = m_nvm.find(n);34 if (i == m_nvm.end()) {35 Vertex u = add_vertex(* m_graph);36 m_vnm[u] = n;37 m_nvm[n] = u;33 typename NameVertexMap::iterator i = nvm_.find(n); 34 if (i == nvm_.end()) { 35 Vertex u = add_vertex(*graph_); 36 (*vnm_)[u] = n; 37 nvm_[n] = u; 38 38 return u; 39 39 } … … 55 55 return; 56 56 } 57 m_base= *tok_iter;57 base_ = *tok_iter; 58 58 } 59 59 else { 60 Vertex u = name_to_vertex( m_base);60 Vertex u = name_to_vertex(base_); 61 61 Vertex v = name_to_vertex(tok1); 62 62 if (tok_iter == tokens.end()) { 63 add_edge(u, v, * m_graph);63 add_edge(u, v, *graph_); 64 64 } 65 65 else { … … 67 67 double w = atof(tok2.c_str()); 68 68 // if (has_w && w > cutoff) continue; 69 add_edge(u, v, * m_graph);70 m_ewm[edge(u, v, *m_graph).first] = w;69 add_edge(u, v, *graph_); 70 (*ewm_)[edge(u, v, *graph_).first] = w; 71 71 } 72 72 } … … 74 74 75 75 public: 76 lgl_reader(Graph& g, VertexNameMap n, EdgeWeightMapw)76 lgl_reader(Graph& g, VertexNameMap& n, EdgeWeightMap& w) 77 77 : SEP(" "), 78 m_graph(&g),79 m_vnm(n),80 m_ewm(w),81 m_base("")78 graph_(&g), 79 vnm_(&n), 80 ewm_(&w), 81 base_("") 82 82 {} 83 83 … … 85 85 bool read(InputStream& is) 86 86 { 87 m_graph>clear();87 graph_>clear(); 88 88 for (line_input_iterator<InputStream> line_iter(is); 89 89 line_iter != line_input_iterator<InputStream>();