BpGraphReader

Declared in lemon/lgf_reader.h, in the group LEMON Graph Format; the same class on the Doxygen site.

template< typename BGR >
class BpGraphReader

LGF reader for bipartite graphs

This utility reads an LGF file.

It can be used almost the same way as GraphReader, but it reads the red and blue nodes from separate sections, and these sections can contain different set of maps.

The red and blue node maps are read from the corresponding sections. If a map is defined with the same name in both of these sections, then it can be read as a node map.

Reading Rules

template< typename Map >
inline BpGraphReader & nodeMap(
const std::string & caption,
Map & map
)

Node map reading rule.

Add a node map reading rule to the reader.

template< typename Map , typename Converter >
inline BpGraphReader & nodeMap(
const std::string & caption,
Map & map,
const Converter & converter = Converter()
)

Node map reading rule.

Add a node map reading rule with specialized converter to the reader.

template< typename Map >
inline BpGraphReader & redNodeMap(
const std::string & caption,
Map & map
)

Add a red node map reading rule to the reader.

template< typename Map , typename Converter >
inline BpGraphReader & redNodeMap(
const std::string & caption,
Map & map,
const Converter & converter = Converter()
)

Red node map reading rule.

Add a red node map node reading rule with specialized converter to the reader.

template< typename Map >
inline BpGraphReader & blueNodeMap(
const std::string & caption,
Map & map
)

Add a blue node map reading rule to the reader.

template< typename Map , typename Converter >
inline BpGraphReader & blueNodeMap(
const std::string & caption,
Map & map,
const Converter & converter = Converter()
)

Blue node map reading rule.

Add a blue node map reading rule with specialized converter to the reader.

template< typename Map >
inline BpGraphReader & edgeMap(
const std::string & caption,
Map & map
)

Edge map reading rule.

Add an edge map reading rule to the reader.

template< typename Map , typename Converter >
inline BpGraphReader & edgeMap(
const std::string & caption,
Map & map,
const Converter & converter = Converter()
)

Edge map reading rule.

Add an edge map reading rule with specialized converter to the reader.

template< typename Map >
inline BpGraphReader & arcMap(
const std::string & caption,
Map & map
)

Arc map reading rule.

Add an arc map reading rule to the reader.

template< typename Map , typename Converter >
inline BpGraphReader & arcMap(
const std::string & caption,
Map & map,
const Converter & converter = Converter()
)

Arc map reading rule.

Add an arc map reading rule with specialized converter to the reader.

template< typename Value >
inline BpGraphReader & attribute(
const std::string & caption,
Value & value
)

Attribute reading rule.

Add an attribute reading rule to the reader.

template< typename Value , typename Converter >
inline BpGraphReader & attribute(
const std::string & caption,
Value & value,
const Converter & converter = Converter()
)

Attribute reading rule.

Add an attribute reading rule with specialized converter to the reader.

inline BpGraphReader & node( const std::string & caption , Node & node )

Node reading rule.

Add a node reading rule to reader.

inline BpGraphReader & redNode( const std::string & caption , RedNode & node )

Red node reading rule.

Add a red node reading rule to reader.

inline BpGraphReader & blueNode( const std::string & caption , BlueNode & node )

Blue node reading rule.

Add a blue node reading rule to reader.

inline BpGraphReader & edge( const std::string & caption , Edge & edge )

Edge reading rule.

Add an edge reading rule to reader.

inline BpGraphReader & arc( const std::string & caption , Arc & arc )

Arc reading rule.

Add an arc reading rule to reader.

Select Section by Name

inline BpGraphReader & nodes( const std::string & caption )

Set @nodes section to be read.

inline BpGraphReader & edges( const std::string & caption )

Set @edges section to be read.

inline BpGraphReader & attributes( const std::string & caption )

Set @attributes section to be read.

Using Previously Constructed Node or Edge Set

template< typename Map >
inline BpGraphReader & useNodes( const Map & map )

Use previously constructed node set.

Use previously constructed node set, and specify the node label map.

template< typename Map , typename Converter >
inline BpGraphReader & useNodes(
const Map & map,
const Converter & converter = Converter()
)

Use previously constructed node set.

Use previously constructed node set, and specify the node label map and a functor which converts the label map values to std::string.

template< typename Map >
inline BpGraphReader & useEdges( const Map & map )

Use previously constructed edge set.

Use previously constructed edge set, and specify the edge label map.

template< typename Map , typename Converter >
inline BpGraphReader & useEdges(
const Map & map,
const Converter & converter = Converter()
)

Use previously constructed edge set.

Use previously constructed edge set, and specify the edge label map and a functor which converts the label map values to std::string.

inline BpGraphReader & skipNodes()

Skip the reading of node section.

Omit the reading of the node section. This implies that each node map reading rule will be abandoned, and the nodes of the graph will not be constructed, which usually cause that the edge set could not be read due to lack of node name could not be read due to lack of node name resolving. Therefore skipEdges() function should also be used, or useNodes() should be used to specify the label of the nodes.

inline BpGraphReader & skipEdges()

Skip the reading of edge section.

Omit the reading of the edge section. This implies that each edge map reading rule will be abandoned, and the edges of the graph will not be constructed.

Execution of the Reader

inline void run()

Start the batch processing.

This function starts the batch processing

Public Types

typedef BGR Graph

Public Functions

inline BpGraphReader( BGR & graph , std::istream & is = std::cin )

Constructor.

Construct an undirected graph reader, which reads from the given input stream.

inline BpGraphReader( BGR & graph , const std::string & fn )

Constructor.

Construct an undirected graph reader, which reads from the given file.

inline BpGraphReader( BGR & graph , const char * fn )

Constructor.

Construct an undirected graph reader, which reads from the given file.

inline ~BpGraphReader()

Destructor.

template< typename TBGR >
BpGraphReader< TBGR > bpGraphReader(
TBGR & graph,
const std::string & fn
)

Return a BpGraphReader class.

This function just returns a BpGraphReader class.

See also

bpGraphReader( TBGR & graph , std::istream & is )

template< typename TBGR >
BpGraphReader< TBGR > bpGraphReader( TBGR & graph , const char * fn )

Return a BpGraphReader class.

This function just returns a BpGraphReader class.

See also

bpGraphReader( TBGR & graph , std::istream & is )