1 //
2 // dotprod_rrrf_example.c
3 //
4 // This example demonstrates the interface to the floating-point dot
5 // product object (dotprod_rrrf).
6 //
7
8 #include <stdio.h>
9 #include "liquid.h"
10
main()11 int main() {
12 // input array
13 float x[] = { 1, 2, 3, 4, 5};
14
15 // coefficients array
16 float h[] = { 1, -1, 1, -1, 1};
17
18 // dot product result
19 float y;
20
21 // run regular dot product
22 dotprod_rrrf_run(x,h,5,&y);
23 printf("dotprod_rrrf : %8.2f\n", y);
24
25 // run structured dot product
26 dotprod_rrrf q = dotprod_rrrf_create(x,5);
27 dotprod_rrrf_execute(q,h,&y);
28 printf("dotprod_rrrf (structured) : %8.2f\n", y);
29 dotprod_rrrf_destroy(q);
30
31 return 0;
32 }
33
34
35