Template Class VecN#

Class Documentation#

template<size_t N, typename dtype = double>
class VecN#

Public Types

typedef dtype *iterator#

return iterators over data

typedef dtype const *const_iterator#

Public Functions

inline VecN()#

default constructor

inline VecN(dtype const &d)#

initialize with constant

inline VecN(pele::Array<dtype> const &x)#

initialize as copy of pele array

template<class input_iter>
inline VecN(input_iter ibegin, input_iter iend)#

initialize values from input iterators

inline size_t size() const#
inline dtype *data()#

return pointer to data

inline dtype const *data() const#
inline iterator begin()#
inline iterator end()#
inline const_iterator begin() const#
inline const_iterator end() const#
inline dtype &operator[](const size_t i)#

access an element in the vector

inline dtype const &operator[](const size_t i) const#
inline void assign(dtype const &d)#

assign each element of the vector to be d

inline void assign(const dtype *const rhs)#

Assignment function: copy the data into the existing array.

inline VecN<N, dtype> &operator=(pele::Array<dtype> const &rhs)#

copy the data in a pele::Array into this vector

inline VecN<N, dtype> &operator+=(const VecN<N, dtype> &rhs)#
inline VecN<N, dtype> &operator+=(const dtype &rhs)#
inline VecN<N, dtype> &operator-=(const VecN<N, dtype> &rhs)#
inline VecN<N, dtype> &operator-=(const dtype &rhs)#
inline VecN<N, dtype> &operator*=(const VecN<N, dtype> &rhs)#
inline VecN<N, dtype> &operator*=(const dtype &rhs)#
inline VecN<N, dtype> &operator/=(const VecN<N, dtype> &rhs)#
inline VecN<N, dtype> &operator/=(const dtype &rhs)#
inline VecN<N, dtype> operator-(VecN<N, dtype> const &rhs) const#
inline VecN<N, dtype> operator*(const VecN<N, dtype> &rhs) const#
inline VecN<N, dtype> operator*(const dtype rhs) const#
inline dtype sum() const#

returns the sum of all elements (reduces the array)

inline dtype prod() const#

returns the product of all elements (reduces the array)