Function rc_vector_from_array#

Function Documentation#

int rc_vector_from_array(rc_vector_t *v, double *ptr, int length)#

Resizes vector v and populates with values from specified array ptr.

Any existing memory allocated for v is freed if necessary to avoid memory leaks. It is not necessary to call rc_alloc_vector before this. This is generally used when the user has an existing array of data and wants to use it with other math functions.

Parameters:
  • v – Pointer to user’s rc_vector_t struct

  • ptr[in] pointer to array to read values from

  • length[in] Length of vector to allocate memory for

Returns:

Returns 0 if successful, otherwise returns -1.