Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Best Practices for passing numpy data pointer to C ?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
mark florisson  
View profile  
 More options Jul 26 2012, 3:56 pm
From: mark florisson <markflorisso...@gmail.com>
Date: Thu, 26 Jul 2012 20:56:58 +0100
Local: Thurs, Jul 26 2012 3:56 pm
Subject: Re: [cython-users] Re: Best Practices for passing numpy data pointer to C ?
On 26 July 2012 20:07, Chris Barker <chris.bar...@noaa.gov> wrote:

> On Thu, Jul 26, 2012 at 11:59 AM, Sturla Molden <sturlamol...@yahoo.no> wrote:
>> Den 26.07.2012 20:12, skrev Chris Barker:

>>> Which is why I suppose we really should have a canonical way to get
>>> that pointer -- thus arr.data, but it has its problems, as well.

>> That is what

>> <dtype_t*> np.PyArray_DATA(arr)

>> does.

> But does that give you the address of the zeroth element? or the
> address of the beginning of the data block? -- which I understand may
> not be the case, say for an array that is a slice of another array.

Those will always be the same. When you slice an array that changes
the starting element in some dimension, the data pointer is moved for
the new view.
> i.e should I update that Wiki page with

> <dtype_t*> np.PyArray_DATA(arr)

> instead of

> &arr[0]

> -Chris

> --

> Christopher Barker, Ph.D.
> Oceanographer

> Emergency Response Division
> NOAA/NOS/OR&R            (206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115       (206) 526-6317   main reception

> Chris.Bar...@noaa.gov


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.