On Sep 7, 2008, at 6:56 AM, Jason Merrill wrote:
>
> On Sep 7, 6:30 am, "John Cremona" <[EMAIL PROTECTED]> wrote:
>> It should be lightly easier than it is to convert a vector of
>> length n
>> to either an nx1 matrix or a 1xn matrix:
>>
>> sage: v = vector(srange(5))
>> sage: v
>> (0, 1, 2, 3,
I think that as matrix(v) returns a row matrix while transpose(v)
returns a column suggests that "someone" is thinking of vectors as
row-matrices! Which is not surprising given the way
solve(matrix,vector) works.
John
2008/9/7 Jason Merrill <[EMAIL PROTECTED]>:
>
> On Sep 7, 6:30 am, "John Crem
On Sep 7, 6:30 am, "John Cremona" <[EMAIL PROTECTED]> wrote:
> It should be lightly easier than it is to convert a vector of length n
> to either an nx1 matrix or a 1xn matrix:
>
> sage: v = vector(srange(5))
> sage: v
> (0, 1, 2, 3, 4)
> sage: matrix(QQ,1,5,[v])
> [0 1 2 3 4]
> sage: matrix(QQ,5,
It should be lightly easier than it is to convert a vector of length n
to either an nx1 matrix or a 1xn matrix:
sage: v = vector(srange(5))
sage: v
(0, 1, 2, 3, 4)
sage: matrix(QQ,1,5,[v])
[0 1 2 3 4]
sage: matrix(QQ,5,1,list(v))
[0]
[1]
[2]
[3]
[4]
I got neither of those right the first time!
On Sep 6, 7:26 pm, Jason Merrill <[EMAIL PROTECTED]> wrote:
> Is there a simple way to think of the difference between a vector with
> n elements, and a 1 by n matrix in Sage. When would I want to use one
> instead of the other?
>
> sage: m = matrix([1,2,3,4,5])
> sage: parent(m)
> Full MatrixSpa