My Project
Loading...
Searching...
No Matches
BpGraphWriter< BGR > Class Template Reference

Detailed Description

template<typename BGR>
class lemon::BpGraphWriter< BGR >

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.

#include <lemon/lgf_writer.h>

Public Member Functions

 BpGraphWriter (const BGR &graph, std::ostream &os=std::cout)
 Constructor.
 
 BpGraphWriter (const BGR &graph, const std::string &fn)
 Constructor.
 
 BpGraphWriter (const BGR &graph, const char *fn)
 Constructor.
 
 ~BpGraphWriter ()
 Destructor.
 
Writing Rules
template<typename Map >
BpGraphWriternodeMap (const std::string &caption, const Map &map)
 Node map writing rule.
 
template<typename Map , typename Converter >
BpGraphWriternodeMap (const std::string &caption, const Map &map, const Converter &converter=Converter())
 Node map writing rule.
 
template<typename Map >
BpGraphWriterredNodeMap (const std::string &caption, const Map &map)
 Red node map writing rule.
 
template<typename Map , typename Converter >
BpGraphWriterredNodeMap (const std::string &caption, const Map &map, const Converter &converter=Converter())
 Red node map writing rule.
 
template<typename Map >
BpGraphWriterblueNodeMap (const std::string &caption, const Map &map)
 Blue node map writing rule.
 
template<typename Map , typename Converter >
BpGraphWriterblueNodeMap (const std::string &caption, const Map &map, const Converter &converter=Converter())
 Blue node map writing rule.
 
template<typename Map >
BpGraphWriteredgeMap (const std::string &caption, const Map &map)
 Edge map writing rule.
 
template<typename Map , typename Converter >
BpGraphWriteredgeMap (const std::string &caption, const Map &map, const Converter &converter=Converter())
 Edge map writing rule.
 
template<typename Map >
BpGraphWriterarcMap (const std::string &caption, const Map &map)
 Arc map writing rule.
 
template<typename Map , typename Converter >
BpGraphWriterarcMap (const std::string &caption, const Map &map, const Converter &converter=Converter())
 Arc map writing rule.
 
template<typename Value >
BpGraphWriterattribute (const std::string &caption, const Value &value)
 Attribute writing rule.
 
template<typename Value , typename Converter >
BpGraphWriterattribute (const std::string &caption, const Value &value, const Converter &converter=Converter())
 Attribute writing rule.
 
BpGraphWriternode (const std::string &caption, const Node &node)
 Node writing rule.
 
BpGraphWriterredNode (const std::string &caption, const RedNode &node)
 Red node writing rule.
 
BpGraphWriterblueNode (const std::string &caption, const BlueNode &node)
 Blue node writing rule.
 
BpGraphWriteredge (const std::string &caption, const Edge &edge)
 Edge writing rule.
 
BpGraphWriterarc (const std::string &caption, const Arc &arc)
 Arc writing rule.
 
Section Captions
BpGraphWriternodes (const std::string &caption)
 Add an additional caption to the @red_nodes and @blue_nodes section.
 
BpGraphWriteredges (const std::string &caption)
 Add an additional caption to the @edges section.
 
BpGraphWriterattributes (const std::string &caption)
 Add an additional caption to the @attributes section.
 
Skipping Section
BpGraphWriterskipNodes ()
 Skip writing the node set.
 
BpGraphWriterskipEdges ()
 Skip writing edge set.
 
Execution of the Writer
void run ()
 Start the batch processing.
 
std::ostream & ostream ()
 Give back the stream of the writer.
 

Related Symbols

(Note that these are not member symbols.)

template<typename TBGR >
BpGraphWriter< TBGR > bpGraphWriter (const TBGR &graph, std::ostream &os)
 Return a BpGraphWriter class.
 
template<typename TBGR >
BpGraphWriter< TBGR > bpGraphWriter (const TBGR &graph, const std::string &fn)
 Return a BpGraphWriter class.
 
template<typename TBGR >
BpGraphWriter< TBGR > bpGraphWriter (const TBGR &graph, const char *fn)
 Return a BpGraphWriter class.
 

Constructor & Destructor Documentation

◆ BpGraphWriter() [1/3]

template<typename BGR >
BpGraphWriter ( const BGR & graph,
std::ostream & os = std::cout )
inline

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

◆ BpGraphWriter() [2/3]

template<typename BGR >
BpGraphWriter ( const BGR & graph,
const std::string & fn )
inline

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

◆ BpGraphWriter() [3/3]

template<typename BGR >
BpGraphWriter ( const BGR & graph,
const char * fn )
inline

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

Member Function Documentation

◆ nodeMap() [1/2]

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

Add a node map writing rule to the writer.

◆ nodeMap() [2/2]

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

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

◆ redNodeMap() [1/2]

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

Add a red node map writing rule to the writer.

◆ redNodeMap() [2/2]

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

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

◆ blueNodeMap() [1/2]

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

Add a blue node map writing rule to the writer.

◆ blueNodeMap() [2/2]

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

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

◆ edgeMap() [1/2]

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

Add an edge map writing rule to the writer.

◆ edgeMap() [2/2]

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

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

◆ arcMap() [1/2]

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

Add an arc map writing rule to the writer.

◆ arcMap() [2/2]

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

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

◆ attribute() [1/2]

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

Add an attribute writing rule to the writer.

◆ attribute() [2/2]

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

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

◆ node()

template<typename BGR >
BpGraphWriter & node ( const std::string & caption,
const Node & node )
inline

Add a node writing rule to the writer.

◆ redNode()

template<typename BGR >
BpGraphWriter & redNode ( const std::string & caption,
const RedNode & node )
inline

Add a red node writing rule to the writer.

◆ blueNode()

template<typename BGR >
BpGraphWriter & blueNode ( const std::string & caption,
const BlueNode & node )
inline

Add a blue node writing rule to the writer.

◆ edge()

template<typename BGR >
BpGraphWriter & edge ( const std::string & caption,
const Edge & edge )
inline

Add an edge writing rule to writer.

◆ arc()

template<typename BGR >
BpGraphWriter & arc ( const std::string & caption,
const Arc & arc )
inline

Add an arc writing rule to writer.

◆ nodes()

template<typename BGR >
BpGraphWriter & nodes ( const std::string & caption)
inline

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

◆ edges()

template<typename BGR >
BpGraphWriter & edges ( const std::string & caption)
inline

Add an additional caption to the @edges section.

◆ attributes()

template<typename BGR >
BpGraphWriter & attributes ( const std::string & caption)
inline

Add an additional caption to the @attributes section.

◆ skipNodes()

template<typename BGR >
BpGraphWriter & skipNodes ( )
inline

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

◆ skipEdges()

template<typename BGR >
BpGraphWriter & skipEdges ( )
inline

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

◆ run()

template<typename BGR >
void run ( )
inline

This function starts the batch processing.

◆ ostream()

template<typename BGR >
std::ostream & ostream ( )
inline

Give back the stream of the writer

Friends And Related Symbol Documentation

◆ bpGraphWriter() [1/2]

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

This function just returns a BpGraphWriter class.

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

◆ bpGraphWriter() [2/2]

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

This function just returns a BpGraphWriter class.

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