Oh, and badvalues. That's in the numpy pipeline, I hear, and may not be a
PDL-advantage for long, but it's something that PDL has had for years.

David


On Tue, Dec 31, 2013 at 5:19 PM, David Mertens <[email protected]>wrote:

> Yes, broadcasting is the numpy equivalent to PDL's "threading":
> http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html
>
> One of the important differences, though, is that PDL performs its
> auto-looping by *always* matching the dimensions from the start of the
> dimension list, whereas certain numpy methods let you indicate the "axis"
> over which to perform an operation. While this seems like a limitation in
> PDL, we actually let you *manipulate* the order of your dimension list, so
> you can arrange data of various shapes so that they operate the way you
> want. To my (limited) knowledge, numpy does not seem to support this.
> Knowledge to the contrary would be much appreciated, but a skim over this
> document <http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html>left 
> me unconvinced. Of course, it can be confusing as all hell to line up
> your dimensions, which might arguably be considered a bug.
>
> Another important distinction is that in PDL slices never break data flow;
> you have to manually sever data flow if you don't want it. The discussion
> on Advanced 
> Indexing<http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html#advanced-indexing>
>  leaves
> me to believe that non-affine slices always perform data copies. This
> feature of PDL was the major technical reason I preferred it over Matlab
> (in addition to the slightly-less-important features of sane hashes,
> awesome string manipulation, and simple sysadmin functionality).
>
> David
>
>
> On Tue, Dec 31, 2013 at 5:02 PM, Zakariyya Mughal 
> <[email protected]>wrote:
>
>> On 2013-12-31 at 14:32:36 -0700, Craig DeForest wrote:
>> > Cool, thanks.  I stand corrected there!  Have I missed something else
>> > important?  Is there an equivalent to PP that handles bookkeeping for
>> > you?
>>
>> I think the closest may be Numba <http://numba.pydata.org/>, which takes
>> Python code and translates it to LLVM IR. It supports broadcasting,
>> which is the numpy equivalent of PDL's threading. This link covers the
>> different tools available: <
>> http://nbviewer.ipython.org/gist/anonymous/4271861>
>>
>> For Weave, broadcasting must be done by using iterators to work along
>> each dimension (see PyArray_MultiIterNew in <
>> http://wiki.scipy.org/Cookbook/Weave>).
>>
>> As a side note, a number of other libraries I've seen take this
>> approach. I'm most familiar with ITK <http://www.itk.org/> which uses
>> C++ templates to do things like apply filters to n-dimensional images.
>>
>> Cheers,
>> - Zaki Mughal
>>
>> >
>> > Cheers,
>> > Craig
>> >
>> > On Dec 31, 2013, at 2:09 PM, Zakariyya Mughal <[email protected]>
>> wrote:
>> >
>> > > On 2013-12-31 at 13:50:31 -0700, Craig DeForest wrote:
>> > >>
>> > >> Again, I could be missing something but it appears Python still
>> > >> requires producing a several-file library to link in the simplest of
>> C
>> > >> programs.
>> > >
>> > > The equivalent to Inline::C in scipy is Weave. Here's an example
>> > > <
>> http://docs.scipy.org/doc/scipy/reference/tutorial/weave.html#more-examples
>> >.
>> > >
>> > > Also, as you can see later in that page, they demonstrate how to use
>> the
>> > > blitz++ library along with Weave for doing vectorised math
>> > > <http://blitz.sourceforge.net/>.
>> > >
>> > > Cheers,
>> > > - Zaki Mughal
>> > >
>> > > _______________________________________________
>> > > Perldl mailing list
>> > > [email protected]
>> > > http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>> > >
>> >
>>
>> _______________________________________________
>> Perldl mailing list
>> [email protected]
>> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>>
>
>
>
> --
>  "Debugging is twice as hard as writing the code in the first place.
>   Therefore, if you write the code as cleverly as possible, you are,
>   by definition, not smart enough to debug it." -- Brian Kernighan
>



-- 
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to