ACE BN BNA CG CLG COMP FM FREE HEKA IDCA NCA NCSF PART SFA SG SGA SP SYMF TAB TYP

FUNCTION: SpSpecialize - specialize a set of variables

CALLING SEQUENCE:

SpSpecialize(expr, gname, f, args)
SP[SpSpecialize](expr, gname, f, args)

PARAMETERS:

expr = any expression
gname = any string or indexed
f = any procedure
args = any (extra) parameters for f

SYNOPSIS:

EXAMPLES:


> with(SP):
> SpSpecialize(x1 + y3 + xx2 + x3^3, 'x', i -> y.i);
 
                                          3
                        y1 + y3 + xx2 + y3
 
> deg:=3:                  # you should use a map to specialize a table...
> map(SpSpecialize, TableX(deg), 'x', proc(i,d) q^(d-i) end, deg);
 
                        table([
                                             2
                            [1, 3, 2] = q + q
                            [1, 2, 3] = 1
                                         4
                            [3, 1, 2] = q
                                         3
                            [2, 3, 1] = q
                                         2
                            [2, 1, 3] = q
                                         5
                            [3, 2, 1] = q
                        ])
 
  # specialization of the yi's as  the permutation [3,1,2] of the  xi's...
> map(SpSpecialize, TableXX(3), 'y', (i,perm) -> x.(perm[i]), [3,1,2]);
 
                     table([
                         [3, 1, 2] = 0
                         [1, 3, 2] = x2 - x3
                         [2, 3, 1] = (x2 - x3) (x1 - x3)
                         [1, 2, 3] = 1
                         [2, 1, 3] = x1 - x3
                         [3, 2, 1] = 0
                     ])
 
> SpSpecialize(X[3,1,2] + X[1,3,2], 'X', perm -> Y[op(Perm2Code(perm))]);
 
                      Y[2, 0, 0] + Y[0, 1, 0]
 

SEE ALSO: SG[Perm2Code] TableX TableXX