Set::Infinite

Set::Infinite Perl module contains sets of intervals.
Download

Set::Infinite Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Flavio Soibelmann Glock
  • Publisher web site:
  • http://search.cpan.org/~fglock/DateTime-Event-Random-0.03/lib/DateTime/Event/Random.pm

Set::Infinite Tags


Set::Infinite Description

Set::Infinite Perl module contains sets of intervals. Set::Infinite Perl module contains sets of intervals.SYNOPSIS use Set::Infinite; $set = Set::Infinite->new(1,2); # print $set->union(5,6); # ,Set::Infinite is a Set Theory module for infinite sets.A set is a collection of objects. The objects that belong to a set are called its members, or "elements".As objects we allow (almost) anything: reals, integers, and objects (such as dates).We allow sets to be infinite.There is no account for the order of elements. For example, {1,2} = {2,1}.There is no account for repetition of elements. For example, {1,2,2} = {1,1,1,2} = {1,2}.CONSTRUCTORnewCreates a new set object: $set = Set::Infinite->new; # empty set $set = Set::Infinite->new( 10 ); # single element $set = Set::Infinite->new( 10, 20 ); # single range $set = Set::Infinite->new( , ); # two rangesempty set $set = Set::Infinite->new;set with a single element $set = Set::Infinite->new( 10 ); $set = Set::Infinite->new( );set with a single span $set = Set::Infinite->new( 10, 20 ); $set = Set::Infinite->new( ); # 10 10, open_begin => 0, b => 20, open_end => 1, } ); # 10 new( 10, 20, 100, 200 ); $set = Set::Infinite->new( , ); $set = Set::Infinite->new( { a => 10, open_begin => 0, b => 20, open_end => 0, }, { a => 100, open_begin => 0, b => 200, open_end => 0, } );The new() method expects ordered parameters.If you have unordered ranges, you can build the set using union: @ranges = ( , ); $set = Set::Infinite->new; $set = $set->union( @$_ ) for @ranges;The data structures passed to new must be immutable. So this is not good practice: $set = Set::Infinite->new( $object_a, $object_b ); $object_a->set_value( 10 );This is the recommended way to do it: $set = Set::Infinite->new( $object_a->clone, $object_b->clone ); $object_a->set_value( 10 );clone / copyCreates a new object, and copy the object data.empty_setCreates an empty set.If called from an existing set, the empty set inherits the "type" and "density" characteristics.universal_setCreates a set containing "all" possible elements.If called from an existing set, the universal set inherits the "type" and "density" characteristics. Requirements: · Perl


Set::Infinite Related Software