Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparse matrix literals of the form [a,b;c,d] #12354

Open
robertwb opened this issue Jan 25, 2012 · 3 comments
Open

Preparse matrix literals of the form [a,b;c,d] #12354

robertwb opened this issue Jan 25, 2012 · 3 comments

Comments

@robertwb
Copy link
Contributor

E.g.

sage: [1,2;3,4]
[1 2]
[3 4]
sage: [1,2;3,4].parent()
Full MatrixSpace of 2 by 2 dense matrices over Integer Ring
sage: [1, 2; 3, 1/2].parent()
Full MatrixSpace of 2 by 2 dense matrices over Rational Field
sage: [1, 2; 3, pi].parent()
Full MatrixSpace of 2 by 2 dense matrices over Symbolic Ring

CC: @kini @kcrisman

Component: linear algebra

Author: Robert Bradshaw

Issue created by migration from https://trac.sagemath.org/ticket/12354

@robertwb
Copy link
Contributor Author

Attachment: preparse_matrix.patch.gz

@jasongrout
Copy link
Member

comment:1

Of course, a big change like this should at least have a vote and discussion on sage-devel.

Rob Beezer points out the preparser doesn't deal so well with newlines, so this patch breaks this valid python syntax:

sage: ["1","2","\n;"
....: "2","4"]
....: 
....: 
....: 
....: 

and it never quits.

@jasongrout
Copy link
Member

comment:2

See #11699 for another take on using this syntax in the regular matrix constructor.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants