Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
Teuchos::MatrixMarket::Raw::GraphElement< Ordinal > Class Template Reference

Stores one entry of a sparse graph. More...

#include <Teuchos_MatrixMarket_Raw_Graph_Adder.hpp>

Public Member Functions

 GraphElement ()
 Default constructor: an invalid entry of the graph. More...
 
 GraphElement (const Ordinal i, const Ordinal j)
 Create a sparse graph entry at (i,j). More...
 
bool operator== (const GraphElement &rhs)
 Compare row and column indices. More...
 
bool operator!= (const GraphElement &rhs)
 Compare row and column indices. More...
 
bool operator< (const GraphElement &rhs) const
 Lexicographic order first by row index, then by column index. More...
 
Ordinal rowIndex () const
 Row index (zero-based) of this GraphElement. More...
 
Ordinal colIndex () const
 Column index (zero-based) of this GraphElement. More...
 

Detailed Description

template<class Ordinal>
class Teuchos::MatrixMarket::Raw::GraphElement< Ordinal >

Stores one entry of a sparse graph.

Author
Alicia Klinvex
Template Parameters
OrdinalThe type of indices of the sparse graph.

This class is mainly useful as an implementation detail of GraphAdder. We expose it to users only if they wish to convert the sparse graph read in by GraphAdder into a storage format other than CSR (compressed sparse row).

An array of Elements implements the so-called "array of structs" representation of a coordinate format sparse graph. A GraphElement has a row and column index (each of type Ordinal). Elements also have equality and ordering comparisons. The equality comparison only tests the row and column index, and is intended to simplify merging matrix entries with the same row and column indices. The ordering comparison means that std::sort of a sequence of Elements will put them in an order suitable for extracting the CSR (compressed sparse row) representation of the sparse graph.

Definition at line 54 of file Teuchos_MatrixMarket_Raw_Graph_Adder.hpp.

Constructor & Destructor Documentation

template<class Ordinal >
Teuchos::MatrixMarket::Raw::GraphElement< Ordinal >::GraphElement ( )
inline

Default constructor: an invalid entry of the graph.

Definition at line 57 of file Teuchos_MatrixMarket_Raw_Graph_Adder.hpp.

template<class Ordinal >
Teuchos::MatrixMarket::Raw::GraphElement< Ordinal >::GraphElement ( const Ordinal  i,
const Ordinal  j 
)
inline

Create a sparse graph entry at (i,j).

Definition at line 63 of file Teuchos_MatrixMarket_Raw_Graph_Adder.hpp.

Member Function Documentation

template<class Ordinal >
bool Teuchos::MatrixMarket::Raw::GraphElement< Ordinal >::operator== ( const GraphElement< Ordinal > &  rhs)
inline

Compare row and column indices.

Definition at line 67 of file Teuchos_MatrixMarket_Raw_Graph_Adder.hpp.

template<class Ordinal >
bool Teuchos::MatrixMarket::Raw::GraphElement< Ordinal >::operator!= ( const GraphElement< Ordinal > &  rhs)
inline

Compare row and column indices.

Definition at line 72 of file Teuchos_MatrixMarket_Raw_Graph_Adder.hpp.

template<class Ordinal >
bool Teuchos::MatrixMarket::Raw::GraphElement< Ordinal >::operator< ( const GraphElement< Ordinal > &  rhs) const
inline

Lexicographic order first by row index, then by column index.

Definition at line 77 of file Teuchos_MatrixMarket_Raw_Graph_Adder.hpp.

template<class Ordinal >
Ordinal Teuchos::MatrixMarket::Raw::GraphElement< Ordinal >::rowIndex ( ) const
inline

Row index (zero-based) of this GraphElement.

Definition at line 88 of file Teuchos_MatrixMarket_Raw_Graph_Adder.hpp.

template<class Ordinal >
Ordinal Teuchos::MatrixMarket::Raw::GraphElement< Ordinal >::colIndex ( ) const
inline

Column index (zero-based) of this GraphElement.

Definition at line 91 of file Teuchos_MatrixMarket_Raw_Graph_Adder.hpp.


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