VLFeat - Documentation > C API

# VLFeat.org

Documentation> C API

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

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

## Detailed Description

Array - Definition.

Author
  Andrea Vedaldi

## Function Documentation

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

Parameters

  self | array.

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

Parameters

  self | array.

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

inline

Parameters

  self | array.

Returns
  data.

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

inline

Parameters

  self | array.

Returns
  type.

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

inline

Parameters

  self | array.

Returns
  dimensions.

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

inline

Parameters

  self | array.

Returns
  number of dimensions.

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

Parameters

  self | array.

Returns
  number of elements.

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.

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.

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.

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.

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.

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.

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.

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.