in reply to Re^5: Imagecat - show color images in a terminal ('Memoization' for PDL)
in thread Imagecat - show color images in a terminal
Here is the test I've constructed from your cases above. Interestingly, only the [0,1] case (don't physicalise the clump-ee, and mutate the clump-ee rather than the original) works perfectly, as you note above. Also interestingly, my first go at this using $pdl->flat->unpdl produced different results from $pdl->unpdl.
for ([0,0], [0,1], [1,0], [1,1]) { my ($phys_clump, $mutate_orig) = @$_; my $orig = zeroes 3,2,1; my $clump = $orig->clump(1,2); $clump->make_physvaffine if $phys_clump; ($mutate_orig ? $orig : $clump) .= 3; my $got = $orig->unpdl; is_deeply $got, [[[(3)x3],[(3)x3]]], "phys_clump=$phys_clump mutate_ +orig=$mutate_orig orig" or diag explain $got; $got = $clump->unpdl; is_deeply $got, [[(3)x3],[(3)x3]], "phys_clump=$phys_clump mutate_or +ig=$mutate_orig clump" or diag explain $got; $got = $clump->uniqvec->unpdl; is_deeply $got, [[(3)x3]], "phys_clump=$phys_clump mutate_orig=$muta +te_orig uniqvec" or diag explain $got; }
|
---|