On Mar 16, 10:47 pm, Alec Mihailovs wrote:
> By the way, vector doesn't work with integer numpy arrays,
>
> from numpy import array
> vector(array([1,2]))
>
> Traceback (most recent call last):
That shouldn't be too hard to implement - in particular, the following
works,
sage: from numpy import
By the way, vector doesn't work with integer numpy arrays,
from numpy import array
vector(array([1,2]))
Traceback (most recent call last):
File "", line 1, in
File "_sage_input_60.py", line 5, in
vector(array([_sage_const_1 ,_sage_const_2 ]))
File "", line 1, in
File "free_module_
On Tue, Mar 16, 2010 at 1:06 PM, Alec Mihailovs
wrote:
> What about vector(3,f), f.vector(3), and f.matrix(3,4) or
> f.matrix(5) ?
I didn't do anything about vector() -- I could probably get to it later.
There's no good way to make a syntax like f.matrix() or f.vector()
work, and it's not someth
On Mar 16, 3:57 pm, Mike Hansen wrote:
> On Tue, Mar 16, 2010 at 12:38 PM, Alec Mihailovs
>
> wrote:
> > Will it work as matrix(5,f) as well, or only as matrix(5,5,f) ?
>
> It now works with both.
>
> --Mike
That's great!
What about vector(3,f), f.vector(3), and f.matrix(3,4) or
f.matrix(5) ?
On Tue, Mar 16, 2010 at 12:38 PM, Alec Mihailovs
wrote:
> Will it work as matrix(5,f) as well, or only as matrix(5,5,f) ?
It now works with both.
--Mike
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...
On Mar 16, 2:32 am, Mike Hansen wrote:
> On Mon, Mar 15, 2010 at 10:16 PM, Jason Grout
>
> wrote:
> > Whoever takes care of this original issue gets to claim a 3-digit ticket!
>
> >http://trac.sagemath.org/sage_trac/ticket/261
>
> Patch up for review.
>
> --Mike
Will it work as matrix(5,f) as we
On Mon, Mar 15, 2010 at 10:16 PM, Jason Grout
wrote:
> Whoever takes care of this original issue gets to claim a 3-digit ticket!
>
> http://trac.sagemath.org/sage_trac/ticket/261
Patch up for review.
--Mike
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe fr
On 03/15/2010 10:58 PM, Alec Mihailovs wrote:
By the way, if that will go into a ticket, it would be nice if also
the possibility of defining a matrix through a function be added to
the matrix constructor (along David Joyner's suggestion).
Whoever takes care of this original issue gets to cla
On Mar 15, 3:48 am, Alec Mihailovs wrote:
> That seems to be a bug introduced in Sage, not in numpy,
>
> sage: fromfunction(lambda i,j:i-j+3,(1,1),dtype=int)
>
> array([[3]])
>
> sage: matrix(_)
>
> [0 0 0]
> [0 0 0]
> [0 0 0]
Yes, and that happens with other numpy 1x1 arrays as well, converted
Am Montag, den 15.03.2010, 10:38 -0700 schrieb Mike Hansen:
> On Mon, Mar 15, 2010 at 10:32 AM, Eckhard Kosin
> wrote:
> > sage: fromfunction(lambda i,j:i-j+3,(1,1),dtype=int)
> > ---
> > NameError
On Mon, Mar 15, 2010 at 10:32 AM, Eckhard Kosin
wrote:
> sage: fromfunction(lambda i,j:i-j+3,(1,1),dtype=int)
> ---
> NameError Traceback (most recent call
> last)
>
> /home/ecki/ in ()
>
> Name
Am Montag, den 15.03.2010, 00:48 -0700 schrieb Alec Mihailovs:
> On Mar 15, 3:39 am, Alec Mihailovs wrote:
> > The second problem is that something strange happens for 1x1 matrices,
> > with any dtype,
> >
> > matrix(fromfunction(lambda i,j:i-j,(1,1),dtype=int))
> >
> > []
> >
> > matrix(fromfunct
On Mar 15, 3:39 am, Alec Mihailovs wrote:
> The second problem is that something strange happens for 1x1 matrices,
> with any dtype,
>
> matrix(fromfunction(lambda i,j:i-j,(1,1),dtype=int))
>
> []
>
> matrix(fromfunction(lambda i,j:i-j+3,(1,1),dtype=int))
>
> [0 0 0]
> [0 0 0]
> [0 0 0]
That seem
On Mar 14, 6:15 pm, Alec Mihailovs wrote:
> That could be also done as
>
> from numpy import fromfunction
>
> matrix(fromfunction(lambda i,j:i-j, (6,6), dtype=int))
>
> [ 0 -1 -2 -3 -4 -5]
> [ 1 0 -1 -2 -3 -4]
> [ 2 1 0 -1 -2 -3]
> [ 3 2 1 0 -1 -2]
> [ 4 3 2 1 0 -1]
> [ 5 4 3 2 1 0]
That could be also done as
from numpy import fromfunction
matrix(fromfunction(lambda i,j:i-j, (6,6), dtype=int))
[ 0 -1 -2 -3 -4 -5]
[ 1 0 -1 -2 -3 -4]
[ 2 1 0 -1 -2 -3]
[ 3 2 1 0 -1 -2]
[ 4 3 2 1 0 -1]
[ 5 4 3 2 1 0]
_.parent()
Full MatrixSpace of 6 by 6 dense matrices over Int
15 matches
Mail list logo