A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.arrayfire.org/docs/group__reduce__func__anytrue__by__key.htm below:

ArrayFire: anyTrueByKey

Check if any values along a given dimension are true, according to an array of keys. More...

Check if any values along a given dimension are true, according to an array of keys.

Values corresponding to each group of consecutive equal keys will be tested to check if any are true. Keys can repeat; however, only consecutive key values will be considered for each reduction. If a key value is repeated somewhere else in the keys array it will be considered the start of a new reduction. There are two outputs: the reduced set of consecutive keys and the corresponding final set of reduced values.

An example demonstrating the reduction behavior can be seen in the following snippet.

array keys(9, hkeys);

array vals(9, hvals);

array okeys, ovals;

anyTrueByKey(okeys, ovals, keys, vals);

The keys' input type must be integer (s32 or u32).

The output type is b8.

The keys array must be 1-dimenstional matching the size of the reduced dimension. An example of multi-dimensional reduce-by-key can be seen below:

array keys(5, hkeys);

array vals(2, 5, hvals);

const int reduce_dim = 1;

array okeys, ovals;

anyTrueByKey(okeys, ovals, keys, vals, reduce_dim);

◆ af_any_true_by_key()

C Interface to check if any values along a given dimension are true.

NaN values are ignored.

Parameters
[out] keys_out reduced keys [out] vals_out array containing 1's if any true; 0's otherwise [in] keys keys array [in] vals input array [in] dim dimensions along which the check occurs
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given
◆ anyTrueByKey()

C++ Interface to check if any values along a given dimension are true, according to an array of keys.

NaN values are ignored.

Parameters
[out] keys_out reduced keys [out] vals_out array containing 1's if any true; 0's otherwise [in] keys keys array [in] vals input array [in] dim dimension along which the check occurs

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4