Post Reply 
a bug or a feature.
11-12-2015, 03:05 PM
Post: #1
a bug or a feature.
I am having great difficulty doing cas matrix operations in a program.

The test case below shows one of the problems

EXPORT hsbat2(M)
BEGIN
LOCAL I,P,Q;
DEBUG;
I := inv(M); <- the inverse seems ok. Both M and I are lists
P := I*M; <- a problem here since '*' does silly list multiply
Q := simplify(P); <- since P is wrong this doesnt do much.
{M,I,P,Q}
END;

From the cas console by hand the matrices are sugar coated with
[[..]] and the parser knows that they are matrices (hidden type) so
it does the right thing.

Not so in a program where '*' sees things as lists so it multiplies element
by element, the wrong answer for matrices and vectors.

If there is a multiplyMat(M1,M2) like function, i cant find it.

Apparenty most of the cas functions expecting vectors or matrices treat
lists appropriatly. Not so for lexical operators, i guess.

Another problem i have is determing the return type when matrices or vectors
are involve since everything is a list.


Do i need to write my own matrix /vector multiply routines for program use[/u]?

I work with android Prime only for now on my
Galaxy Tab Pro/Note 2
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
a bug or a feature. - ji3m - 11-12-2015 03:05 PM
RE: a bug or a feature. - Marcus von Cube - 11-12-2015, 03:14 PM
RE: a bug or a feature. - Han - 11-12-2015, 03:29 PM
RE: a bug or a feature. - ji3m - 11-12-2015, 03:45 PM
RE: a bug or a feature. - ji3m - 11-12-2015, 03:51 PM
RE: a bug or a feature. - Han - 11-12-2015, 04:16 PM



User(s) browsing this thread: 1 Guest(s)