42 #ifndef STOKHOS_SYMMETRIC_DIAGONAL_SPEC_HPP
43 #define STOKHOS_SYMMETRIC_DIAGONAL_SPEC_HPP
45 #include "Kokkos_StaticCrsGraph.hpp"
62 template<
class ExecutionSpace >
69 KOKKOS_INLINE_FUNCTION
73 KOKKOS_INLINE_FUNCTION
74 unsigned matrix_offset(
const unsigned row ,
const unsigned column )
const
77 const int diag = (int) column - (
int) row ;
81 if ( ( 0 <= diag && diag < diag_count ) || ( diag <= - diag_count ) ) {
92 KOKKOS_INLINE_FUNCTION
114 template <
typename Device >
121 template<
typename MatrixValue ,
typename VectorValue >
122 KOKKOS_INLINE_FUNCTION
124 const MatrixValue * a ,
125 const VectorValue *
const x ,
126 VectorValue *
const y )
129 const size_type dim_half = ( dimension + 1 ) >> 1 ;
133 y[
j] += a[
j] * x[
j] ;
137 for (
size_type d = 1 ; d < dim_half ; ++d ) {
144 y[
j] += a[
j] * x[kx] + a[kxr] * x[kxr];
145 if ( dimension == ++kx ) kx = 0 ;
146 if ( dimension == ++kxr ) kxr = 0 ;
151 if ( ! ( dimension & 01 ) ) {
157 y[
j] += a[
j] * x[kx] ;
158 y[kx] += a[
j] * x[
j] ;
163 KOKKOS_INLINE_FUNCTION
static KOKKOS_INLINE_FUNCTION size_type matrix_size(const block_type &block)
static KOKKOS_INLINE_FUNCTION void apply(const block_type &block, const MatrixValue *a, const VectorValue *const x, VectorValue *const y)
KOKKOS_INLINE_FUNCTION unsigned matrix_size() const
Storage size for block coefficients.
KOKKOS_INLINE_FUNCTION unsigned matrix_offset(const unsigned row, const unsigned column) const
Storage location for the (row,column) entry.
SymmetricDiagonalSpec(const SymmetricDiagonalSpec &rhs)
Symmetric diagonal storage for a dense matrix.
execution_space::size_type size_type
SymmetricDiagonalSpec(const unsigned dim)
SymmetricDiagonalSpec< execution_space > block_type
KOKKOS_INLINE_FUNCTION unsigned dimension() const
Dimension of vector block.