Kokkos Core Kernels Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
Kokkos::StaticCrsGraph< DataType, Arg1Type, Arg2Type, Arg3Type, SizeType > Class Template Reference

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...
 

Detailed Description

template<class DataType, class Arg1Type, class Arg2Type = void, class Arg3Type = void, typename SizeType = typename ViewTraits<DataType*, Arg1Type, Arg2Type, Arg3Type>::size_type>
class Kokkos::StaticCrsGraph< DataType, Arg1Type, Arg2Type, Arg3Type, SizeType >

Compressed row storage array.

Template Parameters
DataTypeThe 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.
Arg1TypeThe 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).
Arg2TypeThe third template parameter, which if provided corresponds to the Device type.
Arg3TypeThe third template parameter, which if provided corresponds to the MemoryTraits.
SizeTypeThe 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:

Definition at line 260 of file Kokkos_StaticCrsGraph.hpp.

Constructor & Destructor Documentation

template<class DataType, class Arg1Type, class Arg2Type = void, class Arg3Type = void, typename SizeType = typename ViewTraits<DataType*, Arg1Type, Arg2Type, Arg3Type>::size_type>
KOKKOS_INLINE_FUNCTION Kokkos::StaticCrsGraph< DataType, Arg1Type, Arg2Type, Arg3Type, SizeType >::StaticCrsGraph ( )
inline

Construct an empty view.

Definition at line 291 of file Kokkos_StaticCrsGraph.hpp.

template<class DataType, class Arg1Type, class Arg2Type = void, class Arg3Type = void, typename SizeType = typename ViewTraits<DataType*, Arg1Type, Arg2Type, Arg3Type>::size_type>
KOKKOS_INLINE_FUNCTION Kokkos::StaticCrsGraph< DataType, Arg1Type, Arg2Type, Arg3Type, SizeType >::StaticCrsGraph ( const StaticCrsGraph< DataType, Arg1Type, Arg2Type, Arg3Type, SizeType > &  rhs)
inline

Copy constructor (shallow copy).

Definition at line 295 of file Kokkos_StaticCrsGraph.hpp.

template<class DataType, class Arg1Type, class Arg2Type = void, class Arg3Type = void, typename SizeType = typename ViewTraits<DataType*, Arg1Type, Arg2Type, Arg3Type>::size_type>
KOKKOS_DEFAULTED_FUNCTION Kokkos::StaticCrsGraph< DataType, Arg1Type, Arg2Type, Arg3Type, SizeType >::~StaticCrsGraph ( )
default

Destroy this view of the array. If the last view then allocated memory is deallocated.

Member Function Documentation

template<class DataType, class Arg1Type, class Arg2Type = void, class Arg3Type = void, typename SizeType = typename ViewTraits<DataType*, Arg1Type, Arg2Type, Arg3Type>::size_type>
KOKKOS_INLINE_FUNCTION StaticCrsGraph& Kokkos::StaticCrsGraph< DataType, Arg1Type, Arg2Type, Arg3Type, SizeType >::operator= ( const StaticCrsGraph< DataType, Arg1Type, Arg2Type, Arg3Type, SizeType > &  rhs)
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.

template<class DataType, class Arg1Type, class Arg2Type = void, class Arg3Type = void, typename SizeType = typename ViewTraits<DataType*, Arg1Type, Arg2Type, Arg3Type>::size_type>
KOKKOS_INLINE_FUNCTION size_type Kokkos::StaticCrsGraph< DataType, Arg1Type, Arg2Type, Arg3Type, SizeType >::numRows ( ) const
inline

Return number of rows in the graph.

Definition at line 326 of file Kokkos_StaticCrsGraph.hpp.

template<class DataType, class Arg1Type, class Arg2Type = void, class Arg3Type = void, typename SizeType = typename ViewTraits<DataType*, Arg1Type, Arg2Type, Arg3Type>::size_type>
KOKKOS_INLINE_FUNCTION GraphRowViewConst<StaticCrsGraph> Kokkos::StaticCrsGraph< DataType, Arg1Type, Arg2Type, Arg3Type, SizeType >::rowConst ( const data_type  i) const
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.

template<class DataType, class Arg1Type, class Arg2Type = void, class Arg3Type = void, typename SizeType = typename ViewTraits<DataType*, Arg1Type, Arg2Type, Arg3Type>::size_type>
void Kokkos::StaticCrsGraph< DataType, Arg1Type, Arg2Type, Arg3Type, SizeType >::create_block_partitioning ( size_type  num_blocks,
size_type  fix_cost_per_row = 4 
)
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.


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