Tulip Plugins
Public Member Functions | Public Attributes
AdjacencyMatrixImport Class Reference

List of all members.

Public Member Functions

 AdjacencyMatrixImport (AlgorithmContext context)
 ~AdjacencyMatrixImport ()
bool formatError (const char *s, int curLine)
bool import (const string &)

Public Attributes

vector< node > nodes

Detailed Description

This plugin enables to import a graph coded with a matrix

File format:

The input format of this plugin is an ascii file where each line represents a row of the matrix. In each row, cells must be separated by a space.

Let M(i,j) be a cell of the matrix :

If M(i,j) is real value (0, .0, -1, -1.0), it is stored in the viewMetric property of the graph.
If M(i,j) is a string, it is stored in the viewLabel property of the graph.
Use & to set the viewMetric and viewLabel properties of a node or edge in the same time. If M(i,j) == @ an edge will be created without value
If M(i,j) == # no edge will be created between node[i] and node[j]

EXEMPLE 1 :
A
# B
# # C
Define a graph with 3 nodes (with labels A B C) and without edge.

EXEMPLE 2 :
A
@ B
@ @ C
Define a simple complete graph with 3 nodes (with labels A B C) and no label (or value) on its edges

EXEMPLE 3 :
A # E & 5
@ B
# @ C
Define a graph with 3 nodes and 3 edges, the edge between A and C is named E and has the value 5


Constructor & Destructor Documentation

AdjacencyMatrixImport::AdjacencyMatrixImport ( AlgorithmContext  context) [inline]
AdjacencyMatrixImport::~AdjacencyMatrixImport ( ) [inline]

Member Function Documentation

bool AdjacencyMatrixImport::formatError ( const char *  s,
int  curLine 
) [inline]
bool AdjacencyMatrixImport::import ( const string &  ) [inline]

Member Data Documentation