45 #ifndef AMESOS2_MATRIXTRAITS_HPP 
   46 #define AMESOS2_MATRIXTRAITS_HPP 
   48 #include "Amesos2_config.h" 
   50 #include <Tpetra_CrsMatrix.hpp> 
   53 #ifdef HAVE_AMESOS2_EPETRA 
   54 #  include <Epetra_RowMatrix.h> 
   55 #  include <Epetra_CrsMatrix.h> 
   57 #  include <Epetra_VbrMatrix.h> 
   66   template <
class Matrix>
 
   67   struct MatrixTraits {};
 
   73   template < 
typename Scalar,
 
   74              typename LocalOrdinal,
 
   75              typename GlobalOrdinal,
 
   78     Tpetra::RowMatrix<Scalar,
 
   82     typedef Scalar scalar_t;
 
   83     typedef LocalOrdinal local_ordinal_t;
 
   84     typedef GlobalOrdinal global_ordinal_t;
 
   87     typedef Tpetra::RowMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>  matrix_type;
 
   88     typedef typename matrix_type::local_matrix_type  local_matrix_t;
 
   89     typedef typename matrix_type::local_matrix_type::row_map_type::pointer_type  sparse_ptr_type;
 
   90     typedef typename matrix_type::local_matrix_type::index_type::pointer_type sparse_idx_type;
 
   91     typedef typename matrix_type::local_matrix_type::values_type::pointer_type sparse_values_type;
 
   93     typedef row_access major_access;
 
   96   template < 
typename Scalar,
 
   97              typename LocalOrdinal,
 
   98              typename GlobalOrdinal,
 
  101     Tpetra::CrsMatrix<Scalar,
 
  105     typedef Scalar scalar_t;
 
  106     typedef LocalOrdinal local_ordinal_t;
 
  107     typedef GlobalOrdinal global_ordinal_t;
 
  110     typedef Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>  matrix_type;
 
  111     typedef typename matrix_type::local_matrix_type  local_matrix_t;
 
  112     typedef typename matrix_type::local_matrix_type::row_map_type::pointer_type  sparse_ptr_type;
 
  113     typedef typename matrix_type::local_matrix_type::index_type::pointer_type sparse_idx_type;
 
  114     typedef typename matrix_type::local_matrix_type::values_type::pointer_type sparse_values_type;
 
  116     typedef row_access major_access;
 
  120 #ifdef HAVE_AMESOS2_EPETRA 
  123   struct MatrixTraits<Epetra_RowMatrix> {
 
  124     typedef double scalar_t;
 
  125     typedef int local_ordinal_t;
 
  126     typedef Tpetra::Map<>::global_ordinal_type global_ordinal_t;
 
  127     typedef Tpetra::Map<>::node_type node_t;
 
  129     typedef Epetra_RowMatrix matrix_type;
 
  130     typedef matrix_type local_matrix_t;
 
  131     typedef int* sparse_ptr_type;
 
  132     typedef int* sparse_idx_type;
 
  133     typedef double* sparse_values_type;
 
  135     typedef row_access major_access;
 
  139   struct MatrixTraits<Epetra_CrsMatrix> {
 
  140     typedef double scalar_t;
 
  141     typedef int local_ordinal_t;
 
  142     typedef Tpetra::Map<>::global_ordinal_type global_ordinal_t;
 
  143     typedef Tpetra::Map<>::node_type node_t;
 
  145     typedef Epetra_CrsMatrix matrix_type;
 
  146     typedef matrix_type local_matrix_t;
 
  147     typedef int* sparse_ptr_type;
 
  148     typedef int* sparse_idx_type;
 
  149     typedef double* sparse_values_type;
 
  151     typedef row_access major_access;
 
  165   struct MatrixTraits<Epetra_VbrMatrix> {
 
  166     typedef double scalar_t;
 
  167     typedef int local_ordinal_t;
 
  168     typedef Tpetra::Map<>::global_ordinal_type global_ordinal_t;
 
  169     typedef Tpetra::Map<>::node_type node_t;
 
  171     typedef Epetra_VbrMatrix matrix_type;
 
  172     typedef matrix_type local_matrix_t;
 
  173     typedef int* sparse_ptr_type;
 
  174     typedef int* sparse_idx_type;
 
  175     typedef double* sparse_values_type;
 
  177     typedef row_access major_access;
 
  184 #endif  // AMESOS2_MATRIXTRAITS_HPP 
Utility functions for Amesos2.