DOCUMENTATION CENTER SEARCH
Mathematica
>
Applying Functions to Lists
>
Built-in
Mathematica
Symbol
Structural Operations
Tensors
Tutorials »
|
Outer
Dot
Thread
MapThread
ListCorrelate
See Also »
|
Applying Functions to Lists
Tensors
More About »
Inner
Inner
[
f
,
list
1
,
list
2
,
g
]
is a generalization of
Dot
in which
f
plays the role of multiplication and
g
of addition.
MORE INFORMATION
Inner[
f
, {{
a
,
b
}, {
c
,
d
}}, {
x
,
y
},
g
]
{
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
tensor.
Inner
[
f
,
list
1
,
list
2
]
uses
Plus
for
g
.
Inner
[
f
,
list
1
,
list
2
,
g
,
n
]
contracts index
n
of the first tensor with the first index of the second tensor.
The heads of
list
1
and
list
2
must be the same, but need not necessarily be
List
.
»
EXAMPLES
CLOSE ALL
Basic Examples
(3)
Compute the "inner f" of two list, with "plus operation" g:
In[1]:=
Out[1]=
Compute a generalized inner product of a matrix and a vector:
In[1]:=
Out[1]=
Use familiar operations:
In[1]:=
Out[1]=
In[2]:=
Out[2]=
Scope
(3)
Generalizations & Extensions
(2)
Applications
(3)
Properties & Relations
(2)
SEE ALSO
Outer
Dot
Thread
MapThread
ListCorrelate
TUTORIALS
Structural Operations
Tensors
MORE ABOUT
Applying Functions to Lists
Tensors
RELATED LINKS
NKS|Online
(
A New Kind of Science
)
New in 1
© 2008 Wolfram Research, Inc.