I’m building a Matrix class for all the operations such as addition, subtraction, multiplication, inverse etc. I have overloaded simple operators such as + - () *. But I’m trying to set a row and column value via ().
A sample would be like so
Matrix(1,1) = 10;
assuming that row 1, column 1 would be set to 10.
A sample of my addition overload is this
friend Matrix operator +(Matrix&, Matrix&);
How can I achieve this?
Thanks!
Your matrix should provide element accessors, e.g. via
operator():Then you can say: