Amesos2 - Direct Sparse Solver Interfaces  Version of the Day
Amesos2::TypeMap< ConcreteSolver, Scalar > Struct Template Reference

Map types to solver-specific data-types and enums. More...

#include <Amesos2_TypeMap.hpp>

Inheritance diagram for Amesos2::TypeMap< ConcreteSolver, Scalar >:
Inheritance graph
[legend]

Detailed Description

template<template< class, class > class ConcreteSolver, typename Scalar>
struct Amesos2::TypeMap< ConcreteSolver, Scalar >

Map types to solver-specific data-types and enums.

Some direct linear sparse solvers have custom data types that are more commonly represented as other data types. For example, Superlu uses a custom doublecomplex data types to represent double-precision complex data. Such a scalar is more commonly represented by std::complex<double> . Superlu then also uses an enum class called Dtype to flag the data type for certain methods. Amesos2 uses TypeMap to easily access such data types.

This class can be template specialized for each Amesos2::Solver subclass and its supported types. This also provides a compile time check for whether a solver can handle a data type. It is up to the programmer/user to determine whether the data-type they have may be safely coerced to a type supported by the ConcreteSolver, perhaps with the help of Teuchos::as<>. Appropriate type conversions may be provided with through template specialization of Teuchos::as<>.

The default instance is empty, but specialized instances for each ConcreteSolver should contain at the minimum a typedef called type and other typedefs as appropriate for the ConcreteSolver's needs

Template Parameters
ConcreteSolverA Amesos2::Solver type for which these mappings hold
ScalarThe Scalar type that is being mapped

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