| 1 | initial version |
Found the solution. We have to explicitly define index
from sympy.tensor import IndexedBase, Idx
from sympy import symbols
n,m = symbols('n m', integer=True)
A = IndexedBase('A')
x = IndexedBase('x')
y = IndexedBase('y')
i = Idx('i', m)
j = Idx('j', n)
codegen(('matrix_vector', Eq(y[i], A[i, j]*x[j])), "C","file", header=False, empty=False)
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.