Many thanks. It definitely make sense to vectorize for performance. In this case the reason I want to keep the dimensions is that I only want to generate code for the body of the loops, and create the looping separately. I feel that gives more flexibility in handling boundary conditions, and I want to retain some of the structure of the problem in the code as well. Thanks for the pointer to the PR, tensor stuff is always exciting! Cheers, -TS
On Monday, 1 June 2015 16:44:18 UTC+1, Björn Dahlgren wrote: > > > On Monday, 1 June 2015 16:09:13 UTC+2, TIANJIAO SUN wrote: >> >> /.../ >> Can someone shed some light on why it is done this way? Thanks vm. >> > > I think it's mostly because people have been working with contiguous > arrays (e.g. NumPy arrays). > Even though multidimensional arrays in C offer great flexibility, the > associated pointer > indirection often makes it hard/impossible for compilers to do all their > optimizations > (e.g. autovectorization etc.). > > If you have a use case for pointer-to-potiner-to... type of arrays in C > you may want to introduce a > keyword argument to ccode enabling this behaviour. > > Note that you may want to base your work on this PR: > https://github.com/sympy/sympy/pull/9314 > > Best, > Björn > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/13d885b5-88df-4d63-8ccf-ab2667671e25%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
