Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SF#378 where on dice of pdl bad results #101

Closed
zmughal opened this issue Apr 22, 2015 · 1 comment
Closed

SF#378 where on dice of pdl bad results #101

zmughal opened this issue Apr 22, 2015 · 1 comment

Comments

@zmughal
Copy link
Member

zmughal commented Apr 22, 2015

From http://sourceforge.net/p/pdl/bugs/378/

Running the following code on RHEL7:

#!/usr/bin/perl
use PDL;

print "OS: ".`uname -a`;
print "Perl: ".$^V."\n";
print "PDL: ".$PDL::VERSION."\n";

my $pdl = PDL->new([ [[0, 0]], [[1, 1]], [[2, 2]] ]);
print sprintf("\nPDL:%s\n", $pdl);
my $pslice     = $pdl->where($pdl == 0);
print sprintf("\nPDL Slice:\n%s\n", $pslice);

my $data      = $pdl->dice("X","X",[1, 0]);
print sprintf("\nData:%s\n", $data);

my $dslice     = $data->where($data == 0);
print sprintf("Should be same as PDL Slice\nData Slice:\n%s\n", $dslice);

Generates the following output:

OS: Linux riskrh7 3.10.0-123.9.3.el7.x86_64 #1 SMP Thu Oct 30 00:16:40 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
Perl: v5.16.3
PDL: 2.007_13

PDL:
[
 [
  [0 0]
 ]
 [
  [1 1]
 ]
 [
  [2 2]
 ]
]

PDL Slice:
[0 0]

Data:
[
 [
  [1 1]
 ]
 [
  [0 0]
 ]
]

Should be same as PDL Slice
Data Slice:
[7.897708e-28 3.1620201e-322]

Expected the "Data Slice" values to be the same as "PDL Slice".

@mohawk2
Copy link
Member

mohawk2 commented May 2, 2015

Make this into a *.t file? Or a test in the file already testing slice functionality?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants