Compare commits

...

17 Commits

Author SHA1 Message Date
nobody 71ed466d80 This commit was manufactured by cvs2svn to create tag
'Version_1_31_0'.

[SVN r22162]
2004-02-04 15:24:32 +00:00
Jeremy Siek a0c451569a changed iterator to const_iterator
[SVN r22136]
2004-02-02 14:25:51 +00:00
Jeremy Siek dfa3f853b0 changed to use std::set::find instead of std::find to fix performance bug
also change const_iterator to iterator to match the return type of
std::set::find in case the implementation does not provide conversion


[SVN r22082]
2004-01-30 14:31:56 +00:00
Jeremy Siek 7e1854a3e8 fixed figure reference
[SVN r22036]
2004-01-29 00:42:08 +00:00
Jeremy Siek 34fd4f8853 added -kb
[SVN r22035]
2004-01-29 00:38:05 +00:00
Jeremy Siek cf691e58b8 added binary
[SVN r22034]
2004-01-29 00:36:51 +00:00
Jeremy Siek e9f17367f5 changing to binary
[SVN r22033]
2004-01-29 00:36:50 +00:00
Jeremy Siek e65970e86a added as binary
[SVN r22032]
2004-01-29 00:30:11 +00:00
Jeremy Siek 07e8ab962b still trying to make binary
[SVN r22031]
2004-01-29 00:29:37 +00:00
Jeremy Siek b2719dfd07 fixed figure reference
[SVN r22030]
2004-01-29 00:25:19 +00:00
Vladimir Prus 1537480fae Remove unneeded files
[SVN r21947]
2004-01-26 08:29:41 +00:00
Vladimir Prus 4d8191e286 Merged 1.8 from trunk.
[SVN r21946]
2004-01-26 08:17:33 +00:00
Jeremy Siek 7a0890a753 Merged fixes
[SVN r21937]
2004-01-26 01:29:56 +00:00
Jeremy Siek a57125cf8d Merged fixes
[SVN r21936]
2004-01-26 01:21:50 +00:00
Jeremy Siek f03d5ae56a merged fix
[SVN r21871]
2004-01-21 20:40:21 +00:00
Vladimir Prus 99f82ff7e8 Merged 1.2 from trunk to RC_1_31_0.
[SVN r21491]
2004-01-05 06:56:52 +00:00
nobody 45082c1c24 This commit was manufactured by cvs2svn to create branch 'RC_1_31_0'.
[SVN r21427]
2003-12-30 12:10:04 +00:00
9 changed files with 52 additions and 139 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ representation of an undirected graph.
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 2:</STRONG> Adjacency List Representation of an Undirected Graph.</CAPTION>
<TR><TD><IMG SRC="./figs/undir-adj-matrix-graph2.gif" width="260" height="240"></TD>
<TD><IMG SRC="./figs/undir-adj-list2.gif" width="62" height="122"></TD></TR>
<TD><IMG SRC="./figs/undir-adj-list.gif" width="62" height="122"></TD></TR>
</TABLE>
</DIV><P></P>
+1 -1
View File
@@ -40,7 +40,7 @@ representation of a graph.
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG> Adjacency Matrix Representation of a Directed Graph.</CAPTION>
<TR><TD><IMG SRC="./figs/adj-matrix-graph3.gif" width="386" height="284"></TD>
<TD><IMG SRC="./figs/adj-matrix2.gif" width="135" height="136"></TD></TR>
<TD><IMG SRC="./figs/adj-matrix.gif" width="135" height="136"></TD></TR>
</TABLE>
</DIV><P></P>
+3 -3
View File
@@ -158,7 +158,7 @@ namespace boost {
{ }
void increment() {
++this->base();
++this->base_reference();
++m_targ;
}
@@ -212,12 +212,12 @@ namespace boost {
{
if (m_targ < m_src) // first half
{
++this->base();
++this->base_reference();
}
else
{ // second half
++m_inc;
this->base() += m_inc;
this->base_reference() += m_inc;
}
++m_targ;
}
+5 -4
View File
@@ -47,6 +47,7 @@
#include <boost/graph/named_function_params.hpp>
#include <boost/ref.hpp>
#include <boost/implicit_cast.hpp>
#include <vector>
#include <utility>
@@ -207,12 +208,12 @@ namespace boost {
} // namespace detail
template <class VertexListGraph, class DFSVisitor, class ColorMap,
class Vertex>
template <class VertexListGraph, class DFSVisitor, class ColorMap>
void
depth_first_search(const VertexListGraph& g, DFSVisitor vis, ColorMap color,
Vertex start_vertex)
typename graph_traits<VertexListGraph>::vertex_descriptor start_vertex)
{
typedef typename graph_traits<VertexListGraph>::vertex_descriptor Vertex;
function_requires<DFSVisitorConcept<DFSVisitor, VertexListGraph> >();
typedef typename property_traits<ColorMap>::value_type ColorValue;
typedef color_traits<ColorValue> Color;
@@ -222,7 +223,7 @@ namespace boost {
put(color, *ui, Color::white()); vis.initialize_vertex(*ui, g);
}
if (start_vertex != *vertices(g).first){ vis.start_vertex(start_vertex, g);
if (start_vertex != implicit_cast<Vertex>(*vertices(g).first)){ vis.start_vertex(start_vertex, g);
detail::depth_first_visit_impl(g, start_vertex, vis, color,
detail::nontruth2());
}
+18 -27
View File
@@ -1019,31 +1019,9 @@ namespace boost {
// Placement of these overloaded remove_edge() functions
// inside the class avoids a VC++ bug.
// O(E/V)
inline void
remove_edge(typename Config::edge_descriptor e)
{
typedef typename Config::graph_type graph_type;
graph_type& g = static_cast<graph_type&>(*this);
void
remove_edge(typename Config::edge_descriptor e);
typedef typename Config::OutEdgeList::value_type::property_type PType;
typename Config::OutEdgeList& out_el = g.out_edge_list(source(e, g));
typename Config::OutEdgeList::iterator out_i = out_el.begin();
for (; out_i != out_el.end(); ++out_i)
if (&(*out_i).get_property() == (PType*)e.get_property()) {
out_el.erase(out_i);
break;
}
typename Config::InEdgeList& in_el = in_edge_list(g, target(e, g));
typename Config::InEdgeList::iterator in_i = in_el.begin();
for (; in_i != in_el.end(); ++in_i)
if (&(*in_i).get_property() == (PType*)e.get_property()) {
g.m_edges.erase((*in_i).get_iter());
in_el.erase(in_i);
break;
}
}
inline void
remove_edge(typename Config::out_edge_iterator iter)
{
@@ -1065,7 +1043,17 @@ namespace boost {
detail::remove_edge_and_property(g, g.out_edge_list(u), v, Cat());
detail::erase_from_incidence_list(in_edge_list(g, v), u, Cat());
}
// O(E/V)
// O(E/V) or O(log(E/V))
template <class Config>
inline void
bidirectional_graph_helper_with_property<Config>::remove_edge(typename Config::edge_descriptor e)
{
typedef typename Config::graph_type graph_type;
graph_type& g = static_cast<graph_type&>(*this);
boost::remove_edge(source(e, g), target(e, g), *this);
}
// O(E/V) or O(log(E/V))
template <class EdgeOrIter, class Config>
inline void
remove_edge(EdgeOrIter e,
@@ -1333,9 +1321,12 @@ namespace boost {
boost::disallow_parallel_edge_tag) const
{
bool found;
/* According to the standard, this should be iterator, not const_iterator,
but the VC++ std::set::find() const returns const_iterator.
And since iterator should be convertible to const_iterator, the
following should work everywhere. -Jeremy */
typename Config::OutEdgeList::const_iterator
i = std::find(g.out_edge_list(u).begin(),
g.out_edge_list(u).end(), StoredEdge(v)),
i = g.out_edge_list(u).find(StoredEdge(v)),
end = g.out_edge_list(u).end();
found = (i != end);
if (found)
+17 -45
View File
@@ -3,8 +3,7 @@
# declared in <boost/graph/graphviz.hpp>. There are both directed
# and undirected graph versions of these functions. To use both, you
# will need to compile the code generated from graphviz_parser.y twice,
# once with -DGRAPHVIZ_GRAPH=boost::GraphvizDigraph and once with
# -DGRAPHVIZ_GRAPH=boost::GraphvizGraph.
# once with -DGRAPHVIZ_DIRECTED=0 and once with -DGRAPHVIZ_DIRECTED=1.
#
# This Makefile will most likely *not* work on your system.
# We have not yet had time to create a portable Makefile.
@@ -13,7 +12,7 @@
BOOST = ../../..
CXX = g++ -ftemplate-depth-30
CXX = g++ -ftemplate-depth-50
LEX = flex
YACC = bison
MV = /bin/mv
@@ -33,8 +32,6 @@ AR = ar
default: libbgl-viz.a libbgl-viz.so
.SUFFIXES: .cpp .o .l .y .c
OBJS = graphviz_graph_lex.o graphviz_digraph_lex.o graphviz_digraph_parser.o graphviz_graph_parser.o
libbgl-viz.a: $(OBJS)
@@ -47,8 +44,8 @@ libbgl-viz.so: $(OBJS)
ln -s $@.$(GRAPH_SONAME_VERSION) $@
# this next part is a bit strange. We compile graphviz_parser.cpp twice.
# Once with for undirected graphs with GRAPHVIZ_GRAPH=boost::GraphvizGraph
# and once for directed graphs with GRAPHVIZ_GRAPH=boost::GraphvizDigraph.
# Once with for undirected graphs with GRAPHVIZ_DIRECTED=0
# and once for directed graphs with GRAPHVIZ_DIRECTED=1.
graphviz_graph_parser.o: graphviz_graph_parser.cpp
$(CXX) -DGRAPHVIZ_DIRECTED=0 $(CXXFLAGS) -c graphviz_graph_parser.cpp -o graphviz_graph_parser.o
@@ -56,49 +53,24 @@ graphviz_graph_parser.o: graphviz_graph_parser.cpp
graphviz_digraph_parser.o: graphviz_digraph_parser.cpp
$(CXX) -DGRAPHVIZ_DIRECTED=1 $(CXXFLAGS) -c graphviz_digraph_parser.cpp -o graphviz_digraph_parser.o
graphviz_graph_lex.o: graphviz_graph_lex.cpp graphviz_parser.h
$(CXX) $(CXXFLAGS) -c graphviz_graph_lex.cpp
graphviz_graph_lex.o: graphviz_graph_lex.cpp graphviz_graph_parser.hpp
$(CXX) -DGRAPHVIZ_DIRECTED=0 $(CXXFLAGS) -c graphviz_graph_lex.cpp
graphviz_digraph_lex.o: graphviz_digraph_lex.cpp graphviz_parser.h
$(CXX) $(CXXFLAGS) -c graphviz_digraph_lex.cpp
graphviz_digraph_lex.o: graphviz_digraph_lex.cpp graphviz_digraph_parser.hpp
$(CXX) -DGRAPHVIZ_DIRECTED=1 $(CXXFLAGS) -c graphviz_digraph_lex.cpp
graphviz_graph_lex.cpp: graphviz_lex.l
$(LEX) graphviz_lex.l
rm -rf graphviz_graph_lex.cpp
sed -f ./sed-undir lex.yy.c > graphviz_graph_lex.cpp
graphviz_graph_lex.cpp: graphviz_lex.ll
$(LEX) -Pbgl_undir_ -ographviz_graph_lex.cpp graphviz_lex.ll
graphviz_digraph_lex.cpp: graphviz_lex.l
$(LEX) graphviz_lex.l
rm -rf graphviz_digraph_lex.cpp
sed -f ./sed-dir lex.yy.c > graphviz_digraph_lex.cpp
graphviz_digraph_lex.cpp: graphviz_lex.ll
$(LEX) -Pbgl_dir_ -ographviz_digraph_lex.cpp graphviz_lex.ll
graphviz_graph_parser.cpp: graphviz_parser.y
$(YACC) -p bgl_undir_ -d -v graphviz_parser.y
sed -f ./sed-undir graphviz_parser.tab.c > graphviz_graph_parser.cpp
graphviz_graph_parser.cpp graphviz_graph_parser.hpp: graphviz_parser.yy
$(YACC) -p bgl_undir_ -d -v -o graphviz_graph_parser.cpp graphviz_parser.yy
graphviz_digraph_parser.cpp: graphviz_parser.y
$(YACC) -p bgl_dir_ -d -v graphviz_parser.y
sed -f ./sed-dir graphviz_parser.tab.c > graphviz_digraph_parser.cpp
graphviz_parser.h: graphviz_digraph_parser.cpp
$(MV) graphviz_parser.tab.h graphviz_parser.h
dist:
mkdir -p ./tmp/graphviz/boost/boost/graph
cp boost/boost/graph/graphviz.hpp ./tmp/graphviz/boost/boost/graph
cp graphviz.grammar ./tmp/graphviz
cp graphviz_parser.cpp ./tmp/graphviz
cp graphviz_lex.cpp ./tmp/graphviz
cp graphviz_parser.h ./tmp/graphviz
cp graphviz_graph_type.h ./tmp/graphviz
cp graphviz_lex.l ./tmp/graphviz
cp graphviz_parser.y ./tmp/graphviz
cp graphviz.cpp ./tmp/graphviz
cp *.dot ./tmp/graphviz
cp Makefile ./tmp/graphviz
cd ./tmp; tar cvfz graphviz.tgz graphviz; $(MV) graphviz.tgz ..; cd ..
/bin/rm -rf ./tmp
graphviz_digraph_parser.cpp graphviz_digraph_parser.hpp: graphviz_parser.yy
$(YACC) -p bgl_dir_ -d -v -o graphviz_digraph_parser.cpp graphviz_parser.yy
clean:
/bin/rm -rf *.o *.a *.so* *.output graphviz_digraph_parser.cpp graphviz_graph_parser.cpp graphviz_lex.cpp graphviz_parser.h
/bin/rm -rf *.o *.a *.so* *.output graphviz_digraph_parser.cpp graphviz_digraph_parser.hpp graphviz_graph_parser.cpp graphviz_graph_parser.hpp graphviz_digraph_lex.cpp graphviz_graph_lex.cpp
-20
View File
@@ -1,20 +0,0 @@
s/yylex/bgl_dir_lex/g
s/yyerror/bgl_dir_error/g
s/yylval/bgl_dir_lval/g
s/yychar/bgl_dir_char/g
s/yydebug/bgl_dir_debug/g
s/yynerrs/bgl_dir_nerrs/g
s/yyin/bgl_dir_in/g
s/yyout/bgl_dir_out/g
s/yy_create_buffer/bgl_dir_create_buffer/g
s/yy_load_buffer_state/bgl_dir_load_buffer_state/g
s/yyrestart/bgl_dir_restart/g
s/yy_init_buffer/bgl_dir_init_buffer/g
s/yy_switch_to_buffer/bgl_dir_switch_to_buffer/g
s/yy_delete_buffer/bgl_dir_delete_buffer/g
s/yy_flush_buffer/bgl_dir_flush_buffer/g
s/yy_scan_buffer/bgl_dir_scan_buffer/g
s/yy_scan_string/bgl_dir_scan_string/g
s/yy_scan_bytes/bgl_dir_scan_bytes/g
s/yyleng/bgl_dir_leng/g
s/yytext/bgl_dir_text/g
-20
View File
@@ -1,20 +0,0 @@
s/yylex/bgl_undir_lex/g
s/yyerror/bgl_undir_error/g
s/yylval/bgl_undir_lval/g
s/yychar/bgl_undir_char/g
s/yydebug/bgl_undir_debug/g
s/yynerrs/bgl_undir_nerrs/g
s/yyin/bgl_undir_in/g
s/yyout/bgl_undir_out/g
s/yy_create_buffer/bgl_undir_create_buffer/g
s/yy_load_buffer_state/bgl_undir_load_buffer_state/g
s/yyrestart/bgl_undir_restart/g
s/yy_init_buffer/bgl_undir_init_buffer/g
s/yy_switch_to_buffer/bgl_undir_switch_to_buffer/g
s/yy_delete_buffer/bgl_undir_delete_buffer/g
s/yy_flush_buffer/bgl_undir_flush_buffer/g
s/yy_scan_buffer/bgl_undir_scan_buffer/g
s/yy_scan_string/bgl_undir_scan_string/g
s/yy_scan_bytes/bgl_undir_scan_bytes/g
s/yyleng/bgl_undir_leng/g
s/yytext/bgl_undir_text/g
+7 -18
View File
@@ -1,24 +1,15 @@
//=======================================================================
// Copyright 2002 Indiana University.
// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
//
// This file is part of the Boost Graph Library
// Copyright (c) 2003 Institute of Transport,
// Railway Construction and Operation,
// University of Hanover, Germany
//
// You should have received a copy of the License Agreement for the
// Boost Graph Library along with the software; see the file LICENSE.
// Author: Jürgen Hunold
//
// Permission to modify the code and to distribute modified code is
// granted, provided the text of this NOTICE is retained, a notice that
// the code was modified is included with the above COPYRIGHT NOTICE and
// with the COPYRIGHT NOTICE in the LICENSE file, and that the LICENSE
// file is distributed with the modified code.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.
// By way of example, but not limitation, Licensor MAKES NO
// REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY
// PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE COMPONENTS
// OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS
// OR OTHER RIGHTS.
//=======================================================================
#include <boost/config.hpp>
@@ -82,7 +73,6 @@ int main(int, char* [])
for (std::size_t k = 0; k < N; ++k)
add_vertex(current_vertex_id++, g);
// also need to test EdgeIterator graph constructor -JGS
mt19937 gen;
for (j=0; j < 10; ++j) {
@@ -111,7 +101,6 @@ int main(int, char* [])
print_edges2(g, vertex_id_map, edge_id_map);
print_graph(g, vertex_id_map);
std::cout << "finished printing" << std::endl;
// print_in_edges(g, vertex_id_map);
#endif
}
++E;