KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
Classes | List of all members
Kratos::SparseGraph< TIndexType > Class Template Referencefinal

Short class definition. More...

#include <sparse_graph.h>

Collaboration diagram for Kratos::SparseGraph< TIndexType >:

Classes

class  const_iterator_adaptor
 

Public Member Functions

Life Cycle
 SparseGraph (IndexType N)
 
 SparseGraph ()
 Default constructor. More...
 
 SparseGraph (DataCommunicator &rComm)
 
 ~SparseGraph ()
 Destructor. More...
 
 SparseGraph (const SparseGraph &rOther)
 Copy constructor. More...
 
 SparseGraph (const std::vector< IndexType > &rSingleVectorRepresentation)
 
Operators
const DataCommunicatorGetComm () const
 
const DataCommunicatorpGetComm () const
 
IndexType Size () const
 
bool IsEmpty () const
 
bool Has (const IndexType I, const IndexType J) const
 
const GraphType::mapped_type & operator[] (const IndexType &Key) const
 
void Clear ()
 
void AddEntry (const IndexType RowIndex, const IndexType ColIndex)
 
template<class TContainerType >
void AddEntries (const IndexType RowIndex, const TContainerType &rColIndices)
 
template<class TIteratorType >
void AddEntries (const IndexType RowIndex, const TIteratorType &rColBegin, const TIteratorType &rColEnd)
 
template<class TContainerType >
void AddEntries (const TContainerType &rIndices)
 
template<class TContainerType >
void AddEntries (const TContainerType &rRowIndices, const TContainerType &rColIndices)
 
void AddEntries (SparseGraph &rOtherGraph)
 
void Finalize ()
 
const GraphTypeGetGraph () const
 
template<class TVectorType = DenseVector<IndexType>>
IndexType ExportCSRArrays (TVectorType &rRowIndices, TVectorType &rColIndices) const
 
IndexType ExportCSRArrays (Kratos::span< IndexType > &rRowIndices, Kratos::span< IndexType > &rColIndices) const =delete
 
IndexType ExportCSRArrays (IndexType *&pRowIndicesData, IndexType &rRowDataSize, IndexType *&pColIndicesData, IndexType &rColDataSize) const
 
std::vector< IndexTypeExportSingleVectorRepresentation () const
 
void AddFromSingleVectorRepresentation (const std::vector< IndexType > &rSingleVectorRepresentation)
 
Access
const_iterator_adaptor begin () const
 
const_iterator_adaptor end () const
 
Input and output
std::string Info () const
 Turn back information as a string. More...
 
void PrintInfo (std::ostream &rOStream) const
 Print information about this object. More...
 
void PrintData (std::ostream &rOStream) const
 Print object's data. More...
 

Type Definitions

typedef TIndexType IndexType
 
typedef std::map< IndexType, std::unordered_set< IndexType > > GraphType
 
typedef GraphType::const_iterator const_row_iterator
 
 KRATOS_CLASS_POINTER_DEFINITION (SparseGraph)
 Pointer definition of SparseGraph. More...
 

Private Operators

class Serializer
 

Detailed Description

template<class TIndexType = std::size_t>
class Kratos::SparseGraph< TIndexType >

Short class definition.

This class is designed to store a matrix graph, aimed at the fast construction of other sparse matrix formats (particularly CSR) IMPORTANT NOTE: it is BY DESIGN NOT threadsafe! (a graph should be computed in each thread and then merged)

Member Typedef Documentation

◆ const_row_iterator

template<class TIndexType = std::size_t>
typedef GraphType::const_iterator Kratos::SparseGraph< TIndexType >::const_row_iterator

◆ GraphType

template<class TIndexType = std::size_t>
typedef std::map<IndexType, std::unordered_set<IndexType> > Kratos::SparseGraph< TIndexType >::GraphType

◆ IndexType

template<class TIndexType = std::size_t>
typedef TIndexType Kratos::SparseGraph< TIndexType >::IndexType

Constructor & Destructor Documentation

◆ SparseGraph() [1/5]

template<class TIndexType = std::size_t>
Kratos::SparseGraph< TIndexType >::SparseGraph ( IndexType  N)
inline

◆ SparseGraph() [2/5]

template<class TIndexType = std::size_t>
Kratos::SparseGraph< TIndexType >::SparseGraph ( )
inline

Default constructor.

◆ SparseGraph() [3/5]

template<class TIndexType = std::size_t>
Kratos::SparseGraph< TIndexType >::SparseGraph ( DataCommunicator rComm)
inline

◆ ~SparseGraph()

template<class TIndexType = std::size_t>
Kratos::SparseGraph< TIndexType >::~SparseGraph ( )
inline

Destructor.

◆ SparseGraph() [4/5]

template<class TIndexType = std::size_t>
Kratos::SparseGraph< TIndexType >::SparseGraph ( const SparseGraph< TIndexType > &  rOther)
inline

Copy constructor.

◆ SparseGraph() [5/5]

template<class TIndexType = std::size_t>
Kratos::SparseGraph< TIndexType >::SparseGraph ( const std::vector< IndexType > &  rSingleVectorRepresentation)
inline

Member Function Documentation

◆ AddEntries() [1/5]

template<class TIndexType = std::size_t>
template<class TContainerType >
void Kratos::SparseGraph< TIndexType >::AddEntries ( const IndexType  RowIndex,
const TContainerType &  rColIndices 
)
inline

