Status: New
Owner: ----
Labels: Type-Enhancement Priority-Medium
New issue 3336 by [email protected]: All IndexedBase objects are
assumed to require tensor expansion
http://code.google.com/p/sympy/issues/detail?id=3336
Currently, all IndexedBase objects are assumed to require tensor
expansion. This results in code such as this:
{{{
import sympy
from sympy.utilities.codegen import codegen
A, B, C, D = map(sympy.IndexedBase, "ABCD")
m = sympy.Symbol("m", integer=True)
i = sympy.Idx("i", m)
expr = sympy.Equality(D[i], A[i]*B[i]+C[i])
rv = codegen( ("f1", expr), "C", "temp", header=False)
print rv[0][1]
}}}
returning:
{{{
for (int i=0; i<m; i++){
for (int i=0; i<m; i++){
D[i] = A[i]*B[i] + D[i];
}
}
}}}
The repeated indices in {{{A[i] * B[i]}}} are summed over.
More discussion:
https://groups.google.com/forum/?fromgroups#!topic/sympy/KXoO-BvmD_w
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.