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
Bugfix/implicit qr #3165
base: main
Are you sure you want to change the base?
Bugfix/implicit qr #3165
Conversation
Need to add
for some actions in the failed workflow to work for pull requests from users without write permissions to the repository. |
@@ -158,7 +158,7 @@ void casadi_cvx_givens(T1 a, T1 b, T1* c, T1* s) { | |||
// Golub & Van Loan Alg. 8.3.2 | |||
template<typename T1> | |||
void casadi_cvx_implicit_qr(casadi_int n, T1* t_diag, T1* t_off, T1* cs) { | |||
T1 d, mu, to2, x, z, c, s, t1, t2, d0, d1, o0, o1, sd; | |||
T1 d, mu, to2, x, z, c, s, t1, t2, d0, d1, o0, sd; | |||
casadi_int i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@victorfors A general comment: this code isn't readable. There should be comments on each line explaining every step of the algorithm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will add some comments in this function where it makes sense.
I've been going through some of the code in this file, would you want a pull request with added comments if I find some other places where I think they would help readability?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My personal opinion is that all code should be properly commented or be removed from the repo. I'm not sure what the story is for this particular code however. I think pull requests for adding comments are always welcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments. Sorry for the merge noise in the commit history but I assume you can squash that if you merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, great!
At the final iteration in casadi_cvx_implicit_qr the code accessed the out of bounds element t_off[n-1]. t_off[i+1], x, and z are no longer updated in the final iteration (i=n-2).