-
Notifications
You must be signed in to change notification settings - Fork 29
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
matrix multiplication #226
Comments
To do this, you need to overwrite a function in |
Correct, matrix multiplication is S4 generic, but not S3, so it's not a good idea to overwrite it. We could take a look at this again if we manage at some point to make units compatible with S4. I recall trying to |
As suggested in #311, I have some thoughts on how matrices may be implemented with My ideas are two-fold. For For Another option would be to try to make a And, these options are not exclusive, but due to maintenance effort, I assume that only supporting one would be preferable. |
A list-matrix is not very useful and a kind of an aberration IMHO. :) And matrix operations would be extremely inefficient. So theoretically we could make it work... for toy examples. |
Thanks to @t-kalinowski, matrix multiplication is now an S3 generic starting R 4.3.0. :) So we'll revisit this. |
I was looking for this function and found the commented code block at the end of the arith.R file. It requires just a few changes to make it work (see below code). The changes are (1) use
%*%.numeric
as the name of the default method and (2) useas_units()
on the other argument to ensure that it has units. With the blow code the examples for%*%
work.I hope this is useful.
The text was updated successfully, but these errors were encountered: