|
|
using | ColumnIndexesViewType = typename Base::ColumnsIndexesViewType |
|
using | ConstMatrixRowView = typename MatrixRowView::ConstRowView |
|
using | ConstMatrixView = typename MatrixView::ConstViewType |
| | Type of constant sparse 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::SparseMatrixView< Real, Device, Index, MatrixType_, SegmentsView, ComputeRealType > |
| | Type of the sparse 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 the matrix elements values.
|
|
using | VertexView = GraphVertexView< MatrixView, GraphType_ > |
| | Type of the graph node view.
|
|
using | ColumnsIndexesViewType |
| | Type of container view used for storing the column indexes of the matrix elements.
|
|
using | ConstColumnsIndexesViewType |
| | Type of constant container view used for storing the column indexes of the matrix elements.
|
|
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 | GetValueConstResultType |
|
using | GetValueResultType |
|
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 sparse matrix row view.
|
|
using | SegmentViewType |
| | Type representing matrix row format.
|
|
using | ValuesViewType |
| | Type of container view used for storing the matrix elements values.
|
|
|
__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, const ColumnIndexesViewType &columnIndexesView) |
| | Constructs a vertex view from segment, values, and column index 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.
|
| __cuda_callable__ | SparseMatrixRowView (SegmentViewType segmentView, ValuesViewType values, ColumnsIndexesViewType columnIndexes) |
| | Constructor with segmentView, values and columnIndexes.
|
| __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__ const ColumnsIndexesViewType::ValueType & | getColumnIndex (IndexType localIdx) const |
| | Returns constants reference to a column index of an element with given rank in the row.
|
| __cuda_callable__ IndexType | getGlobalIndex (IndexType localIdx) const |
| | Computes the global index of the matrix element with given rank in the 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__ auto | getValue (IndexType localIdx) const -> GetValueConstResultType |
| | Returns constants reference to value of an element with given rank in the row.
|
| __cuda_callable__ bool | operator== (const SparseMatrixRowView< _SegmentView, _ValuesView, _ColumnsIndexesView > &other) const |
| | Comparison of two matrix rows.
|
| __cuda_callable__ void | setColumnIndex (IndexType localIdx, const IndexType &columnIndex) |
| | Sets a column index of matrix element with given rank in the matrix row.
|
| __cuda_callable__ void | setElement (IndexType localIdx, IndexType columnIndex, const RealType &value) |
| | Sets both a value and a column index of matrix element with given rank in the matrix row.
|
| __cuda_callable__ void | setValue (IndexType localIdx, const RealType &value) |
| | Sets a value of matrix element with given rank in the matrix row.
|
|
__cuda_callable__ void | sortColumnIndexes () |
| | Sort the matrix row by column indexes in ascending order.
|
template<typename Real, typename Device, typename Index, typename MatrixType_, template< typename Device_, typename Index_ > class SegmentsView, typename ComputeRealType, typename GraphType_>
struct TNL::Graphs::GraphVertexView< Matrices::SparseMatrixView< Real, Device, Index, MatrixType_, SegmentsView, ComputeRealType >, GraphType_ >
Specialization of GraphVertexView for sparse adjacency matrices.
This specialization is used when the graph stores its adjacency information using a sparse matrix. In this case, only the actual edges are stored, and edge indices are separate from target vertex indices. The sparse representation is more memory-efficient for graphs with few edges per vertex.
- Template Parameters
-
| Real | Type of edge weights. |
| Device | Device type (Host or Cuda). |
| Index | Type for indexing vertices and edges. |
| MatrixType_ | Matrix type for the sparse matrix. |
| SegmentsView | Segments view type for the sparse matrix. |
| ComputeRealType | Computation real type. |
| GraphType_ | Graph type for orientation information. |
template<typename Real, typename Device, typename Index, typename MatrixType_, template< typename Device_, typename Index_ > class SegmentsView, typename ComputeRealType, typename GraphType_>
Returns the degree (number of edges) of this vertex.
For sparse matrices, this counts only the valid edges (excluding padding entries). Padding entries are marked with paddingIndex and are not counted as real edges.
- Returns
- The vertex degree.
template<typename Real, typename Device, typename Index, typename MatrixType_, template< typename Device_, typename Index_ > class SegmentsView, typename ComputeRealType, typename GraphType_>
Sets both the target vertex and weight for an edge.
For sparse matrices, this method updates both the target vertex index and the edge weight at the specified edge index.
- Parameters
-
| edgeIndex | Index of the edge (0 to getDegree()-1). |
| target | New target vertex index. |
| weight | New weight for the edge. |