Ticket #4713 (closed defect: fixed)

Opened 1 month ago

Last modified 1 month ago

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

Reported by: jason Assigned to: jason
Priority: major Milestone: sage-3.2.2
Component: linear algebra Keywords:
Cc:

Description

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

Attachments

vector_apply_map.patch (2.3 kB) - added by jason on 12/06/2008 03:41:15 PM.

Change History

12/05/2008 12:32:49 AM changed 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.

12/06/2008 03:26:02 PM changed 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)))

12/06/2008 03:26:46 PM changed by was

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

12/06/2008 03:41:15 PM changed by jason

  • attachment vector_apply_map.patch added.

12/06/2008 03:45:23 PM changed 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.

12/07/2008 01:06:44 AM changed by mabshoff

  • status changed from assigned to closed.
  • resolution set to fixed.

Merged in Sage 3.2.2.alpha1