20 template<
class K >
class EigenVector;
25 struct DenseMatVecTraits< Fem::EigenVector< K > >
27 typedef Fem::EigenVector< K > derived_type;
28 typedef Eigen::Matrix< K, Eigen::Dynamic, 1 > container_type;
30 typedef unsigned int size_type;
34 struct FieldTraits< Fem::EigenVector< K > >
36 typedef typename FieldTraits< K >::field_type field_type;
37 typedef typename FieldTraits< K >::real_type real_type;
49 class EigenVector :
public DenseVector< EigenVector< K > >
51 typedef EigenVector< K > ThisType;
52 typedef DenseVector< ThisType > BaseType;
55 typedef typename BaseType::size_type size_type;
56 typedef size_type SizeType;
57 typedef typename BaseType::value_type value_type;
58 typedef value_type FieldType;
59 typedef typename DenseMatVecTraits< ThisType >::container_type container_type;
60 typedef container_type DofStorageType;
63 explicit EigenVector( size_type
size = 0 )
68 EigenVector( size_type
size,
const value_type& s )
71 std::fill( data_.begin(), data_.end(), s );
76 EigenVector(
const DenseVector< T >& v )
79 std::copy( v.begin(), v.end(), data_.begin() );
83 EigenVector &operator=(
const EigenVector& other )
85 data_.resize( other.size() );
86 std::copy( other.begin(), other.end(), data_.begin() );
90 const value_type& operator[]( size_type index )
const
92 return data_( index );
95 value_type& operator[]( size_type index )
97 return data_( index );
101 const DofStorageType& coefficients()
const
107 DofStorageType& coefficients()
113 const value_type* data()
const
125 void reserve( size_type newSize )
127 data_.resize( newSize );
131 void resize( size_type newSize )
133 data_.resize( newSize );
137 void resize( size_type newSize,
const value_type& s )
139 data_.resize( newSize );
140 std::fill( data_.begin(), data_.end(), s );
143 size_type
size()
const
149 DofStorageType data_;
164 inline std::istream&
operator>>( std::istream& in, EigenVector< K >& v )
166 EigenVector< K > w(v);
167 for(
typename EigenVector< K >::size_type i = 0; i < w.size(); ++i )
Implements the dense vector interface, with an exchangeable storage class.
Type traits to determine the type of reals (when working with complex numbers)
Stream & operator>>(Stream &stream, std::tuple< Ts... > &t)
Read a std::tuple.
Definition: streamoperators.hh:43
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75