Opened 12 years ago

Closed 12 years ago

#4713 closed defect (fixed)

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

Reported by: jason Owned by: jason
Priority: major Milestone: sage-3.2.2
Component: linear algebra Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: 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 12 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 12 years ago by jason

  • Owner changed from was to jason
  • Status changed from new to assigned
  • Summary changed from make an apply_map function for vectors to [with patch, needs review] make an apply_map function for vectors

comment:2 Changed 12 years ago by was

  • Summary changed from [with patch, needs review] make an apply_map function for vectors to [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 12 years ago by was

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

Changed 12 years ago by jason

comment:4 Changed 12 years ago by jason

  • Summary changed from [with patch, needs work] make an apply_map function for vectors to [with patch, positive review] make an apply_map function for vectors

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

comment:5 Changed 12 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from assigned to closed

Merged in Sage 3.2.2.alpha1

Note: See TracTickets for help on using tickets.