You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
<ahref="data_8h.htm">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aid="l00001" name="l00001"></a><spanclass="lineno"> 1</span><spanclass="comment">/*******************************************************</span></div>
<divclass="line"><aid="l00005" name="l00005"></a><spanclass="lineno"> 5</span><spanclass="comment"> * This file is distributed under 3-clause BSD license.</span></div>
<divclass="line"><aid="l00006" name="l00006"></a><spanclass="lineno"> 6</span><spanclass="comment"> * The complete license agreement can be obtained at:</span></div>
<divclass="ttc" id="aclassaf_1_1array_htm"><divclass="ttname"><ahref="classaf_1_1array.htm">af::array</a></div><divclass="ttdoc">A multi dimensional data container.</div><divclass="ttdef"><b>Definition:</b><ahref="array_8h_source.htm#l00037">array.h:37</a></div></div>
<divclass="ttc" id="aclassaf_1_1dim4_htm"><divclass="ttname"><ahref="classaf_1_1dim4.htm">af::dim4</a></div><divclass="ttdoc">Generic object that represents size and shape.</div><divclass="ttdef"><b>Definition:</b><ahref="dim4_8hpp_source.htm#l00025">dim4.hpp:26</a></div></div>
<divclass="ttc" id="adefines_8h_htm_a7f026aa801b1fa6b85b0d992b414cccb"><divclass="ttname"><ahref="defines_8h.htm#a7f026aa801b1fa6b85b0d992b414cccb">dim_t</a></div><divclass="ttdeci">long long dim_t</div><divclass="ttdef"><b>Definition:</b><ahref="defines_8h_source.htm#l00056">defines.h:56</a></div></div>
<divclass="ttc" id="agroup__data__func__constant_htm_ga0db7363474e85542f16e4bbcf57fe842"><divclass="ttname"><ahref="group__data__func__constant.htm#ga0db7363474e85542f16e4bbcf57fe842">af::constant</a></div><divclass="ttdeci">array constant(T val, const dim4 &dims, const dtype ty=(af_dtype) dtype_traits< T >::ctype)</div><divclass="ttdoc">C++ Interface to generate an array with elements set to a specified value.</div></div>
<divclass="ttc" id="agroup__data__func__constant_htm_ga10f1c9fad1ce9e9fefd885d5a1d1fd49"><divclass="ttname"><ahref="group__data__func__constant.htm#ga10f1c9fad1ce9e9fefd885d5a1d1fd49">af_constant_long</a></div><divclass="ttdeci">AFAPI af_err af_constant_long(af_array *arr, const long long val, const unsigned ndims, const dim_t *const dims)</div><divclass="ttdoc">C Interface to generate an array with elements set to a specified value.</div></div>
<divclass="ttc" id="agroup__data__func__constant_htm_ga5a083b1f3cd8a72a41f151de3bdea1a2"><divclass="ttname"><ahref="group__data__func__constant.htm#ga5a083b1f3cd8a72a41f151de3bdea1a2">af_constant_complex</a></div><divclass="ttdeci">AFAPI af_err af_constant_complex(af_array *arr, const double real, const double imag, const unsigned ndims, const dim_t *const dims, const af_dtype type)</div><divclass="ttdoc">C Interface to generate a complex array with elements set to a specified value.</div></div>
<divclass="ttc" id="agroup__data__func__constant_htm_ga67af670cc9314589f8134019f5e68809"><divclass="ttname"><ahref="group__data__func__constant.htm#ga67af670cc9314589f8134019f5e68809">af_constant_ulong</a></div><divclass="ttdeci">AFAPI af_err af_constant_ulong(af_array *arr, const unsigned long long val, const unsigned ndims, const dim_t *const dims)</div><divclass="ttdoc">C Interface to generate an array with elements set to a specified value.</div></div>
<divclass="ttc" id="agroup__data__func__constant_htm_gafc51b6a98765dd24cd4139f3bde00670"><divclass="ttname"><ahref="group__data__func__constant.htm#gafc51b6a98765dd24cd4139f3bde00670">af_constant</a></div><divclass="ttdeci">AFAPI af_err af_constant(af_array *arr, const double val, const unsigned ndims, const dim_t *const dims, const af_dtype type)</div><divclass="ttdoc">C Interface to generate an array with elements set to a specified value.</div></div>
<divclass="ttc" id="agroup__data__func__diag_htm_ga0a28a19534f3c92f11373d662c183061"><divclass="ttname"><ahref="group__data__func__diag.htm#ga0a28a19534f3c92f11373d662c183061">af_diag_extract</a></div><divclass="ttdeci">AFAPI af_err af_diag_extract(af_array *out, const af_array in, const int num)</div><divclass="ttdoc">C Interface to extract the diagonal from an array.</div></div>
<divclass="ttc" id="agroup__data__func__diag_htm_ga2edf122701d157ee0af36d2950376174"><divclass="ttname"><ahref="group__data__func__diag.htm#ga2edf122701d157ee0af36d2950376174">af::diag</a></div><divclass="ttdeci">AFAPI array diag(const array &in, const int num=0, const bool extract=true)</div><divclass="ttdoc">C++ Interface to extract the diagonal from an array.</div></div>
<divclass="ttc" id="agroup__data__func__diag_htm_gaecc9950acc89aefcb99ad805af8aa29b"><divclass="ttname"><ahref="group__data__func__diag.htm#gaecc9950acc89aefcb99ad805af8aa29b">af_diag_create</a></div><divclass="ttdeci">AFAPI af_err af_diag_create(af_array *out, const af_array in, const int num)</div><divclass="ttdoc">C Interface to create a diagonal matrix from an extracted diagonal array.</div></div>
<divclass="ttc" id="agroup__data__func__identity_htm_ga1dcf8d1baa51e7b343d43b57e0760df1"><divclass="ttname"><ahref="group__data__func__identity.htm#ga1dcf8d1baa51e7b343d43b57e0760df1">af::identity</a></div><divclass="ttdeci">AFAPI array identity(const dim4 &dims, const dtype ty=f32)</div><divclass="ttdoc">C++ Interface to generate an identity array.</div></div>
<divclass="ttc" id="agroup__data__func__iota_htm_ga032c10a9bbd3cf051f711bfea1dea65c"><divclass="ttname"><ahref="group__data__func__iota.htm#ga032c10a9bbd3cf051f711bfea1dea65c">af_iota</a></div><divclass="ttdeci">AFAPI af_err af_iota(af_array *out, const unsigned ndims, const dim_t *const dims, const unsigned t_ndims, const dim_t *const tdims, const af_dtype type)</div><divclass="ttdoc">C Interface to generate an array with [0, n-1] values modified to specified dimensions and tiling.</div></div>
<divclass="ttc" id="agroup__data__func__iota_htm_ga440f01f3a85d20f5adc677ed1c9f0deb"><divclass="ttname"><ahref="group__data__func__iota.htm#ga440f01f3a85d20f5adc677ed1c9f0deb">af::iota</a></div><divclass="ttdeci">AFAPI array iota(const dim4 &dims, const dim4 &tile_dims=dim4(1), const dtype ty=f32)</div><divclass="ttdoc">C++ Interface to generate an array with [0, n-1] values modified to specified dimensions and tiling.</div></div>
<divclass="ttc" id="agroup__data__func__lower_htm_ga40302d71a619692513a4623a89334b52"><divclass="ttname"><ahref="group__data__func__lower.htm#ga40302d71a619692513a4623a89334b52">af_lower</a></div><divclass="ttdeci">AFAPI af_err af_lower(af_array *out, const af_array in, bool is_unit_diag)</div><divclass="ttdoc">C Interface to return the lower triangle array.</div></div>
<divclass="ttc" id="agroup__data__func__lower_htm_ga66eb3da220db252236c6d48e3a6811f1"><divclass="ttname"><ahref="group__data__func__lower.htm#ga66eb3da220db252236c6d48e3a6811f1">af::lower</a></div><divclass="ttdeci">AFAPI array lower(const array &in, bool is_unit_diag=false)</div><divclass="ttdoc">C++ Interface to return the lower triangle array.</div></div>
<divclass="ttc" id="agroup__data__func__pad_htm_gabe75c767e4e89f82a4e5864bf6e1ef15"><divclass="ttname"><ahref="group__data__func__pad.htm#gabe75c767e4e89f82a4e5864bf6e1ef15">af_pad</a></div><divclass="ttdeci">AFAPI af_err af_pad(af_array *out, const af_array in, const unsigned begin_ndims, const dim_t *const begin_dims, const unsigned end_ndims, const dim_t *const end_dims, const af_border_type pad_fill_type)</div><divclass="ttdoc">C Interface to pad an array.</div></div>
<divclass="ttc" id="agroup__data__func__pad_htm_gaf4d4417bd591fe34932975f63156cfad"><divclass="ttname"><ahref="group__data__func__pad.htm#gaf4d4417bd591fe34932975f63156cfad">af::pad</a></div><divclass="ttdeci">AFAPI array pad(const array &in, const dim4 &beginPadding, const dim4 &endPadding, const borderType padFillType)</div><divclass="ttdoc">C++ Interface to pad an array.</div></div>
<divclass="ttc" id="agroup__data__func__range_htm_gaabed40660d2001b8d273d251cd4992c3"><divclass="ttname"><ahref="group__data__func__range.htm#gaabed40660d2001b8d273d251cd4992c3">af::range</a></div><divclass="ttdeci">AFAPI array range(const dim4 &dims, const int seq_dim=-1, const dtype ty=f32)</div><divclass="ttdoc">C++ Interface to generate an array with [0, n-1] values along the seq_dim dimension and tiled across ...</div></div>
<divclass="ttc" id="agroup__data__func__range_htm_gadd6c9b479692454670a51e00ea5b26d5"><divclass="ttname"><ahref="group__data__func__range.htm#gadd6c9b479692454670a51e00ea5b26d5">af_range</a></div><divclass="ttdeci">AFAPI af_err af_range(af_array *out, const unsigned ndims, const dim_t *const dims, const int seq_dim, const af_dtype type)</div><divclass="ttdoc">C Interface to generate an array with [0, n-1] values along the seq_dim dimension and tiled across ot...</div></div>
<divclass="ttc" id="agroup__data__func__replace_htm_ga21eeef8e69367938673753fafe539431"><divclass="ttname"><ahref="group__data__func__replace.htm#ga21eeef8e69367938673753fafe539431">af::replace</a></div><divclass="ttdeci">AFAPI void replace(array &a, const array &cond, const array &b)</div><divclass="ttdoc">C++ Interface to replace elements of an array with elements of another array.</div></div>
<divclass="ttc" id="agroup__data__func__replace_htm_ga2f87db0057e25419d24639d96fb82972"><divclass="ttname"><ahref="group__data__func__replace.htm#ga2f87db0057e25419d24639d96fb82972">af_replace_scalar_long</a></div><divclass="ttdeci">AFAPI af_err af_replace_scalar_long(af_array a, const af_array cond, const long long b)</div><divclass="ttdoc">C Interface to replace elements of an array with a scalar value.</div></div>
<divclass="ttc" id="agroup__data__func__replace_htm_ga58449937228761176de47b1d75d689d8"><divclass="ttname"><ahref="group__data__func__replace.htm#ga58449937228761176de47b1d75d689d8">af_replace_scalar</a></div><divclass="ttdeci">AFAPI af_err af_replace_scalar(af_array a, const af_array cond, const double b)</div><divclass="ttdoc">C Interface to replace elements of an array with a scalar value.</div></div>
<divclass="ttc" id="agroup__data__func__replace_htm_ga6d285cd28d8c380fbc0dafd5296703b5"><divclass="ttname"><ahref="group__data__func__replace.htm#ga6d285cd28d8c380fbc0dafd5296703b5">af_replace</a></div><divclass="ttdeci">AFAPI af_err af_replace(af_array a, const af_array cond, const af_array b)</div><divclass="ttdoc">C Interface to replace elements of an array with elements of another array.</div></div>
<divclass="ttc" id="agroup__data__func__replace_htm_gadb52709a7afa197176b1bde8c199a066"><divclass="ttname"><ahref="group__data__func__replace.htm#gadb52709a7afa197176b1bde8c199a066">af_replace_scalar_ulong</a></div><divclass="ttdeci">AFAPI af_err af_replace_scalar_ulong(af_array a, const af_array cond, const unsigned long long b)</div><divclass="ttdoc">C Interface to replace elements of an array with a scalar value.</div></div>
<divclass="ttc" id="agroup__data__func__select_htm_ga022ec3d8aefcbd2716f6557020de8924"><divclass="ttname"><ahref="group__data__func__select.htm#ga022ec3d8aefcbd2716f6557020de8924">af_select_scalar_l_long</a></div><divclass="ttdeci">AFAPI af_err af_select_scalar_l_long(af_array *out, const af_array cond, const long long a, const af_array b)</div><divclass="ttdoc">C Interface to select elements based on a conditional array.</div></div>
<divclass="ttc" id="agroup__data__func__select_htm_ga0ccdc05779f88cab5095bce987c2da9d"><divclass="ttname"><ahref="group__data__func__select.htm#ga0ccdc05779f88cab5095bce987c2da9d">af_select_scalar_l</a></div><divclass="ttdeci">AFAPI af_err af_select_scalar_l(af_array *out, const af_array cond, const double a, const af_array b)</div><divclass="ttdoc">C Interface to select elements based on a conditional array.</div></div>
<divclass="ttc" id="agroup__data__func__select_htm_ga1a2bf0110367961d084bc6b5d33f7555"><divclass="ttname"><ahref="group__data__func__select.htm#ga1a2bf0110367961d084bc6b5d33f7555">af::select</a></div><divclass="ttdeci">AFAPI array select(const array &cond, const array &a, const array &b)</div><divclass="ttdoc">C++ Interface to select elements based on a conditional array.</div></div>
<divclass="ttc" id="agroup__data__func__select_htm_ga5b5aaaacf680c1166439431faf8609f4"><divclass="ttname"><ahref="group__data__func__select.htm#ga5b5aaaacf680c1166439431faf8609f4">af_select_scalar_l_ulong</a></div><divclass="ttdeci">AFAPI af_err af_select_scalar_l_ulong(af_array *out, const af_array cond, const unsigned long long a, const af_array b)</div><divclass="ttdoc">C Interface to select elements based on a conditional array.</div></div>
<divclass="ttc" id="agroup__data__func__select_htm_ga64eeb0752ed3a6d021c22a42a6350291"><divclass="ttname"><ahref="group__data__func__select.htm#ga64eeb0752ed3a6d021c22a42a6350291">af_select_scalar_r_ulong</a></div><divclass="ttdeci">AFAPI af_err af_select_scalar_r_ulong(af_array *out, const af_array cond, const af_array a, const unsigned long long b)</div><divclass="ttdoc">C Interface to select elements based on a conditional array.</div></div>
<divclass="ttc" id="agroup__data__func__select_htm_ga8a956fa53ec9e6cecccaeb2773a79259"><divclass="ttname"><ahref="group__data__func__select.htm#ga8a956fa53ec9e6cecccaeb2773a79259">af_select_scalar_r_long</a></div><divclass="ttdeci">AFAPI af_err af_select_scalar_r_long(af_array *out, const af_array cond, const af_array a, const long long b)</div><divclass="ttdoc">C Interface to select elements based on a conditional array.</div></div>
<divclass="ttc" id="agroup__data__func__select_htm_gab6886120d0bac4717276910e468bbe88"><divclass="ttname"><ahref="group__data__func__select.htm#gab6886120d0bac4717276910e468bbe88">af_select_scalar_r</a></div><divclass="ttdeci">AFAPI af_err af_select_scalar_r(af_array *out, const af_array cond, const af_array a, const double b)</div><divclass="ttdoc">C Interface to select elements based on a conditional array.</div></div>
<divclass="ttc" id="agroup__data__func__select_htm_gac4af16e31ddd5ddcf09b670f676fd093"><divclass="ttname"><ahref="group__data__func__select.htm#gac4af16e31ddd5ddcf09b670f676fd093">af_select</a></div><divclass="ttdeci">AFAPI af_err af_select(af_array *out, const af_array cond, const af_array a, const af_array b)</div><divclass="ttdoc">C Interface to select elements based on a conditional array.</div></div>
<divclass="ttc" id="agroup__data__func__upper_htm_ga7a4077d52aa4b4b22cccb29a1bdd32ea"><divclass="ttname"><ahref="group__data__func__upper.htm#ga7a4077d52aa4b4b22cccb29a1bdd32ea">af_upper</a></div><divclass="ttdeci">AFAPI af_err af_upper(af_array *out, const af_array in, bool is_unit_diag)</div><divclass="ttdoc">C Interface to return the upper triangle array.</div></div>
<divclass="ttc" id="agroup__data__func__upper_htm_gaf31c8b029aa632a17995a2f018f0da0f"><divclass="ttname"><ahref="group__data__func__upper.htm#gaf31c8b029aa632a17995a2f018f0da0f">af::upper</a></div><divclass="ttdeci">AFAPI array upper(const array &in, bool is_unit_diag=false)</div><divclass="ttdoc">C++ Interface to return the upper triangle array.</div></div>
<divclass="ttc" id="agroup__manip__func__flat_htm_gac0b04a65e0b17278203a2a5a952be02f"><divclass="ttname"><ahref="group__manip__func__flat.htm#gac0b04a65e0b17278203a2a5a952be02f">af::flat</a></div><divclass="ttdeci">AFAPI array flat(const array &in)</div><divclass="ttdoc">C++ Interface to flatten an array.</div></div>
<divclass="ttc" id="agroup__manip__func__flat_htm_gac6dfb22cbd3b151ddffb9a4ddf74455e"><divclass="ttname"><ahref="group__manip__func__flat.htm#gac6dfb22cbd3b151ddffb9a4ddf74455e">af_flat</a></div><divclass="ttdeci">AFAPI af_err af_flat(af_array *out, const af_array in)</div><divclass="ttdoc">C Interface to flatten an array.</div></div>
<divclass="ttc" id="agroup__manip__func__flip_htm_ga6ff6ec075121a26867608360ced85c86"><divclass="ttname"><ahref="group__manip__func__flip.htm#ga6ff6ec075121a26867608360ced85c86">af::flip</a></div><divclass="ttdeci">AFAPI array flip(const array &in, const unsigned dim)</div><divclass="ttdoc">C++ Interface to flip an array.</div></div>
<divclass="ttc" id="agroup__manip__func__flip_htm_gac0795e2a4343ea8f897b3b7d23802ccb"><divclass="ttname"><ahref="group__manip__func__flip.htm#gac0795e2a4343ea8f897b3b7d23802ccb">af_flip</a></div><divclass="ttdeci">AFAPI af_err af_flip(af_array *out, const af_array in, const unsigned dim)</div><divclass="ttdoc">C Interface to flip an array.</div></div>
<divclass="ttc" id="agroup__manip__func__join_htm_ga4c0b185d13b49023cc22c0269eedbdb2"><divclass="ttname"><ahref="group__manip__func__join.htm#ga4c0b185d13b49023cc22c0269eedbdb2">af_join</a></div><divclass="ttdeci">AFAPI af_err af_join(af_array *out, const int dim, const af_array first, const af_array second)</div><divclass="ttdoc">C Interface to join 2 arrays along a dimension.</div></div>
<divclass="ttc" id="agroup__manip__func__join_htm_ga67a36384247f6bb40254e0cb2e6d5d5c"><divclass="ttname"><ahref="group__manip__func__join.htm#ga67a36384247f6bb40254e0cb2e6d5d5c">af_join_many</a></div><divclass="ttdeci">AFAPI af_err af_join_many(af_array *out, const int dim, const unsigned n_arrays, const af_array *inputs)</div><divclass="ttdoc">C Interface to join many arrays along a dimension.</div></div>
<divclass="ttc" id="agroup__manip__func__join_htm_gaa829b2ec622d809f760a39a631162772"><divclass="ttname"><ahref="group__manip__func__join.htm#gaa829b2ec622d809f760a39a631162772">af::join</a></div><divclass="ttdeci">AFAPI array join(const int dim, const array &first, const array &second)</div><divclass="ttdoc">C++ Interface to join 2 arrays along a dimension.</div></div>
<divclass="ttc" id="agroup__manip__func__moddims_htm_ga13488a6c9e298fd44dd343347d7b156d"><divclass="ttname"><ahref="group__manip__func__moddims.htm#ga13488a6c9e298fd44dd343347d7b156d">af::moddims</a></div><divclass="ttdeci">AFAPI array moddims(const array &in, const dim4 &dims)</div><divclass="ttdoc">C++ Interface to modify the dimensions of an input array to a specified shape.</div></div>
<divclass="ttc" id="agroup__manip__func__moddims_htm_ga50442cfa497c34054c3dc4404e92667a"><divclass="ttname"><ahref="group__manip__func__moddims.htm#ga50442cfa497c34054c3dc4404e92667a">af_moddims</a></div><divclass="ttdeci">AFAPI af_err af_moddims(af_array *out, const af_array in, const unsigned ndims, const dim_t *const dims)</div><divclass="ttdoc">C Interface to modify the dimensions of an input array to a specified shape.</div></div>
<divclass="ttc" id="agroup__manip__func__reorder_htm_ga57383f4d00a3a86eab08dddd52c3ad3d"><divclass="ttname"><ahref="group__manip__func__reorder.htm#ga57383f4d00a3a86eab08dddd52c3ad3d">af_reorder</a></div><divclass="ttdeci">AFAPI af_err af_reorder(af_array *out, const af_array in, const unsigned x, const unsigned y, const unsigned z, const unsigned w)</div><divclass="ttdoc">C Interface to reorder an array.</div></div>
<divclass="ttc" id="agroup__manip__func__shift_htm_ga64a0cd7680b71e87f3ab372876153b66"><divclass="ttname"><ahref="group__manip__func__shift.htm#ga64a0cd7680b71e87f3ab372876153b66">af_shift</a></div><divclass="ttdeci">AFAPI af_err af_shift(af_array *out, const af_array in, const int x, const int y, const int z, const int w)</div><divclass="ttdoc">C Interface to shift an array.</div></div>
<divclass="ttc" id="agroup__manip__func__shift_htm_ga731b20f4fcf65b45342c3ff4a37599c2"><divclass="ttname"><ahref="group__manip__func__shift.htm#ga731b20f4fcf65b45342c3ff4a37599c2">af::shift</a></div><divclass="ttdeci">AFAPI array shift(const array &in, const int x, const int y=0, const int z=0, const int w=0)</div><divclass="ttdoc">C++ Interface to shift an array.</div></div>
<divclass="ttc" id="agroup__manip__func__tile_htm_ga3540329723c9876839e0c790075ab076"><divclass="ttname"><ahref="group__manip__func__tile.htm#ga3540329723c9876839e0c790075ab076">af_tile</a></div><divclass="ttdeci">AFAPI af_err af_tile(af_array *out, const af_array in, const unsigned x, const unsigned y, const unsigned z, const unsigned w)</div><divclass="ttdoc">C Interface to generate a tiled array.</div></div>