James Bergstra | 1 Dec 04:04
Picon

Re: convert strides/shape/offset into nd index?

Your question involves a few concepts:

- an integer vector describing the position of an element

- the logical shape (another int vector)

- the physical strides (another int vector)

Ignoring the case of negative offsets, a physical offset is the inner
product of the physical strides with the position vector.

In these terms, you are asking how to solve the inner-product equation
for the position vector.  There can be many possible solutions (like,
if there is a stride of 1, then you can make that dimension account
for the entire offset.  This is often not the solution you want.).
For valid ndarrays though, there is at most one solution though with
the property that every position element is less than the shape.

You will also need to take into account that for certain stride
vectors, there is no way to get certain offsets.  Imagine all the
strides were even, and you needed to get at an odd offset... it would
be impossible.  It would even be impossible if there were a dimension
with stride 1 but it had shape of 1 too.

I can't think of an algorithm off the top of my head that would do
this in a quick and elegant way.

James

On Sun, Nov 29, 2009 at 10:36 AM, Zachary Pincus
(Continue reading)

David Cournapeau | 1 Dec 04:47
Picon

Numpy 1.4.0 rc1 released

Hi,

The first release candidate for 1.4.0 has been released. The sources,
as well as mac and windows installers may be found here:

https://sourceforge.net/projects/numpy/files/

The main improvements compared to 1.3.0 are:

* Faster import time
* Extended array wrapping mechanism for ufuncs
* New Neighborhood iterator (C-level only)
* C99-like complex functions in npymath

As well as more than 50 bug fixes. The detailed list of changes may be
found on trac:

http://projects.scipy.org/numpy/roadmap

cheers,

David
Anne Archibald | 1 Dec 05:14
Picon

Re: convert strides/shape/offset into nd index?

2009/11/30 James Bergstra <bergstrj <at> iro.umontreal.ca>:
> Your question involves a few concepts:
>
> - an integer vector describing the position of an element
>
> - the logical shape (another int vector)
>
> - the physical strides (another int vector)
>
> Ignoring the case of negative offsets, a physical offset is the inner
> product of the physical strides with the position vector.
>
> In these terms, you are asking how to solve the inner-product equation
> for the position vector.  There can be many possible solutions (like,
> if there is a stride of 1, then you can make that dimension account
> for the entire offset.  This is often not the solution you want.).
> For valid ndarrays though, there is at most one solution though with
> the property that every position element is less than the shape.
>
> You will also need to take into account that for certain stride
> vectors, there is no way to get certain offsets.  Imagine all the
> strides were even, and you needed to get at an odd offset... it would
> be impossible.  It would even be impossible if there were a dimension
> with stride 1 but it had shape of 1 too.
>
> I can't think of an algorithm off the top of my head that would do
> this in a quick and elegant way.

Not to be a downer, but this problem is technically NP-complete. The
so-called "knapsack problem" is to find a subset of a collection of
(Continue reading)

Virgil Stokes | 1 Dec 09:17
Picon
Picon
Favicon
Gravatar

Re: Numpy 1.4.0 rc1 released

David Cournapeau wrote:
> Hi,
>
> The first release candidate for 1.4.0 has been released. The sources,
> as well as mac and windows installers may be found here:
>
> https://sourceforge.net/projects/numpy/files/
>
> The main improvements compared to 1.3.0 are:
>
> * Faster import time
> * Extended array wrapping mechanism for ufuncs
> * New Neighborhood iterator (C-level only)
> * C99-like complex functions in npymath
>
> As well as more than 50 bug fixes. The detailed list of changes may be
> found on trac:
>
> http://projects.scipy.org/numpy/roadmap
>
> cheers,
>
> David
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion <at> scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>   
Thanks for your  hard work David! :-)

(Continue reading)

David Cournapeau | 1 Dec 09:31
Picon

Re: Python 3K merge

On Tue, Dec 1, 2009 at 5:04 AM, Charles R Harris
<charlesr.harris <at> gmail.com> wrote:
> Hi Pauli,
>
> It looks like you doing great stuff with the py3k transition. Do you and
> David have any sort of merge schedule in mind?

I have updated my py3k branch for numpy.distutils, and it is ready to merge:

http://github.com/cournape/numpy/tree/py3k_bootstrap_take3

I have not thoroughly tested it, but it can run on both 2.4 and 3.1 on
Linux at least. The patch is much smaller than my previous attempts as
well, so I would just push it to the trunk, and deal with the issues
as they come.

cheers,

David
Sebastian Haase | 1 Dec 10:00
Picon
Gravatar

Re: Numpy 1.4.0 rc1 released

