NumLA is a scientific computing library designed to be easy-to-use and highly optimized, with a focus on providing a clean and modern interface for students.
- Matrix and Vector Operations: NumLA provides a comprehensive set of matrix and vector operations, including addition, subtraction, multiplication, and more.
- Linear Algebra: NumLA includes a variety of linear algebra routines, such as solving linear systems using Gaussian elimination, Gauss-Jordan elimination, and LU decomposition. The library is currently in pre-alpha stage, and more features will be added in the future.
- Performance: NumLA is designed to be efficient and fast, leveraging modern C++ features and optimizations to deliver high performance for scientific computing tasks.
- Ease of Use: NumLA is designed with a focus on simplicity and ease of use, making it accessible to students and researchers who may not have extensive experience with scientific computing libraries.
- A C++17 compatible compiler (e.g., GCC, Clang, MSVC).
- CMake 3.15 or later.
The recommended way to use NumLA is to add it as a dependency using CMake's FetchContent module. This will download and configure NumLA automatically.
- Create your
CMakeLists.txt:
Add the following to your CMakeLists.txt file:
cmake_minimum_required(VERSION 3.15)
project(MyProject LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(FetchContent)
FetchContent_Declare(
NumLA
GIT_REPOSITORY https://github.com/baranwalayush/NumLA.git
GIT_TAG main
)
FetchContent_MakeAvailable(NumLA)
add_executable(my_program main.cpp)
target_link_libraries(my_program PRIVATE NumLA::NumLA)- Write your code (
main.cpp):
Here is a simple example of how to use NumLA:
#include <iostream>
#include "NumLA/matrix.hpp"
int main() {
// Create a 2x2 Identity Matrix
auto I = NumLA::Matrix<double, 2, 2>::Identity();
std::cout << "Successfully loaded NumLA!\n" << I;
return 0;
}- Build and Run:
mkdir build
cd build
cmake ..
cmake --build .
./my_programThe directory structure will look like this
my_project/
├── build/
├── CMakeLists.txt
└── main.cpp