Public Member Functions | List of all members
mirtk::EdgeTable Class Reference

#include <EdgeTable.h>

Inheritance diagram for mirtk::EdgeTable:
Inheritance graph
Collaboration diagram for mirtk::EdgeTable:
Collaboration graph

Public Member Functions

virtual void Clear ()
 Clear edge table.
 
template<class IdType1 , class IdType2 >
int EdgeId (IdType1, IdType2) const
 
 EdgeTable (vtkDataSet *=nullptr)
 Construct edge table for given dataset.
 
 EdgeTable (const EdgeTable &)
 Copy constructor.
 
void GetAdjacentPoints (int, int &, const int *&) const
 Access list of adjacent nodes (thread-safe)
 
void GetAdjacentPoints (int, const int *&, const int *&) const
 Get start and end pointer into list of adjacent nodes (thread-safe)
 
template<class EdgeIdType , class IdType1 , class IdType2 >
bool GetEdge (EdgeIdType, IdType1 &ptId1, IdType2 &ptId2) const
 Get IDs of edge nodes (ptId1 < ptId2)
 
void Initialize (vtkDataSet *)
 Initialize edge table from given dataset.
 
template<class IdType1 , class IdType2 >
bool IsEdge (IdType1, IdType2) const
 Determine whether two nodes are connected by an edge.
 
int MaxNumberOfAdjacentPoints () const
 Get maximum number of adjacent points.
 
template<class IdType >
int NumberOfAdjacentPoints (IdType) const
 Get number of adjacent points.
 
int NumberOfPoints () const
 Number of nodes.
 
EdgeTableoperator= (const EdgeTable &)
 Assignment operator.
 
virtual ~EdgeTable ()
 Destructor.
 
- Public Member Functions inherited from mirtk::GenericSparseMatrix< int >
void ClearIndex ()
 Free memory needed for precomputed indices.
 
void Col (int, Entries &, bool=false)
 
Entries Col (int) const
 
int ColNNZ (int) const
 Number of non-zero entries in specified column.
 
EntryType ColSum (int) const
 
void Column (int, Entries &, bool=false)
 
Entries Column (int) const
 
EntryType ColumnSum (int) const
 
Vector Diag () const
 Get diagonal values.
 
void Diag (const Vector &d)
 Set diagonal to specified (non-zero) values.
 
void Diag (int d)
 Set diagonal to specified (non-zero) value.
 
int Eigenvalues (Vector &v, int k, const char *sigma="LM", int p=0, double tol=.0, int maxit=0, Vector *v0=NULL) const
 
int Eigenvectors (Matrix &E, int k, const char *sigma="LM", int p=0, double tol=.0, int maxit=0, Vector *v0=NULL) const
 
int Eigenvectors (Matrix &E, Vector &v, int k, const char *sigma="LM", int p=0, double tol=.0, int maxit=0, Vector *v0=NULL) const
 
 GenericSparseMatrix (StorageLayout=CCS)
 Default constructor.
 
 GenericSparseMatrix (int, int=0, StorageLayout=CCS)
 Construct sparse m x n matrix.
 
 GenericSparseMatrix (int, int, int, StorageLayout=CCS)
 Construct sparse m x n matrix with specified number of non-zero entries.
 
 GenericSparseMatrix (const GenericSparseMatrix< TOtherEntry > &)
 Copy constructor.
 
EntryType Get (int, int=-1) const
 Get value.
 
void GetCol (int, Entries &) const
 
void GetColumn (int, Entries &) const
 
void GetDiag (Vector &d) const
 Get diagonal values.
 
int GetRawData (int *&, int *&, int *&) const
 Get raw access to index and data arrays.
 
void GetRow (int, Entries &) const
 
void Index ()
 
void Initialize (int, int=0, int=0)
 Initialize sparse matrix.
 
void Initialize (int, int, Array< Entries > &, bool=false)
 Initialize sparse matrix given compressed rows (CRS) or columns (CCS)
 
void Initialize (int, int, Entries [], bool=false)
 Initialize sparse matrix given compressed rows (CRS) or columns (CCS)
 
bool IsSymmetric () const
 Whether this matrix is symmetric.
 
void Layout (StorageLayout)
 Change storage layout.
 
void MakeSymmetric (bool extent=false)
 
 mirtkAttributeMacro (int, Size)
 Number of allocated elements.
 
 mirtkPublicAttributeMacro (int, MaxNumberOfUnusedEntries)
 Maximum number of unused entries, i.e., (_Size - _NNZ)
 
 mirtkReadOnlyAttributeMacro (enum StorageLayout, Layout)
 Storage layout.
 
 mirtkReadOnlyAttributeMacro (int, Rows)
 Number of rows.
 
 mirtkReadOnlyAttributeMacro (int, Cols)
 Number of columns.
 
 mirtkReadOnlyAttributeMacro (int, NNZ)
 Number of non-zero entries.
 
