Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make an apply_map function for vectors #4713

Closed
jasongrout opened this issue Dec 5, 2008 · 4 comments
Closed

make an apply_map function for vectors #4713

jasongrout opened this issue Dec 5, 2008 · 4 comments

Comments

@jasongrout
Copy link
Member

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

Component: linear algebra

Issue created by migration from https://trac.sagemath.org/ticket/4713

@williamstein
Copy link
Contributor

comment:2

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)))

@williamstein
Copy link
Contributor

comment:3

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

@jasongrout
Copy link
Member Author

comment:4

Attachment: vector_apply_map.patch.gz

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

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Dec 7, 2008

comment:5

Merged in Sage 3.2.2.alpha1

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Dec 7, 2008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants