-
Notifications
You must be signed in to change notification settings - Fork 393
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
n+1-1 in sum/prod #74
Comments
Implemented here: latexify_py/src/latexify/codegen/function_codegen.py Lines 335 to 354 in c6c291d
Current behavior is caused by not being able to convert The |
@Casper-Guo I think the code above is an obsolete permalink. In the current implementation, FunctionCodegen introduced an additional analyzer that obtains subtree of range:
We can implement a specific process if we detected |
We would like to work on this. Can you please assign me and @LakeBlair. |
@Casper-Guo Thanks for taking your effort! Assigned to you anyway since you are the only person who attended this discussion. |
Resolved by #115 |
Currently the analyzer of
sum
andprod
does not recognize the reducable addition and subtraction in thestop
parameter ofrange
:It would be good if we could get$n$ rather than $n+1-1$ in most cases. This reduction would be safe because the operands of $+$ and $-$ .
range
must be integers, whose objects must be always associative and commutative in terms of operationsThe text was updated successfully, but these errors were encountered: