[ Home ] [ Support ] [ Documentation ] [ Systems ]

NAME

Set::IntegerRange - Sets of Integers

Easy manipulation of sets of integers (arbitrary intervals)


SYNOPSIS


METHODS

Version

    $version = $Set::IntegerRange::VERSION;

new

    $set = new Set::IntegerRange($lower,$upper);

    $set = Set::IntegerRange->new($lower,$upper);

    $set = $any_set->new($lower,$upper);

Size

    ($lower,$upper) = $set->Size();

Empty

    $set->Empty();

Fill

    $set->Fill();

Flip

    $set->Flip();

Interval_Empty

    $set->Interval_Empty($lower,$upper);

    $set->Empty_Interval($lower,$upper); # (deprecated)

Interval_Fill

    $set->Interval_Fill($lower,$upper);

    $set->Fill_Interval($lower,$upper);  # (deprecated)

Interval_Flip

    $set->Interval_Flip($lower,$upper);

    $set->Flip_Interval($lower,$upper);  # (deprecated)

Bit_Off

    $set->Bit_Off($index);

    $set->Delete($index);                # (deprecated)

Bit_On

    $set->Bit_On($index);

    $set->Insert($index);                # (deprecated)

bit_flip

    $bit = $set->bit_flip($index);

    if ($set->bit_flip($index))

    $bit = $set->flip($index);           # (deprecated)

    if ($set->flip($index))              # (deprecated)

bit_test

    $bit = $set->bit_test($index);

    if ($set->bit_test($index))

    $bit = $set->contains($index);

    if ($set->contains($index))

    $bit = $set->in($index);             # (deprecated)

    if ($set->in($index))                # (deprecated)

Norm

    $norm = $set->Norm();

Min

    $min = $set->Min();

Max

    $max = $set->Max();

Union

    $set1->Union($set2,$set3);           # in-place is possible!

Intersection

    $set1->Intersection($set2,$set3);    # in-place is possible!

Difference

    $set1->Difference($set2,$set3);      # in-place is possible!

ExclusiveOr

    $set1->ExclusiveOr($set2,$set3);     # in-place is possible!

Complement

    $set1->Complement($set2);            # in-place is possible!

equal

    if ($set1->equal($set2))

subset

    if ($set1->subset($set2))

    if ($set1->inclusion($set2))         # (deprecated)

lexorder

    if ($set1->lexorder($set2))

Compare

    $cmp = $set1->Compare($set2);

Copy

    $set1->Copy($set2);

Shadow

    $other_set = $some_set->Shadow();

Clone

    $twin_set = $some_set->Clone();

to_ASCII

    $string = $set->to_ASCII();          # e.g., "-8..-5,-1..2,4,6..9"

from_ASCII

    eval { $set->from_ASCII($string); };

to_String

    $string = $set->to_String();         # e.g., "0007AF1E"

from_String

    eval { $set->from_String($string); };


OVERLOADED OPERATORS

    # "$index" is a number or a Perl scalar variable containing a
    # number which represents the set containing only that element:

Emptyness

    if ($set) # if not empty

    if (! $set) # if empty

    unless ($set) # if empty

Equality

    if ($set1 == $set2)

    if ($set1 != $set2)

    if ($set == $index)

    if ($set != $index)

Lexical Comparison

    $cmp = $set1 cmp $set2;

    if ($set1 lt $set2)

    if ($set1 le $set2)

    if ($set1 gt $set2)

    if ($set1 ge $set2)

    if ($set1 eq $set2)

    if ($set1 ne $set2)

    $cmp = $set cmp $index;

    if ($set lt $index)

    if ($set le $index)

    if ($set gt $index)

    if ($set ge $index)

    if ($set eq $index)

    if ($set ne $index)

String Conversion

    $string = "$set";

    print "\$set = '$set'\n";

Union

    $set1 = $set2 + $set3;

    $set1 += $set2;

    $set1 = $set2 | $set3;

    $set1 |= $set2;

    $set1 = $set2 + $index;

    $set += $index;

    $set1 = $set2 | $index;

    $set |= $index;

Intersection

    $set1 = $set2 * $set3;

    $set1 *= $set2;

    $set1 = $set2 & $set3;

    $set1 &= $set2;

    $set1 = $set2 * $index;

    $set *= $index;

    $set1 = $set2 & $index;

    $set &= $index;

Difference

    $set1 = $set2 - $set3;

    $set1 -= $set2;

    $set1 = $set2 - $set1;

    $set1 = $set2 - $index;

    $set1 = $index - $set2;

    $set -= $index;

ExclusiveOr

    $set1 = $set2 ^ $set3;

    $set1 ^= $set2;

    $set1 = $set2 ^ $index;

    $set ^= $index;

Complement

    $set1 = -$set2;

    $set1 = ~$set2;

    $set = -$set;

    $set = ~$set;

Subset Relationship

    if ($set1 <= $set2)

True Subset Relationship

    if ($set1 < $set2)

Superset Relationship

    if ($set1 >= $set2)

True Superset Relationship

    if ($set1 > $set2)

Norm

    $norm = abs($set);


DESCRIPTION

This class lets you dynamically create sets of arbitrary intervals of integers and perform all the basic operations for sets on them (for a list of available methods and operators, see above).

See Vector(3) for more details!


SEE ALSO

Bit::Vector(3), Set::IntegerFast(3), Math::MatrixBool(3), Math::MatrixReal(3), DFA::Kleene(3), Math::Kleene(3), Graph::Kruskal(3).


VERSION

This man page documents ``Set::IntegerRange'' version 4.0.


AUTHOR

Steffen Beyer .


COPYRIGHT

Copyright (c) 1996, 1997 by Steffen Beyer. All rights reserved.


LICENSE

This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself.