VecMath is a highly optimized SIMD-based C library, interoperable with C++ for matrix and vector mathematics. It includes support for matrices and vectors up to size 4, with planned support for arbitrarily large matrices. This library also include basic graphics features, with more advanced ones planned for the future.
- Block Matrix: The default matrix for 4x4 (and beyond, in the future). Block matrices offer improved performance over row-major matrices.
- Optimized with SIMD: Uses SIMD intrinsics for maximum speed. Currently supports SSE and AVX, and ongoing support for AVX512.
- Graphics Extension: Adds basic graphics functions.
- Optimized yet Abstracted: VecMath is highly optimized using SIMD intrinsics and block matrices, while maintaining sufficient abstraction for ease of use.
- AVX512 implementation
- mxn matrices
- Advanced graphics functions
- Advanced linear algebra functions
- C/C++ compiler supporting SIMD (GCC/G++, Clang, MSVC)
- Optionally, Git for version control
- VecMath is a header-only library and does not need building
- Clone the repositry
- Import
path/to/vecmath/vec_math.h - Define VecMath flags. For a full list, see the comment at the top of
define.h - Compile your program. Make sure to use
-msse,-mavxor-mavx512to enable SIMD intrinsicsgcc -O3 -mavx main.c -o main.exe - For an example, refer to
example.c
Contributions are welcome. Feel free to fork the repo and submit pull requests for
- Bug Fixes
- Performance Optimizations
- New Features
The project is licensed under the MIT License. See the LICENSE file for details.