Array1D

template<typename T>
class Array1D

Public Functions

inline Array1D()

Create an empty array.

inline explicit Array1D(Int size)

Create an array with specified number of entries.

Parameters:

size – Number of entries in the array

inline explicit Array1D(const Range &rng)

Create an array from a Range.

Parameters:

rng – Indexing range

inline Int size() const

Get number of entries in the array.

Returns:

Number of entries in the array

inline void zero()

Set all entries in the array to zero.

inline void set(const T &val)

Assign a value into all vector entries, i.e.

vec[i] = val

Parameters:

val – Value to assign

inline const T &operator[](Int i) const

Get the entry at a specified location for reading.

Parameters:

i – Index fo the entry

Returns:

Entry at the ith location

inline T &operator[](Int i)

Get the entry at a specified location for writing.

Parameters:

i – Index fo the entry

Returns:

Entry at the ith location

struct ConstIterator

Public Functions

inline ConstIterator &operator++()

Prefix increment.

inline ConstIterator operator++(int)

Postfix increment.

struct Iterator

Public Functions

inline Iterator &operator++()

Prefix increment.

inline Iterator operator++(int)

Postfix increment.