Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Set::CrossProduct 1.92

    Download button

    No screenshots available
    Downloads: 316  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    brian d foy | More programs
    Perl Artistic License / FREE
    July 5th, 2007, 00:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Set::CrossProduct description

    Set::CrossProduct is a Perl module that allows you to work with the cross product of two or more sets.

    Set::CrossProduct is a Perl module that allows you to work with the cross product of two or more sets.

    SYNOPSIS

    my $iterator = Set::CrossProduct->new( ARRAY_OF_ARRAYS );

    # get the next tuple
    my $number_of_tuples = $iterator->cardinality;

    # get the next tuple
    my $tuple = $iterator->get;

    # move back one position
    my $tuple = $iterator->unget;

    # get the previous tuple without resetting
    # the cursor (peek at it)
    my $next_tuple = $iterator->next;

    # get the previous tuple without resetting
    # the cursor
    my $last_tuple = $iterator->previous;

    # get a random tuple
    my $tuple = $iterator->random;

    # in list context returns a list of all tuples
    my @tuples = $iterator->combinations;

    # in scalar context returns an array reference to all tuples
    my $tuples = $iterator->combinations;

    Given sets S(1), S(2), ..., S(k), each of cardinality n(1), n(2), ..., n(k) respectively, the cross product of the sets is the set CP of ordered tuples such that { | s1 => S(1), s2 => S(2), .... sk => S(k). }
    If you do not like that description, how about:

    Create a list by taking one item from each array, and do that for all possible ways that can be done, so that the first item in the list is always from the first array, the second item from the second array, and so on.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    cross product | Perl class | Perl module | Set::CrossProduct | cross | product

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM