A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Functions
join
ArrayFire Functions | ArrayFire Functions by Category » Functions to create and modify Arrays » Move and Reorder array content

## Functions
AFAPI array | join (const int dim, const array &first, const array &second)
| C++ Interface to join 2 arrays along a dimension.
AFAPI array | join (const int dim, const array &first, const array &second, const array &third)
| C++ Interface to join 3 arrays along a dimension.
AFAPI array | join (const int dim, const array &first, const array &second, const array &third, const array &fourth)
| C++ Interface to join 4 arrays along a dimension.
AFAPI af_err | af_join (af_array *out, const int dim, const af_array first, const af_array second)
| C Interface to join 2 arrays along a dimension.
AFAPI af_err | af_join_many (af_array *out, const int dim, const unsigned n_arrays, const af_array *inputs)
| C Interface to join many arrays along a dimension.

## Detailed Description

Join up to 4 arrays along specified dimension.

Requires that all dimensions except the join dimension must be the same for all arrays.

## Function Documentation

## ◆ af_join()

AFAPI af_err af_join | ( | af_array * | out,
|  | const int | dim,
|  | const af_array | first,
|  | const af_array | second )

C Interface to join 2 arrays along a dimension.

Empty arrays are ignored.

Parameters

  [out] | out | joined array
  [in] | dim | dimension along which the join occurs
  [in] | first | input array
  [in] | second | input array

Returns
  AF_SUCCESS, if function returns successfully, else an af_err code is given

## ◆ af_join_many()

AFAPI af_err af_join_many | ( | af_array * | out,
|  | const int | dim,
|  | const unsigned | n_arrays,
|  | const af_array * | inputs )

C Interface to join many arrays along a dimension.

Limited to 10 arrays. Empty arrays are ignored.

Parameters

  [out] | out | joined array
  [in] | dim | dimension along which the join occurs
  [in] | n_arrays | number of arrays to join
  [in] | inputs | array of af_arrays containing handles to the arrays to be joined

Returns
  AF_SUCCESS, if function returns successfully, else an af_err code is given

## ◆ join() [1/3]

AFAPI array join | ( | const int | dim,
|  | const array & | first,
|  | const array & | second )

C++ Interface to join 2 arrays along a dimension.

Empty arrays are ignored.

Parameters

  [in] | dim | dimension along which the join occurs
  [in] | first | input array
  [in] | second | input array

Returns
  joined array

## ◆ join() [2/3]

AFAPI array join | ( | const int | dim,
|  | const array & | first,
|  | const array & | second,
|  | const array & | third )

C++ Interface to join 3 arrays along a dimension.

Empty arrays are ignored.

Parameters

  [in] | dim | dimension along which the join occurs
  [in] | first | input array
  [in] | second | input array
  [in] | third | input array

Returns
  joined array

## ◆ join() [3/3]

AFAPI array join | ( | const int | dim,
|  | const array & | first,
|  | const array & | second,
|  | const array & | third,
|  | const array & | fourth )

C++ Interface to join 4 arrays along a dimension.

Empty arrays are ignored.

Parameters

  [in] | dim | dimension along which the join occurs
  [in] | first | input array
  [in] | second | input array
  [in] | third | input array
  [in] | fourth | input array

Returns
  joined array