Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check the shape of vector/matrix in operation #2

Open
gf712 opened this issue Nov 12, 2019 · 1 comment
Open

check the shape of vector/matrix in operation #2

gf712 opened this issue Nov 12, 2019 · 1 comment

Comments

@gf712
Copy link
Member

gf712 commented Nov 12, 2019

Right now I can add two dynamic vectors/matrices of different shapes, which could lead to some unexpected results...

STD_LA::dyn_vector<double> vec1{1,2};
STD_LA::dyn_vector<double> vec2{1,2,3};
auto result = vec1 + vec2; // {2,4}
std::cout << result.size() << "\n"; // 2

I would personally expect an error (at most some broadcasting, e.g. result would have 3 elements, because under the hood vec1 would be interpreted as {1,2,0})

@rishabh-jain14
Copy link

@gf712 Can i work on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants