Download test/unit/test_matrix/test_solve.c from camenduru/pocketsphinx: direct link, hf CLI and curl.
- Browser
- Download file 598 Bytes
-
https://huggingface.co/camenduru/pocketsphinx/resolve/main/test/unit/test_matrix/test_solve.c
- Command line
-
hf download hf://camenduru/pocketsphinx/test/unit/test_matrix/test_solve.c
-
curl -L -o test_solve.c https://huggingface.co/camenduru/pocketsphinx/resolve/main/test/unit/test_matrix/test_solve.c
598 Bytes
| const float32 foo[3][3] = { | |
| {2, 1, 1}, | |
| {1, 2, 1}, | |
| {1, 1, 2} | |
| }; | |
| float32 bar[3] = {1, 3, 1}; | |
| int | |
| main(int argc, char *argv[]) | |
| { | |
| float32 **a, *x; | |
| int i; | |
| (void)argc; | |
| (void)argv; | |
| a = (float32 **)ckd_calloc_2d(3, 3, sizeof(float32)); | |
| memcpy(a[0], foo, sizeof(float32) * 3 * 3); | |
| x = ckd_calloc(3, sizeof(float32)); | |
| /* Should see: | |
| -0.25 1.75 -0.25 | |
| */ | |
| solve(a, bar, x, 3); | |
| for (i = 0; i < 3; ++i) | |
| printf("%.2f ", x[i]); | |
| printf("\n"); | |
| ckd_free_2d((void **)a); | |
| ckd_free(x); | |
| return 0; | |
| } | |