-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
mdivide_right_tri copies a lot #706
Comments
uhm... after digging into this I found another variant (and test for it) in our
If someone has an idea here, that would be great. The function can be important and the old version does lots of copying as it does not take advantage of clever Eigen views for the problem. |
Reducing copies would be great. Transposes are much worse than copies as one of the matrices is going to be copied without memory locality. For the first case, you can't perform operations that mix different scalar types. So no matrix/vector multiplication of The second test is testing for something to be shaped like a row vector or column vector at runtime. |
What I really do not understand is that the To me it looks like either the promote magic failing for some reason or some obscurities from Eigen are making this fail. Now, I have to say that at least for internal code one can work around this issue whenever one has many repeated evaluations of |
OK, checked out and validated it doesn't work. The return of a transposition is a different type.
|
Summary:
The current mdivide_right_tri functions does lots of copying.
Description:
Currently, the mdivide_right_tri function does a lot of copying as it calls the mdivide_left_tri function with each of its inputs being transposed. As each input gets copied this creates a lot of overhead.
So
currently this is mapped to (A' * b')' and evaluated by creating a copy of A and b. We should avoid the copying.
Reproducible Steps:
Please report steps to reproduce the issue. If it's not possible to reproduce, please include a description of how you discovered the issue.
If you have a reproducible example, please include it.
Current Output:
The current output. Knowing what is the current behavior is useful.
Expected Output:
Just run the test
./test/unit//math/prim/mat/fun/mdivide_right_tri_test
Additional Information:
Provide any additional information here.
Current Version:
v2.17.0
The text was updated successfully, but these errors were encountered: