mandelbrot SciMax Toolbox mapatom

SciMax Toolbox >> map

map

Maxima Function

Calling Sequence

map (f, expr_1, ..., expr_n)

Description

Returns an expression whose leading operator is the same as that of the expressions expr_1, ..., expr_n but whose subparts are the results of applying f to the corresponding subparts of the expressions. f is either the name of a function of n arguments or is a lambda form of n arguments.

maperror - if false will cause all of the mapping functions to (1) stop when they finish going down the shortest expr_i if not all of the expr_i are of the same length and (2) apply f to [expr_1, expr_2, ...] if the expr_i are not all the same type of object. If maperror is true then an error message will be given in the above two instances.

One of the uses of this function is to map a function (e.g. partfrac) onto each term of a very large expression where it ordinarily wouldn't be possible to use the function on the entire expression due to an exhaustion of list storage space in the course of the computation.

(%i1) map(f,x+a*y+b*z);
(%o1)                        f(b z) + f(a y) + f(x)
(%i2) map(lambda([u],partfrac(u,x)),x+1/(x^3+4*x^2+5*x+2));
                           1       1        1
(%o2)                     ----- - ----- + -------- + x
                         x + 2   x + 1          2
                                         (x + 1)
(%i3) map(ratsimp, x/(x^2+x)+(y^2+y)/y);
                                      1
(%o3)                            y + ----- + 1
                                    x + 1
(%i4) map("=",[a,b],[-0.5,3]);
(%o4)                          [a = - 0.5, b = 3]
mandelbrot SciMax Toolbox mapatom