Loading...
Searching...
No Matches
Dune::Amg::MatrixGraph< M > Class Template Reference
Iterative Solvers Template Library (ISTL) » Iterative Solvers » Preconditioners » Parallel Algebraic Multigrid

The (undirected) graph of a matrix. More...

`#include <dune/istl/paamg/graph.hh>`

Inheritance diagram for Dune::Amg::MatrixGraph< M >:

## Classes

class | EdgeIteratorT
| Iterator over all edges starting from a vertex. More...
class | VertexIteratorT
| The vertex iterator type of the graph. More...

## Public Types

enum | { mutableMatrix = std::is_same<M, typename std::remove_const<M>::type>::value }
typedef M | Matrix
| The type of the matrix we are a graph for.
typedef std::remove_const< M >::type | MutableMatrix
| The mutable type of the matrix we are a graph for.
typedef M::block_type | Weight
| The type of the weights.
typedef M::size_type | VertexDescriptor
| The vertex descriptor.
typedef std::ptrdiff_t | EdgeDescriptor
| The edge descriptor.
typedef EdgeIteratorT< const MatrixGraph< Matrix > > | ConstEdgeIterator
| The constant edge iterator type.
typedef EdgeIteratorT< MatrixGraph< Matrix > > | EdgeIterator
| The mutable edge iterator type.
typedef VertexIteratorT< const MatrixGraph< Matrix > > | ConstVertexIterator
| The constant vertex iterator type.
typedef VertexIteratorT< MatrixGraph< Matrix > > | VertexIterator
| The mutable vertex iterator type.

## Public Member Functions

| MatrixGraph (Matrix &matrix)
| Constructor.
| ~MatrixGraph ()
| Destructor.
VertexIterator | begin ()
| Get an iterator over the vertices.
VertexIterator | end ()
| Get an iterator over the vertices.
ConstVertexIterator | begin () const
| Get an iterator over the vertices.
ConstVertexIterator | end () const
| Get an iterator over the vertices.
EdgeIterator | beginEdges (const VertexDescriptor &source)
| Get an iterator over the edges starting at a vertex.
EdgeIterator | endEdges (const VertexDescriptor &source)
| Get an iterator over the edges starting at a vertex.
ConstEdgeIterator | beginEdges (const VertexDescriptor &source) const
| Get an iterator over the edges starting at a vertex.
ConstEdgeIterator | endEdges (const VertexDescriptor &source) const
| Get an iterator over the edges starting at a vertex.
Matrix & | matrix ()
| Get the underlying matrix.
const Matrix & | matrix () const
| Get the underlying matrix.
std::size_t | noVertices () const
| Get the number of vertices in the graph.
VertexDescriptor | maxVertex () const
| Get the maximal vertex descriptor.
std::size_t | noEdges () const
| Get the number of edges in the graph.
EdgeDescriptor | findEdge (const VertexDescriptor &source, const VertexDescriptor &target) const
| Find the descriptor of an edge.

## Detailed Description

template<class M>
class Dune::Amg::MatrixGraph< M >

The (undirected) graph of a matrix.

The graph of a sparse matrix essentially describes the sparsity pattern (nonzero entries) of a matrix. It is assumed that the underlying sparsity pattern is symmetric, i.e if entry a_ij is present in the storage scheme of the matrix (i.e. nonzero) so is a_ji.

The matrix entries can be accessed as weights of the vertices and edges.

## Member Typedef Documentation

## ConstEdgeIterator

template<class M>

typedef EdgeIteratorT<const MatrixGraph<Matrix> > Dune::Amg::MatrixGraph< M >::ConstEdgeIterator

The constant edge iterator type.

## ConstVertexIterator

template<class M>

typedef VertexIteratorT<const MatrixGraph<Matrix> > Dune::Amg::MatrixGraph< M >::ConstVertexIterator

The constant vertex iterator type.

## EdgeDescriptor

template<class M>

typedef std::ptrdiff_t Dune::Amg::MatrixGraph< M >::EdgeDescriptor

The edge descriptor.

Each edge is identifies by exactly one descriptor.

## EdgeIterator

template<class M>

typedef EdgeIteratorT<MatrixGraph<Matrix> > Dune::Amg::MatrixGraph< M >::EdgeIterator

The mutable edge iterator type.

## Matrix

template<class M>

typedef M Dune::Amg::MatrixGraph< M >::Matrix

The type of the matrix we are a graph for.

## MutableMatrix

template<class M>

typedef std::remove_const<M>::type Dune::Amg::MatrixGraph< M >::MutableMatrix

The mutable type of the matrix we are a graph for.

## VertexDescriptor

template<class M>

typedef M::size_type Dune::Amg::MatrixGraph< M >::VertexDescriptor

The vertex descriptor.

