Amesos2 - Direct Sparse Solver Interfaces  Version of the Day
Static Public Member Functions | List of all members
Amesos2::Util::get_ccs_helper< Matrix, S, GO, GS > Struct Template Reference

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

#include <Amesos2_Util.hpp>

Inheritance diagram for Amesos2::Util::get_ccs_helper< Matrix, S, GO, GS >:
Inheritance graph
[legend]
Collaboration diagram for Amesos2::Util::get_ccs_helper< Matrix, S, GO, GS >:
Collaboration graph
[legend]

Static Public Member Functions

static void do_get (const Teuchos::Ptr< const Matrix > mat, const ArrayView< S > nzvals, const ArrayView< GO > indices, const ArrayView< GS > pointers, GS &nnz, EDistribution distribution, EStorage_Ordering ordering=ARBITRARY, GO indexBase=0)
 
static void do_get (const Teuchos::Ptr< const Matrix > mat, const ArrayView< S > nzvals, const ArrayView< GO > indices, const ArrayView< GS > pointers, GS &nnz, EDistribution distribution, EStorage_Ordering ordering=ARBITRARY)
 
static void do_get (const Teuchos::Ptr< const Matrix > mat, const ArrayView< S > nzvals, const ArrayView< GO > indices, const ArrayView< GS > pointers, GS &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 S, typename GO, typename GS>
struct Amesos2::Util::get_ccs_helper< Matrix, S, GO, 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

static void Amesos2::Util::get_cxs_helper< Matrix, S, GO, GS, get_ccs_func< Matrix > >::do_get ( const Teuchos::Ptr< const Matrix >  mat,
const ArrayView< S >  nzvals,
const ArrayView< GO >  indices,
const ArrayView< GS >  pointers,
GS &  nnz,
EDistribution  distribution,
EStorage_Ordering  ordering = ARBITRARY 
)
inlinestaticinherited

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

static void Amesos2::Util::get_cxs_helper< Matrix, S, GO, GS, get_ccs_func< Matrix > >::do_get ( const Teuchos::Ptr< const Matrix >  mat,
const ArrayView< S >  nzvals,
const ArrayView< GO >  indices,
const ArrayView< GS >  pointers,
GS &  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: