55 Commits

Author SHA1 Message Date
eed418e6cd Add changeable load factor 2025-12-23 14:11:05 +01:00
8b696b31fc Add move- and copy ctors to dict and guf_str 2025-12-23 14:11:05 +01:00
e1bc585f68 Use SIZE_MAX instead of SIZE_T_MAX 2025-12-23 14:11:05 +01:00
25cf7f17b7 Fix dict asserts 2025-12-23 14:11:05 +01:00
c8ffde8c19 Fix warnings in release 2025-12-23 14:11:05 +01:00
e1af4f76a7 Replace puts with fputs in guf_err_to_str 2025-12-23 14:11:05 +01:00
ec9cd97631 Pass key_hash to guf_dict_find_idx to avoid re-computation 2025-12-23 14:11:05 +01:00
18f4496204 Fix GUF_DICT_64_BIT_IDX and guf_dict_max_capacity() 2025-12-23 14:11:05 +01:00
f3f7cec5f4 Use single u32/u64 as GUF_DICT_KV_META_T instead of two 2025-12-23 14:11:05 +01:00
5d8fa1cc62 Fix allocation overflow for guf_dbuf and guf_dict
(Implement GUF_ALLOC_MAX_BYTES and GUF_ALLOC_MAX_CAPACITY).
2025-12-23 14:11:05 +01:00
52ca55f1d6 Improve guf_id_pool 2025-12-23 14:11:05 +01:00
81ab99ff15 Implement guf_str 2025-12-23 14:11:05 +01:00
517151b342 Change short-string approach to use 32 instead of 40 bytes 2025-12-23 14:11:05 +01:00
3d83ea0b17 Add 3x3 matrix inversion 2025-12-23 14:11:05 +01:00
7e348e74bc Change linalg mat_inverse.
Still not sure whether it's better to calculate
rref[pivot_row][col] * (rref[row][pivot_col] / pivot_val) (option 1)
vs.
rref[pivot_row][col] * rref[row][pivot_col] / pivot_val   (option 2)

(i.e.  a * b / c vs. "a * (b/c))

in terms of floating point error.

But I think option 1 (current commit) is better, since the scale factor
(rref[row][pivot_col] / pivot_val) is always <= 1 here (I think).
2025-12-23 14:11:05 +01:00
ea6a63aa3a Fix linalg bugs 2025-12-23 14:11:05 +01:00
bf5a8d9aac Add guf_nearly_zero/one 2025-12-23 14:11:05 +01:00
5f16855dab Add matrix inversion 2025-12-23 14:11:05 +01:00
93e9603218 Fix guf_dict size types 2025-12-23 14:11:05 +01:00
4a0a77d438 Rename GUF_STATIC_BUF_SIZE 2025-12-23 14:11:05 +01:00
ac9fa9f9ce Add quaternion operations 2025-12-23 14:11:05 +01:00
57e405714d Add linear algebra functions 2025-12-23 14:11:05 +01:00
d9114104c6 Add guf_str_view functions 2025-12-23 14:11:04 +01:00
f942cd8160 Add GUF_CSTR_TO_VIEW_CPP 2025-12-23 14:11:04 +01:00
2bf683906b Add more dict tests 2025-12-23 14:11:04 +01:00
8197a5f45f Add dict_erase tests 2025-12-23 14:11:04 +01:00
98774f842f Fix guf_dict probing 2025-12-23 14:11:04 +01:00
6bed0d7616 Fix guf_dict growth bug 2025-12-23 14:11:04 +01:00
467f9be00a Refactor 2025-12-23 14:11:04 +01:00
02cd5937a1 Make preserved_delims work (in guf_str_next_tok) 2025-12-23 14:11:04 +01:00
947041838e Add tokeniser 2025-12-23 14:11:04 +01:00
d59d29f9f1 Add utf-8 handling 2025-12-23 14:11:04 +01:00
ead8bd8914 Work on utf-8 2025-12-23 14:11:04 +01:00
5e377a4c4d Add more tests 2025-12-23 14:11:04 +01:00
d687bfe441 Improve tests 2025-12-23 14:11:04 +01:00
27d0cc65e4 Add C++ tests 2025-12-23 14:11:04 +01:00
0e4e3f392c Improve iterator functions 2025-12-23 14:11:04 +01:00
ce1f465326 Fix dbuf iterator begin for dbuf.size == 0 2025-12-23 14:11:04 +01:00
df43178b15 Implement guf_dict 2025-12-23 14:11:04 +01:00
099ee09a94 Work on guf_dict 2025-12-23 14:11:04 +01:00
0b39cd3422 Add guf_rand with 32-bit operations (using xoshiro128** 1.1) 2025-12-23 14:11:04 +01:00
03638d5462 Fix overflow in guf_rand32range_i32 and guf_randrange_i64 2025-12-23 14:11:04 +01:00
c584279892 Add guf_rand32 2025-12-23 14:11:04 +01:00
77b5d60d6f Add guf_rand 2025-12-23 14:11:04 +01:00
e01321b2b9 Change iterator 2025-12-23 14:11:04 +01:00
319ada61fd Add iter index functions 2025-12-23 14:11:04 +01:00
f04a426489 Change sort function name 2025-12-23 14:11:04 +01:00
42f6a4e20d Major refactor 2025-12-23 14:11:04 +01:00
6addd12dcd Rewrite dbuf 2025-12-23 14:11:04 +01:00
f5d9c604e9 Add better error handling 2025-12-23 14:11:04 +01:00