Each descriptor describes exactly one vertex.

## VertexIterator

template<class M>

typedef VertexIteratorT<MatrixGraph<Matrix> > Dune::Amg::MatrixGraph< M >::VertexIterator

The mutable vertex iterator type.

## Weight

template<class M>

typedef M::block_type Dune::Amg::MatrixGraph< M >::Weight

The type of the weights.

## Member Enumeration Documentation

## anonymous enum

template<class M>

anonymous enum

Enumerator
mutableMatrix |

## Constructor & Destructor Documentation

## MatrixGraph()

template<class M>

Dune::Amg::MatrixGraph< M >::MatrixGraph | ( | Matrix & | matrix | ) |

Constructor.

Parameters

  matrix | The matrix we are a graph for.

## ~MatrixGraph()

template<class M>

Dune::Amg::MatrixGraph< M >::~MatrixGraph | ( |  | ) |

Destructor.

## Member Function Documentation

## begin() [1/2]

template<class M>

VertexIterator Dune::Amg::MatrixGraph< M >::begin | ( |  | ) |

Get an iterator over the vertices.

Returns
  A vertex Iterator positioned at the first vertex.

## begin() [2/2]

template<class M>

ConstVertexIterator Dune::Amg::MatrixGraph< M >::begin | ( |  | ) | const

Get an iterator over the vertices.

Returns
  A vertex Iterator positioned at the first vertex.

## beginEdges() [1/2]

template<class M>

EdgeIterator Dune::Amg::MatrixGraph< M >::beginEdges | ( | const VertexDescriptor & | source | ) |

Get an iterator over the edges starting at a vertex.

Parameters

  source | The vertex where the edges should start.

Returns
  An edge iterator positioned at the first edge starting from vertex source.

## beginEdges() [2/2]

template<class M>

ConstEdgeIterator Dune::Amg::MatrixGraph< M >::beginEdges | ( | const VertexDescriptor & | source | ) | const

Get an iterator over the edges starting at a vertex.

Parameters

  source | The vertex where the edges should start.

Returns
  An edge iterator positioned at the first edge starting from vertex source.

## end() [1/2]

template<class M>

VertexIterator Dune::Amg::MatrixGraph< M >::end | ( |  | ) |

Get an iterator over the vertices.

Returns
  A vertex Iterator positioned behind the last vertex.

## end() [2/2]

template<class M>

ConstVertexIterator Dune::Amg::MatrixGraph< M >::end | ( |  | ) | const

Get an iterator over the vertices.

Returns
  A vertex Iterator positioned behind the last vertex.

## endEdges() [1/2]

template<class M>

EdgeIterator Dune::Amg::MatrixGraph< M >::endEdges | ( | const VertexDescriptor & | source | ) |

Get an iterator over the edges starting at a vertex.

Parameters

  source | The vertex where the edges should start.

Returns
  An edge iterator positioned behind the last edge starting from vertex source.

## endEdges() [2/2]

template<class M>

ConstEdgeIterator Dune::Amg::MatrixGraph< M >::endEdges | ( | const VertexDescriptor & | source | ) | const

Get an iterator over the edges starting at a vertex.

Parameters

  source | The vertex where the edges should start.

Returns
  An edge iterator positioned behind the last edge starting from vertex source.

## findEdge()

template<class M>

EdgeDescriptor Dune::Amg::MatrixGraph< M >::findEdge | ( | const VertexDescriptor & | source,
|  | const VertexDescriptor & | target ) const

Find the descriptor of an edge.

Parameters

  source | The source vertex of the edge we search for.
  target | The target vertex of the edge we search for.

Returns
  The edge we found or numeric_limits<EdgeIterator>::max() if it does not exist.

## matrix() [1/2]

template<class M>

Matrix & Dune::Amg::MatrixGraph< M >::matrix | ( |  | ) |

Get the underlying matrix.

Returns
  The matrix of the graph.

## matrix() [2/2]

template<class M>

const Matrix & Dune::Amg::MatrixGraph< M >::matrix | ( |  | ) | const

Get the underlying matrix.

Returns
  The matrix of the graph.

## maxVertex()

template<class M>

VertexDescriptor Dune::Amg::MatrixGraph< M >::maxVertex | ( |  | ) | const

Get the maximal vertex descriptor.

Returns
  The minimum value v such that for all vertices w in the graph w<v holds.

## noEdges()

template<class M>

std::size_t Dune::Amg::MatrixGraph< M >::noEdges | ( |  | ) | const

Get the number of edges in the graph.

## noVertices()

template<class M>

std::size_t Dune::Amg::MatrixGraph< M >::noVertices | ( |  | ) | const

Get the number of vertices in the graph.

The documentation for this class was generated from the following file:

- graph.hh