From 96ecf29e8be977f51f351308ef2c7c492bb829aa Mon Sep 17 00:00:00 2001 From: Ethan Werner Date: Tue, 9 Jun 2026 01:17:41 +0400 Subject: refactor --- README.md | 52 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 17 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index a3f2732..bb62aa4 100755 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ The following libraries are *highly* experimental and should be treated as such. Please feel free to create issues, and pull requests are always welcome. -## ann.h - Artifical Neural Network +## ann.h - Artificial Neural Network -This library provides an implementation of a fully connected, artifical neural network with backpropagation. The entirety of the ANN is stored in a single memory allocation, allowing for ease in persisting models and training via external methods. +This library provides an implementation of a fully connected, artificial neural network with backpropagation. The entirety of the ANN is stored in a single memory allocation, allowing for ease in persisting models and training via external methods. ### Activation Functions @@ -22,11 +22,11 @@ The activation function for hidden layers can be chosen independently from that ## bin.h - Flat File Block Storage -This library is an experiment in storing ordered numerical data as binary "flat files". The contained data must be of a fixed block size. The primary goal of the library is to provide a simple method of persisting and caching data that is time-series in nature. The resulting files should be short lived. +This library is an experiment in storing ordered numerical data as binary "flat files". The contained data must be of a fixed block size. The primary goal of the library is to provide a simple method of persisting and caching data that is time-series in nature. The resulting files should be short lived. ### Format -The file header contains two 64 bit unsigned integers, block count and block size. The rest of the file contains the block data. +The file header contains two 64 bit unsigned integers, block count and block size. The rest of the file contains the block data. Each block must possess a numerical key/index as the first element. Prior to using the library, a ```typedef [numerical_type] bin_key_t``` must be declared in the implementation file. @@ -34,32 +34,44 @@ Each block must possess a numerical key/index as the first element. Prior to usi This is a naive library, and as such, does not provide input validation. If data is placed out of order, *there it will remain.* +## buffer.h - Dynamic Buffer + +A dynamically resizing buffer with embedded metadata. Stores capacity, element count, and element size preceding the data pointer. Automatically doubles capacity when usage exceeds 80%, and halves when below 20% (minimum capacity of 32). + +## direct.h - Computation Graph + +A computation graph library with topological update ordering. Nodes are connected via edges and evaluated in dependency order using DFS. Uses a generation counter to avoid re-evaluating unchanged nodes. Provides basic arithmetic node functions (add, subtract) as examples. + ## escape.h - ANSI Escape Codes -This library provides utility functions/macros for an assortment of ANSI escape codes. +This library provides utility functions and macros for an assortment of ANSI escape codes, including cursor movement, screen clearing, text formatting, and color output. Each operation is available as both a macro (string literal) and a function (writes to stdout or a given FILE*). ## flat.h - Directory Traversal -This library provides a simple wrapper for traversing POSIX file systems. The intention for this library is to be used alongside bin.h, for the purpose of traversing hierarchial directory structures. +This library provides a simple wrapper for traversing POSIX file systems. The intention for this library is to be used alongside bin.h, for the purpose of traversing hierarchical directory structures. Provides both POSIX (dirent.h) and Windows (FindFirstFileA) implementations. ## genetic.h - Genetic Algorithm -An implementation of a genetic algorithm. The library exposes a single function for creating a new generation of individuals. The function is "generic", meaning that the respective operations for crossover, mutation, and fitness are passed as as function pointers. +An implementation of a genetic algorithm. The library exposes a single function for creating a new generation of individuals. The function is "generic", meaning that the respective operations for crossover, mutation, and fitness are passed as function pointers. ### Algorithm Overview **1. Crossover** - Determine the selection cutoff for the population. -- Replace all unfit individuals by preforming a crossover operation with two randomly selected fit indivuals. +- Replace all unfit individuals by performing a crossover operation with two randomly selected fit individuals. **2. Mutation** -- Determine the number of mutation operations, and perform those on a randomly selected individual. +- Determine the number of mutation operations, and perform those on randomly selected individuals. **3. Fitness** -- Sort the population by descending fitness, in preparation for the next generation. +- Sort the population by ascending fitness, in preparation for the next generation. + +## interpolate.h - 1D Interpolation Macros + +A collection of interpolation and easing macros inspired by "Math for Game Programmers: Fast and Funky 1D Nonlinear Transformations". Provides namespaced `INTERP_*` macros for collision safety, legacy unprefixed aliases guarded by `#ifndef`, and function wrappers for debuggability. ## pool.h - Memory Pool @@ -67,20 +79,26 @@ A free-list based memory pool. The pool has a fixed size after allocation. **Note:** The size of a block must be greater than or equal to ```sizeof(void *)``` +## pushdown.h - Pushdown Automata + +An implementation of a stack-based pushdown automata with 65+ operations. Instructions execute sequentially until an END marker, supporting arithmetic, trigonometry, stack manipulation (Forth-style), and comparison operations. Designed for use with stack.h. + ## stack.h - Stack Implementation -A stack implementation to be used with pushdown.h +A generic dynamic stack with automatic resizing. Requires the user to define ```typedef stack_value_t``` before inclusion. Provides both simple variants (return zero on empty) and ```_ok``` variants (return status code) for pop and peek operations. + +## test.h - Test Utilities -**Note:** A pop operation on an empty stack will return 0/NULL. +A minimal test framework providing ```ASSERT```, ```ASSERT_FLOAT_EQ```, and ```ASSERT_STR_EQ``` macros. Tracks failure count and prints results. Not a library for distribution — intended for the test suite only. -## pushdown.h - A Pushdown/Stack Automata +## type.h - Type Aliases -This file provides an implementation of a pushdown/stack automata. +Common type aliases used across the libraries: ```i8```, ```i16```, ```i32```, ```i64```, ```u8```, ```u16```, ```u32```, ```u64```, ```f32```, ```f64```. -## ufo.h - Universal Functions Originator +## ufo.h - Universal Function Originator - An implementation of the symbolic regression technique known as a Universal Functions Originator. The originating paper can be found [here](https://doi.org/10.1016/j.asoc.2020.106417). +An implementation of the symbolic regression technique known as a Universal Function Originator. The originating paper can be found [here](https://doi.org/10.1016/j.asoc.2020.106417). Uses a single-allocation design for easy persistence and serialization. ## uri.h - URI Builder -A simple, and likely incomplete, implementation of a "builder" pattern to generate URIs as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). The URIs are stored interally as separate blocks, enabling sequential URIs to be generated with ease. +A simple, and likely incomplete, implementation of a "builder" pattern to generate URIs as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). The URIs are stored internally as separate components, enabling sequential URIs to be generated with ease. -- cgit v1.3.1