Function rc_vector_subtract#

Function Documentation#

int rc_vector_subtract(rc_vector_t v1, rc_vector_t v2, rc_vector_t *s)#

Populates vector s with the difference v1 - v2.

v1 and v2 must be of the same length. Any existing memory allocated for s is freed and lost, new memory is allocated if necessary.

Parameters:
  • v1[in] User’s vector struct

  • v2[in] User’s vector struct

  • s[out] output difference v1-v2

Returns:

Returns 0 on success, otherwise -1.