1 #ifndef DUNE_FEM_STLARRAY_HH 2 #define DUNE_FEM_STLARRAY_HH 13 template<
class ElementImp,
class RealImp >
27 : realIterator_( realIterator )
32 : realIterator_( other.realIterator )
36 inline ThisType &
operator= (
const ThisType &other )
64 template<
class ElementImp >
68 template<
class ElementImp >
85 template<
class ElementImp >
114 const ElementType &element )
115 : vector_( size, element )
120 : vector_( other.vector_ )
124 inline const ElementType &operator[] (
unsigned int index )
const 126 return vector_[ index ];
129 inline ElementType &operator[] (
unsigned int index )
131 return vector_[ index ];
135 inline ThisType &
assign (
const ElementType &element )
137 vector_.
assign( size(), element );
145 const unsigned int size = other.
size();
147 for(
unsigned int i = 0; i < size; ++i )
148 vector_[ i ] = other[ i ];
152 inline void append (
const ElementType &element )
154 vector_.push_back( element );
160 const unsigned int arraySize = array.
size();
161 for(
unsigned int i = 0; i < arraySize; ++i )
162 append( array[ i ] );
165 inline void resize (
unsigned int newSize )
167 vector_.resize( newSize );
171 inline ConstIteratorType
begin ()
const 173 return ConstIteratorType( vector_.begin() );
179 return IteratorType( vector_.begin() );
183 inline ConstIteratorType
end ()
const 185 return ConstIteratorType( vector_.end() );
189 inline IteratorType
end ()
191 return IteratorType( vector_.end() );
194 inline unsigned int size ()
const 196 return vector_.size();
204 #endif // #ifndef DUNE_FEM_STLARRAY_HH STLArrayTraits< ElementType > Traits
Definition: stlarray.hh:92
ConstIteratorType end() const
obtain end iterator
Definition: stlarray.hh:183
void append(const ElementType &element)
Definition: stlarray.hh:152
STLArrayIterator< ElementType, typename stdVectorType::iterator > IteratorType
Definition: stlarray.hh:78
ElementType & operator*()
Definition: stlarray.hh:41
ElementImp ElementType
Definition: stlarray.hh:71
ThisType & operator=(const ThisType &other)
Definition: stlarray.hh:36
Traits::IteratorType IteratorType
Definition: stlarray.hh:101
STLArray< ElementType > ArrayType
Definition: stlarray.hh:73
STLArrayIterator< const ElementType, typename stdVectorType::const_iterator > ConstIteratorType
Definition: stlarray.hh:80
bool operator==(const ThisType &other) const
Definition: stlarray.hh:52
RealImp realIterator_
Definition: stlarray.hh:23
STLArray(unsigned int size, const ElementType &element)
Definition: stlarray.hh:113
bool operator!=(const ThisType &other) const
Definition: stlarray.hh:57
ThisType & assign(const ArrayInterface< T > &other)
copy another array to this one
Definition: stlarray.hh:143
Definition: stlarray.hh:69
ElementImp ElementType
Definition: stlarray.hh:17
ConstIteratorType begin() const
obtain begin iterator
Definition: stlarray.hh:171
Traits::ConstIteratorType ConstIteratorType
Definition: stlarray.hh:102
ThisType & assign(const ElementType &element)
fill the array with copies of an element
Definition: stlarray.hh:135
Definition: coordinate.hh:4
STLArray(const ThisType &other)
Definition: stlarray.hh:119
STLArrayIterator(RealImp realIterator)
Definition: stlarray.hh:26
IteratorType end()
obtain end iterator
Definition: stlarray.hh:189
unsigned int size() const
Definition: stlarray.hh:194
Definition: stlarray.hh:14
ThisType & operator++()
Definition: stlarray.hh:46
STLArrayIterator(const ThisType &other)
Definition: stlarray.hh:31
void resize(unsigned int newSize)
Definition: stlarray.hh:165
unsigned int size() const
Definition: array.hh:155
STLArray(unsigned int size=0)
Definition: stlarray.hh:108
std::vector< ElementType > stdVectorType
Definition: stlarray.hh:75
abstract array interface
Definition: array.hh:23
ElementImp ElementType
Definition: stlarray.hh:90
stdVectorType vector_
Definition: stlarray.hh:105
IteratorType begin()
obtain begin iterator
Definition: stlarray.hh:177
Definition: stlarray.hh:65
void append(const ArrayInterface< T > &array)
Definition: stlarray.hh:158