void MultAv (EntryType [], EntryType []) const
 
EntryTypeoperator() (int, int=-1)
 
GenericSparseMatrix operator* (EntryType) const
 Multiply by a scalar.
 
GenericSparseMatrixoperator*= (EntryType)
 Multiply by a scalar in-place.
 
GenericSparseMatrix operator/ (EntryType) const
 Divide by a scalar.
 
GenericSparseMatrixoperator/= (EntryType)
 Divide by a scalar in-place.
 
GenericSparseMatrixoperator= (const GenericSparseMatrix< TOtherEntry > &)
 Assignment operator.
 
void Put (int, int, EntryType)
 
int * RawPointer (int=0)
 Get raw access to non-zero values.
 
const int * RawPointer (int=0) const
 Get raw access to non-zero values.
 
bool ReadMAT (const char *, const char *="A")
 
void RemoveZeros ()
 Remove any zero entries.
 
void Reserve (int)
 Reserve more memory.
 
void Row (int, Entries &, bool=false)
 
Entries Row (int) const
 
int RowNNZ (int) const
 Number of non-zero entries in specified row.
 
EntryType RowSum (int) const
 
GenericSparseMatrixScaleCol (int, EntryType)
 
GenericSparseMatrixScaleColumn (int, EntryType)
 
GenericSparseMatrixScaleRow (int, EntryType)
 
GenericSparseMatrix Sub (int, int, int, int) const
 Get non-zero entries of specified submatrix.
 
void Sub (int, int, const GenericSparseMatrix &)
 Set non-zero entries of specified submatrix.
 
int SubNNZ (int, int, int, int) const
 Number of non-zero entries in specified submatrix.
 
void Transpose (bool keep_layout=false)
 
bool WriteMAT (const char *, const char *="A") const
 
void WriteMFile (const char *, const char *="A") const
 
void Zero ()
 Set all non-zero entries to zero (i.e., remove)
 
virtual ~GenericSparseMatrix ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Object
virtual const char * NameOfClass () const =0
 Get name of class, which this object is an instance of.
 
virtual ParameterList Parameter () const
 Get parameter name/value pairs.
 
bool Parameter (const ParameterList &)
 Set parameters from name/value pairs.
 
virtual bool Set (const char *name, const char *value)
 
virtual ~Object ()
 Destructor.
 

Additional Inherited Members

- Public Types inherited from mirtk::GenericSparseMatrix< int >
typedef Array< EntryEntries
 List of non-zero entries.
 
typedef Pair< int, int > Entry
 Type of non-zero entry.
 
typedef int EntryType
 Type of matrix entry values.
 
enum  StorageLayout
 
- Static Public Member Functions inherited from mirtk::Object
static const char * NameOfType ()
 Get name of this class type.
 
- Protected Member Functions inherited from mirtk::GenericSparseMatrix< int >
void CheckEntries (Entries &) const
 Check non-zero entries, sort them, remove zero entries, and sum up duplicates.
 
void CopyAttributes (const GenericSparseMatrix< TOtherEntry > &)
 Copy other matrix, used by copy constructor and assignment operator only.
 
- Protected Member Functions inherited from mirtk::Object
template<typename... Args>
void Throw (ErrorType err, const char *func, Args... args) const
 
- Static Protected Member Functions inherited from mirtk::Object
template<typename... Args>
static void ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args)
 
- Protected Attributes inherited from mirtk::GenericSparseMatrix< int >
int * _Col
 
EntryType_Data
 Non-zero entries.
 
Array< int > * _Index
 
int * _Row
 

Detailed Description

Edge table / adjacency matrix

This class represents the adjacency matrix of point set nodes. It provides efficient access to the set of nodes adjacent to a given point. The non-zero entries stored in the sparse matrix are the one-based edge IDs such that sparse matrix entries are non-zero. To efficiently iterate all edges or a subset of these, use the thread-safe EdgeIterator.

Definition at line 44 of file EdgeTable.h.

Member Function Documentation

§ EdgeId()

template<class IdType1 , class IdType2 >
int mirtk::EdgeTable::EdgeId ( IdType1  ptId1,
IdType2  ptId2 
) const
inline

Get ID of undirected edge connecting two nodes

Returns
Zero-based edge ID or -1 if edge does not exist.

Definition at line 127 of file EdgeTable.h.


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