An open API service indexing awesome lists of open source software.

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

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 .
```