This is the latest (main) BeagleBoard documentation. If you are looking for stable releases, use the drop-down menu on the bottom-left and select the desired version.

Function rc_matrix_alloc

Function Documentation

int rc_matrix_alloc(rc_matrix_t *A, int rows, int cols)

Allocates memory for matrix A to have size rows&cols.

If A is initially the right size, nothing is done and the data in A is preserved. If A is uninitialized or of the wrong size then any existing memory is freed and new memory is allocated, helping to prevent accidental memory leaks. The contents of the new matrix is not guaranteed to be anything in particular as the memory is allocated with malloc. Will only be unsuccessful if rows&cols are invalid or there is insufficient memory available.

Parameters
  • A – Pointer to user’s matrix struct

  • rows[in] number of rows

  • cols[in] number of columns

Returns

0 on success, -1 on failure.