Hey all.  The reshape issue (as I saw it) was that reshaping $R to have fewer 
dims makes the mv() trans invalid.  The trans gets constructed to refer to the 
corresponding dims in both the parent and the child.  Reshaping the child to 
remove a dim means that the trans ends up pointing to a dim that doesn't exist. 
 In the specific cases where reshape() is used to rearrange dims without 
destroying any, or to add dims, everything works out.  

There are two other ways to solve that problem: one which is to make the 
cpoffsets macro code check the length of the dimlist before trying to de 
reference any dim.  The other is to make reshape trigger the RedoDims code.  
That last is probably the right answer, since then RedoDims can throw an error 
if necessary.  I don't have a clear strategy for either - it would take some 
digging around and I have not had the time to do it.

But reshape() on a connected PDL is pretty horrible practice anyway, which is 
why I added the masking error.  

"$R->mv(-1,0)->sever->reshape(4,2)" ought to make anyone happy...

(Mobile)

> On Dec 6, 2015, at 8:54 AM, Karl Glazebrook <[email protected]> wrote:
> 
> 
> Are we sure it is a ‘bug’? The reason I say that is it works fine on ancient 
> old PDL v2.007 and there is an obvious behaviour to 
> $R->mv(-1,0)->reshape(4,2) that v2.007 seems to give correctly.
> 
> I am hesitant that old code might well use constructs like that?
> 
> Karl
> 
> 
> 
>> On 7 Dec 2015, at 2:44 am, Chris Marshall <[email protected]> wrote:
>> 
>> Hi Karl-
>> 
>> The 'bug' was more in the interaction
>> of various dataflow connections as implemented
>> by mv(), reshape(), and others.  We 'fixed'
>> the problem by forbidding the problematic
>> operation.
>> 
>> The goal for PDL-2.015 was to fix the critical
>> problems of PDL-2.014 so that we would have a
>> PDL version with working 64bit index support.
>> This is to provide a stable, PDL-2.x version
>> to hold at while work on PDLA and PDLng takes
>> place.
>> 
>> For PDL-2.015 you'll need to use an explicit
>> sever to get the result you wish:
>> 
>> $R->mv(-1,0)->sever()->reshape(4,2)
>> 
>> We'll maintain PDL-2.015 as the stable, reference
>> release with incremental clean-up releases as
>> updates and bug fixes are made.  However, the
>> plan is that the PDL Next Gen (PDLng) and the
>> move to an agile development stance will be the
>> best way to improve PDL further.
>> 
>> I'm hopeful that the new developments will make
>> PDL more exciting and attract new contributions
>> and grow the PDL community.
>> 
>> Cheers,
>> Chris
>> 
>> 
>>> On 12/6/2015 10:13, Karl Glazebrook wrote:
>>> I am still curious about the reshape ‘bug’ from v.2014.
>>> 
>>> On PDL-2.015:
>>> 
>>>> pdl> $R = double([ [ [0,1],[2,3] ],[ [4,5],[6,7] ] ]);
>>>> 
>>>> pdl> p $R->mv(-1,0)->reshape(4,2)
>>>> Can't setdims on a PDL that already has children at blib/lib/PDL/Core.pm 
>>>> line 2650, <DATA> line 90.
>>> 
>>> On a very old version (PDL 2.007):
>>> 
>>>> pdl> $R = double([ [ [0,1],[2,3] ],[ [4,5],[6,7] ] ]);
>>>> 
>>>> pdl> p $R->mv(-1,0)->reshape(4,2)
>>>> 
>>>> [
>>>> [0 4 1 5]
>>>> [2 6 3 7]
>>>> ]
>>> Isn’t the latter what we expect?
>>> 
>>> Karl
> 
> 
> ------------------------------------------------------------------------------
> Go from Idea to Many App Stores Faster with Intel(R) XDK
> Give your users amazing mobile app experiences with Intel(R) XDK.
> Use one codebase in this all-in-one HTML5 development environment.
> Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
> http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
> _______________________________________________
> pdl-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pdl-general
> 
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to