BpGraphWriter

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

template< typename BGR >
class BpGraphWriter

LGF writer for undirected bipartite graphs

This utility writes an LGF file.

It can be used almost the same way as GraphWriter, 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 written to the corresponding sections. The node maps are written to both of these sections with the same map name.

Warning

The values given to the node, arc, edge and attribute writing rules are kept by reference and read by run(), hence they have to exist until then: a temporary passed to a rule is destroyed at the end of the expression that passes it.

Writing Rules

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

Node map writing rule.

Add a node map writing rule to the writer.

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

Node map writing rule.

Add a node map writing rule with specialized converter to the writer.

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

Red node map writing rule.

Add a red node map writing rule to the writer.

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

Red node map writing rule.

Add a red node map writing rule with specialized converter to the writer.

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

Blue node map writing rule.

Add a blue node map writing rule to the writer.

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

Blue node map writing rule.

Add a blue node map writing rule with specialized converter to the writer.

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

Edge map writing rule.

Add an edge map writing rule to the writer.

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

Edge map writing rule.

Add an edge map writing rule with specialized converter to the writer.

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

Arc map writing rule.

Add an arc map writing rule to the writer.

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

Arc map writing rule.

Add an arc map writing rule with specialized converter to the writer.

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

Attribute writing rule.

Add an attribute writing rule to the writer.

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

Attribute writing rule.

Add an attribute writing rule with specialized converter to the writer.

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

Node writing rule.

Add a node writing rule to the writer.

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

Red node writing rule.

Add a red node writing rule to the writer.

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

Blue node writing rule.

Add a blue node writing rule to the writer.

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

Edge writing rule.

Add an edge writing rule to writer.

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

Arc writing rule.

Add an arc writing rule to writer.

Section Captions

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

Add an additional caption to the @red_nodes and @blue_nodes section.

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

Add an additional caption to the @edges section.

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

Add an additional caption to the @attributes section.

Skipping Section

inline BpGraphWriter & skipNodes()

Skip writing the node set.

The @red_nodes and @blue_nodes section will not be written to the stream.

inline BpGraphWriter & skipEdges()

Skip writing edge set.

The @edges section will not be written to the stream.

Execution of the Writer

inline void run()

Start the batch processing.

This function starts the batch processing.

inline std::ostream & ostream()

Give back the stream of the writer

Public Types

typedef BGR BpGraph

Public Functions

TEMPLATE_BPGRAPH_TYPEDEFS(BGR)
inline BpGraphWriter( const BGR & graph , std::ostream & os = std::cout )

Constructor.

Construct a bipartite graph writer, which writes to the given output stream.

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

Constructor.

Construct a bipartite graph writer, which writes to the given output file.

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

Constructor.

Construct a bipartite graph writer, which writes to the given output file.

inline ~BpGraphWriter()

Destructor.

template< typename TBGR >
BpGraphWriter< TBGR > bpGraphWriter(
const TBGR & graph,
const std::string & fn
)

Return a BpGraphWriter class.

This function just returns a BpGraphWriter class.

See also

graphWriter( const TBGR & graph , std::ostream & os )

template< typename TBGR >
BpGraphWriter< TBGR > bpGraphWriter(
const TBGR & graph,
const char * fn
)

Return a BpGraphWriter class.

This function just returns a BpGraphWriter class.

See also

graphWriter( const TBGR & graph , std::ostream & os )