Hello, all,

I am going to manipulate Legendre (P) polynomials.
So I do something like this:

sage: P.<x>=QQ[]

sage: #generate de first Lagrange polynomial
sage: s=[legendre_P(i,x) for i in [0..2]]
sage: print s
[1, x, 3/2*x^2 - 1/2]

sage: #now, look at the parents
sage: s[0].parent()
Integer Ring
sage: s[1].parent()
Univariate Polynomial Ring in x over Rational Field

Ok, this is correct, and seems nice; but I want to evaluate these
polynomials for  different values of x, and you cannot evaluate a member
of "Integer Ring" at say, x=1/21... So I need to compute the parent of
polynomials (which possibly are scalars)  in all my functions, make test
and so on....

I have found a work-around:
sage:  s=[P(legendre_P(i,x)) for i in [0..2]]

Then, I get:

sage: s[0].parent()
Univariate Polynomial Ring in x over Rational Field

Ok, but is there some other way to do this?

Yours
t.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.

<<attachment: tdumont.vcf>>

Reply via email to