A header-only template library with implementation of Linear Algebra tools and methods for C++
Linear Algebra Library is a C++ project that provides access to different Linear Algebra tools and methods. It can be used in other projects or to help students understand and learn Linear Algebra.
Current version of library contains:
- Own Matrix class with different methods to operate with it;
- Different methods to solve a system of linear equations;
- And some other functions.
Full list of tools and methods can be viewed in Documentation.
I am looking forward to add new functionality soon such as:
- Boolean (binary) Matrix implementation;
- Matrix class iterator;
- Vector class;
- New methods to solve system of linear equations;
- Complex number class.
Linear Algebra Library requires C++14 standard or newer.
1. Clone the repository from GitHub
PATH = path to clone repository
>> cd <PATH>
>> git clone --recursive https://github.com/sergeyshor/Linear-Algebra-Library.git
>> cd Linear-Algebra-Library
>> mkdir build
>> cd build
>> cmake ..
You may need to open a command prompt with admin privileges on Windows.
You should run the following command with sudo
on Linux.
>> cmake --build .
>> cd test/Debug
>> LinearAlgebraTest.exe
>> ./LinearAlgebraTest
#include <iostream>
#include <LinearAlgebra.hpp>
int main()
{
LinAlg::Matrix<double> matrix = { { -11, 5, 4 }, { 8, 0, 31 }, { 27, -3, 16 } };
std::cout << matrix.determinant() << '\n'; // matrix determinant calculation
return 0;
}
cmake_minimum_required(VERSION 3.23.2)
project(MainProject LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(Sources main.cpp)
add_executable(MainProject ${Sources})
add_subdirectory(Linear-Algebra-Library)
target_link_libraries(
MainProject
Linear-Algebra-Library
)
SRC_PATH = path to created CMakeLists.txt
and main.cpp
files
>> cd <SRC_PATH>
>> mkdir build
>> cd build
>> cmake ..
>> cmake --build . --config Release
>> cd Release
>> MainProject.exe
>> ./MainProject