Difference between array and matrix and usage of "~"
Subject: Difference between array and matrix and usage of "~"
From: Robert Dodier
Date: Tue, 13 Nov 2007 21:58:28 -0700
On 11/13/07, ? ???? <tianjh04 at mails.tsinghua.edu.cn> wrote:
> (C1) load(vect)$
> (C2) A : matrix([1,2,3], [4,5,6])$
> (C3) row(A,1) ~ row(A,2);
> (D3) [ 1 2 3 ] ~ [ 4 5 6 ]
> (C4) express(row(A,1) ~ row(A,2));
> ~ USED WITH IMPROPER ARGUMENTS: [ 1 2 3 ] [ 4 5 6 ]
A[k] is the k'th row of the matrix, a list. Try this:
express (A[1] ~ A[2]);
> 2. zero vector returned from "~" simply "shrinks" to scalar zero:
>
> (C1) [1,1,1] ~ [1,1,1];
> (D1) 0
>
> Why isn't it [0,0,0]?
I agree, it should be [0, 0, 0]. I will see if there is some interest in
changing the vect package.
Until then, you can try this:
simp : false;
matchdeclare (aa, all);
tellsimp (aa ~ aa, [0, 0, 0]);
tellsimp ([0, 0, 0] ~ aa, [0, 0, 0]);
tellsimp (aa ~ [0, 0, 0], [0, 0, 0]);
simp : true;
[1, 1, 1] ~ [1, 1, 1];
=> [0, 0, 0]
By the way, it appears you have a very old version of Maxima
(maybe 3 or 4 years old). I recommend that you get a more
recent version; there have been many bug fixes and other
improvements.
best
Robert Dodier