1 | initial version |
I think you just put things in the wrong order.
I am guessing you want to achieve something like the following.
Here I'm using a random matrix and a random vector.
sage: A = random_matrix(ZZ, 5) sage: A [ 22 0 -128 1 -1] [ 0 -3 -1 -1 1] [ 1 -1 -1 1 0] [ 3 -4 2 25 0] [ 3 32 1 2 -1] sage: B = random_vector(ZZ, 5) sage: B (1, -5, 0, 1, 14)
Multiply them.
sage: A * B (9, 28, 7, 48, -169)
And use the result to define a, b, c, d, e.
sage: a, b, c, d, e = A * B sage: a, b, c, d, e (9, 28, 7, 48, -169) sage: b 28 sage: e -169
2 | No.2 Revision |
I think you just put things in the wrong order.
I am guessing you want to achieve something like the following.
Here I'm using a random matrix and a random vector.
sage: A = random_matrix(ZZ, 5)
sage: A
[ 22 0 -128 1 -1]
[ 0 -3 -1 -1 1]
[ 1 -1 -1 1 0]
[ 3 -4 2 25 0]
[ 3 32 1 2 -1]
sage: B = random_vector(ZZ, 5)
sage: B
(1, -5, 0, 1, Multiply them.
Here is their product.
sage: A * B
(9, 28, 7, 48, And use the result to define
Define
a, b, c, d,
sage: a, b, c, d, e = A * B
sage: a, b, c, d, e
(9, 28, 7, 48, -169)
sage: b
28
sage: e