...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::compute::valarray
// In header: <boost/compute/container/valarray.hpp> template<typename T> class valarray { public: // construct/copy/destruct explicit valarray(const context & = system::default_context()); explicit valarray(size_t, const context & = system::default_context()); valarray(const T &, size_t, const context & = system::default_context()); valarray(const T *, size_t, const context & = system::default_context()); valarray(const valarray< T > &); valarray(const std::valarray< T > &, const context & = system::default_context()); valarray< T > & operator=(const valarray< T > &); valarray< T > & operator=(const std::valarray< T > &); ~valarray(); // public member functions valarray< T > & operator*=(const T &); valarray< T > & operator/=(const T &); valarray< T > & operator%=(const T &); valarray< T > operator+() const; valarray< T > operator-() const; valarray< T > operator~() const; valarray< char > operator!() const; valarray< T > & operator+=(const T &); valarray< T > & operator-=(const T &); valarray< T > & operator^=(const T &); valarray< T > & operator&=(const T &); valarray< T > & operator|=(const T &); valarray< T > & operator<<=(const T &); valarray< T > & operator>>=(const T &); valarray< T > & operator*=(const valarray< T > &); valarray< T > & operator/=(const valarray< T > &); valarray< T > & operator%=(const valarray< T > &); valarray< T > & operator+=(const valarray< T > &); valarray< T > & operator-=(const valarray< T > &); valarray< T > & operator^=(const valarray< T > &); valarray< T > & operator&=(const valarray< T > &); valarray< T > & operator|=(const valarray< T > &); valarray< T > & operator<<=(const valarray< T > &); valarray< T > & operator>>=(const valarray< T > &); size_t size() const; void resize(size_t, T = T()); unspecified operator[](size_t); unspecified operator[](size_t) const; T() min() const; T() max() const; T sum() const; template<typename UnaryFunction> valarray< T > apply(UnaryFunction) const; const buffer & get_buffer() const; // private member functions buffer_iterator< T > begin() const; buffer_iterator< T > end() const; };
valarray
public
construct/copy/destructexplicit valarray(const context & context = system::default_context());
explicit valarray(size_t size, const context & context = system::default_context());
valarray(const T & value, size_t size, const context & context = system::default_context());
valarray(const T * values, size_t size, const context & context = system::default_context());
valarray(const valarray< T > & other);
valarray(const std::valarray< T > & valarray, const context & context = system::default_context());
valarray< T > & operator=(const valarray< T > & other);
valarray< T > & operator=(const std::valarray< T > & valarray);
~valarray();
valarray
public member functionsvalarray< T > & operator*=(const T &);
valarray< T > & operator/=(const T &);
valarray< T > & operator%=(const T & val);
valarray< T > operator+() const;
valarray< T > operator-() const;
valarray< T > operator~() const;
valarray< char > operator!() const;
In OpenCL there cannot be memory buffer with bool type, for this reason return type is valarray<char> instead of valarray<bool>. 1 means true, 0 means false.
valarray< T > & operator+=(const T &);
valarray< T > & operator-=(const T &);
valarray< T > & operator^=(const T &);
valarray< T > & operator&=(const T &);
valarray< T > & operator|=(const T &);
valarray< T > & operator<<=(const T &);
valarray< T > & operator>>=(const T &);
valarray< T > & operator*=(const valarray< T > &);
valarray< T > & operator/=(const valarray< T > &);
valarray< T > & operator%=(const valarray< T > &);
valarray< T > & operator+=(const valarray< T > &);
valarray< T > & operator-=(const valarray< T > &);
valarray< T > & operator^=(const valarray< T > &);
valarray< T > & operator&=(const valarray< T > &);
valarray< T > & operator|=(const valarray< T > &);
valarray< T > & operator<<=(const valarray< T > &);
valarray< T > & operator>>=(const valarray< T > &);
size_t size() const;
void resize(size_t size, T value = T());
unspecified operator[](size_t index);
unspecified operator[](size_t index) const;
T() min() const;
T() max() const;
T sum() const;
template<typename UnaryFunction> valarray< T > apply(UnaryFunction function) const;
const buffer & get_buffer() const;
valarray
private member functionsbuffer_iterator< T > begin() const;
buffer_iterator< T > end() const;