Instructions to use NoesisLab/LITOperator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LeRobot
How to use NoesisLab/LITOperator with LeRobot:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download lit_operator/dense.c from NoesisLab/LITOperator: direct link, hf CLI and curl.
- Browser
- Download file 2.05 kB
-
https://huggingface.co/NoesisLab/LITOperator/resolve/main/lit_operator/dense.c
- Command line
-
hf download hf://NoesisLab/LITOperator/lit_operator/dense.c
-
curl -L -o dense.c https://huggingface.co/NoesisLab/LITOperator/resolve/main/lit_operator/dense.c
2.05 kB
| /* | |
| * dense.c — the dense body simulator: symbols x symbols x time. | |
| * | |
| * The body is never stored. Every cell is a coordinate name, and the | |
| * cut mask is a function evaluated on demand. A search therefore | |
| * spends memory only on the tree it walks. | |
| */ | |
| int dense_init(dense *d, uint32_t symbols, uint64_t steps, | |
| int (*cut)(void *ctx, uint32_t a, uint32_t b, uint64_t t), | |
| void *ctx) | |
| { | |
| uint64_t x2; | |
| if (!d || symbols == 0 || steps == 0) { | |
| return -1; | |
| } | |
| x2 = (uint64_t)symbols * symbols; | |
| if (x2 > UINT64_MAX / steps) { | |
| return -1; | |
| } | |
| memset(d, 0, sizeof(*d)); | |
| d->symbols = symbols; | |
| d->steps = steps; | |
| d->cells = x2 * steps; | |
| d->cut = cut; | |
| d->ctx = ctx; | |
| return 0; | |
| } | |
| void dense_free(dense *d) | |
| { | |
| if (d) { | |
| memset(d, 0, sizeof(*d)); | |
| } | |
| } | |
| uint64_t dense_cells(const dense *d) | |
| { | |
| return d ? d->cells : 0; | |
| } | |
| uint64_t dense_index(const dense *d, uint32_t a, uint32_t b, | |
| uint64_t t) | |
| { | |
| if (!d || a >= d->symbols || b >= d->symbols || t >= d->steps) { | |
| return UINT64_MAX; | |
| } | |
| return ((t * d->symbols + a) * d->symbols) + b; | |
| } | |
| int dense_cell(const dense *d, uint64_t cell, uint32_t *a, | |
| uint32_t *b, uint64_t *t) | |
| { | |
| uint64_t x2; | |
| if (!d || cell >= d->cells) { | |
| return -1; | |
| } | |
| x2 = (uint64_t)d->symbols * d->symbols; | |
| if (a) { | |
| *a = (uint32_t)((cell / d->symbols) % d->symbols); | |
| } | |
| if (b) { | |
| *b = (uint32_t)(cell % d->symbols); | |
| } | |
| if (t) { | |
| *t = cell / x2; | |
| } | |
| return 0; | |
| } | |
| int dense_cut(const dense *d, uint64_t cell) | |
| { | |
| uint32_t a; | |
| uint32_t b; | |
| uint64_t t; | |
| uint64_t x2; | |
| if (!d || cell >= d->cells) { | |
| return 1; | |
| } | |
| if (!d->cut) { | |
| return 0; | |
| } | |
| x2 = (uint64_t)d->symbols * d->symbols; | |
| b = (uint32_t)(cell % d->symbols); | |
| a = (uint32_t)((cell / d->symbols) % d->symbols); | |
| t = cell / x2; | |
| return d->cut(d->ctx, a, b, t) ? 1 : 0; | |
| } | |