Template Numerical Library version\ main:4e6e2c1
Loading...
Searching...
No Matches
TNL::Graphs::GraphBase< Value, Device, Index, Orientation, AdjacencyMatrixView_ > Struct Template Reference

Graph class represents a mathematical graph using an adjacency matrix. More...

#include <TNL/Graphs/GraphBase.h>

Inheritance diagram for TNL::Graphs::GraphBase< Value, Device, Index, Orientation, AdjacencyMatrixView_ >:
[legend]

Public Types

using AdjacencyMatrixView = AdjacencyMatrixView_
 Type of the adjacency matrix view.
using ConstAdjacencyMatrixView = typename AdjacencyMatrixView::ConstViewType
 Type of constant view of the adjacency matrix.
using ConstVertexView = typename VertexView::ConstVertexView
using DeviceType = Device
 Type of device where the graph will be operating.
using GraphOrientation = Orientation
 Type of the graph - directed or undirected.
using IndexType = Index
 Type for indexing of the graph nodes.
using ValueType = Value
 Type for weights of the graph edges.
using VertexView = GraphVertexView< AdjacencyMatrixView, Orientation >

Public Member Functions

 GraphBase ()=default
 Default constructor.
 GraphBase (const GraphBase &)=default
 Copy constructor.
 GraphBase (GraphBase &&)=default
 Move constructor.
 ~GraphBase ()=default
 Destructor.
__cuda_callable__ AdjacencyMatrixViewgetAdjacencyMatrixView ()
 Returns the view of adjacency matrix of the graph.
__cuda_callable__ const AdjacencyMatrixViewgetAdjacencyMatrixView () const
 Returns the constant view of adjacency matrix of the graph.
__cuda_callable__ IndexType getEdgeCount () const
 Returns the number of edges in the graph.
__cuda_callable__ ValueType getEdgeWeight (IndexType vertexIdx, IndexType edgeIdx) const
__cuda_callable__ VertexView getVertex (IndexType vertexIdx)
__cuda_callable__ ConstVertexView getVertex (IndexType vertexIdx) const
__cuda_callable__ IndexType getVertexCount () const
 Returns the number of nodes in the graph.
__cuda_callable__ IndexType getVertexDegree (IndexType nodeIdx) const
GraphBaseoperator= (const GraphBase &)=delete
 Copy-assignment operator.
GraphBaseoperator= (GraphBase &&)=delete
 Move-assignment operator.
bool operator== (const GraphBase &other) const
 Comparisons operator.
__cuda_callable__ void setEdgeWeight (IndexType vertexIdx, IndexType edgeIdx, const ValueType &value)

Static Public Member Functions

static std::string getSerializationType ()
 Returns the type of serialization used for the graph.
static constexpr bool isDirected ()
 Checks if the graph is directed.
static constexpr bool isUndirected ()
 Checks if the graph is undirected.

Protected Attributes

AdjacencyMatrixView adjacencyMatrixView

Detailed Description

template<typename Value, typename Device, typename Index, typename Orientation, typename AdjacencyMatrixView_>
struct TNL::Graphs::GraphBase< Value, Device, Index, Orientation, AdjacencyMatrixView_ >

Graph class represents a mathematical graph using an adjacency matrix.

Template Parameters
Matrixis type of matrix used to store the adjacency matrix of the graph.
GraphTypeis type of the graph - directed or undirected.

Member Function Documentation

◆ operator=() [1/2]

template<typename Value, typename Device, typename Index, typename Orientation, typename AdjacencyMatrixView_>
GraphBase & TNL::Graphs::GraphBase< Value, Device, Index, Orientation, AdjacencyMatrixView_ >::operator= ( const GraphBase< Value, Device, Index, Orientation, AdjacencyMatrixView_ > & )
delete

Copy-assignment operator.

Copy-assignment operator is deleted since it requires data allocation.

◆ operator=() [2/2]

template<typename Value, typename Device, typename Index, typename Orientation, typename AdjacencyMatrixView_>
GraphBase & TNL::Graphs::GraphBase< Value, Device, Index, Orientation, AdjacencyMatrixView_ >::operator= ( GraphBase< Value, Device, Index, Orientation, AdjacencyMatrixView_ > && )
delete

Move-assignment operator.

Move-assignment operator is deleted since it requires data allocation.


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