Good point. That works for me. --Chris
On 12/6/2015 13:06, Craig DeForest wrote:
Ah. Well, if the original behavior was to invoke pdl() it would have
included a sever() like operation automagically. If that is the
behavior you want, we could avoid this whole michigas by making
reshape() call sever() directly. My impression was that people wanted
flow through reshape(). I have no objection to asserting that reshape
will always sever.
(Mobile)
On Dec 6, 2015, at 10:59 AM, kmx <[email protected] <mailto:[email protected]>>
wrote:
On 6.12.2015 18:06, Karl Glazebrook wrote:
I am just wondering where that changed happened between 2.007 and
2.014 and if we missed something obvious.
1/ At he beginning there was my bug report: #398 $pdl->hdr items are
lost
after $pdl->reshape
https://sourceforge.net/p/pdl/bugs/398/
Which ended up in one-line fix like this:
sub PDL::reshape{
if (@_ == 2 && $_[1] == -1) { # a slicing reshape that drops 1-dims
return $_[0]->slice( map { $_==1 ? [0,0,0] : [] } $_[0]->dims);
}
- my $pdl = pdl($_[0]);
+ my $pdl = topdl($_[0]);
my $nelem = $pdl->nelem;
...
2/ With this change reshape() start crashing in some specific cases
3/ Craig added pdl_barf("Can't setdims on a PDL that already has
children"); to setdims in order to barf instead of crashing.
--
kmx
------------------------------------------------------------------------------
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