Function rc_vector_sum#
Defined in File vector.h
Function Documentation#
-
int rc_vector_sum(rc_vector_t v1, rc_vector_t v2, rc_vector_t *s)#
Populates vector s with the sum of vectors v1 and 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 sum
- Returns:
Returns 0 on success, otherwise -1.