Skip to content

gpdaniels/gtl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1413ded Β· Apr 27, 2025
Apr 14, 2025
Apr 27, 2025
Apr 27, 2025
Apr 27, 2025
Apr 27, 2025
Apr 27, 2025
Aug 26, 2024
Apr 14, 2025
Jun 13, 2019
Jan 29, 2022
Apr 27, 2025
Aug 17, 2022
Jan 1, 2024
Apr 27, 2025

gtl

This repository is a collection of useful cross-platform, well-commented, self-contained, simple, and interesting C++ classes in the style of the standard template library.

Build Status Code Quality License: MIT

Content

The current classes are as described below:

Group Class Description ❔
ai ann Artificial neural network using the backpropagation algorithm for training. βœ”οΈ
ai hmm Hidden markov model using the Baum-Welch algorithm for training. βœ”οΈ
algorithm astar Implementation of the astar algorithm used to solve pathfinding problems. βœ”οΈ
algorithm dijkstra Implementation of Dijkstra's algorithm used to solve pathfinding problems. βœ”οΈ
algorithm gaussian_elimination Linear simultaneous equation solver. βœ”οΈ
algorithm kmeans Implementation of the KMeans clustering algorithm. 🚧
algorithm maxn The MaxN search algorithm to find the best possible moves for an N player game with known information. 🚧
algorithm quicksort Recursive quicksort algorithm, both full and partial versions. βœ”οΈ
algorithm satisfiability A simple SAT solver. 🚧
algorithm simulation_loop Fixed time step helper class for creating game loops. βœ”οΈ
container any Class that can hold any variable type. βœ”οΈ
container array_nd N-dimensional statically or dynamically sized array. βœ”οΈ
container lambda Lambda function class that uses the heap for storage. βœ”οΈ
container ring_buffer Dynamically sized thread-safe multi-producer multi-consumer ring-buffer. βœ”οΈ
container static_array_nd N-dimensional statically sized array. βœ”οΈ
container static_lambda Lambda function class that uses the stack for storage. βœ”οΈ
container static_ring_buffer Statically sized thread-safe multi-producer multi-consumer ring-buffer. βœ”οΈ
container static_variant A static_variant class that can contain any one of its listed template types. 🚧
container static_view A non-owning static_view into multi-dimensional memory. 🚧
crypto aes An implementation of the aes encryption algorithm for 128, 196, and 256 bits. βœ”οΈ
crypto chacha An implementation of the chacha encryption algorithm. βœ”οΈ
crypto rc4 An implementation of the rc4 or arc4 encryption algorithm. 🚧
crypto rsa An implementation of the RSA (Rivest-Shamir-Adleman) asymmetric encryption algorithm. βœ”οΈ
debug access Classes and macros for accessing class private members. βœ”οΈ
debug assert Macros that define an assert macro that optionally takes a format string and parameters. βœ”οΈ
debug assume Macro that hints to the compiler when a statement should be assumed true. βœ”οΈ
debug breakpoint Macro for creating a breakpoint. βœ”οΈ
debug expect Macro that hints to the compiler when a statement should be expected as true or false. 🚧
debug sentinel A simple class to help detect stack overflows. 🚧
debug short_file Replacement for the __FILE__ macro to prevent build path being leaked into the binary. βœ”οΈ
debug signal Class to wrap signal handlers allowing the use of lambdas with scope. βœ”οΈ
debug unused Macro for hiding unused variable warnings. βœ”οΈ
execution barrier Thread syncronisation barrier. βœ”οΈ
execution coroutine Setjump/Longjump implementation of stackful coroutines. βœ”οΈ
execution semaphore Semaphore made using a mutex and condition variable. βœ”οΈ
execution spin_lock Spin lock implemented using an atomic flag. βœ”οΈ
execution thread_pool Multi-queue thread-pool that performs jobs in priority order. βœ”οΈ
execution triple_buffer Lockless triple buffer interface to three buffers. βœ”οΈ
file/archive tar Tar format archive reader and writer. 🚧
file/text json A small json parser and composer. 🚧
game mastermind An implementation of Donald Knuth's algorithm to solve the mastermind game in five moves or less. 🚧
game puzzle_cube Solver for 3x3 puzzle cubes. 🚧
game sudoku A sudoku solver for standard 9x9 grids. 🚧
game tic_tac_toe Solver for the game tic-tac-toe on a 3x3 board. 🚧
hash crc An implementation of the crc hashing function for 8, 16, 32, and 64 bits. βœ”οΈ
hash md5 An implementation of the md5 hashing function. βœ”οΈ
hash sha0 An implementation of the sha0 hashing function. βœ”οΈ
hash sha1 An implementation of the sha1 hashing function. βœ”οΈ
hash sha2 An implementation of the sha2 hashing function for 224, 256, 384, and 512 bits. βœ”οΈ
hash sha3 An implementation of the sha3 hashing function for 224, 256, 384, and 512 bits. βœ”οΈ
io file An RAII file handle that wraps file operation functions. 🚧
io paths Collection of cross platform functions to provide useful paths. βœ”οΈ
io socket Cross platform socket class, supporting tcp (server and client) and udp protocols. 🚧
math big_integer Arbitrary sized signed integers. βœ”οΈ
math big_unsigned Arbitrary sized unsigned integers. βœ”οΈ
math symbolic Compile time symbolic differentiation using template metaprogramming. 🚧
parser generator A parser generator to generate parsers defined using a collection of parsing primitives. βœ”οΈ
parser pl0 A parser and interpreter for the PL/0 programming language. 🚧
platform architecture Macros and helper function to get the architecture used for the build. βœ”οΈ
platform compiler Macros and helper function to get the compiler used for the build. βœ”οΈ
platform cpu Class to extract cpuid information to determine supported instructions at runtime. βœ”οΈ
platform operating_system Macros and helper function to get the operating system used for the build. βœ”οΈ
platform runtime Macros and helper function to get the runtime used for the build. βœ”οΈ
platform timestamp Function to get a monotonically increasing timestamp. βœ”οΈ
platform types Type aliases of standard types to short names. βœ”οΈ
protection virtual_machine A simple stack based virtual machine allowing easy creation of custom operands. βœ”οΈ
random random_mt Mersenne twister pseudo-random number generator. βœ”οΈ
random random_pcg PCG pseudo-random number generator. βœ”οΈ
random random_rlcg A reversible pseudo-random number generator. βœ”οΈ
random random_romu_32 Romu 32 bit pseudo-random number generator. βœ”οΈ
random random_romu_64 Romu 64 bit pseudo-random number generator. βœ”οΈ
random random_splitmix Splitmix pseudo-random number generator. βœ”οΈ
random random_xorshift Xorshift pseudo-random number generator. βœ”οΈ
string static_string Container and macro generator for compile time string templates. βœ”οΈ
string static_string_encrypted Compile-time string encryption with runtime decryption to obfuscate strings. βœ”οΈ
type enum_name Compile-time enum value name as a string with -fno-rtti. βœ”οΈ
type standard Standard type size sanity. 🚧
type type_id Simple run-time-type-information (rtti) with -fno-rtti. βœ”οΈ
type type_name Compile-time type name as a string with -fno-rtti. βœ”οΈ
utility error Composable error class that can be returned down a call stack. βœ”οΈ
utility event Thread safe multi-in/multi-out event/messaging system. βœ”οΈ
utility pimpl Statically sized pointer to implementation wrapper. βœ”οΈ
utility sizeof_bitfield Macro to get the size in bits of a bitfield. 🚧
vision/camera/model pinhole Pinhole camera model with no distortion. 🚧
vision/consensus/evaluate inlier_support Implementation of a model evaulator that counts the number of inliers under a threshold. 🚧
vision/consensus/evaluate least_median_of_squares Implementation of a model evaulator that calculates the LMedS score. 🚧
vision/consensus/evaluate maximum_likelihood Implementation of a model evaulator that calculates a capped residual sum. 🚧
vision/consensus/sample exhaustive Implementation of an exhaustive dataset sampler. 🚧
vision/consensus/sample random Implementation of a random dataset sampler. 🚧
vision/consensus consensus A generic consensus system composed of templated dataset sampler, model estimator, and model evaluator. 🚧
vision/consensus estimator Interface of a consensus model estimator. 🚧
vision/consensus evaluator Interface of a consensus model evaluator. 🚧
vision/consensus sampler Interface of a consensus dataset sampler. 🚧
vision/feature/angle orb_angle Implemetation of feature angle from the paper "ORB: An efficient alternative to SIFT or SURF". IEEE International Conference on Computer Vision (2011). 🚧
vision/feature/descriptor beblid Implemetation of feature description from the paper "BEBLID: Boosted Efficient Binary Local Image Descriptor". Pattern Recognition Letters (2020). 🚧
vision/feature/descriptor orb Implemetation of feature description from the paper "ORB: An efficient alternative to SIFT or SURF". IEEE International Conference on Computer Vision (2011). 🚧
vision/feature/descriptor rs_brief Implemetation of feature description from the paper "eSLAM: An Energy-Efficient Accelerator for Real-Time ORB-SLAM on FPGA Platform". Design Automation Conference (2019). 🚧
vision/feature/detector fast Implemetation of feature detection from the paper "Faster and better: A machine learning approach to corner detection". IEEE transactions on pattern analysis and machine intelligence (2008). 🚧
vision/feature/distributor square_covering Implemetation of feature distribution from the paper "Efficient adaptive non-maximal suppression algorithms for homogeneous spatial keypoint distribution". Pattern Recognition Letters (2018). 🚧
vision/feature/refinement exhaustive Exhaustive search method for the best match between two patches. 🚧
vision/feature/refinement golden_section Golden section search method for the best match between two patches. 🚧
vision/feature/refinement quadratic_fitting Quadratic fitting search method for the best match between two patches. 🚧
vision/feature/score fast_score Implemetation of feature quality score from the paper "Faster and better: A machine learning approach to corner detection". IEEE transactions on pattern analysis and machine intelligence (2008). 🚧
vision/feature/score harris_score Implemetation of feature quality score from the paper "A Combined Corner and Edge Detector". Alvey Vision Conference (1988). 🚧
vision/feature/score shi_tomasi_score Implemetation of feature quality score from the paper "Good Features to Track". IEEE Conference on Computer Vision and Pattern Recognition (1994). 🚧
vision/feature binary_descriptor Simple structure to hold a buffer of binary data that describes a feature. 🚧
vision/feature feature Simple structure to hold a the information defining a detected feature. 🚧
vision/image_processing integral Simple integral image processor. 🚧
vision/image_processing sub_pixel_patch Generation of a sub-pixel patch for match refinement. 🚧
vision/match/detector bruteforce Bruteforce feature matcher. 🚧
vision/match/score hamming Simple hamming matching without the popcount instruction. 🚧
vision/match/score ncc Normalised cross correleation between two patches. 🚧
vision/match/score sad Sum of absolute distances between two patches. 🚧
vision/match/score ssd Sum of squared distances between two patches. 🚧
vision/match/score zncc Zero-mean normalised cross correleation between two patches. 🚧
vision/match/score zsad Zero-mean sum of absolute distances between two patches. 🚧
vision/match/score zssd Zero-mean sum of squared distances between two patches. 🚧
vision/match match Simple structure to hold a the information defining a matched pair of features. 🚧
vision api An API for a computer vision system that consumes sensor data to perform localisation and mapping. 🚧

License

Copyright (C) 2018-2024 Geoffrey Daniels. https://gpdaniels.com/

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License only.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

About

A collection of useful well-commented, self-contained, simple, and/or interesting C++ classes

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks