- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

Functions
complex
Complete List of ArrayFire Functions ArrayFire Functions by Category » Mathematical functions » | Complex operations

create complex arrays More...

## Functions
AFAPI af_err | af_cplx2 (af_array *out, const af_array lhs, const af_array rhs, const bool batch)
| C Interface for creating complex array from two input arrays. More...
AFAPI af_err | af_cplx (af_array *out, const af_array in)
| C Interface for creating complex array from real array. More...
AFAPI array | complex (const array &lhs, const array &rhs)
| C++ Interface for creating complex array from two inputs. More...
AFAPI array | complex (const array &lhs, const double rhs)
| C++ Interface for creating complex array from two inputs. More...
AFAPI array | complex (const double lhs, const array &rhs)
| C++ Interface for creating complex array from two inputs. More...
AFAPI array | complex (const array &in)
| C++ Interface for creating complex array from real array. More...

## Detailed Description

create complex arrays

## Function Documentation

AFAPI af_err af_cplx | ( | af_array * | out,
|  | const af_array | in
| ) |  |

C Interface for creating complex array from real array.

Parameters

  [out] | out | will contain complex array created from real input `in`
  [in] | in | is real array

Returns
  AF_SUCCESS if the execution completes properly

AFAPI af_err af_cplx2 | ( | af_array * | out,
|  | const af_array | lhs,
|  | const af_array | rhs,
|  | const bool | batch
| ) |  |

C Interface for creating complex array from two input arrays.

Parameters

  [out] | out | will contain the complex array generated from inputs
  [in] | lhs | is real array
  [in] | rhs | is imaginary array
  [in] | batch | specifies if operations need to be performed in batch mode

Returns
  AF_SUCCESS if the execution completes properly

AFAPI array af::complex | ( | const array & | lhs,
|  | const array & | rhs
| ) |  |

C++ Interface for creating complex array from two inputs.

Creates a complex number from two sets of inputs. The left hand side is the real part and the right hand side is the imaginary part. This function accepts two af::array or one af::array and a scalar as nputs.

Parameters

  [in] | lhs | is real value(s)
  [in] | rhs | is imaginary value(s)

Returns
  complex array from inputs

Examples:
  fractal.cpp.

AFAPI array af::complex | ( | const array & | lhs,
|  | const double | rhs
| ) |  |

C++ Interface for creating complex array from two inputs.

Creates a complex number from two sets of inputs. The left hand side is the real part and the right hand side is the imaginary part. This function accepts two af::array or one af::array and a scalar as nputs.

Parameters

  [in] | lhs | is real value(s)
  [in] | rhs | is imaginary value(s)

Returns
  complex array from inputs

AFAPI array af::complex | ( | const double | lhs,
|  | const array & | rhs
| ) |  |

C++ Interface for creating complex array from two inputs.

Creates a complex number from two sets of inputs. The left hand side is the real part and the right hand side is the imaginary part. This function accepts two af::array or one af::array and a scalar as nputs.

Parameters

  [in] | lhs | is real value(s)
  [in] | rhs | is imaginary value(s)

Returns
  complex array from inputs

AFAPI array af::complex | ( | const array & | in | ) |

C++ Interface for creating complex array from real array.

Parameters

  [in] | in | is real array

Returns
  complex array from `in`