Amesos2 - Direct Sparse Solver Interfaces  Version of the Day
Static Public Member Functions | List of all members
Amesos2::Util::get_ccs_helper_kokkos_view< Matrix, KV_S, KV_GO, KV_GS > Struct Template Reference

A generic helper class for getting a CCS representation of a Matrix. More...

#include <Amesos2_Util.hpp>

Inherits Amesos2::Util::get_cxs_helper_kokkos_view< Matrix, KV_S, KV_GO, KV_GS, Op >.

Static Public Member Functions

static void do_get (const Teuchos::Ptr< const Matrix > mat, KV_S &nzvals, KV_GO &indices, KV_GS &pointers, typename KV_GS::value_type &nnz, EDistribution distribution, EStorage_Ordering ordering=ARBITRARY, typename KV_GO::value_type indexBase=0)
 
static void do_get (const Teuchos::Ptr< const Matrix > mat, KV_S &nzvals, KV_GO &indices, KV_GS &pointers, typename KV_GS::value_type &nnz, EDistribution distribution, EStorage_Ordering ordering=ARBITRARY)
 
static void do_get (const Teuchos::Ptr< const Matrix > mat, KV_S &nzvals, KV_GO &indices, KV_GS &pointers, typename KV_GS::value_type &nnz, const Teuchos::Ptr< const Tpetra::Map< typename Matrix::local_ordinal_t, typename Matrix::global_ordinal_t, typename Matrix::node_t > > map, EDistribution distribution, EStorage_Ordering ordering=ARBITRARY)
 

Detailed Description

template<class Matrix, typename KV_S, typename KV_GO, typename KV_GS>
struct Amesos2::Util::get_ccs_helper_kokkos_view< Matrix, KV_S, KV_GO, KV_GS >

A generic helper class for getting a CCS representation of a Matrix.

The template types S , GO , and GS (scalar, global ordinal, and global size type, respectively) are the types that you would like to get from the Matrix, regardless of what types are actually housed in the matrix. Type conversions will be performed when necessary.

Say for example that you have a matrix that has complex<double> scalar values, int global ordinals, and unsigned long size type, but your solver has a special complex data type that it defines and has size type int. As long as the Teuchos::ValueTypeConversionTraits class is specialized for conversion between the complex<double> and the solver's complex double type, then you can use this helper to help with this conversion. We assume that we want the global matrix representation at the root processor (Rooted), and the row indices can be in an arbitrary order (Arbitrary):

// with unsigned long size_t
typedef Tpetra::CrsMatrix<std::complex<double>, int, int> mat_t;
mat_t my_mat;
// initialize mt_mat
Array<solver_complex> nzvals(nnz);
Array<int> rowind(nnz);
Array<int> colptr(numcols+1);
get_ccs_helper<mat_t,solver_complex,int,int>::do_get(mat,nzvals,rowind,rowptr,nnz,Rooted,Arbitrary);
See Also
get_crs_helper

Member Function Documentation

template<class Matrix, typename KV_S, typename KV_GO, typename KV_GS, class Op>
static void Amesos2::Util::get_cxs_helper_kokkos_view< Matrix, KV_S, KV_GO, KV_GS, Op >::do_get ( const Teuchos::Ptr< const Matrix >  mat,
KV_S &  nzvals,
KV_GO &  indices,
KV_GS &  pointers,
typename KV_GS::value_type &  nnz,
EDistribution  distribution,
EStorage_Ordering  ordering = ARBITRARY 
)
inlinestaticinherited

Basic function overload that uses the matrix's row/col map as returned by Op::getMap().

template<class Matrix, typename KV_S, typename KV_GO, typename KV_GS, class Op>
static void Amesos2::Util::get_cxs_helper_kokkos_view< Matrix, KV_S, KV_GO, KV_GS, Op >::do_get ( const Teuchos::Ptr< const Matrix >  mat,
KV_S &  nzvals,
KV_GO &  indices,
KV_GS &  pointers,
typename KV_GS::value_type &  nnz,
const Teuchos::Ptr< const Tpetra::Map< typename Matrix::local_ordinal_t, typename Matrix::global_ordinal_t, typename Matrix::node_t > >  map,
EDistribution  distribution,
EStorage_Ordering  ordering = ARBITRARY 
)
inlinestaticinherited

Function overload that takes an explicit map to use for the representation's distribution.


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