18 #ifndef _MATRIX_IMPL_IPP
19 #define _MATRIX_IMPL_IPP
21 #include "../include/Matrix.hpp"
24 template <
typename EntryT>
27 if (M.size1() != M.size2()) {
28 throw std::invalid_argument(
"Matrix supplied to trace() is not square");
32 for (
size_t i = 0; i < n ; ++i){
38 #endif // _MATRIX_IMPL_H
43 template <
typename MatrixT>
46 return (M.size1() == M.size2());
boost::numeric::ublas::matrix< EntryT > Matrix
Typedef for the main matrix class.
EntryT trace(const Matrix< EntryT > &M)
Finds trace of a square matrix.
bool isSquare(const MatrixT &M)
Convinience function to check if a matrix is square or not.