MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

AW: Re: Transpose matrix does not work when MatrixForm is used, why?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45275] AW: [mg45264] Re: Transpose matrix does not work when MatrixForm is used, why?
  • From: Klamser at t-online.de
  • Date: Sat, 27 Dec 2003 05:00:14 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

why has Santa Claus a red cape on?

A deer is not a dog is not a dog.

A MatrixForm Object is not a Matrix.

m = { {1, 2, 3}, {4, 5, 6} } // MatrixForm;
??m -> m = MatrixForm[{{1, 2, 3}, {4, 5, 6}}]

Therefore m[[0]] -> MatrixForm

But

(m = { {1, 2, 3}, {4, 5, 6} }) // MatrixForm;
??m -> m = {{1, 2, 3}, {4, 5, 6}}

Therefore m[[0]] -> List

Therefore again:

A MatrixForm Object is not a Matrix.

Regards

Peter Klamser


-----Ursprüngliche Nachricht-----
Von: steve_H [mailto:nma124 at hotmail.com]
Gesendet: Mittwoch, 24. Dezember 2003 23:42
An: mathgroup at smc.vnet.net
Betreff: [mg45264] Re: Transpose matrix does not work when MatrixForm is
used, why?


Dr Bob <drbob at bigfoot.com> wrote in message
news:<bsbmsb$lr1$1 at smc.vnet.net>...

> That may be easier... if we are willing to constantly pay attention to
> whether the target of Transpose is "wrapped" in MatrixForm or not.
> (Transpose/@m if it's wrapped, Transpose@m if not.)
>
> But if we want Help's claim that evaluation is not affected to be true (it
> currently is NOT), then we have to redefine Transpose, Inverse, etc. as in
> my example.
>
> Only then would MatrixForm act properly as a wrapper, as intended.
>
> Bobby
>


> On Tue, 23 Dec 2003 18:38:10 +0900, Andrzej Kozlowski <akoz at mimuw.edu.pl>
> wrote:
>
> > This of course works, but presumably he would want do this for other
> > functions, (e.g. Inverse etc), not just transpose. So it seems to me it
> > is easier simply to use Map:
> >
> > m = { {1, 2, 3}, {4, 5, 6} } // MatrixForm
> > Transpose/@m
> >
> > etc.
> >
> > Andrzej Kozlowski
> >


Correct Dr Bob,

But why do we have to resort to all these tricks? Why can't Mathematica just
accept a MatrixForm (or any other representation form) of the object
in its functions (Transpose in this example) just as well as the
list representation?

Each Mathematica function, where needed, could start by checking if this
'Wrapper' as you call it exists, and converts it to a list
representation (remove the wrapper), and do its thing on the list,
and at the end put the 'wrapper' around the result as needed and
return the result to the user?

This way one does not have to worry which form of an object one uses,
the representation form or the list form.

i.e. representation form will be transparent to all Mathematica functions.


  • Prev by Date: Re: Transpose matrix does not work when MatrixForm is used, why?
  • Next by Date: Re: Re: Transpose matrix does not work when MatrixForm is used, why?
  • Previous by thread: Re: [RE] Can someone tell me why NDsolve isn't working here?
  • Next by thread: AW: Re: Transpose matrix does not work when MatrixForm is used, why?