Guest User

Untitled

a guest
Jan 18th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. class Matrix {
  2. std::vector<std::vector<float> > m;
  3. int rows, cols;
  4. public:
  5. Matrix(int r=DEFAULT_ALLOC, int c=DEFAULT_ALLOC);
  6. inline int nrows();
  7. inline int ncols();
  8.  
  9. static Matrix identity(int dimensions);
  10. std::vector<float>& operator[](const int i);
  11. Matrix operator*(const Matrix& a);
  12. Matrix transpose();
  13. Matrix inverse();
  14.  
  15. friend std::ostream& operator<<(std::ostream& s, Matrix& m);
  16. };
  17.  
  18. 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