Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14926

Re: Working with arrays

From Roland Franzius <roland.franzius@uos.de>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Working with arrays
Date 2013-06-17 10:18 +0000
Message-ID <kpmnp2$h3l$1@smc.vnet.net> (permalink)
References <kpjvhm$9n8$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


Am 16.06.2013 11:12, schrieb amannucci:
> lA = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
> xtest = {4, 5, 6};
> lA\[CenterDot]xtest (* First case *)
> {{a, b}, {c, d}} . {x, y} (* Second case *)
>
> The output is:
>
> {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}\[CenterDot]{4, 5, 6}
>
> {a x + b y, c x + d y}


The Dot-multiplication operator is overloaded with conventional physical 
applications.

In the mathematical sense you may declare matrix multiplication from the 
left with row vectors

{1,2,3}.{{1,2,3},{4,5,6},{7,8,9}}

or multiplication from the right with column vectors

{{1,2,3},{4,5,6},{7,8,9}.{{1},{2},{3}}


But since the most common three bilinear procedures on higher 
dimensional objects of maximal tensor rank 2:

1) scalar multiplication with implicitely assumed euclidean metrics,
2) applying forms on vectors and tensors of rank 2
3) matrix multiplication procedures

are obcsured in physics textbooks, completely, Mathematica, as a user 
friendly package, deliberately is guessing if a given Dot product may 
make any sense.


A hint to the background of this strange behavour is given in the "more 
information" statement in the Help for Dot:

" When its arguments are not lists or sparse arrays, Dot remains 
unevaluated"


Evaluate[lA].Evaluate[xtest]

is working as expected.

Take it as a hint that Dot is a generic name for a library of highly 
specialized subfunctions, that will be called with the arguments by name 
and not by value or on the stack.

It is the same reason why Plot or Integrate do not Evaluate the 
functional arguments. If needed, the values explicitely have to be 
handed over with an Evaluate beforehand in order to replace the name by 
its value in an argument at a Hold position.

But this behaviour is not documented for Dot.

Attributes[Dot]  ...

Perhaps this behaviour may force numerical linear programmers to use the 
correct mathematical tensor categories even in case of simple numerics 
with numerical arrays -- or perhaps they will use other  packages not so 
sophisticated.

-- 

Roland Franzius

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Working with arrays amannucci <Anthony.J.Mannucci@jpl.nasa.gov> - 2013-06-16 09:12 +0000
  Re: Working with arrays David Bailey <dave@removedbailey.co.uk> - 2013-06-17 10:15 +0000
  Re: Working with arrays amannucci <Anthony.J.Mannucci@jpl.nasa.gov> - 2013-06-17 10:17 +0000
    Re: Working with arrays David Bailey <dave@removedbailey.co.uk> - 2013-06-19 05:20 +0000
  Re: Working with arrays "Kevin J. McCann" <kjm@KevinMcCann.com> - 2013-06-17 10:17 +0000
  Re: Working with arrays Roland Franzius <roland.franzius@uos.de> - 2013-06-17 10:18 +0000

csiph-web