Opened 9 years ago

Last modified 6 years ago

#12354 new enhancement

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

Reported by: robertwb Owned by: jason, was
Priority: major Milestone: sage-6.4
Component: linear algebra Keywords:
Cc: kini, kcrisman Merged in:
Authors: Robert Bradshaw Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

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

Attachments (1)

preparse_matrix.patch (2.9 KB) - added by robertwb 9 years ago.

Download all attachments as: .zip

Change History (9)

Changed 9 years ago by robertwb

comment:1 Changed 9 years ago by jason

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.

comment:2 Changed 9 years ago by jason

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

comment:3 Changed 9 years ago by kini

  • Cc kini added

comment:4 Changed 8 years ago by kcrisman

  • Cc kcrisman added

comment:5 Changed 7 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:6 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:7 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:8 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.