Skip to content

Fixed bugs introduced while converting from Python to C++#129

Merged
noahcao merged 1 commit intonoahcao:masterfrom
jasseeeem:patch-1
Apr 21, 2026
Merged

Fixed bugs introduced while converting from Python to C++#129
noahcao merged 1 commit intonoahcao:masterfrom
jasseeeem:patch-1

Conversation

@jasseeeem
Copy link
Copy Markdown
Contributor

@jasseeeem jasseeeem commented Sep 2, 2024

While testing OCSort C++ code base, I noticed that few variables were not matching. On digging deeper, I found couple of bugs in the C++ code after comparing to Python code.

  1. A comma is given instead of multiplication operator resulting in the second operand F.transpose() being returned instead of (F * P) * F.transpose():
    Python code:
    P = (alpha * alpha) * dot(dot(F, P), F.T) + Q
    Incorrect C++ code:
    P = _alpha_sq * ((F * P), F.transpose()) + Q;
    Correct C++ code:
    P = _alpha_sq * ((F * P) * F.transpose()) + Q;

  2. Added an inverse operation that was present in the Python code, but not in the C++ code.

Note: There is no change in line 1 and 156.

@jasseeeem
Copy link
Copy Markdown
Contributor Author

Hey @noahcao
Can we merge this?

@jasseeeem
Copy link
Copy Markdown
Contributor Author

Hey @noahcao
Please take a look!

@noahcao noahcao merged commit c1d7909 into noahcao:master Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants