Kokkos Core Kernels Package
Version of the Day
|
Compressed row storage array. More...
#include <Kokkos_StaticCrsGraph.hpp>
Public Member Functions | |
KOKKOS_INLINE_FUNCTION | StaticCrsGraph () |
Construct an empty view. More... | |
KOKKOS_INLINE_FUNCTION | StaticCrsGraph (const StaticCrsGraph &rhs) |
Copy constructor (shallow copy). More... | |
KOKKOS_INLINE_FUNCTION StaticCrsGraph & | operator= (const StaticCrsGraph &rhs) |
Assign to a view of the rhs array. If the old view is the last view then allocated memory is deallocated. More... | |
KOKKOS_DEFAULTED_FUNCTION | ~StaticCrsGraph ()=default |
Destroy this view of the array. If the last view then allocated memory is deallocated. More... | |
KOKKOS_INLINE_FUNCTION size_type | numRows () const |
Return number of rows in the graph. More... | |
KOKKOS_INLINE_FUNCTION GraphRowViewConst < StaticCrsGraph > | rowConst (const data_type i) const |
Return a const view of row i of the graph. More... | |
void | create_block_partitioning (size_type num_blocks, size_type fix_cost_per_row=4) |
Create a row partitioning into a given number of blocks balancing non-zeros + a fixed cost per row. More... | |
Compressed row storage array.
DataType | The type of stored entries. If a StaticCrsGraph is used as the graph of a sparse matrix, then this is usually an integer type, the type of the column indices in the sparse matrix. |
Arg1Type | The second template parameter, corresponding either to the Device type (if there are no more template parameters) or to the Layout type (if there is at least one more template parameter). |
Arg2Type | The third template parameter, which if provided corresponds to the Device type. |
Arg3Type | The third template parameter, which if provided corresponds to the MemoryTraits. |
SizeType | The type of row offsets. Usually the default parameter suffices. However, setting a nondefault value is necessary in some cases, for example, if you want to have a sparse matrices with dimensions (and therefore column indices) that fit in int , but want to store more than INT_MAX entries in the sparse matrix. |
A row has a range of entries:
row_map[i0] <= entry < row_map[i0+1]
0 <= i1 < row_map[i0+1] - row_map[i0]
entries( entry , i2 , i3 , ... );
entries( row_map[i0] + i1 , i2 , i3 , ... );
Definition at line 260 of file Kokkos_StaticCrsGraph.hpp.
|
inline |
Construct an empty view.
Definition at line 291 of file Kokkos_StaticCrsGraph.hpp.
|
inline |
Copy constructor (shallow copy).
Definition at line 295 of file Kokkos_StaticCrsGraph.hpp.
|
default |
Destroy this view of the array. If the last view then allocated memory is deallocated.
|
inline |
Assign to a view of the rhs array. If the old view is the last view then allocated memory is deallocated.
Definition at line 310 of file Kokkos_StaticCrsGraph.hpp.
|
inline |
Return number of rows in the graph.
Definition at line 326 of file Kokkos_StaticCrsGraph.hpp.
|
inline |
Return a const view of row i of the graph.
If row i does not belong to the graph, return an empty view.
The returned object view
implements the following interface:
view.length
is the number of entries in the row view.colidx(k)
returns a const reference to the column index of the k-th entry in the row k is not a column index; it just counts from 0 to view.length - 1
.
Users should not rely on the return type of this method. They should instead assign to 'auto'. That allows compile-time polymorphism for different kinds of sparse matrix formats (e.g., ELLPACK or Jagged Diagonal) that we may wish to support in the future.
Definition at line 355 of file Kokkos_StaticCrsGraph.hpp.
|
inline |
Create a row partitioning into a given number of blocks balancing non-zeros + a fixed cost per row.
Definition at line 371 of file Kokkos_StaticCrsGraph.hpp.