On Tue, Dec 1, 2009 at 9:17 AM, Virgil Stokes <vs <at> it.uu.se> wrote:
> David Cournapeau wrote:
>> Hi,
>>
>> The first release candidate for 1.4.0 has been released. The sources,
>> as well as mac and windows installers may be found here:
>>
>> https://sourceforge.net/projects/numpy/files/
>>
>> The main improvements compared to 1.3.0 are:
>>
>> * Faster import time
>> * Extended array wrapping mechanism for ufuncs
>> * New Neighborhood iterator (C-level only)
>> * C99-like complex functions in npymath
>>
>> As well as more than 50 bug fixes. The detailed list of changes may be
>> found on trac:
>>
>> http://projects.scipy.org/numpy/roadmap
>>
>> cheers,
>>
>> David
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion <at> scipy.org
>> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
> Thanks for your  hard work David! :-)
(Continue reading)

David Cournapeau | 1 Dec 10:46
Picon

Re: Numpy 1.4.0 rc1 released

On Tue, Dec 1, 2009 at 6:00 PM, Sebastian Haase <seb.haase <at> gmail.com> wrote:

>
> I can only agree - great work !
>

Thanks.

> Where can one find out about the
> * New Neighborhood iterator (C-level only)
> ?

Here:

http://docs.scipy.org/doc/numpy/reference/c-api.array.html#functions

You can find some examples in the multiarray_tests.c in numpy/core
(which test "stacked iterators"), as well as in scipy.signal (the
nd-correlate function uses the neighborhood iterator).

Note that optimizations such as used in VTK to separate the zones
where boundaries handling is needed from the ones without is not
implemented yet.

cheers,

David
Picon
Picon

Re: convert strides/shape/offset into nd index?

Anne Archibald wrote:
> 2009/11/30 James Bergstra <bergstrj <at> iro.umontreal.ca>:
>   
>> Your question involves a few concepts:
>>
>> - an integer vector describing the position of an element
>>
>> - the logical shape (another int vector)
>>
>> - the physical strides (another int vector)
>>
>> Ignoring the case of negative offsets, a physical offset is the inner
>> product of the physical strides with the position vector.
>>
>> In these terms, you are asking how to solve the inner-product equation
>> for the position vector.  There can be many possible solutions (like,
>> if there is a stride of 1, then you can make that dimension account
>> for the entire offset.  This is often not the solution you want.).
>> For valid ndarrays though, there is at most one solution though with
>> the property that every position element is less than the shape.
>>
>> You will also need to take into account that for certain stride
>> vectors, there is no way to get certain offsets.  Imagine all the
>> strides were even, and you needed to get at an odd offset... it would
>> be impossible.  It would even be impossible if there were a dimension
>> with stride 1 but it had shape of 1 too.
>>
>> I can't think of an algorithm off the top of my head that would do
>> this in a quick and elegant way.
>>     
(Continue reading)

Picon
Picon

Re: convert strides/shape/offset into nd index?

Dag Sverre Seljebotn wrote:
> Anne Archibald wrote:
>   
>> 2009/11/30 James Bergstra <bergstrj <at> iro.umontreal.ca>:
>>   
>>     
>>> Your question involves a few concepts:
>>>
>>> - an integer vector describing the position of an element
>>>
>>> - the logical shape (another int vector)
>>>
>>> - the physical strides (another int vector)
>>>
>>> Ignoring the case of negative offsets, a physical offset is the inner
>>> product of the physical strides with the position vector.
>>>
>>> In these terms, you are asking how to solve the inner-product equation
>>> for the position vector.  There can be many possible solutions (like,
>>> if there is a stride of 1, then you can make that dimension account
>>> for the entire offset.  This is often not the solution you want.).
>>> For valid ndarrays though, there is at most one solution though with
>>> the property that every position element is less than the shape.
>>>
>>> You will also need to take into account that for certain stride
>>> vectors, there is no way to get certain offsets.  Imagine all the
>>> strides were even, and you needed to get at an odd offset... it would
>>> be impossible.  It would even be impossible if there were a dimension
>>> with stride 1 but it had shape of 1 too.
>>>
(Continue reading)

Eloi Gaudry | 1 Dec 16:51
Picon
Gravatar

Re: Is anyone knowledgeable about dll deployment on windows ?

Thanks for these references (that's a pity we currently can't find 
anything related to runtime libraries versioning on the msdn database).

Eloi

David Cournapeau wrote:
> On Mon, Nov 30, 2009 at 8:52 PM, Eloi Gaudry <eg <at> fft.be> wrote:
>
>   
>> Well, I wasn't aware of Microsoft willing to giving up the whole
>> SxS/manifest thing. Is there any MSDN information available?
>>     
>
> I have seen this mentioned for the first time on the python-dev ML:
>
> http://aspn.activestate.com/ASPN/Mail/Message/python-dev/3764855
>
> The mention of including the version in the dll file, if true, is
> tragically comic. Maybe in 20 years windows will be able to have a
> system which exists for more than a decade on conventional unix... The
> link given by M.A Lemburg has changed since, though, as the
> description is nowhere to be found in the link. I think I have read
> that VS 2010 will never install the runtime in the SxS configuration,
> but I of course cannot find this information anymore. Maybe it is not
> true anymore, VS 2010 has not yet been released.
>
> You can also find useful manifest troubleshooting information there:
>
> http://blogs.msdn.com/junfeng/archive/2006/04/14/576314.aspx
>
(Continue reading)


Gmane