structura is a modern C++ library for data structures, algorithms, mathematical types and operations.
It unifies two main domains:
- Core — classical data structures and general-purpose algorithms
- Math — algebraic, analytic, and geometric types and operations
The project emphasizes clean design, modular architecture, and modern C++ practices, and is intended as a foundation for reusable components and long-term library development.
This project is under active refactoring and continuous development.
- CMake ≥ 3.25
- C++20 compatible compiler (Clang, GCC, MSVC)
cmake -S . -B build
cmake --build buildcmake --install build --prefix installThis installs public headers under include/ and CMake package configuration for downstream usage.
Once installed, the library can be integrated using CMake:
find_package(structura REQUIRED)
target_link_libraries(your_target PRIVATE structura::structura).
├── CMakeLists.txt
├── README.md
├── LICENSE
├── include/
│ └── structura/
│ ├── core/
│ │ ├── Array
│ │ ├── BinaryTree
│ │ ├── Deque
│ │ ├── DoubleList
│ │ ├── Queue
│ │ ├── SearchTree
│ │ ├── SingleList
│ │ ├── Stack
│ │ └── Vector
│ └── math/
│ ├── algebra/
│ │ ├── Vector
│ │ ├── Matrix
│ │ └── LinearTransform
│ ├── analysis/
│ └── geometry/
│ └── Point
├── examples/
├── tests/
└── cmake/
Fundamental data structures and algorithmic building blocks.
Includes:
- array, vector
- stack, queue, deque
- linked lists
- binary and search trees
Planned extensions:
- sorting and searching algorithms
- graph data structures and algorithms
- traversal and utility abstractions
Linear algebra and related mathematical structures.
Includes:
- vector
- matrix
- linear transform
Planned extensions:
- operations (dot product, cross product, norms, determinants, inverses, ...)
- algorithms (Gaussian elimination, matrix decomposition, eigenvalue methods, solving linear systems, ...)
- transforms (rotation, reflection, scaling, shear, projection, ...)
- supporting abstractions (basis, affine transform, change of basis, ...)
Design:
- separation into storage, operations, algorithms, and aliases
- modular, composable headers
Geometric primitives, higher-level shapes, algorithms, and transformations.
Includes:
- point
Planned extensions:
- primitives (line, segment, ray, plane, …)
- shapes (triangle, rectangle, circle, polygon, box, sphere, …)
- algorithms (intersection, containment, distance, area, centroid, convex hull, …)
- transforms (translation, rotation, scaling, projection)
Numerical analysis tools for evaluating and transforming functions.
Planned extensions:
- differentiation (numerical and symbolic)
- integration (trapezoidal, Simpson, adaptive methods)
- series expansions (Taylor series)
- transforms (Fourier transform and related methods)
Initial focus:
- numerical differentiation and integration
- simple function abstractions
- extensible design for future symbolic capabilities
The library is structured by domain, not as a flat collection of headers.
Design principles:
- Clear separation between core, algebra, and geometry
- Small, composable components (storage / operations / algorithms / aliases)
- Modern C++ (C++20) with emphasis on clarity and type safety
- Incremental, long-term evolution
A key design goal is to separate concepts across domains — for example, a mathematical vector and a dynamic array are treated as distinct abstractions.
The project uses a lightweight test setup based on doctest.
- Tests are located in the
tests/directory - Test cases are grouped by module (e.g.
core/,math/) - Doctest supports filtering, tagging, and fine-grained execution
cmake -S . -B build -DSTRUCTURA_BUILD_TESTS=ON
cmake --build buildctest --test-dir build
# OR
ctest --test-dir build -V # verbose output (shows individual test cases)./build/tests/structura-tests
# OR
./build/tests/structura-tests -s # show all test cases
# OR
./build/tests/structura-tests -tc="Vector*" # run only tests matching "Vector"
# OR
./build/tests/structura-tests --list-test-cases # list all test casesThis repository is intended to be:
- a personal reference implementation library
- a place to practice library and API design in C++
- a foundation for future algorithmic and mathematical extensions
- a unified home for reusable core and mathematical components
Planned additions include:
- namespace cleanup and API consolidation
- consistent naming across modules
- classic sorting and searching algorithms
- graph structures and graph algorithms
- more linear algebra operations
- analysis and numerical methods
- more geometry primitives and utilities