KokkosSparse::CooMatrix

Defined in header KokkosSparse_CooMatrix.hpp

template <class ScalarType, class OrdinalType, class Device, class MemoryTraits = void,
          class SizeType = typename Kokkos::ViewTraits<OrdinalType*, Device, void, void>::size_type>
class CooMatrix;

KokkosSparse::CooMatrix provides a COO (coordinate) implementation of a sparse matrix.

Template Parameters

ScalarType:

type of the values stored in the matrix.

OrdinalType:

type of the indices storied in the matrix (row and column indices).

Device:

type of the Kokkos::Device of the matrix

MemoryTraits:

type of Kokkos memory traits used for the views of the matrix.

SizeType:

unused.

Member Types

Member type

Definition

execution_space

Alias for Device::execution_space.

memory_space

Alias for Device::memory_space.

device_type

Device associated with the matrix.

ordinal_type

Type of the indices stored in the matrix, alias for OrdinalType.

row_type

Alias for ordinal_type.

column_type

Alias for ordinal_type.

size_type

Alias for SizeType.

memory_traits

Alias for MemoryTraits.

row_view

Type of the view storing the row indices.

column_view

Type of the view storing the column indices.

scalar_view

Type of the view storing the numerical values.

Member Functions

Name

Definition

constructor

Construct a CooMatrix from inputs, this can perform shallow or deep copies of input parameters depending on inputs and semantic.

numRows

Returns the number of rows in the matrix.

numCols

Returns the number of columns in the matrix.

setNumRows

Modify the number of rows in the matrix.

setNumCols

Modify the number of columns in the matrix.

nnz

Returns the number of structural non-zero values in the matrix (some of these might actually store zero).

row

Returns the row indices view.

col

Returns the column indices view.

data

Returns the scalar values view.

numRows

KOKKOS_INLINE_FUNCTION ordinal_type numRows() const;

Returns the number of rows in the matrix.

numCols

KOKKOS_INLINE_FUNCTION ordinal_type numCols() const;

Returns the number of columns in the matrix.

setNumRows

void setNumRows(ordinal_type r);

Modify the number of rows in the sparse matrix. This invalidates any algorithm handles which previously used this matrix.

setNumCols

void setNumCols(ordinal_type c);

Modify the number of columns in the sparse matrix. This invalidates any algorithm handles which previously used this matrix.

nnz

KOKKOS_INLINE_FUNCTION size_type nnz() const;

Returns the number of non-zero entries in the matrix.

row

KOKKOS_INLINE_FUNCTION size_type row() const;

Returns the row indices view.

col

KOKKOS_INLINE_FUNCTION size_type col() const;

Returns the column indices view.

data

KOKKOS_INLINE_FUNCTION size_type data() const;

Returns the scalar values view.