Hello,

I've pasted the code below, since I'm not sure attachments will make it to the list. I have a program that does something similar to this. Obviously not as simple, but using the same concept: an inner loop using the index() function with an argument calculated from the outer loop.

In PDL 2.082 it loops at a consistent speed. But in PDL 2.083, each successive loop takes longer than the previous, and the real code becomes unusable, practically speaking.

On my particular machine, with PDL 2.082 the included code runs in 13 seconds, real time. With PDL 2.083, it's 5 minutes.

Any thoughts would be appreciated.

Thanks,
Pete

#! /usr/bin/perl

use strict;
use warnings;

use PDL;

my $n = 700;

my $a = sequence($n)->dummy(0, $n)->flat;
my $b = sequence($n)->dummy(1, $n)->flat;

for my $a_val (0..$n-1) {
  printf "%d / %d\n", $a_val, $n-1;
  my $ind1 = which($a == $a_val);
  for my $b_val (0..$n-1) {
    my $ind2 = which($b->index($ind1) == $b_val);
  }
}


_______________________________________________
pdl-devel mailing list
pdl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-devel

Reply via email to