Dot
Usage Message: a.b.c or Dot[a, b, c] gives products of vectors, matrices and tensors. Attributes[Dot] = {Flat, OneIdentity, Protected} Notes:
In Mathematica 4.0.0, the behavior of Dot has changed
for zero terms. For example,
In[1]:= {{a, b}, {c, d}}.{{0, 0}, {0, 1.}}
Version 3.0 returns,
Out[1]= {{0, 1. b}, {0, 1. d}}
Version 4.0.0 returns,
Out[1]= {{0. a + 0. b, 0. a + 1. b}, {0. c + 0. d, 0. c + 1. d}}
If you are doing multiple dot products, version 4.0.0
can be slower or requore more memory because of this behavior.
You can use Chop or Inner
to return the form used in 3.0.
In[2]:= Chop[{{a, b}, {c, d}}.{{0, 0}, {0, 1.}}]
Out[2]= {{0, 1. b}, {0, 1. d}}
In[3]:= myDot[x_, y__] := Fold[Inner[Times, ##, Plus] &, x, {y}]
In[4]:= myDot[{{a, b}, {c, d}},{{0, 0}, {0, 1.}}]
Out[4]= {{0, 1. b}, {0, 1. d}}
Additional Online Documentation:
Mathematica 3.0
http://documents.wolfram.com/v3/RefGuide/Dot.html
Mathematica 4.0
http://documents.wolfram.com/v4/RefGuide/Dot.html
Questions or comments? Send email to support@wolfram.com.
| |