create a_linalg_dot
[liba.git] / test / trajbell.h
blob084885f476ac4cb1000c72f7a84551f2ed38849e
1 #define MAIN(x) trajbell##x
2 #include "test.h"
3 #include "a/trajbell.h"
5 int main(int argc, char *argv[]) /* NOLINT(misc-definitions-in-headers) */
7 a_float arg[7] = {0, 0, 0, 0, 0, 0, 0};
8 a_float t, x, delta;
9 int i, start = 1;
10 a_trajbell ctx;
12 if (argc > 1)
14 char *endptr = A_NULL;
15 (void)strtonum(argv[1], &endptr);
16 if (argv[1] == endptr)
18 main_init(argc, argv, 1);
19 ++start;
23 for (i = start; i < argc; ++i)
25 arg[i - start] = strtonum(argv[i], A_NULL);
27 t = a_trajbell_gen(&ctx, arg[0], arg[1], arg[2], arg[3], arg[4], arg[5], arg[6]);
28 for ((void)(x = 0), delta = t / 1000; x < t; x += delta) /* NOLINT */
30 debug("%+" A_FLOAT_PRI "f,%+" A_FLOAT_PRI "f,%+" A_FLOAT_PRI "f,%+" A_FLOAT_PRI "f,%+" A_FLOAT_PRI "f\n",
31 x, a_trajbell_pos(&ctx, x), a_trajbell_vel(&ctx, x), a_trajbell_acc(&ctx, x), a_trajbell_jer(&ctx, x));
34 #if defined(__cplusplus) && (__cplusplus > 201100L)
35 A_BUILD_ASSERT(std::is_pod<a_trajbell>::value);
36 #endif /* __cplusplus */
38 return 0;