nikhil.patil has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.
  • Comment on Upper limit on length of arrays accepted by Set::CrossProduct

Replies are listed 'Best First'.
Re: Upper limit on length of arrays accepted by Set::CrossProduct
by moritz (Cardinal) on Jan 29, 2008 at 12:18 UTC
    I just looked into the source:
    sub cardinality { my $self = shift; my $product = 1; foreach my $length ( @{ $self->{lengths} } ) { $product *= ( $length + 1 ); } return $product; }

    And $self->{lengths} is initialized like this:

    $self->{lengths} = [ map { $#{$_} } @$array_ref ];

    Looks right to me, and doesn't look like a length limit.

    Could you try to find a data sample where cardinality returns 0?

    The simplest explanation is that one of your arrays is empty.

      Hi, Unknowingly, some empty arrays were getting included in the 10 arrays that I was using as input for Set::CrossProduct. On removing them, the cross-product result is perfect. Thanks!

        When you find a solution, please do not delete the content of the original node. The thread is next to worthless when that happens.

        If it happened accidentally, then never mind ;)

        --MidLifeXis