-
Notifications
You must be signed in to change notification settings - Fork 468
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
Fix clang warnings in FactorSVD. #211
base: master
Are you sure you want to change the base?
Conversation
inputMatrix must be initialized after singularValues, otherwise I get a compiler error.
In my second commit on this PR, I rearrange constructor initializations. I tried to match the same order as given in FactorSVDRep.h, but this gave an error (non-warning error):
So I have to initialize |
I'm not sure this is right. getRank() is at least logically const. Why do you want to change it? |
Its implementation calls non-const methods. If rank == 0, it performs the SVD. See https://github.com/simbody/simbody/blob/master/SimTKmath/LinearAlgebra/src/FactorSVD.cpp#L173 |
I'm confused -- how was it compiling at all before then? |
Because it wasn't overriding the base class method. It had its own non-const getRank(). |
If you're talking about the second commit: I don't know, I'm confused! |
I'd like to revisit this PR, since I believe it fixes an actual bug.
If you're referring to the constness of |
|
This isn't right, Chris. In Simbody |
Looks to me that BTW, note that you can't remove |
Ah okay. I think fixing the inheritance is still an improvement over the existing code, which has a bug (the sublcass method is never called). Thanks for your point about breaking changes; is FactorSVDRepBase part of the user interface? I'm not sure I know enough to add in consts and to do the necessary const-casting. Maybe I'll give it a shot at some point. |
No. |
This change is