Eric Gourgoulhon wrote: > - Technically, it would be desirable to create a subclass, > ConstScalarField say, of the Element class of C^oo(U) (ScalarField) to > implement constant fields, in order to take advantage of their > specific properities [...] > - Mathematically, the set of constant scalar fields is a subalgebra of > C^oo(U), so it would be natural to implement it as such. Is there any > way to do this in the Parent/Element scheme ? [...] > In particular, CU(0).parent() would no longer be CU but CCU, which may > result in some undesired effects...
How about defining two parents (CU and CCU, with a coercion CCU --> CU and a partial conversion CU --> CCU), and two element classes (SF and a subclass CSF), and having CU(0) create an instance of CSF, but set the instance's parent to CU? -- Marc -- You received this message because you are subscribed to the Google Groups "sage-devel" 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-devel. For more options, visit https://groups.google.com/d/optout.
