Skip to content

vpenando/MatMath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MatMath (Work in progress!) Build Status

C++ API for math operations on matrices written by Vincent P. There's two types of matrices:

  • Matrix: Buffer allocated on the stack => More exception safety
  • DynamicMatrix: Buffer allocated on the heap => Less exception safety

Note: By default, only arithmetic types are allowed to ensure more exception safety. You can disallow this verification by defining NO_TYPE_CHECK. Example:

clang++ -std=c++14 -DNO_TYPE_CHECK main.cc -o matmath

Code examples

Usage of Matrix:

using namespace mat;
const Matrix<int, 3, 3> mat1 = {
  1, 2, 3,
  4, 5, 6,
  7, 8, 9
};
const Matrix<int, 3, 3> mat2 = {
  3, 2, 1,
  6, 5, 4,
  9, 8, 7
};
const auto product = mat1 * mat2;
const auto identity = Matrix<int, 4, 4>::identity();

Usage of DynamicMatrix:

using namespace mat;
DynamicMatrix<int> mat1(3, 3);
mat1 = {
  1, 2, 3,
  4, 5, 6,
  7, 8, 9
};
DynamicMatrix<int> mat2(2, 2);
mat2 = {
  1, 2,
  3, 4
};
mat2.resize(3, 3);
const auto product = mat1 * mat2;

Todo list

  • Add comments for Doxygen doc
  • Add missing operations (matrix determinant, etc)

About

C++ API for math operations on matrices

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published