Uses for MapAll ( //@ )

后端 未结 4 1680
Happy的楠姐
Happy的楠姐 2021-01-02 05:07

The function MapAll was seen as important enough to warrant the short form //@, yet I rarely use it, especially compared to others like /@

4条回答
  •  滥情空心
    2021-01-02 05:13

    I would use it as a lazy way to apply algebraic expressions on objects algebraic functions do not work with:

    In[13]:= ser = 1/(1 + x)^a + O[x]^4
    
    Out[13]= SeriesData[x, 0, {
     1, -a, Rational[1, 2] (a + a^2), 
      Rational[1, 6] ((-2) a - 3 a^2 - a^3)}, 0, 4, 1]
    
    In[14]:= Factor[ser]
    
    Out[14]= SeriesData[x, 0, {
     1, -a, Rational[1, 2] (a + a^2), 
      Rational[1, 6] ((-2) a - 3 a^2 - a^3)}, 0, 4, 1]
    
    In[15]:= MapAll[Factor, ser]
    
    Out[15]= SeriesData[x, 0, {
     1, -a, Rational[1, 2] a (1 + a), 
      Rational[-1, 6] a (1 + a) (2 + a)}, 0, 4, 1]
    

提交回复
热议问题