On Mon, Jul 20, 2009 at 1:44 PM, Citi, Luca wrote:
> Just my 2 cents.
> It is duplicated code.
> But it is only 3 lines.
> "identity" does not need to handle rectangular matrices and non-principal
> diagonals,
> therefore it can be reasonably faster (especially for small matrices, I
> guess).
I
Just my 2 cents.
It is duplicated code.
But it is only 3 lines.
"identity" does not need to handle rectangular matrices and non-principal
diagonals,
therefore it can be reasonably faster (especially for small matrices, I guess).
___
NumPy-Discussion mai
OK, thanks! (Forgive my being a stickler, but I think it's good to have it in
the thread, for posterity.)
DG
--- On Mon, 7/20/09, Keith Goodman wrote:
> From: Keith Goodman
> Subject: Re: [Numpy-discussion] My identity
> To: "Discussion of Numerical Python"
>
On Mon, Jul 20, 2009 at 1:11 PM, David Goldsmith wrote:
>
> Just to be clear, in which namespace(s) are we talking about making (or
> having made) the change: IIUC, the result you're talking about would be
> inappropriate for ufunc.identity.
np.identity
np.matlib.identity
___
Just to be clear, in which namespace(s) are we talking about making (or having
made) the change: IIUC, the result you're talking about would be inappropriate
for ufunc.identity.
DG
--- On Mon, 7/20/09, Keith Goodman wrote:
> From: Keith Goodman
> Subject: Re: [Numpy-discussion]
On Mon, Jul 20, 2009 at 10:53 AM, Pauli Virtanen wrote:
> On 2009-07-20, Keith Goodman wrote:
> [clip]
>> Oh, sorry, I misunderstood. Yes, a similar change was made to eye but
>> not to identity.
>
> Nasty, duplicated code there it seems...
So
def myidentity2(n, dtype=None):
return eye(n, M=
On 2009-07-20, Keith Goodman wrote:
[clip]
> Oh, sorry, I misunderstood. Yes, a similar change was made to eye but
> not to identity.
Nasty, duplicated code there it seems...
--
Pauli Virtanen
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.
On Mon, Jul 20, 2009 at 9:32 AM, Keith Goodman wrote:
> On Mon, Jul 20, 2009 at 9:03 AM, Charles R
> Harris wrote:
>>
>>
>> On Mon, Jul 20, 2009 at 9:39 AM, Keith Goodman wrote:
>>>
>>> Using a trick that Robert Kern recently posted to the list makes the
>>> identity function much faster.
>>>
>>>
On Mon, Jul 20, 2009 at 9:03 AM, Charles R
Harris wrote:
>
>
> On Mon, Jul 20, 2009 at 9:39 AM, Keith Goodman wrote:
>>
>> Using a trick that Robert Kern recently posted to the list makes the
>> identity function much faster.
>>
>> Current version:
>>
>> def identity(n, dtype=None):
>> a = arra
On Mon, Jul 20, 2009 at 9:39 AM, Keith Goodman wrote:
> Using a trick that Robert Kern recently posted to the list makes the
> identity function much faster.
>
> Current version:
>
> def identity(n, dtype=None):
>a = array([1]+n*[0],dtype=dtype)
>b = empty((n,n),dtype=dtype)
>b.flat =
Using a trick that Robert Kern recently posted to the list makes the
identity function much faster.
Current version:
def identity(n, dtype=None):
a = array([1]+n*[0],dtype=dtype)
b = empty((n,n),dtype=dtype)
b.flat = a
return b
Proposed version:
def myidentity(n, dtype=None):
11 matches
Mail list logo