1#ifndef CLASSIC_Array1D_HH
2#define CLASSIC_Array1D_HH
134 len(array.len), data(new
T[len]) {
141 len(
n), data(new
T[len])
147 len(
n), data(new
T[len]) {
163 data =
new T[rhs.
len];
173template<
class T>
inline
179template<
class T>
inline
187 if(i < 0 || i >= size()) {
188 throw CLRangeError(
"Array1D::operator()",
"Index out of range.");
196 if(i < 0 || i >= size()) {
197 throw CLRangeError(
"Array1D::operator()",
"Index out of range.");
238 std::copy(old, old + len,
begin());
247 for(
int i = 0; i < v.
size(); ++i) {
PartBunchBase< T, Dim >::ConstIterator begin(PartBunchBase< T, Dim > const &bunch)
std::ostream & operator<<(std::ostream &os, const Array1D< T > &v)
Inform & endl(Inform &inf)
Array1D(int n, const T &t)
Constructor.
const_iterator end() const
Get end of data.
Array1D(int n)
Constructor.
iterator begin()
Get beginning of data.
const T & operator[](int) const
Get value of element.
Array1D(const Array1D< T > &)
int size() const
Get array size.
iterator end()
Get end of data.
T * iterator
The iterator type for the array.
const T * const_iterator
The iterator type for constant array.
T & operator()(int n)
Get reference to element.
T & operator[](int)
Get reference to element.
const T & operator()(int n) const
Get value of element.
Array1D< T > & operator=(const Array1D< T > &)
void resize(int size)
Change array size.
const_iterator begin() const
Get beginning of data.
Array1D()
Default constructor.
T value_type
The value type of this array.