diff options
| author | Tyge Løvset <[email protected]> | 2020-12-17 08:00:00 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-12-17 08:00:00 +0100 |
| commit | c432774d0d08aa1b379fd513e68e46483c477208 (patch) | |
| tree | 0922faa29f5e60a5e67d3e0a55b450aced70446d /docs | |
| parent | bc2981ee8fa3cba0be0d0efb1e2a2072c98ca5a0 (diff) | |
| parent | fa128b7b255760540ea95c7c6855de6ce7e10382 (diff) | |
| download | STC-modified-c432774d0d08aa1b379fd513e68e46483c477208.tar.gz STC-modified-c432774d0d08aa1b379fd513e68e46483c477208.zip | |
Merge branch 'master' of https://github.com/tylo-work/C99Containers into master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/carray_api.md | 31 | ||||
| -rw-r--r-- | docs/copt_api.md | 8 | ||||
| -rw-r--r-- | docs/crand_api.md | 8 |
3 files changed, 25 insertions, 22 deletions
diff --git a/docs/carray_api.md b/docs/carray_api.md index 24841448..248c67c1 100644 --- a/docs/carray_api.md +++ b/docs/carray_api.md @@ -9,17 +9,17 @@ This is 1D, 2D and 3D arrays, which are allocated from heap in one single contig #define using_carray(X, Value, valueDestroy=c_default_del) ``` The macro `using_carray()` can be instantiated with 2 or 3 arguments in the global scope. -Default values are given above for args not specified. `X` is a type tag name and +Default values are given above for args not specified. `X` and `N` are type tags and will affect the names of all cset types and methods. E.g. declaring `using_carray(my, int);`, `X` should -be replaced by `my` in all of the following documentation. The `#` character should be replaced by `1`, `2` or `3`. +be replaced by `my` in all of the following documentation. The `N` character should be replaced by `1`, `2` or `3`. ## Types | Type name | Type definition | Used to represent... | |:---------------------|:------------------------------|:--------------------------| -| `carray#X` | `struct { ... }` | The carray type | -| `carray#X_value_t` | `Value` | The value type | -| `carray#X_iter_t` | `struct { Value *ref; }` | Iterator type | +| `carrayNX` | `struct { ... }` | The carray type | +| `carrayNX_value_t` | `Value` | The value type | +| `carrayNX_iter_t` | `struct { Value *ref; }` | Iterator type | ## Constants and macros @@ -44,16 +44,16 @@ All cset definitions and prototypes may be included in your C source file by inc ``` ## Methods -### Constructors ```c -carray1X carray1X_init(size_t xdim, Value ref); -carray2X carray2X_init(size_t ydim, size_t xdim, Value ref); -carray3X carray3X_init(size_t zdim, size_t ydim, size_t xdim, Value ref); +carray1X carray1X_init(size_t xdim, Value val); +carray2X carray2X_init(size_t ydim, size_t xdim, Value val); +carray3X carray3X_init(size_t zdim, size_t ydim, size_t xdim, Value val); carray1X carray1X_from(Value* array, size_t xdim); carray2X carray2X_from(Value* array, size_t ydim, size_t xdim); carray3X carray3X_from(Value* array, size_t zdim, size_t ydim, size_t xdim); +void carrayNX_del(carrayNX* self); ``` -### Data access +Constructors and destructor. ```c Value* carray1X_at(carray1X *self, size_t x); Value* carray2X_at(carray2X *self, size_t y, size_t x); @@ -62,13 +62,14 @@ carray1X carray2X_at1(carray2X *self, size_t y); carray1X carray3X_at2(carray3X *self, size_t z, size_t y); carray2X carray3X_at1(carray3X *self, size_t z); ``` -### Iterators +Array accessor methods. ```c -carray#X_iter_t carray#X_begin(carray#X* self); -carray#X_iter_t carray#X_end(carray#X* self); -void carray#X_next(carray#X_iter_t* it); -carray#X_value_t* carray#X_itval(carray#X_iter_t it); +carrayNX_iter_t carrayNX_begin(carrayNX* self); +carrayNX_iter_t carrayNX_end(carrayNX* self); +void carrayNX_next(carrayNX_iter_t* it); +carrayNX_value_t* carrayNX_itval(carrayNX_iter_t it); ``` +Iterator methods. ## Example ```c diff --git a/docs/copt_api.md b/docs/copt_api.md index 3c0d1719..31a935ac 100644 --- a/docs/copt_api.md +++ b/docs/copt_api.md @@ -24,11 +24,13 @@ typedef struct { int has_arg; int ref; } copt_long_t; + +const copt_t copt_inits; ``` ## Methods -``` +```c copt_t copt_init(void); int copt_get(copt_t *opt, int argc, char *argv[], const char *shortopts, const copt_long_t *longopts); @@ -36,7 +38,7 @@ int copt_get(copt_t *opt, int argc, char *argv[], ## Example -``` +```c #include <stdio.h> #include "stc/copt.h" @@ -79,4 +81,4 @@ int main(int argc, char *argv[]) { } return 0; } -```
\ No newline at end of file +``` diff --git a/docs/crand_api.md b/docs/crand_api.md index 3eb0bf43..ddab9b23 100644 --- a/docs/crand_api.md +++ b/docs/crand_api.md @@ -9,13 +9,13 @@ Weyl-sequence as part of the state. It is faster than *sfc64*, *wyhash64*, *pcg6 128-bit integer operations. It has a 256 bit state, but updates only 192 bit per generated number. -There is no *jump function*, but by incrementing the Weyl-increment by 2, it starts -a new unique 2^64 *minimum* length period. Note that for each Weyl-increment, the period +There is no *jump function*, but by incrementing the Weyl-increment by 2, it starts a new +unique 2^64 *minimum* length period. Note that for each Weyl-increment (state[3]), the period length is about 2^126 with a high probability. For a single thread, a minimum period of 2^127 -is generated when the Weyl-increment is incremented by 2 every 2^64 output number. +is generated when the Weyl-increment is incremented by 2 every 2^64 output. **crand** passes *PractRand*, tested up to 8TB output, Vigna's Hamming weight test, and simple -correlation tests, i.e. N interleaved streams with only one-bit differences in initial state. +correlation tests, i.e. *n* interleaved streams with only one-bit differences in initial state. ## Types |
