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

Possible error in ALM/PM constraint implementation #275

Open
djrakita opened this issue Jul 7, 2022 · 1 comment
Open

Possible error in ALM/PM constraint implementation #275

djrakita opened this issue Jul 7, 2022 · 1 comment
Assignees
Labels
rust issue related to the code Rust library

Comments

@djrakita
Copy link

djrakita commented Jul 7, 2022

Describe the bug
The res: &mut [f64] slice in f2 (or f1) functions in ALM/PM constraints can be incorrect length.

A clear and concise description of what the bug is.
I was implementing an equality constraint in my code using OpEn, and realized that the output of JF_2(u)^T d should be 6x1 but the res: &mut [f64] slice was only of length 1, causing the code to panic when I tried to assign to res[0], res[1], ..., res[5]. When digging into this issue, I realized that I believe the same issue is present in the public example (explained below).

To Reproduce
Looking at the provided pm.rs example (though the same issue may be present for alm as well), the output of jf2t should be a 3x1 vector or, in other words, res should be a slice of length 3. However, res is, instead, a slice of length 1. This example appears to fail silently as res and u have zipped iterators, which just stops after the single entry of res without actually iterating through all of u as well.

Expected behavior
The output of jf2t should be length 3 and, thus, res should be a slice of length 3.

System information:

⚠️ Please, provide the following information:

  • System/Platform Mac
  • OS: MacOS
@alphaville alphaville added the rust issue related to the code Rust library label Jul 14, 2022
@alphaville alphaville self-assigned this Sep 28, 2022
@alphaville
Copy link
Owner

Must be related to #309 - we're looking at it now and hopefully we'll resolve both issues soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rust issue related to the code Rust library
Projects
None yet
Development

No branches or pull requests

2 participants