Opened 14 years ago

Closed 14 years ago

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

Reported by: Owned by: Jason Grout Jason Grout major sage-3.2.2 linear algebra N/A

### Description

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

### comment:1 Changed 14 years ago by Jason Grout

Owner: changed from William Stein to Jason Grout new → assigned 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.

### 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 assigned → closed

Merged in Sage 3.2.2.alpha1

Note: See TracTickets for help on using tickets.