#19045: better subs method for matrices
-------------------------------------+-------------------------------------
Reporter: vdelecroix | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.9
Component: linear algebra | Resolution:
Keywords: | Merged in:
Authors: Vincent Delecroix | Reviewers: Nathann Cohen,
Report Upstream: N/A | Thierry Monteil
Branch: | Work issues:
u/vdelecroix/19045 | Commit:
Dependencies: | 59990af70ddf8f7de42d7c781b12248977eac664
| Stopgaps:
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
Replying to [comment:9 tmonteil]:
> This is probably due to a problem in the substitution at the polynomial
level.
It is. And then indepent of this ticket.
{{{
sage: R.<x,y,z> = ZZ[]
sage: x.subs(x=1).parent()
Multivariate Polynomial Ring in x, y, z over Integer Ring
sage: x.subs(x=RDF(1)).parent()
Real Double Field
}}}
The above subs is clearly broken and you are welcome to fix it.
The method `matrix.subs()` is just a shortcut to apply `subs` to all
coefficients. It is needed because otherwise there is the one that is
inherited from `Element`.
> Also, the parent of the result should be determined by the parent of the
matrix and the parent of the substitued values, not only the entries of
the result, or it will be unpredictable.
I do not see what I can do better for the sake of this ticket. This is not
clear enough to me what I should do. Perhaps opening a ticket "give
specifications for subs and include it in the coercion model"?
--
Ticket URL: <http://trac.sagemath.org/ticket/19045#comment:11>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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-trac.
For more options, visit https://groups.google.com/d/optout.