Skip to content
Snippets Groups Projects
Commit 4e05f9af authored by Max Kahnt's avatar Max Kahnt
Browse files

Add vector traits.

parent e3d13ea1
No related branches found
No related tags found
No related merge requests found
#ifndef DUNE_MATRIX_VECTOR_VECTORTRAITS_HH
#define DUNE_MATRIX_VECTOR_VECTORTRAITS_HH
#include <dune/common/fvector.hh>
#include <dune/istl/bvector.hh>
#include <dune/istl/multitypeblockvector.hh>
namespace Dune {
namespace MatrixVector {
/** \brief Class to identify vector types and extract information
*
* Specialize this class for all types that can be used like a vector.
*/
template <class T>
struct VectorTraits {
constexpr static bool isVector = false;
};
template <class K, int n>
struct VectorTraits<FieldVector<K, n>> {
constexpr static bool isVector = true;
};
template <class Block>
struct VectorTraits<BlockVector<Block>> {
constexpr static bool isVector = true;
};
} // end namespace MatrixVector
} // end namespace Dune
#endif // DUNE_MATRIX_VECTOR_VECTORTRAITS_HH
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment