Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Class template valarray

boost::compute::valarray

Synopsis

// 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;
};

Description

valarray public construct/copy/destruct

  1. explicit valarray(const context & context = system::default_context());
  2. explicit valarray(size_t size, 
                      const context & context = system::default_context());
  3. valarray(const T & value, size_t size, 
             const context & context = system::default_context());
  4. valarray(const T * values, size_t size, 
             const context & context = system::default_context());
  5. valarray(const valarray< T > & other);
  6. valarray(const std::valarray< T > & valarray, 
             const context & context = system::default_context());
  7. valarray< T > & operator=(const valarray< T > & other);
  8. valarray< T > & operator=(const std::valarray< T > & valarray);
  9. ~valarray();

valarray public member functions

  1. valarray< T > & operator*=(const T &);
  2. valarray< T > & operator/=(const T &);
  3. valarray< T > & operator%=(const T & val);
  4. valarray< T > operator+() const;
  5. valarray< T > operator-() const;
  6. valarray< T > operator~() const;
  7. 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.

  8. valarray< T > & operator+=(const T &);
  9. valarray< T > & operator-=(const T &);
  10. valarray< T > & operator^=(const T &);
  11. valarray< T > & operator&=(const T &);
  12. valarray< T > & operator|=(const T &);
  13. valarray< T > & operator<<=(const T &);
  14. valarray< T > & operator>>=(const T &);
  15. valarray< T > & operator*=(const valarray< T > &);
  16. valarray< T > & operator/=(const valarray< T > &);
  17. valarray< T > & operator%=(const valarray< T > &);
  18. valarray< T > & operator+=(const valarray< T > &);
  19. valarray< T > & operator-=(const valarray< T > &);
  20. valarray< T > & operator^=(const valarray< T > &);
  21. valarray< T > & operator&=(const valarray< T > &);
  22. valarray< T > & operator|=(const valarray< T > &);
  23. valarray< T > & operator<<=(const valarray< T > &);
  24. valarray< T > & operator>>=(const valarray< T > &);
  25. size_t size() const;
  26. void resize(size_t size, T value = T());
  27. unspecified operator[](size_t index);
  28. unspecified operator[](size_t index) const;
  29. T() min() const;
  30. T() max() const;
  31. T sum() const;
  32. template<typename UnaryFunction> 
      valarray< T > apply(UnaryFunction function) const;
  33. const buffer & get_buffer() const;

valarray private member functions

  1. buffer_iterator< T > begin() const;
  2. buffer_iterator< T > end() const;

PrevUpHomeNext