Thanks for your answer. Though I have defined and now use such a function you suggested, but I need to calculate this function later for thousands of different inputs. This means a huge amount of computation that can be avoided, by once deriving an expression in terms of x[i]'s and then just replacing them with different inputs. A part of my code is as follows:
> > def CS(P): > F=0; > c=1; f1=0; > for i in range(n+1): > for k in range(n+1,m+1): > j=copy(k); > for r in range(u): > c=c*(1/2)*P[u*i+r]*(j%2) > j=j/int(2); > f1=f1+c; > c=1; > F+=f1; > and some similar parts and then: > F+=f2; > and so on, and finally : > return F > Then I should call CS like this: P=[1,1,1,0,0,1]; CS(P) The other use of my first question is for defining a large system of ordinary differential equations: PSI'[t]=A[t].PSI[t] to be numerically solved by sage's desolver functions, where I need to find PSI[t] ( a vector of n functions of t) with A[t] and PSI[0] are given. (n can easily be larger than 20000 in my problem!) Thanks for your patience! -- You received this message because you are subscribed to the Google Groups "sage-support" 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/sage-support. For more options, visit https://groups.google.com/d/optout.
