I am currently in the process of rewriting some old code into
Mathematica. One of the things I've come across is the matrix
operation
A \ b
Which is defined as "left division." In other words (if I have this
right):
A \ b = inv(A)*b
and "right division" is
b / A = b*inv(A)
I guess my question is, does mathematica make the distinction between
left and right division, or is this more or less related to the
algorithm used by the solver (I am using numerical values by the way,
and not a symbolic solution)?
Cheers,
t.
if Mathematica would make a difference between row and column vectors
yes. Otherwise not.
AFAIK Mathematica implements none of the operators and it depend
on you to make the decision. Since b/A with a matrix would do a
component wise division and that is not what you want.
Regards
Jens
Hi,
The star operator "*" works element by elemet. The operator you want
is: Dot ".". It binds the leftmost index of the left operand and the
rightmost index of the right operand.
Therefore you would write:
Inverse[A].b for left division and
b.Inverse[A] for right division.
hope this helps, Daniel
The (preferred) Mathematica equivalents would be LinearSolve[A,b] and
LinearSolve[Transpose[A],b] respectively.
Mathematica does not support an infix form of this sort of division, so
the immediate question is moot.
Daniel Lichtblau
Wolfram Research
Cheers,
t.
You can turn LinearSolve into an "infix division" using the infix
notation:
In[1]:= a ~LinearSolve~ b
Out[1]= LinearSolve[a, b]
Not suggesting that is a particularly practical thing to do, but
sometimes the infix notation is useful, for instance for ~Join~
Regards,
JM
Hi,
I just saw your reply. Please note that using Inverse[A] to solve
equations is numerically unstable. Use LinearSolve. Even "A\vec" in
your other language is only syntax. The real procedure does not directly
use the matrix inverse.
The simplest procedure to solve equations is Gauss Elimination.
hope this helps, Daniel