GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Main Page
  • Tutorials
  • Functions
  • Release Notes
  • Examples

This view

  • Original page
  • New address

GeezerVison is showing arrayfire.org — ArrayFire: replace

Logo
A high-performance general-purpose compute library
  • Main Page
  • Tutorials
  • Functions
  • Release Notes
  • Examples
Functions
replace
ArrayFire Functions | ArrayFire Functions by Category » Functions to create and modify Arrays » Move and Reorder array content

Replace elements of an array with elements of another array. More...

Functions

AFAPI void replace (array &a, const array &cond, const array &b)
 C++ Interface to replace elements of an array with elements of another array. More...
 
AFAPI void replace (array &a, const array &cond, const double &b)
 C++ Interface to replace elements of an array with a scalar value. More...
 
AFAPI void replace (array &a, const array &cond, const long long b)
 C++ Interface to replace elements of an array with a scalar value. More...
 
AFAPI void replace (array &a, const array &cond, const unsigned long long b)
 C++ Interface to replace elements of an array with a scalar value. More...
 
AFAPI af_err af_replace (af_array a, const af_array cond, const af_array b)
 C Interface to replace elements of an array with elements of another array. More...
 
AFAPI af_err af_replace_scalar (af_array a, const af_array cond, const double b)
 C Interface to replace elements of an array with a scalar value. More...
 
AFAPI af_err af_replace_scalar_long (af_array a, const af_array cond, const long long b)
 C Interface to replace elements of an array with a scalar value. More...
 
AFAPI af_err af_replace_scalar_ulong (af_array a, const af_array cond, const unsigned long long b)
 C Interface to replace elements of an array with a scalar value. More...
 

Detailed Description

Replace elements of an array with elements of another array.

Input values are retained when corresponding elements from the conditional array are true. Input values are replaced when corresponding elements from the conditional array are false.


Function Documentation

◆ af_replace()

AFAPI af_err af_replace ( af_array  a,
const af_array  cond,
const af_array  b 
)

C Interface to replace elements of an array with elements of another array.

Elements of a are replaced with corresponding elements of b when cond is false.

Parameters
[in,out]ainput array
[in]condconditional array
[in]breplacement array
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ af_replace_scalar()

AFAPI af_err af_replace_scalar ( af_array  a,
const af_array  cond,
const double  b 
)

C Interface to replace elements of an array with a scalar value.

Elements of a are replaced with a scalar value when cond is false.

Parameters
[in,out]ainput array
[in]condconditional array
[in]breplacement scalar value
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ af_replace_scalar_long()

AFAPI af_err af_replace_scalar_long ( af_array  a,
const af_array  cond,
const long long  b 
)

C Interface to replace elements of an array with a scalar value.

Elements of a are replaced with a scalar value when cond is false.

Parameters
[in,out]ainput array
[in]condconditional array
[in]breplacement scalar value
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ af_replace_scalar_ulong()

AFAPI af_err af_replace_scalar_ulong ( af_array  a,
const af_array  cond,
const unsigned long long  b 
)

C Interface to replace elements of an array with a scalar value.

Elements of a are replaced with a scalar value when cond is false.

Parameters
[in,out]ainput array
[in]condconditional array
[in]breplacement scalar value
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ replace() [1/4]

AFAPI void replace ( array &  a,
const array &  cond,
const array &  b 
)

C++ Interface to replace elements of an array with elements of another array.

Elements of a are replaced with corresponding elements of b when cond is false.

Parameters
[in,out]ainput array
[in]condconditional array
[in]breplacement array
Examples
pde/bhrt.cpp, and pde/boltzmann_cfd.cpp.

◆ replace() [2/4]

AFAPI void replace ( array &  a,
const array &  cond,
const double &  b 
)

C++ Interface to replace elements of an array with a scalar value.

Elements of a are replaced with a scalar value when cond is false.

Parameters
[in,out]ainput array
[in]condconditional array
[in]breplacement scalar value

◆ replace() [3/4]

AFAPI void replace ( array &  a,
const array &  cond,
const long long  b 
)

C++ Interface to replace elements of an array with a scalar value.

Elements of a are replaced with a scalar value when cond is false.

Parameters
[in,out]ainput array
[in]condconditional array
[in]breplacement scalar value

◆ replace() [4/4]

AFAPI void replace ( array &  a,
const array &  cond,
const unsigned long long  b 
)

C++ Interface to replace elements of an array with a scalar value.

Elements of a are replaced with a scalar value when cond is false.

Parameters
[in,out]ainput array
[in]condconditional array
[in]breplacement scalar value
  • Generated by doxygen 1.9.5
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.