(Inner product) Assume two vectors a = (ao, Q1, ..., An-1) and (bo, b1, ..., bn-1). The inner product between a and b is
Posted: Fri May 20, 2022 12:23 pm
the result.
(Inner product) Assume two vectors a = (ao, Q1, ..., An-1) and (bo, b1, ..., bn-1). The inner product between a and b is defined as a. b = a,bo + a bı + ... + an-1bn-1 For given a and b, compute the inner product of a · b.
• Program setup 1) Ask the user to enter two vectors of length n = 5, and store them in arrays a and b (float). 2) Implement a function that returns the inner product between a and b. The array names are passed as pointers to the function. 3) Display the result. The prototype of the functions is as follows. - float inn_prod(float* a, float* b, int len);