Opened 14 years ago

Closed 14 years ago

#4713 closed defect (fixed)

[with patch, positive review] make an apply_map function for vectors

Reported by: Jason Grout Owned by: Jason Grout
Priority: major Milestone: sage-3.2.2
Component: linear algebra Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Matrices have the function; it would be handy for vectors to also have this utility function.

Attachments (1)

vector_apply_map.patch (2.3 KB) - added by Jason Grout 14 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 14 years ago by Jason Grout

Owner: changed from William Stein to Jason Grout
Status: newassigned
Summary: make an apply_map function for vectors[with patch, needs review] make an apply_map function for vectors

comment:2 Changed 14 years ago by William Stein

Summary: [with patch, needs review] make an apply_map function for vectors[with patch, needs work] make an apply_map function for vectors

You could also do this in the first example:

sage: m = vector(ZZ, 9, range(9)) 
sage: k.<a> = GF(9) 
sage: m.apply_map(k)
(0, 1, 2, 0, 1, 2, 0, 1, 2)

I think it would be nice to have a really simple first example, that requires much less knowledge of "abstract algebra". Maybe the first example could be for engineers or something?

sage: m = vector([1,x,sin(x+1)])
sage: m.apply_map(x^2)
(1, x^2, sin(x + 1)^2)
sage: m.apply_map(sin)
(sin(1), sin(x), sin(sin(x + 1)))

comment:3 Changed 14 years ago by William Stein

By the way, definitely positive review pending adding the doctests suggested above.

Changed 14 years ago by Jason Grout

Attachment: vector_apply_map.patch added

comment:4 Changed 14 years ago by Jason Grout

Summary: [with patch, needs work] make an apply_map function for vectors[with patch, positive review] make an apply_map function for vectors

updated patch with the suggestions. Accordingly, marking this positive review.

comment:5 Changed 14 years ago by Michael Abshoff

Resolution: fixed
Status: assignedclosed

Merged in Sage 3.2.2.alpha1

Note: See TracTickets for help on using tickets.