jerryt
Junior Member level 3
Hi, I am working on a school project. I need to be able to multiply two matrices together. The values in the matrices are all signed digits.
I need to multiply two matrices like this and add each value to an offset of [x0]:
X[1] [W1 W2 W3 W4] [x1] [x0]
X[2] [W2 W3 W4 W1] [x2] [x0]
X[3] = [W3 W4 W1 W2] * [x3] + [x0]
X[4] [W4 W1 W2 W3] [x4] [x0]
Here is how I formed the W matrix. For example:
type matrix4x4 is array (1 to 4, 1 to 4) of signed;
variable matrixA: matrix4x3 : ((W1,W2,W3,W4),(W2,W3,W4,W1),(W3,W4,W1,W2),(W4,W1,W2,W3));
You will notice that each row of the W matrix is just a cyclic shift of itself. Am I declaring the W matrix correctly? Can I call it signed? How could I just declare one row of the matrix [for instance row 1: [W1 W2 W3 W4] and then declare the next 3 rows of the matrix by shifting row 1 by one?
Thanks for everyone's help!
I need to multiply two matrices like this and add each value to an offset of [x0]:
X[1] [W1 W2 W3 W4] [x1] [x0]
X[2] [W2 W3 W4 W1] [x2] [x0]
X[3] = [W3 W4 W1 W2] * [x3] + [x0]
X[4] [W4 W1 W2 W3] [x4] [x0]
Here is how I formed the W matrix. For example:
type matrix4x4 is array (1 to 4, 1 to 4) of signed;
variable matrixA: matrix4x3 : ((W1,W2,W3,W4),(W2,W3,W4,W1),(W3,W4,W1,W2),(W4,W1,W2,W3));
You will notice that each row of the W matrix is just a cyclic shift of itself. Am I declaring the W matrix correctly? Can I call it signed? How could I just declare one row of the matrix [for instance row 1: [W1 W2 W3 W4] and then declare the next 3 rows of the matrix by shifting row 1 by one?
Thanks for everyone's help!