https://github.com/tonitaga/mtlt
MTLT is a header-only math matrix library that allows you to do compile-time calculations, perform atomic operations, and contains all the basic operations on matrices. The library is written in STL style, supports joint work with STL algorithms. Since C++11
https://github.com/tonitaga/mtlt
cpp11 cpp14 cpp17 cpp20 cpp23 linear-algebra matrix
Last synced: 11 months ago
JSON representation
MTLT is a header-only math matrix library that allows you to do compile-time calculations, perform atomic operations, and contains all the basic operations on matrices. The library is written in STL style, supports joint work with STL algorithms. Since C++11
- Host: GitHub
- URL: https://github.com/tonitaga/mtlt
- Owner: tonitaga
- License: mit
- Created: 2023-07-12T14:58:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-13T16:13:56.000Z (12 months ago)
- Last Synced: 2025-04-10T00:51:10.204Z (11 months ago)
- Topics: cpp11, cpp14, cpp17, cpp20, cpp23, linear-algebra, matrix
- Language: C++
- Homepage:
- Size: 263 KB
- Stars: 19
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MTLT - Matrix Template Library Tonitaga
MTLT is a header-only template matrix library that supports different data types, and has been C++ standard since 11
## Install and Configuration
#### 1. vcpkg and cmake
```shell
git clone https://github.com/Microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
vcpkg install mtlt
```
Then configure in your project CMakeLists.txt
```cmake
cmake_minimum_required(VERSION 3.5...3.16)
project(PROJECT)
find_package(mtlt REQUIRED)
add_executable(${PROJECT_NAME} main.cc)
target_link_libraries(${PROJECT_NAME} PRIVATE mtlt::mtlt)
```
Write simple source code in main.cc for check
```c++
#include
#include // For mtlt::print
int main() {
mtlt::matrix matrix(3, 3, {
1, 2, 3,
4, 5, 6,
7, 8, 9
});
mtlt::print(matrix);
}
```
Build your program using cmake
```shell
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=[vcpkg_root]/scripts/buildsystems/vcpkg.cmake
cmake --build .
```
#### 2. Install as git submodule
```shell
mkdir third_party
cd third_party
git submodule add https://github.com/tonitaga/Matrix-Template-Library-CPP.git
```
Configure CMakeLists.txt
```cmake
add_subdirectory(third_party/MTLT)
target_link_libraries(${PROJECT_NAME} PRIVATE mtlt::mtlt)
```
Build your program using cmake
```shell
git submodule update --init
mkdir build
cd build
cmake ..
cmake --build .
```