◆ AddEntries() [2/5]

template<class TIndexType = std::size_t>
template<class TIteratorType >
void Kratos::SparseGraph< TIndexType >::AddEntries ( const IndexType  RowIndex,
const TIteratorType &  rColBegin,
const TIteratorType &  rColEnd 
)
inline

◆ AddEntries() [3/5]

template<class TIndexType = std::size_t>
template<class TContainerType >
void Kratos::SparseGraph< TIndexType >::AddEntries ( const TContainerType &  rIndices)
inline

◆ AddEntries() [4/5]

template<class TIndexType = std::size_t>
template<class TContainerType >
void Kratos::SparseGraph< TIndexType >::AddEntries ( const TContainerType &  rRowIndices,
const TContainerType &  rColIndices 
)
inline

◆ AddEntries() [5/5]

template<class TIndexType = std::size_t>
void Kratos::SparseGraph< TIndexType >::AddEntries ( SparseGraph< TIndexType > &  rOtherGraph)
inline

◆ AddEntry()

template<class TIndexType = std::size_t>
void Kratos::SparseGraph< TIndexType >::AddEntry ( const IndexType  RowIndex,
const IndexType  ColIndex 
)
inline

◆ AddFromSingleVectorRepresentation()

template<class TIndexType = std::size_t>
void Kratos::SparseGraph< TIndexType >::AddFromSingleVectorRepresentation ( const std::vector< IndexType > &  rSingleVectorRepresentation)
inline

◆ begin()

template<class TIndexType = std::size_t>
const_iterator_adaptor Kratos::SparseGraph< TIndexType >::begin ( ) const
inline

◆ Clear()

template<class TIndexType = std::size_t>
void Kratos::SparseGraph< TIndexType >::Clear ( )
inline

◆ end()

template<class TIndexType = std::size_t>
const_iterator_adaptor Kratos::SparseGraph< TIndexType >::end ( ) const
inline

◆ ExportCSRArrays() [1/3]

template<class TIndexType = std::size_t>
IndexType Kratos::SparseGraph< TIndexType >::ExportCSRArrays ( IndexType *&  pRowIndicesData,
IndexType rRowDataSize,
IndexType *&  pColIndicesData,
IndexType rColDataSize 
) const
inline

◆ ExportCSRArrays() [2/3]

template<class TIndexType = std::size_t>
IndexType Kratos::SparseGraph< TIndexType >::ExportCSRArrays ( Kratos::span< IndexType > &  rRowIndices,
Kratos::span< IndexType > &  rColIndices 
) const
delete

◆ ExportCSRArrays() [3/3]

template<class TIndexType = std::size_t>
template<class TVectorType = DenseVector<IndexType>>
IndexType Kratos::SparseGraph< TIndexType >::ExportCSRArrays ( TVectorType &  rRowIndices,
TVectorType &  rColIndices 
) const
inline

◆ ExportSingleVectorRepresentation()

template<class TIndexType = std::size_t>
std::vector<IndexType> Kratos::SparseGraph< TIndexType >::ExportSingleVectorRepresentation ( ) const
inline

◆ Finalize()

template<class TIndexType = std::size_t>
void Kratos::SparseGraph< TIndexType >::Finalize ( )
inline

◆ GetComm()

template<class TIndexType = std::size_t>
const DataCommunicator& Kratos::SparseGraph< TIndexType >::GetComm ( ) const
inline

◆ GetGraph()

template<class TIndexType = std::size_t>
const GraphType& Kratos::SparseGraph< TIndexType >::GetGraph ( ) const
inline

◆ Has()

template<class TIndexType = std::size_t>
bool Kratos::SparseGraph< TIndexType >::Has ( const IndexType  I,
const IndexType  J 
) const
inline

◆ Info()

template<class TIndexType = std::size_t>
std::string Kratos::SparseGraph< TIndexType >::Info ( ) const
inline

Turn back information as a string.

◆ IsEmpty()

template<class TIndexType = std::size_t>
bool Kratos::SparseGraph< TIndexType >::IsEmpty ( ) const
inline

◆ KRATOS_CLASS_POINTER_DEFINITION()

template<class TIndexType = std::size_t>
Kratos::SparseGraph< TIndexType >::KRATOS_CLASS_POINTER_DEFINITION ( SparseGraph< TIndexType >  )

Pointer definition of SparseGraph.

◆ operator[]()

template<class TIndexType = std::size_t>
const GraphType::mapped_type& Kratos::SparseGraph< TIndexType >::operator[] ( const IndexType Key) const
inline

◆ pGetComm()

template<class TIndexType = std::size_t>
const DataCommunicator* Kratos::SparseGraph< TIndexType >::pGetComm ( ) const
inline

◆ PrintData()

template<class TIndexType = std::size_t>
void Kratos::SparseGraph< TIndexType >::PrintData ( std::ostream &  rOStream) const
inline

Print object's data.

◆ PrintInfo()

template<class TIndexType = std::size_t>
void Kratos::SparseGraph< TIndexType >::PrintInfo ( std::ostream &  rOStream) const
inline

Print information about this object.

◆ Size()

template<class TIndexType = std::size_t>
IndexType Kratos::SparseGraph< TIndexType >::Size ( ) const
inline

Friends And Related Function Documentation

◆ Serializer

template<class TIndexType = std::size_t>
friend class Serializer
friend

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