home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_5a1b357550c4b29c1c3c37adb3cf272e
< prev
next >
Wrap
Text File
|
2000-03-23
|
9KB
|
315 lines
<HTML>
<HEAD>
<TITLE>Set::IntRange - Sets of Integers</TITLE>
<LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Set::IntRange - Sets of Integers</P></STRONG>
</TD></TR>
</TABLE>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
<UL>
<LI><A HREF="#methods">METHODS</A></LI>
<LI><A HREF="#overloaded operators">OVERLOADED OPERATORS</A></LI>
</UL>
<LI><A HREF="#description">DESCRIPTION</A></LI>
<LI><A HREF="#see also">SEE ALSO</A></LI>
<LI><A HREF="#version">VERSION</A></LI>
<LI><A HREF="#author">AUTHOR</A></LI>
<LI><A HREF="#copyright">COPYRIGHT</A></LI>
<LI><A HREF="#license">LICENSE</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>Set::IntRange - Sets of Integers</P>
<P>Easy manipulation of sets of integers (arbitrary intervals)</P>
<P>
<HR>
<H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
<UL>
<LI>Linux</LI>
<LI>Solaris</LI>
<LI>Windows</LI>
</UL>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<P>
<H2><A NAME="methods">METHODS</A></H2>
<PRE>
Version
$version = $Set::IntRange::VERSION;</PRE>
<PRE>
new
$set = Set::IntRange->new($lower,$upper);
$set = $any_set->new($lower,$upper);</PRE>
<PRE>
Resize
$set->Resize($lower,$upper);</PRE>
<PRE>
Size
($lower,$upper) = $set->Size();</PRE>
<PRE>
Empty
$set->Empty();</PRE>
<PRE>
Fill
$set->Fill();</PRE>
<PRE>
Flip
$set->Flip();</PRE>
<PRE>
Interval_Empty
$set->Interval_Empty($lower,$upper);
$set->Empty_Interval($lower,$upper); # (deprecated)</PRE>
<PRE>
Interval_Fill
$set->Interval_Fill($lower,$upper);
$set->Fill_Interval($lower,$upper); # (deprecated)</PRE>
<PRE>
Interval_Flip
$set->Interval_Flip($lower,$upper);
$set->Flip_Interval($lower,$upper); # (deprecated)</PRE>
<PRE>
Interval_Scan_inc
while (($min,$max) = $set->Interval_Scan_inc($start))</PRE>
<PRE>
Interval_Scan_dec
while (($min,$max) = $set->Interval_Scan_dec($start))</PRE>
<PRE>
Bit_Off
$set->Bit_Off($index);
$set->Delete($index); # (deprecated)</PRE>
<PRE>
Bit_On
$set->Bit_On($index);
$set->Insert($index); # (deprecated)</PRE>
<PRE>
bit_flip
$bit = $set->bit_flip($index);
if ($set->bit_flip($index))
$bit = $set->flip($index); # (deprecated)
if ($set->flip($index)) # (deprecated)</PRE>
<PRE>
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)</PRE>
<PRE>
Norm
$norm = $set->Norm();</PRE>
<PRE>
Min
$min = $set->Min();</PRE>
<PRE>
Max
$max = $set->Max();</PRE>
<PRE>
Union
$set1->Union($set2,$set3); # in-place is possible!</PRE>
<PRE>
Intersection
$set1->Intersection($set2,$set3); # in-place is possible!</PRE>
<PRE>
Difference
$set1->Difference($set2,$set3); # in-place is possible!</PRE>
<PRE>
ExclusiveOr
$set1->ExclusiveOr($set2,$set3); # in-place is possible!</PRE>
<PRE>
Complement
$set1->Complement($set2); # in-place is possible!</PRE>
<PRE>
is_empty
if ($set->is_empty())</PRE>
<PRE>
is_full
if ($set->is_full())</PRE>
<PRE>
equal
if ($set1->equal($set2))</PRE>
<PRE>
subset
if ($set1->subset($set2))
if ($set1->inclusion($set2)) # (deprecated)</PRE>
<PRE>
Lexicompare
$cmp = $set1->Lexicompare($set2); # unsigned</PRE>
<PRE>
Compare
$cmp = $set1->Compare($set2); # signed</PRE>
<PRE>
Copy
$set1->Copy($set2);</PRE>
<PRE>
Shadow
$other_set = $some_set->Shadow();</PRE>
<PRE>
Clone
$twin_set = $some_set->Clone();</PRE>
<PRE>
to_Enum
$string = $set->to_Enum(); # e.g., "-8..-5,-1..2,4,6..9"</PRE>
<PRE>
from_Enum
eval { $set->from_Enum($string); };</PRE>
<PRE>
to_Hex
$string = $set->to_Hex(); # e.g., "0007AF1E"</PRE>
<PRE>
from_Hex
eval { $set->from_Hex($string); };</PRE>
<PRE>
BitVector
$set->BitVector->any_Bit_Vector_method();</PRE>
<P>
<H2><A NAME="overloaded operators">OVERLOADED OPERATORS</A></H2>
<PRE>
# "$index" is a number or a Perl scalar variable containing a
# number which represents the set containing only that element:</PRE>
<PRE>
Emptyness
if ($set) # if not empty
if (! $set) # if empty
unless ($set) # if empty</PRE>
<PRE>
Equality
if ($set1 == $set2)
if ($set1 != $set2)
if ($set == $index)
if ($set != $index)</PRE>
<PRE>
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)</PRE>
<PRE>
String Conversion
$string = "$set";
print "\$set = '$set'\n";</PRE>
<PRE>
Union
$set1 = $set2 + $set3;
$set1 += $set2;
$set1 = $set2 | $set3;
$set1 |= $set2;
$set1 = $set2 + $index;
$set += $index;
$set1 = $set2 | $index;
$set |= $index;</PRE>
<PRE>
Intersection
$set1 = $set2 * $set3;
$set1 *= $set2;
$set1 = $set2 & $set3;
$set1 &= $set2;
$set1 = $set2 * $index;
$set *= $index;
$set1 = $set2 & $index;
$set &= $index;</PRE>
<PRE>
Difference
$set1 = $set2 - $set3;
$set1 -= $set2;
$set1 = $set2 - $set1;
$set1 = $set2 - $index;
$set1 = $index - $set2;
$set -= $index;</PRE>
<PRE>
ExclusiveOr
$set1 = $set2 ^ $set3;
$set1 ^= $set2;
$set1 = $set2 ^ $index;
$set ^= $index;</PRE>
<PRE>
Complement
$set1 = -$set2;
$set1 = ~$set2;
$set = -$set;
$set = ~$set;</PRE>
<PRE>
Subset Relationship
if ($set1 <= $set2)</PRE>
<PRE>
True Subset Relationship
if ($set1 < $set2)</PRE>
<PRE>
Superset Relationship
if ($set1 >= $set2)</PRE>
<PRE>
True Superset Relationship
if ($set1 > $set2)</PRE>
<PRE>
Norm
$norm = abs($set);</PRE>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>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).</P>
<P>See <A HREF="../../../Bit/Vector(3).html">the Bit::Vector(3) manpage</A> for more details!</P>
<P>
<HR>
<H1><A NAME="see also">SEE ALSO</A></H1>
<P>Bit::Vector(3), Set::IntegerFast(3), Math::MatrixBool(3),
Math::MatrixReal(3), DFA::Kleene(3), Math::Kleene(3),
Graph::Kruskal(3).</P>
<P>
<HR>
<H1><A NAME="version">VERSION</A></H1>
<P>This man page documents ``Set::IntRange'' version 5.0.</P>
<P>
<HR>
<H1><A NAME="author">AUTHOR</A></H1>
<P>Steffen Beyer <<A HREF="mailto:sb@sdm.de">sb@sdm.de</A>>.</P>
<P>
<HR>
<H1><A NAME="copyright">COPYRIGHT</A></H1>
<P>Copyright (c) 1996, 1997 by Steffen Beyer. All rights reserved.</P>
<P>
<HR>
<H1><A NAME="license">LICENSE</A></H1>
<P>This package is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.</P>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Set::IntRange - Sets of Integers</P></STRONG>
</TD></TR>
</TABLE>
</BODY>
</HTML>