---
name: "AdjacencyMatrixImport"
section: "3tulip"
platform: "linux"
package: "tulip-doc"
version: "3.1.2-2.3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/AdjacencyMatrixImport"
---

# AdjacencyMatrixImport(3tulip)

AdjacencyMatrixImport.cpp - Import a graph coded with matrix.

## NAME

AdjacencyMatrixImport -

**AdjacencyMatrixImport.cpp** - Import a graph coded with matrix.

## SYNOPSIS

### Public Member Functions

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

### Public Attributes

vector\< node \> **nodes**\

## Detailed Description

**AdjacencyMatrixImport.cpp** - Import a graph coded with matrix.

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 i==j we define the value of a node.

- •

  if i!=j we define a directed edge between node\[i\] and node\[j\]

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

**HISTORY**

Version 1.0: First version replace old adjacency matrix format included in Tulip (no more supported)

**TODO :**

Add tests in order to prevent bad file format.

**Author:**

David Auber University of Bordeaux I (LaBRI) France \
\
  Email:auber@tulip-software.org

**LICENCE**

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

## 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 & name)` [inline]`

## Member Data Documentation

### vector\<node\> AdjacencyMatrixImport::nodes

## Author

Generated automatically by Doxygen for Tulip Plugins Library from the source code.
