On 3/30/13 5:08 AM, Gary McConnell wrote:
Hi Jason

fair question - I was trying to avoid including all the boring details
of my code! In the simplest case I have a search routine which looks for
M sets of d vectors inside a vector space of dimension N over a finite
field, whose dot products satisfy a bunch of polynomial equations. My
problem is that I need to compare each new vector with all of the
antecedent vectors, so that the number of "equations" varies with d, M
and N (in several "recursive dimensions"). The only way I have been able
to do it so far is to construct separate loops by hand for each of d,N,M
and for each "new" vector within them ... ie every time I alter any one
of d, N or M, I need a new program!!

So I had hoped that your code would have allowed me to "telescope" the
search and comparison loops as functions of d,M,N in a neat way; only
obviously I've misunderstood what it does.

I think the confusion may be in what we mean by "variable". My code in this thread is for easily constructing Sage symbolic variables, and is just a convenient way to do something like var('x1,x2,x3') (x[1] is something like var('x1')). It sounds like you are referring to python variables, which are a different concept.

Still, if you can give a short example illustrating exactly what you trying to do, I think we can still probably point you in the right direction (for example, give us a working example of the nested for loops that you currently have that you'd like to generalize). If I followed you correctly, you should be able to do what you want fairly easily.

Thanks,

Jason


--
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to