Skip to content

Curved Kick Fixes #384

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

Merged
merged 2 commits into from
Aug 2, 2023
Merged

Conversation

jgray-19
Copy link
Contributor

@jgray-19 jgray-19 commented Aug 2, 2023

  • Fix bf(x/y) copy to c.
  • Fix the loop of bxbyh in C++.
  • Reduce Lua vs Cpp numerical discrepancy in bxbyh

Copy link
Contributor

@ldeniau ldeniau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loop RFOR(j,m.snm-(i+1)) is equivalent to
for(idx_t j = m.snm-i-1-1; j >= 0; j--)
which does one step less than the original loop in cpp and lua

minor changes to be confirmed as I was confused by this PR...
@ldeniau ldeniau merged commit 07b8ea1 into MethodicalAcceleratorDesign:dev Aug 2, 2023
@jgray-19
Copy link
Contributor Author

jgray-19 commented Aug 2, 2023

So RFOR(j,m.snm-(i+1)) means that we do the same number of loops as Lua.

The outer for loop is equivalent to
for i = snm-1, 0, -1 do
meaning i is initially one less than in Lua, but does the same number of iterations

The inner for loop becomes then
for j = snm - 1 - i, 0, -1 do

The -1 in the j loop accounts for the fact you go to 0 (compared to lua going to 1), but because i is 1 less compared to lua, you need to account for this fact.

Therefore
for j = snm - 1 - (i+1), 0, -1 do
accounts for i being smaller.

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.

2 participants