|
Template Numerical Library version\ main:0b2c40fb1
|
Specialization of GraphVertexView for dense adjacency matrices. More...
#include <TNL/Graphs/GraphVertexView.h>
Public Types | |
| using | Base = Matrices::DenseMatrixRowView< typename MatrixView::SegmentViewType, typename MatrixView::ValuesViewType > |
| Base type. | |
| using | ConstMatrixRowView = typename MatrixRowView::ConstRowView |
| using | ConstMatrixView = typename MatrixView::ConstViewType |
| Type of constant dense matrix view. | |
| using | ConstVertexView = GraphVertexView< ConstMatrixView, GraphType_ > |
| Type of the constant graph node view. | |
| using | IndexType |
| The type used for matrix elements indexing. | |
| using | MatrixRowView |
| using | MatrixView = Matrices::DenseMatrixView< Real, Device, Index, Organization > |
| Type of the dense matrix view. | |
| using | RealType |
| The type of matrix elements. | |
| using | SegmentViewType |
| Type representing matrix row format. | |
| using | ValuesViewType |
| Type of container view used for storing matrix elements values. | |
| using | VertexView = GraphVertexView< MatrixView, GraphType_ > |
| Type of the graph node view. | |
| Public Types inherited from TNL::Matrices::DenseMatrixRowView< Matrices::DenseMatrixView< Real, Device, Index, Organization >::SegmentViewType, Matrices::DenseMatrixView< Real, Device, Index, Organization >::ValuesViewType > | |
| using | ConstIteratorType |
| Type of constant iterator for the matrix row. | |
| using | ConstRowView |
| Type of constant sparse matrix row view. | |
| using | ConstValuesViewType |
| Type of constant container view used for storing the matrix elements values. | |
| using | IndexType |
| The type used for matrix elements indexing. | |
| using | IteratorType |
| Type of iterator for the matrix row. | |
| using | MatrixElementType |
| The type of related matrix element. | |
| using | RealType |
| The type of matrix elements. | |
| using | RowView |
| Type of dense matrix row view. | |
| using | SegmentViewType |
| Type representing matrix row format. | |
| using | ValuesViewType |
| Type of container view used for storing matrix elements values. | |
Public Member Functions | |
| __cuda_callable__ | GraphVertexView (const GraphVertexView &)=default |
| Copy constructor. | |
| __cuda_callable__ | GraphVertexView (const MatrixRowView &matrixRowView) |
| Constructs a vertex view from a matrix row view. | |
| __cuda_callable__ | GraphVertexView (const SegmentViewType &segmentView, const ValuesViewType &valuesView) |
| Constructs a vertex view from segment and values views. | |
| __cuda_callable__ | GraphVertexView (MatrixRowView &&matrixRowView) |
| Constructs a vertex view by moving from a matrix row view. | |
| __cuda_callable__ IndexType | getDegree () const |
| Returns the degree (number of edges) of this vertex. | |
| __cuda_callable__ RealType & | getEdgeWeight (IndexType edgeIndex) |
| Returns the weight of the edge at the given edge index (non-const version). | |
| __cuda_callable__ const RealType & | getEdgeWeight (IndexType edgeIndex) const |
| Returns the weight of the edge at the given edge index (const version). | |
| __cuda_callable__ IndexType | getTargetIndex (IndexType edgeIndex) const |
| Returns the target vertex index of the edge at the given edge index. | |
| __cuda_callable__ IndexType | getVertexIndex () const |
| Returns the index of this vertex in the graph. | |
| __cuda_callable__ void | setEdge (IndexType edgeIndex, IndexType target, const RealType &weight) |
| Sets both the target vertex and weight for an edge. | |
| __cuda_callable__ void | setEdgeWeight (IndexType edgeIndex, const RealType &weight) |
| Sets the weight of the edge at the given edge index. | |
| Public Member Functions inherited from TNL::Matrices::DenseMatrixRowView< Matrices::DenseMatrixView< Real, Device, Index, Organization >::SegmentViewType, Matrices::DenseMatrixView< Real, Device, Index, Organization >::ValuesViewType > | |
| __cuda_callable__ | DenseMatrixRowView (SegmentViewType segmentView, ValuesViewType values) |
| Constructor with segmentView and values. | |
| __cuda_callable__ IteratorType | begin () |
| Returns iterator pointing at the beginning of the matrix row. | |
| __cuda_callable__ ConstIteratorType | cbegin () const |
| Returns constant iterator pointing at the beginning of the matrix row. | |
| __cuda_callable__ ConstIteratorType | cend () const |
| Returns constant iterator pointing at the end of the matrix row. | |
| __cuda_callable__ IteratorType | end () |
| Returns iterator pointing at the end of the matrix row. | |
| __cuda_callable__ IndexType | getColumnIndex (IndexType localIdx) const |
| This method is only for compatibility with sparse matrix row. | |
| __cuda_callable__ IndexType | getRowIndex () const |
| Returns the matrix row index. | |
| __cuda_callable__ IndexType | getSize () const |
| Returns size of the matrix row, i.e. number of matrix elements in this row. | |
| __cuda_callable__ const RealType & | getValue (IndexType column) const |
| Returns constants reference to an element with given column index. | |
| __cuda_callable__ void | setElement (IndexType localIdx, IndexType column, const RealType &value) |
| Sets value of matrix element with given column index. | |
| __cuda_callable__ void | setValue (IndexType column, const RealType &value) |
| Sets value of matrix element with given column index. | |
Additional Inherited Members | |
| Protected Attributes inherited from TNL::Matrices::DenseMatrixRowView< Matrices::DenseMatrixView< Real, Device, Index, Organization >::SegmentViewType, Matrices::DenseMatrixView< Real, Device, Index, Organization >::ValuesViewType > | |
| SegmentViewType | segmentView |
| ValuesViewType | values |
Specialization of GraphVertexView for dense adjacency matrices.
This specialization is used when the graph stores its adjacency information using a dense matrix. In this case, edge indices correspond directly to target vertex indices, and all possible edges (for the vertex degree) are stored explicitly.
| Real | Type of edge weights. |
| Device | Device type (Host or Cuda). |
| Index | Type for indexing vertices and edges. |
| Organization | Dense matrix elements organization. |
| GraphType_ | Graph type for orientation information. |
| using TNL::Graphs::GraphVertexView< Matrices::DenseMatrixView< Real, Device, Index, Organization >, GraphType_ >::MatrixRowView |
|
inline |
Constructs a vertex view from segment and values views.
| segmentView | View of the matrix segment (row metadata). |
| valuesView | View of edge weights. |
|
inline |
Constructs a vertex view by moving from a matrix row view.
| matrixRowView | Matrix row view to move from. |
|
inline |
Constructs a vertex view from a matrix row view.
| matrixRowView | Matrix row view to copy from. |
|
inlinenodiscard |
Returns the degree (number of edges) of this vertex.
For dense matrices, this is the size of the row, which corresponds to the number of vertices in the graph.
|
inlinenodiscard |
Returns the weight of the edge at the given edge index (non-const version).
| edgeIndex | Index of the edge (0 to getDegree()-1). |
|
inlinenodiscard |
Returns the weight of the edge at the given edge index (const version).
| edgeIndex | Index of the edge (0 to getDegree()-1). |
|
inlinenodiscard |
Returns the target vertex index of the edge at the given edge index.
| edgeIndex | Index of the edge (0 to getDegree()-1). |
|
inlinenodiscard |
Returns the index of this vertex in the graph.
|
inline |
Sets both the target vertex and weight for an edge.
For dense matrices, the edge is identified by its target index, so the edgeIndex parameter is not used. This method sets the weight for the edge to the specified target vertex.
| edgeIndex | Edge index (it is ignored for dense adjacency matrices). |
| target | Target vertex index. |
| weight | New weight for the edge. |
|
inline |
Sets the weight of the edge at the given edge index.
| edgeIndex | Index of the edge (0 to getDegree()-1). |
| weight | New weight for the edge. |