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

Vector-Vector binary operators should return Vector instead of Matrix #5741

Closed
calcmogul opened this issue Oct 9, 2023 · 0 comments · Fixed by #5772
Closed

Vector-Vector binary operators should return Vector instead of Matrix #5741

calcmogul opened this issue Oct 9, 2023 · 0 comments · Fixed by #5772
Labels
component: wpimath Math library type: bug Something isn't working.

Comments

@calcmogul
Copy link
Member

calcmogul commented Oct 9, 2023

Vector inherits its binary operators from Matrix, which return a Matrix if the right-hand side is a Vector. It should return a Vector instead.

Vector should provide two overloads for each binary operator where the Vector RHS overload returns Vector and the Matrix RHS overload returns Matrix. The Matrix RHS overload might already be implicitly provided by the base class, so Vector itself just needs the more specific Vector RHS overload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: wpimath Math library type: bug Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant