acmpesuecc / laalibrary

This repository contains a C++ file which aims to act as a library for simple to complex linear arithmetic operations.
MIT License
0 stars 11 forks source link

Operator Overloading #52

Closed anirudhRowjee closed 4 years ago

anirudhRowjee commented 4 years ago

Is your feature request related to a problem? Please describe. using the current methods to perform operations such as add, subtract, scalar multiplication and scalar division are extremely tedious

Describe the solution you'd like Implement operator overloading, so instead of using member methods, we can do

Matrix m1(2, 2);
Matrix m2(2, 2);
Matrix res(2, 2, false);

res = m1 + m2
/* or 
res = m2 + m1
res = m2 - m1
*/

// scalar multiplication
res = 3 * m1
// or
res = m1 * 3

// scalar division
res = m1 / 3

Describe alternatives you've considered none

shreya1010svg commented 4 years ago

!bounty 10

acm-bot[bot] commented 4 years ago

Congrats @anirudhRowjee, you got 10 points!