Simple...?
Matrix by vector multiplication using MAT:
Say, for example, M() is a matrix of 3 rows by 3 columns, V() is a column vector of 3 rows...
DIM M(1 TO 3,1 TO 3) AS EXT, V(1 TO 3) AS EXT
If, after populating these arrays with data, I wish to replace the data in V() with the result of multiplying M() by V(), as in...
MAT V() = M() * V()
I get an incorrect result, whereas...
MAT V2() = M() * V()
provides the correct result, but I then have to copy V2() into V().
Providing a second dimension in V(), as in V(1 to 3,1 to 1), doesn't help.
What am I missing here? I'm perfectly prepared for someone to tell me that I'm being very stupid!
Michael Bell (using PB/CC5)
Matrix by vector multiplication using MAT:
Say, for example, M() is a matrix of 3 rows by 3 columns, V() is a column vector of 3 rows...
DIM M(1 TO 3,1 TO 3) AS EXT, V(1 TO 3) AS EXT
If, after populating these arrays with data, I wish to replace the data in V() with the result of multiplying M() by V(), as in...
MAT V() = M() * V()
I get an incorrect result, whereas...
MAT V2() = M() * V()
provides the correct result, but I then have to copy V2() into V().
Providing a second dimension in V(), as in V(1 to 3,1 to 1), doesn't help.
What am I missing here? I'm perfectly prepared for someone to tell me that I'm being very stupid!
Michael Bell (using PB/CC5)
Comment