Functions | |
template<typename T > | |
nested< T > | arbb::repeat (const nested< T > &src, const usize ×, const boolean collate=true, const usize &level=usize(0)) |
Returns a nested vector containing the elements of src at the given level repeated times times, with collate determining whether multiple copies of the same element are placed contiguously (collate = true ) or interleaved (collate = false ). | |
template<typename T > | |
nested< T > | arbb::repeat (const nested< T > &src, const nested< usize > ×, const usize &level=usize(0)) |
Returns a nested vector containing each element of src at the given level repeated as many times as in the corresponding element at that level in times . | |
template<typename T > | |
nested< T > | arbb::shuffle (const nested< T > &src1, const nested< T > &src2, const usize &grain, const usize &level=usize(0)) |
Returns a dense container with grain elements alternately drawn from src1 and src2 at nesting level level . | |
template<typename T > | |
nested< T > | arbb::unshuffle (const nested< T > &src, const usize &grain, const usize &level=usize(0)) |
Partitions source into two containers, each having an alternating grain elements from source at nesting level level , and returns the two containers concatenated in order. | |
template<typename T > | |
nested< T > | arbb::reshape_nested_lengths (const dense< T, 1 > &data, const dense< usize, 1 > &lengths) |
Returns a nested container with its elements drawn from data , partitioned into segments with lengths are provided by lengths . | |
template<typename T , typename U > | |
nested< T > | arbb::reshape_as (const dense< T, 1 > &data, const nested< U > &reference) |
Returns a nested container with the same nesting structure as reference , but elements drawn from data . | |
template<typename T > | |
nested< T > | arbb::split (const dense< T, 1 > &source, const dense< isize, 1 > &tristate) |
Returns a nested vector containing up to three segments, with the elements from source corresponding to tristate values of -1, 0, and 1, in that order. | |
template<typename T > | |
nested< T > | arbb::split (const nested< T > &src, const nested< isize > &tristate) |
Returns a nested vector with the source segments split into up to three segments, with the elements from source corresponding to tristate values of -1, 0, and 1, in that order. | |
template<typename T > | |
dense< T, 1 > | arbb::unsplit (const nested< T > &src, const dense< isize, 1 > &tristate) |
Returns the dense container R such that src == split(R, tristate) . | |
template<typename T > | |
nested< T > | arbb::unsplit (const nested< T > &src, const nested< isize > &tristate) |
Returns the nested container R such that src == split(R, tristate) . | |
template<typename T > | |
nested< T > | arbb::cat (const nested< T > &src1, const nested< T > &src2) |
Returns a nested container with each segment in src1 concatenated before each element in src2 . | |
template<typename T > | |
nested< T > | arbb::replace_segment (const nested< T > &src, const usize &i, const dense< T, 1 > &value) |
Returns a nested container with the same segments as src , but the segment at index i replaced by value . | |
template<typename T > | |
nested< T > | arbb::replace (const nested< T > &src, const usize &segment, const usize &element, const T &value) |
Returns a nested container with the same segments as src , but the element at index element of the segment at index segment replaced by value . | |
template<typename T > | |
nested< T > | arbb::unpack (const nested< T > &src, const nested< boolean > &mask, const T &value) |
Returns a nested container with each segment i set to select(mask[i], src[i], value) . | |
template<typename T > | |
nested< T > | arbb::unpack (const nested< T > &src, const nested< boolean > &mask, const typename uncaptured< T >::type value) |
Returns a nested container with each segment i set to select(mask[i], src[i], value) . | |
template<typename T > | |
nested< T > | arbb::reshape_nested_offsets (const dense< T, 1 > &src, const dense< usize, 1 > &segs) |
Returns a nested container with its elements drawn from src , partitioned into segments which begin at indices corresponding to segs . | |
template<typename T > | |
nested< T > | arbb::reshape_nested_flags (const dense< T, 1 > &src, const dense< boolean, 1 > &flags) |
Returns a nested container with its elements drawn from src , where a new segment is started whenever the corresponding value of flags is true . |
nested<T> arbb::repeat | ( | const nested< T > & | src, | |
const usize & | times, | |||
const boolean | collate = true , |
|||
const usize & | level = usize(0) | |||
) | [inline] |
Returns a nested vector containing the elements of src
at the given level
repeated times
times, with collate
determining whether multiple copies of the same element are placed contiguously (collate = true
) or interleaved (collate = false
).
For example:
// collate = true, level = 1 repeat(nested<i32>::parse("{{0,1}, {2,3}}"), 2, true, 1) // {{0,1}, {2,3}, {0,1}, {2,3}} // collate = false, level = 1 repeat(nested<i32>::parse("{{0,1}, {2,3}}"), 2, false, 1) // {{0,1}, {0,1}, {2,3}, {2,3}} // collate = true, level = 0 repeat(nested<i32>::parse("{{0,1}, {2,3}}"), 2, true, 0) // {{0,1,0,1}, {2,3,2,3}} // collate = false, level = 0 repeat(nested<i32>::parse("{{0,1}, {2,3}}"), 2, false, 0) // {{0,0,1,1}, {2,2,3,3}}
nested<T> arbb::repeat | ( | const nested< T > & | src, | |
const nested< usize > & | times, | |||
const usize & | level = usize(0) | |||
) | [inline] |
Returns a nested vector containing each element of src
at the given level
repeated as many times as in the corresponding element at that level in times
.
For example:
nested<T> arbb::shuffle | ( | const nested< T > & | src1, | |
const nested< T > & | src2, | |||
const usize & | grain, | |||
const usize & | level = usize(0) | |||
) | [inline] |
Returns a dense container with grain
elements alternately drawn from src1
and src2
at nesting level level
.
For example:
nested<T> arbb::unshuffle | ( | const nested< T > & | src, | |
const usize & | grain, | |||
const usize & | level = usize(0) | |||
) | [inline] |
Partitions source
into two containers, each having an alternating grain
elements from source
at nesting level level
, and returns the two containers concatenated in order.
For example:
nested<T> arbb::reshape_nested_lengths | ( | const dense< T, 1 > & | data, | |
const dense< usize, 1 > & | lengths | |||
) | [inline] |
Returns a nested container with its elements drawn from data
, partitioned into segments with lengths are provided by lengths
.
nested<T> arbb::reshape_as | ( | const dense< T, 1 > & | data, | |
const nested< U > & | reference | |||
) | [inline] |
Returns a nested container with the same nesting structure as reference
, but elements drawn from data
.
nested<T> arbb::split | ( | const dense< T, 1 > & | source, | |
const dense< isize, 1 > & | tristate | |||
) | [inline] |
Returns a nested vector containing up to three segments, with the elements from source
corresponding to tristate
values of -1, 0, and 1, in that order.
For example:
nested<T> arbb::split | ( | const nested< T > & | src, | |
const nested< isize > & | tristate | |||
) | [inline] |
Returns a nested vector with the source segments split into up to three segments, with the elements from source
corresponding to tristate
values of -1, 0, and 1, in that order.
dense<T, 1> arbb::unsplit | ( | const nested< T > & | src, | |
const dense< isize, 1 > & | tristate | |||
) | [inline] |
Returns the dense container R
such that src == split(R, tristate)
.
nested<T> arbb::unsplit | ( | const nested< T > & | src, | |
const nested< isize > & | tristate | |||
) | [inline] |
Returns the nested container R
such that src == split(R, tristate)
.
nested<T> arbb::cat | ( | const nested< T > & | src1, | |
const nested< T > & | src2 | |||
) | [inline] |
Returns a nested container with each segment in src1
concatenated before each element in src2
.
For example:
// Returns {{1, 2, 6, 7, 7, 6}, {3, 4, 5, 8, 9}}. cat(nested<i32>::parse("{{1, 2}, {3, 4, 5}}"), nested<i32>::parse("{{6, 7, 7, 6}, {8, 9}}"))
nested<T> arbb::replace_segment | ( | const nested< T > & | src, | |
const usize & | i, | |||
const dense< T, 1 > & | value | |||
) | [inline] |
Returns a nested container with the same segments as src
, but the segment at index i
replaced by value
.
nested<T> arbb::replace | ( | const nested< T > & | src, | |
const usize & | segment, | |||
const usize & | element, | |||
const T & | value | |||
) | [inline] |
Returns a nested container with the same segments as src
, but the element at index element
of the segment at index segment
replaced by value
.
nested<T> arbb::unpack | ( | const nested< T > & | src, | |
const nested< boolean > & | mask, | |||
const T & | value | |||
) | [inline] |
Returns a nested container with each segment i
set to select(mask[i], src[i], value)
.
nested<T> arbb::unpack | ( | const nested< T > & | src, | |
const nested< boolean > & | mask, | |||
const typename uncaptured< T >::type | value | |||
) | [inline] |
Returns a nested container with each segment i
set to select(mask[i], src[i], value)
.
nested<T> arbb::reshape_nested_offsets | ( | const dense< T, 1 > & | src, | |
const dense< usize, 1 > & | segs | |||
) | [inline] |
Returns a nested container with its elements drawn from src
, partitioned into segments which begin at indices corresponding to segs
.
nested<T> arbb::reshape_nested_flags | ( | const dense< T, 1 > & | src, | |
const dense< boolean, 1 > & | flags | |||
) | [inline] |
Returns a nested container with its elements drawn from src
, where a new segment is started whenever the corresponding value of flags
is true
.
Copyright © 2010, Intel Corporation. All rights reserved.