evalindets - transform all subexpressions of a given type
|
Calling Sequence
|
|
evalindets( expr, atype, transformer, rest )
evalindets[flat]( expr, atype, transformer, rest )
|
|
Parameters
|
|
expr
|
-
|
anything; any Maple expression
|
atype
|
-
|
type; any Maple type expression
|
transformer
|
-
|
anything; an expression (typically, a procedure) to be called on each subexpression processed
|
rest
|
-
|
anything; (optional) expression sequence of extra arguments to be passed to transformer
|
|
|
|
|
Description
|
|
•
|
The command evalindets is a particular combination of calls to eval and indets that allows you to efficiently transform all subexpressions of a given type by some algorithm. It encapsulates a common "pattern" used in expression manipulation and transformation.
|
•
|
Each subexpression of type atype is transformed by the supplied transformer procedure to produce a "replacement" for it. Then, each subexpression is replaced in the original expression using eval with the corresponding transformed expression.
|
•
|
The flat option indicates that the subexpressions of expr of type atype are not nested. This provides a hint to Maple that it can use a somewhat faster algorithm in this special case. If the flat option is passed and nesting occurs, unexpected results may be be produced.
|
|
|
Examples
|
|
This example changes every call to to a call to .
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
Shift all symbols by a constant of .
>
|
|
| (5) |
Expand all products in an expression.
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
Using evalindets, you can avoid expanding things you might not want expanded.
>
|
|
| (9) |
Optional arguments may be passed to the transformer.
>
|
|
| (10) |
>
|
|
| (11) |
>
|
|
| (12) |
|
|
Download Help Document
Was this information helpful?