You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.6 KiB
55 lines
1.6 KiB
8 years ago
|
C++ Matrix Template Library
|
||
6 years ago
|
===========================
|
||
8 years ago
|
|
||
8 years ago
|
Library to provide mathematical matrices as standard C++ types that behave like standard types.
|
||
8 years ago
|
|
||
|
Features:
|
||
|
* Allows any size of Matrix
|
||
|
* Either fixed size, size given as template parameter
|
||
|
* Or variable size, size is given in constructor
|
||
8 years ago
|
* Allows any type of values, given as template parameter
|
||
8 years ago
|
* Supports matrix specific functions:
|
||
|
* transposition
|
||
|
* gaussian algorithm
|
||
8 years ago
|
* determinant using gauss algorithm
|
||
|
* inversion using gauss-jordan algorithm
|
||
8 years ago
|
* Supports mathematical operations:
|
||
|
* addition
|
||
8 years ago
|
* subtraction
|
||
8 years ago
|
* multiplication
|
||
|
* division (using the inverse matrix)
|
||
8 years ago
|
* Higly stable and well tested in >200 tests
|
||
8 years ago
|
|
||
8 years ago
|
Example with templated size:
|
||
8 years ago
|
|
||
|
const Matrix<T,2,4> m1(1, 2, 3, 4,
|
||
|
5, 6, 7, 8);
|
||
|
const Matrix<T,2,4> m2(2, 4, 6, 8,
|
||
|
1, 3, 5, 7);
|
||
|
const Matrix<T,2,4> m(m1+m2);
|
||
|
const Matrix<T,2,4> res(3, 6, 9, 12,
|
||
|
6, 9, 12, 15);
|
||
|
if (m==res) {
|
||
|
std::cout<<"Yes, it is that easy!\n"<<m<<"\n";
|
||
|
} else {
|
||
8 years ago
|
std::cerr<<"Ooops!\n";
|
||
|
}
|
||
|
|
||
6 years ago
|
Example with given size:
|
||
8 years ago
|
|
||
|
const Matrix<T> m1(2, 4,
|
||
|
1, 2, 3, 4,
|
||
|
5, 6, 7, 8);
|
||
|
const Matrix<T> m2(2, 4,
|
||
|
2, 4, 6, 8,
|
||
|
1, 3, 5, 7);
|
||
|
const Matrix<T> m(m1+m2);
|
||
|
const Matrix<T> res(2, 4,
|
||
|
3, 6, 9, 12,
|
||
|
6, 9, 12, 15);
|
||
|
if (m==res) {
|
||
|
std::cout<<"Yes, it is that easy!\n"<<m<<"\n";
|
||
|
} else {
|
||
|
std::cerr<<"Ooops!\n";
|
||
8 years ago
|
}
|