Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Matrix {
- std::vector<std::vector<float> > m;
- int rows, cols;
- public:
- Matrix(int r=DEFAULT_ALLOC, int c=DEFAULT_ALLOC);
- inline int nrows();
- inline int ncols();
- static Matrix identity(int dimensions);
- std::vector<float>& operator[](const int i);
- Matrix operator*(const Matrix& a);
- Matrix transpose();
- Matrix inverse();
- friend std::ostream& operator<<(std::ostream& s, Matrix& m);
- };
- Matrix::Matrix(int r, int c) : m(std::vector<std::vector<float> >(r, std::vector<float>(c, 0.f))), r, c) { }
Add Comment
Please, Sign In to add comment