Matrix multiplication: Difference between revisions

Content added Content deleted
Line 68: Line 68:
# Some sample matrices to test #
# Some sample matrices to test #
MAT a=((1, 1, 1, 1), # matrix A #
MAT a=((1, 1, 1, 1), # matrix A #
(2, 4, 8, 16),
(2, 4, 8, 16),
(3, 9, 27, 81),
(3, 9, 27, 81),
(4, 16, 64, 256));
(4, 16, 64, 256));
MAT b=(( 4 , -3 , 4/3, -1/4 ), # matrix B #
MAT b=(( 4 , -3 , 4/3, -1/4 ), # matrix B #
(-13/3, 19/4, -7/3, 11/24),
(-13/3, 19/4, -7/3, 11/24),
( 3/2, -2 , 7/6, -1/4 ),
( 3/2, -2 , 7/6, -1/4 ),
( -1/6, 1/4, -1/6, 1/24));
( -1/6, 1/4, -1/6, 1/24));
MAT prod = a * b; # actual multiplication example of A x B #
MAT prod = a * b; # actual multiplication example of A x B #