4 #ifndef DUNE_FVECTOR_HH
5 #define DUNE_FVECTOR_HH
19 #if ! DUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD
20 #warning The FieldVector class exports its size by the enum member 'size'. \
21 This behavior is deprecated. In the future, 'size' will be a method, \
22 which puts it in compliance with the stl conventions. To enable the new behavior \
23 (and get rid of this warning), build your Dune with --enable-fieldvector-size-is-method. \
24 If you do need the vector size as an enum, use 'dimension'.
39 template<
class K,
int SIZE >
class FieldVector;
40 template<
class K,
int SIZE >
49 template<
class K,
int SIZE >
64 template<
typename C,
int SIZE>
75 template<
typename T,
int SIZE>
81 template<
typename T,
int SIZE,
int SIZE1>
93 template<
class K,
int SIZE >
95 public DenseVector< FieldVector<K,SIZE> >
98 typedef DenseVector< FieldVector<K,SIZE> > Base;
104 #if ! DUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD
142 assert(x.
size() == SIZE);
148 template<
class K1,
int SIZE1>
155 using Base::operator=;
162 void fill(
const K&
t)
164 for (
int i=0; i<SIZE; i++) _data[i]=t;
179 template<
class K,
int SIZE>
196 typedef K container_type;
197 typedef K value_type;
198 typedef size_t size_type;
204 class FieldVector<K, 1> :
205 public DenseVector< FieldVector<K,1> >
208 typedef DenseVector< FieldVector<K,1> > Base;
214 #if ! DUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD
235 dune_static_assert(((
bool)IsFieldVectorSizeCorrect<C,1>::value),
"FieldVectors do not match in dimension!");
236 assert(x.size() == 1);
263 operator K () {
return _data; }
266 operator K ()
const {
return _data; }
276 inline FieldVector<K,1>
operator+ (
const FieldVector<K,1>& a,
const K b)
283 inline FieldVector<K,1>
operator- (
const FieldVector<K,1>& a,
const K b)
290 inline FieldVector<K,1>
operator* (
const FieldVector<K,1>& a,
const K b)
297 inline FieldVector<K,1>
operator/ (
const FieldVector<K,1>& a,
const K b)
304 inline bool operator> (
const FieldVector<K,1>& a,
const K b)
311 inline bool operator>= (
const FieldVector<K,1>& a,
const K b)
318 inline bool operator< (const FieldVector<K,1>& a,
const K b)
325 inline bool operator<= (const FieldVector<K,1>& a,
const K b)
332 inline bool operator== (
const FieldVector<K,1>& a,
const K b)
339 inline bool operator!= (
const FieldVector<K,1>& a,
const K b)
348 inline FieldVector<K,1>
operator+ (
const K a,
const FieldVector<K,1>& b)
355 inline FieldVector<K,1>
operator- (
const K a,
const FieldVector<K,1>& b)
362 inline FieldVector<K,1>
operator* (
const K a,
const FieldVector<K,1>& b)
369 inline FieldVector<K,1>
operator/ (
const K a,
const FieldVector<K,1>& b)
376 inline bool operator> (
const K a,
const FieldVector<K,1>& b)
383 inline bool operator>= (
const K a,
const FieldVector<K,1>& b)
390 inline bool operator< (const K a, const FieldVector<K,1>& b)
397 inline bool operator<= (const K a, const FieldVector<K,1>& b)
404 inline bool operator== (
const K a,
const FieldVector<K,1>& b)
411 inline bool operator!= (
const K a,
const FieldVector<K,1>& b)