matrix addition/subtraction/init
Posted: Sun Sep 03, 2006 9:14 am
hi all
can we easily initialize a matrix by setting it to some array?
do we have matrix built-in function other than invert, multiply, transpose?
battery-included init, add, sub, determinant, size functions are nice to have
i played with matrix for a bit and i feel my code's long:
(set 'a (array-list (array 3 2 (sequence 1 6)))) ;matrix initialization
(set 'b (array-list (array 3 2 (sequence 4 9)))) ;array-list and array redundant?
(set 'c (array-list (array (length a) (length (a 1)) (map + (flat a) (flat b)))))
(invert (multiply (transpose c) c))
;((1.028645833 -0.8567708333) (-0.8567708333 0.7161458333))
this is my first time, sorry if the topic is old (i searched old posts tho)
thx!
can we easily initialize a matrix by setting it to some array?
do we have matrix built-in function other than invert, multiply, transpose?
battery-included init, add, sub, determinant, size functions are nice to have
i played with matrix for a bit and i feel my code's long:
(set 'a (array-list (array 3 2 (sequence 1 6)))) ;matrix initialization
(set 'b (array-list (array 3 2 (sequence 4 9)))) ;array-list and array redundant?
(set 'c (array-list (array (length a) (length (a 1)) (map + (flat a) (flat b)))))
(invert (multiply (transpose c) c))
;((1.028645833 -0.8567708333) (-0.8567708333 0.7161458333))
this is my first time, sorry if the topic is old (i searched old posts tho)
thx!