Documentation>C API
Data Structures | Macros
array.h File Reference

Array. More...

`#include "generic.h"`

## Data Structures

struct | VlArray
| Numeric array. More...

## Macros

#define | VL_ARRAY_MAX_NUM_DIMENSIONS 16
| Maximum number of array dimensions.

## Functions

Get data and parameters
vl_size | vl_array_get_num_dimensions (VlArray const *self)
| Get number of dimensions.
vl_size const * | vl_array_get_dimensions (VlArray const *self)
| Get dimensions.
void * | vl_array_get_data (VlArray const *self)
| Get data.
vl_type | vl_array_get_data_type (VlArray const *self)
| Get type.
vl_size | vl_array_get_num_elements (VlArray const *self)
| Get number of elements in array.
Constructing and destroying
VlArray * | vl_array_init (VlArray *self, vl_type type, vl_size numDimension, vl_size const *dimensions)
| New numeric array.
VlArray * | vl_array_init_envelope (VlArray *self, void *data, vl_type type, vl_size numDimension, vl_size const *dimensions)
| New numeric array envelope.
VlArray * | vl_array_init_matrix (VlArray *self, vl_type type, vl_size numRows, vl_size numColumns)
| New numeric array with matrix shape.
VlArray * | vl_array_init_matrix_envelope (VlArray *self, void *data, vl_type type, vl_size numRows, vl_size numColumns)
| New numeric array envelpe with matrix shape.
VlArray * | vl_array_new (vl_type type, vl_size numDimension, vl_size const *dimensions)
| New numeric array.
VlArray * | vl_array_new_envelope (void *data, vl_type type, vl_size numDimension, vl_size const *dimensions)
| New numeric array envelope.
VlArray * | vl_array_new_matrix (vl_type type, vl_size numRows, vl_size numColumns)
| New numeric array with matrix shape.
VlArray * | vl_array_new_matrix_envelope (void *data, vl_type type, vl_size numRows, vl_size numColumns)
| New numeric array envelpe with matrix shape.
void | vl_array_dealloc (VlArray *self)
| Delete array.
void | vl_array_delete (VlArray *self)
| Delete array.

## Detailed Description

Array - Definition.

Author
  Andrea Vedaldi

## Function Documentation

## ◆ vl_array_dealloc()

void vl_array_dealloc | ( | VlArray * | self | ) |

Parameters

  self | array.

## ◆ vl_array_delete()

void vl_array_delete | ( | VlArray * | self | ) |

Parameters

  self | array.

## ◆ vl_array_get_data()

void * vl_array_get_data | ( | VlArray const * | self | ) |

inline

Parameters

  self | array.

Returns
  data.

## ◆ vl_array_get_data_type()

vl_type vl_array_get_data_type | ( | VlArray const * | self | ) |

inline

Parameters

  self | array.

Returns
  type.

## ◆ vl_array_get_dimensions()

vl_size const * vl_array_get_dimensions | ( | VlArray const * | self | ) |

inline

Parameters

  self | array.

Returns
  dimensions.

## ◆ vl_array_get_num_dimensions()

vl_size vl_array_get_num_dimensions | ( | VlArray const * | self | ) |

inline

Parameters

  self | array.

Returns
  number of dimensions.

## ◆ vl_array_get_num_elements()

vl_size vl_array_get_num_elements | ( | VlArray const * | self | ) |

Parameters

  self | array.

Returns
  number of elements.

## ◆ vl_array_init()

VlArray * vl_array_init | ( | VlArray * | self,
|  | vl_type | type,
|  | vl_size | numDimensions,
|  | vl_size const * | dimensions )

Parameters

  self | array to initialize.
  type | data type.
  numDimensions | number of dimensions.
  dimensions | dimensions.

The function initializes the specified array and allocates the necessary memory for storage.

## ◆ vl_array_init_envelope()

VlArray * vl_array_init_envelope | ( | VlArray * | self,
|  | void * | data,
|  | vl_type | type,
|  | vl_size | numDimensions,
|  | vl_size const * | dimensions )

Parameters

  self | array to initialize.
  data | data to envelople.
  type | data type.
  numDimensions | number of dimensions.
  dimensions | dimensions.

The function initializes the specified array wrapping the specified buffer.

## ◆ vl_array_init_matrix()

VlArray * vl_array_init_matrix | ( | VlArray * | self,
|  | vl_type | type,
|  | vl_size | numRows,
|  | vl_size | numColumns )

Parameters

  self | array to initialize.
  type | type.
  numRows | number of rows.
  numColumns | number of columns.

## ◆ vl_array_init_matrix_envelope()

VlArray * vl_array_init_matrix_envelope | ( | VlArray * | self,
|  | void * | data,
|  | vl_type | type,
|  | vl_size | numRows,
|  | vl_size | numColumns )

Parameters

  self | array to initialize.
  data | data to envelope.
  type | type.
  numRows | number of rows.
  numColumns | number of columns.

## ◆ vl_array_new()

VlArray * vl_array_new | ( | vl_type | type,
|  | vl_size | numDimensions,
|  | vl_size const * | dimensions )

Parameters

  type | data type.
  numDimensions | number of dimensions.
  dimensions | dimensions.

The function creates a new VLArray instance and allocates the necessary memory for storage.

## ◆ vl_array_new_envelope()

VlArray * vl_array_new_envelope | ( | void * | data,
|  | vl_type | type,
|  | vl_size | numDimensions,
|  | vl_size const * | dimensions )

Parameters

  data | data to envelople.
  type | data type.
  numDimensions | number of dimensions.
  dimensions | dimensions.

## ◆ vl_array_new_matrix()

VlArray * vl_array_new_matrix | ( | vl_type | type,
|  | vl_size | numRows,
|  | vl_size | numColumns )

Parameters

  type | type.
  numRows | number of rows.
  numColumns | number of columns.

## ◆ vl_array_new_matrix_envelope()

VlArray * vl_array_new_matrix_envelope | ( | void * | data,
|  | vl_type | type,
|  | vl_size | numRows,
|  | vl_size | numColumns )

Parameters

  data | data to envelope.
  type | type.
  numRows | number of rows.
  numColumns | number of columns.