Mathematica > Core Language > List Manipulation > Applying Functions to Lists >
Mathematica > Data Manipulation > Handling Arrays of Data > Applying Functions to Lists >

Inner

Inner[f, list1, list2, g]
is a generalization of Dot in which f plays the role of multiplication and g of addition.
  • Inner[f, {{a, b}, {c, d}}, {x, y}, g]LongRightArrow{g[f[a, x], f[b, y]], g[f[c, x], f[d, y]]}.
  • Like Dot, Inner effectively contracts the last index of the first tensor with the first index of the second tensor. Applying Inner to a rank r tensor and a rank s tensor gives a rank r+s-2 tensor.
  • Inner[f, list1, list2, g, n] contracts index n of the first tensor with the first index of the second tensor.
  • The heads of list1 and list2 must be the same, but need not necessarily be List.  »
New in 1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team