Write a code that does the following: ( C programming ) //In all of the functions below,
Question:
Write a code that does the following: ( C programming )
//In all of the functions below, all arguments of type Matrix
//or Vector are passed by reference (since they are array types).
/* set_vector(Vout, vector_size, value)
Given a scalar value, a reference to a vector and a size,
set the elements of Vout at indices 0, 1, 2, ..., vector_size - 1
to the provided value. Do not set any other indices of the vector.
*/
void set_vector(Vector Vout, int vector_size, double value);
/* add_scalar_to_vector(V, Vout, vector_size, value)
Given an input vector V, an output vector V, a size and a value,
set every element of Vout to be the corresponding element
of V plus the provided value. Only use indices 0 - (vector_size-1).
Do not modify any elements of the input vector V.
*/
void add_scalar_to_vector(Vector V, Vector Vout, int vector_size, double value);
/* mul_vector_by_scalar(V, Vout, vector_size, value)
Given an input vector V, an output vector V, a size and a value,
set every element of Vout to be the corresponding element
of V multiplied by the provided value. Only use indices 0 - (vector_size-1).
Do not modify any elements of the input vector V.
*/
void mul_vector_by_scalar(Vector V, Vector Vout, int vector_size, double value);