26 #ifndef ASLVECTORSDYNAMICLENGTH_H 27 #define ASLVECTORSDYNAMICLENGTH_H 30 #include "../aslUtilities.h" 39 template <
typename T =
double>
class AVec
48 inline explicit AVec(
unsigned int s);
49 inline AVec(
unsigned int s, T a);
51 template <
typename Tv>
54 template <
typename Tv>
56 template <
typename Tv>
60 inline const T&
operator[](
unsigned int i)
const;
61 inline const unsigned int &
getSize()
const;
62 inline void resize(
unsigned int newSize);
67 inline const unsigned int nD(
const AVec<T> a);
96 memset(x, 0,
sizeof(T)*s);
104 for (
unsigned int i(0); i<size; ++i)
114 x(new T[a.getSize()]),
117 for (
unsigned int i(0); i < size; ++i)
122 x(new T[a.getSize()]),
125 for (
unsigned int i(0); i < size; ++i)
130 template <
typename T>
template<
typename Tv>
134 for (
unsigned int i(0); i<size; ++i)
139 template <
typename T>
143 for (
unsigned int i(0); i<size; ++i)
148 template <
typename T>
template<
typename Tv>
152 for (
unsigned int i(0); i<size; ++i)
158 template <
typename T>
164 template <
typename T>
170 template <
typename T>
208 template <
typename T>
inline std::ostream &
operator<<(std::ostream & output,
211 for (
unsigned int i(0); i<a.getSize(); ++i)
212 output << a[i]<<
" ";
216 template <
typename T>
222 template <
typename T>
225 if (size != newSize){
234 #endif //ASLVECTORSDYNAMICLENGTH_H Advanced Simulation Library.
void errorMessage(cl_int status, const char *errorMessage)
Prints errorMessage and exits depending on the status.
const unsigned int nD(const Block &b)
std::ostream & operator<<(std::ostream &output, const std::vector< T > &vector)
Prints elements of the vector separated by space.
const unsigned int nD(const AVec< T > a)
const unsigned int & getSize() const
const AVec< T > & operator=(const AVec< Tv > &a)
T & operator[](unsigned int i)
void resize(unsigned int newSize)
ExpressionContainer & operator<<(ExpressionContainer &ec, const std::vector< Element > &a)
puts a vector<Element> in ExpressionContainer