1 #ifndef CLASSIC_FArray1D_HH
2 #define CLASSIC_FArray1D_HH
26 #include <initializer_list>
38 template<
class T,
int N>
118 template<
class T,
int N>
124 template<
class T,
int N>
130 template<
class T,
int N>
137 template<
class T,
int N>
141 if (init.size() > N) {
142 throw SizeError(
"FArray1D<T,N>(const std::initializer_list<T>&)",
"Size exceeds array dimension.");
146 std::copy(init.begin(), init.end(),
begin());
149 if (init.size() < N) {
150 std::fill(
begin()+init.size(),
end(),
T(0));
154 template<
class T,
int N>
161 template<
class T,
int N>
inline
167 template<
class T,
int N>
inline
173 template<
class T,
int N>
176 throw CLRangeError(
"FArray1D::operator()",
"Index out of range.");
182 template<
class T,
int N>
185 throw CLRangeError(
"FArray1D::operator()",
"Index out of range.");
191 template<
class T,
int N>
inline
197 template<
class T,
int N>
inline
203 template<
class T,
int N>
inline
209 template<
class T,
int N>
inline
215 template<
class T,
int N>
inline
221 template <
class T,
int N>
223 for(
int i = 0; i < N; ++i) {
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
PartBunchBase< T, Dim >::ConstIterator begin(PartBunchBase< T, Dim > const &bunch)
std::ostream & operator<<(std::ostream &os, const FArray1D< T, N > &v)
Inform & endl(Inform &inf)
A templated representation for one-dimensional arrays.
int size() const
Get array size.
FArray1D(const FArray1D &)
Copy constructor.
T & operator()(int n)
Get element.
iterator end()
Get iterator pointing past end of array.
const_iterator end() const
Get iterator pointing past end of array.
FArray1D()
Default constructor.
T value_type
The value type of this array.
iterator begin()
Get iterator pointing to beginning of array.
const_iterator begin() const
Get iterator pointing to beginning of array.
T * iterator
Iterator for the array.
FArray1D(const T &t)
Constructor.
T & operator[](int n)
Get element.
const T * const_iterator
Iterator for constant array.
const T & operator()(int n) const
Get element.
const FArray1D & operator=(const FArray1D &)
Assignment.
FArray1D(const std::initializer_list< T > &)
Consructor with initializer list (needs C++11) (see http://en.cppreference.com/w/cpp/utility/initiali...
const T & operator[](int n) const
Get element.