Small Arrays

The arbb::array type provides a class for expressing operations over multiple instances of a type at once.

This can be especially useful for porting code from shading languages or pre-vectorized functions.

The operations provided on regular Intel(R) Array Building Blocks (Intel(R) ArBB) containers are generally provided by the arbb::array class as well.

See Also

arbb::array

Classes

struct  arbb::array< T, N >
 A small array with a compile-time constant number of elements. More...

Modules

 Small Array Element-wise Functions

Functions

template<typename T , std::size_t N>
void arbb::swap (array< T, N > &a, array< T, N > &b)
 Swaps the provided arrays by calling a.swap(b).
template<std::size_t N, typename T >
array< T, N > arbb::make_array (const T &t)
 Constructs an array from the given value t (scalar extension).
template<typename T , std::size_t N>
arbb::add_reduce (const array< T, N > &source)
 Applies operator+(const T&, const T&) to the elements of the provided array in sequence and returns the result.
template<typename T , std::size_t N>
arbb::mul_reduce (const array< T, N > &source)
 Applies operator*(const T&, const T&) to the elements of the provided array in sequence and returns the result.
template<typename T , std::size_t N>
arbb::min_reduce (const array< T, N > &source)
 Applies min(const T&, const T&) to the elements of the provided array in sequence and returns the result.
template<typename T , std::size_t N>
arbb::max_reduce (const array< T, N > &source)
 Applies max(const T&, const T&) to the elements of the provided array in sequence and returns the result.
template<typename T , std::size_t N>
arbb::and_reduce (const array< T, N > &source)
 Applies operator&&(const T&, const T&) to the elements of the provided array in sequence and returns the result.
template<typename T , std::size_t N>
arbb::ior_reduce (const array< T, N > &source)
 Applies operator||(const T&, const T&) to the elements of the provided array in sequence and returns the result.
template<typename T , std::size_t N>
arbb::xor_reduce (const array< T, N > &source)
 Applies operator!=(const T&, const T&) to the elements of the provided array in sequence and returns the result.
template<std::size_t M, typename T , std::size_t N>
array< T, M > arbb::resize (const array< T, N > &a, const T &value)
 Returns an arbb::array with M elements, copying the first min(M, N) elements from a, and filling any remaining elements with value.
template<std::size_t M, typename T , std::size_t N>
array< T, M > arbb::resize (const array< T, N > &a)
 Returns an arbb::array with M elements, copying the first min(M, N) elements from a, and filling any remaining elements with T().
template<typename T , std::size_t M, std::size_t N>
array< T, M+N > arbb::cat (const array< T, M > &a, const array< T, N > &b)
 Returns an arbb::array with M + N elements consisting of the concatention of a and b.
template<typename T , std::size_t N>
arbb::boolean arbb::any (const array< T, N > &source)
 Returns ior_reduce(source) as a single value.
template<typename T , std::size_t N>
arbb::boolean arbb::all (const array< T, N > &source)
 Returns and_reduce(source) as a single value.
template<typename T , std::size_t N>
arbb::sum (const array< T, N > &source)
 Returns add_reduce(source) as a single value.
template<typename T , std::size_t N>
arbb::product (const array< T, N > &source)
 Returns mul_reduce(source) as a single value.

Function Documentation

template<typename T , std::size_t N>
void arbb::swap ( array< T, N > &  a,
array< T, N > &  b 
) [inline]

Swaps the provided arrays by calling a.swap(b).

template<std::size_t N, typename T >
array<T, N> arbb::make_array ( const T &  t  )  [inline]

Constructs an array from the given value t (scalar extension).

template<typename T , std::size_t N>
T arbb::add_reduce ( const array< T, N > &  source  )  [inline]

Applies operator+(const T&, const T&) to the elements of the provided array in sequence and returns the result.

Parameters:

source The values to be summed.

Definition at line 3530 of file array_funcs.hpp.

template<typename T , std::size_t N>
T arbb::mul_reduce ( const array< T, N > &  source  )  [inline]

Applies operator*(const T&, const T&) to the elements of the provided array in sequence and returns the result.

Parameters:

source The values to be multiplied.

Definition at line 3546 of file array_funcs.hpp.

template<typename T , std::size_t N>
T arbb::min_reduce ( const array< T, N > &  source  )  [inline]

Applies min(const T&, const T&) to the elements of the provided array in sequence and returns the result.

Parameters:

source The values of which to compute the minimum.

Definition at line 3562 of file array_funcs.hpp.

template<typename T , std::size_t N>
T arbb::max_reduce ( const array< T, N > &  source  )  [inline]

Applies max(const T&, const T&) to the elements of the provided array in sequence and returns the result.

Parameters:

source The values of which to compute the maximum.

Definition at line 3580 of file array_funcs.hpp.

template<typename T , std::size_t N>
T arbb::and_reduce ( const array< T, N > &  source  )  [inline]

Applies operator&&(const T&, const T&) to the elements of the provided array in sequence and returns the result.

Parameters:

source The values on which to compute the logical and.

Definition at line 3598 of file array_funcs.hpp.

template<typename T , std::size_t N>
T arbb::ior_reduce ( const array< T, N > &  source  )  [inline]

Applies operator||(const T&, const T&) to the elements of the provided array in sequence and returns the result.

Parameters:

source The values on which to compute the logical or.

Definition at line 3614 of file array_funcs.hpp.

template<typename T , std::size_t N>
T arbb::xor_reduce ( const array< T, N > &  source  )  [inline]

Applies operator!=(const T&, const T&) to the elements of the provided array in sequence and returns the result.

Parameters:

source The values on which to compute the logical xor.

Definition at line 3630 of file array_funcs.hpp.

template<std::size_t M, typename T , std::size_t N>
array<T, M> arbb::resize ( const array< T, N > &  a,
const T &  value 
) [inline]

Returns an arbb::array with M elements, copying the first min(M, N) elements from a, and filling any remaining elements with value.

Definition at line 3651 of file array_funcs.hpp.

template<std::size_t M, typename T , std::size_t N>
array<T, M> arbb::resize ( const array< T, N > &  a  )  [inline]

Returns an arbb::array with M elements, copying the first min(M, N) elements from a, and filling any remaining elements with T().

Definition at line 3667 of file array_funcs.hpp.

template<typename T , std::size_t M, std::size_t N>
array<T, M + N> arbb::cat ( const array< T, M > &  a,
const array< T, N > &  b 
) [inline]

Returns an arbb::array with M + N elements consisting of the concatention of a and b.

Definition at line 3677 of file array_funcs.hpp.

template<typename T , std::size_t N>
arbb ::boolean arbb::any ( const array< T, N > &  source  )  [inline]

Returns ior_reduce(source) as a single value.

Definition at line 3735 of file array_funcs.hpp.

template<typename T , std::size_t N>
arbb ::boolean arbb::all ( const array< T, N > &  source  )  [inline]

Returns and_reduce(source) as a single value.

Definition at line 3743 of file array_funcs.hpp.

template<typename T , std::size_t N>
T arbb::sum ( const array< T, N > &  source  )  [inline]

Returns add_reduce(source) as a single value.

Definition at line 3751 of file array_funcs.hpp.

template<typename T , std::size_t N>
T arbb::product ( const array< T, N > &  source  )  [inline]

Returns mul_reduce(source) as a single value.

Definition at line 3759 of file array_funcs.hpp.

Submit feedback on this help topic

Copyright © 2010, Intel Corporation. All rights reserved.