Replace elements of an array based on a conditional array. More...

Functions

AFAPI void replace (array &a, const array &cond, const array &b)
 
AFAPI void replace (array &a, const array &cond, const double &b)
 
AFAPI af_err af_replace (af_array a, const af_array cond, const af_array b)
 
AFAPI af_err af_replace_scalar (af_array a, const af_array cond, const double b)
 

Detailed Description

Replace elements of an array based on a conditional array.


Function Documentation

◆ af_replace()

AFAPI af_err af_replace ( af_array  a,
const af_array  cond,
const af_array  b 
)
Parameters
[in,out]ais the input array
[in]condis the conditional array.
[in]bis the replacement array.
Note
Values of a are replaced with corresponding values of b, when cond is false.

◆ af_replace_scalar()

AFAPI af_err af_replace_scalar ( af_array  a,
const af_array  cond,
const double  b 
)
Parameters
[in,out]ais the input array
[in]condis the conditional array.
[in]bis the replacement array.
Note
Values of a are replaced with corresponding values of b, when cond is false.

◆ replace() [1/2]

AFAPI void af::replace ( array a,
const array cond,
const array b 
)
Parameters
[in,out]ais the input array
[in]condis the conditional array.
[in]bis the replacement array.
Note
Values of a are replaced with corresponding values of b, when cond is false.

◆ replace() [2/2]

AFAPI void af::replace ( array a,
const array cond,
const double &  b 
)
Parameters
[in,out]ais the input array
[in]condis the conditional array.
[in]bis the replacement value.
Note
Values of a are replaced with corresponding values of b, when cond is false.