Skip to content

qustrolabe/cpp-matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++23 matrix library

Created for educational purposes-only

Example usage

#include <print>
#include "cpp_matrix.hpp"

int main() {
  using namespace qustrolabe::cpp_matrix;

  auto print_matrix = [](auto& m) {
    for (auto& row : m.getRows()) {
      for (auto& e : row) {
        std::print("{} ", e);
      }
      std::println();
    }
    std::println();
  };

  auto m1 = Matrix2D<int>({3, 4});
  auto m2 = Rand2D<int>({3, 4});
  auto m3 = Rand2D<int>({2, 4});

  print_matrix(m1);
  print_matrix(m2);
  print_matrix(m3);

  m1 = Add(m1, m2);
  m3 = Transpose(m3);

  auto result = DotProduct2D(m1, m3);

  print_matrix(result);
}

Building

conan install . --output-folder build --build=missing --settings=build_type=Debug  
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake"
cmake --build .

Requirements

  • C++23
  • Catch2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published