Stokhos  Development
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
Stokhos::CrsProductTensor< ValueType, DeviceType > Class Template Reference

Sparse product tensor with replicated entries to provide subsets with a given coordinate. More...

#include <Stokhos_CrsProductTensor.hpp>

Public Types

typedef DeviceType device_type
 
typedef device_type::size_type size_type
 
typedef ValueType value_type
 

Public Member Functions

 CrsProductTensor (const CrsProductTensor &rhs)
 
CrsProductTensor & operator= (const CrsProductTensor &rhs)
 
KOKKOSARRAY_INLINE_FUNCTION size_type dimension () const
 Dimension of the tensor.
 
KOKKOSARRAY_INLINE_FUNCTION size_type entry_count () const
 Number of sparse entries.
 
KOKKOSARRAY_INLINE_FUNCTION size_type entry_maximum () const
 Maximum sparse entries for any coordinate.
 
KOKKOSARRAY_INLINE_FUNCTION size_type entry_begin (size_type i) const
 Begin entries with a coordinate 'i'.
 
KOKKOSARRAY_INLINE_FUNCTION size_type entry_end (size_type i) const
 End entries with a coordinate 'i'.
 
KOKKOSARRAY_INLINE_FUNCTION size_type num_entry (size_type i) const
 Number of entries with a coordinate 'i'.
 
KOKKOSARRAY_INLINE_FUNCTION const size_type & coord (const size_type entry, const size_type c) const
 Coordinates of an entry.
 
KOKKOSARRAY_INLINE_FUNCTION const size_type & coord (const size_type entry) const
 Coordinates of an entry.
 
KOKKOSARRAY_INLINE_FUNCTION const value_type & value (const size_type entry) const
 Value of an entry.
 
KOKKOSARRAY_INLINE_FUNCTION size_type num_non_zeros () const
 Number of non-zero's.
 
KOKKOSARRAY_INLINE_FUNCTION size_type num_flops () const
 Number flop's per multiply-add.
 

Static Public Member Functions

template<typename OrdinalType >
static CrsProductTensor create (const Stokhos::ProductBasis< OrdinalType, ValueType > &basis, const Stokhos::Sparse3Tensor< OrdinalType, ValueType > &Cijk, const Teuchos::ParameterList &params=Teuchos::ParameterList())
 

Detailed Description

template<typename ValueType, class DeviceType>
class Stokhos::CrsProductTensor< ValueType, DeviceType >

Sparse product tensor with replicated entries to provide subsets with a given coordinate.

This allows product tensor multiplication to be partitioned on a given coordinate values.

for ( size_type i = 0 ; i < p.dimension() ; ++i ) { y[i] = 0 ; for ( size_type e = p.entry_begin(i) ; e < p.entry_end(i) ; ++e ) { const size_type j = p.coord(e,0); const size_type k = p.coord(e,1); Scalar tmp = a[j] * x[k] ; if ( j != k ) tmp += a[k] * x[j] ; y[i] += p.value(e) * tmp ; } }


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