r64578 - in /trunk/libset-intspan-perl: Changes IntSpan.pm MANIFEST META.yml debian/changelog t/ord.t t/span_ord.t

periapt-guest at users.alioth.debian.org periapt-guest at users.alioth.debian.org
Fri Nov 5 08:20:46 UTC 2010


Author: periapt-guest
Date: Fri Nov  5 08:20:26 2010
New Revision: 64578

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=64578
Log:
New upstream release

Added:
    trunk/libset-intspan-perl/t/ord.t
      - copied unchanged from r64577, branches/upstream/libset-intspan-perl/current/t/ord.t
    trunk/libset-intspan-perl/t/span_ord.t
      - copied unchanged from r64577, branches/upstream/libset-intspan-perl/current/t/span_ord.t
Modified:
    trunk/libset-intspan-perl/Changes
    trunk/libset-intspan-perl/IntSpan.pm
    trunk/libset-intspan-perl/MANIFEST
    trunk/libset-intspan-perl/META.yml
    trunk/libset-intspan-perl/debian/changelog

Modified: trunk/libset-intspan-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-intspan-perl/Changes?rev=64578&op=diff
==============================================================================
--- trunk/libset-intspan-perl/Changes (original)
+++ trunk/libset-intspan-perl/Changes Fri Nov  5 08:20:26 2010
@@ -1,4 +1,7 @@
 Revision history for Perl extension Set::IntSpan
+
+1.15  2010 Nov 04
+        - added span_ord() method
 
 1.14  2010 Jun 22
         - added ord() method

Modified: trunk/libset-intspan-perl/IntSpan.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-intspan-perl/IntSpan.pm?rev=64578&op=diff
==============================================================================
--- trunk/libset-intspan-perl/IntSpan.pm (original)
+++ trunk/libset-intspan-perl/IntSpan.pm Fri Nov  5 08:20:26 2010
@@ -6,7 +6,7 @@
 use base qw(Exporter);
 use Carp;
 
-our $VERSION   = '1.14';
+our $VERSION   = '1.15';
 our @EXPORT_OK = qw(grep_set map_set grep_spans map_spans);
 
 use overload
@@ -902,6 +902,13 @@
     $upper + 1
 }
 
+sub span_ord
+{
+    my($set, $n) = @_;
+
+    my $i = _bsearch($set->{edges}, $n);
+    ($set->{negInf} xor $i & 1) ? $i >> 1 : undef
+}
 
 sub min
 {
@@ -1411,8 +1418,6 @@
     undef
 }
 
-
-
 sub slice
 {
     my($set, $from, $to) = @_;
@@ -1644,6 +1649,7 @@
   $n       = $set->at($i);
   $slice   = $set->slice($from, $to);
   $i       = $set->ord($n);
+  $i       = $set->span_ord($n);
 
 =head2 Operator overloads
 
@@ -2319,6 +2325,15 @@
 
 Dies if I<$set> is C<neg_inf>.
 
+=item I<$i> = I<$set>->C<span_ord>($n)
+
+Returns the index I<$i> of the span containing the integer I<$n>,
+or C<undef> if I<$n> if not an element of I<$set>.
+
+To recover the span continaing I<$n>, write
+
+  (I<$set>->C<spans>)[I<$i>]
+
 =back
 
 
@@ -2647,6 +2662,10 @@
 
 Marc Lehmann <schmorp at schmorp.de>
 
+=item *
+
+Andrew Olson <aolson at me.com>
+
 =back
 
 

Modified: trunk/libset-intspan-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-intspan-perl/MANIFEST?rev=64578&op=diff
==============================================================================
--- trunk/libset-intspan-perl/MANIFEST (original)
+++ trunk/libset-intspan-perl/MANIFEST Fri Nov  5 08:20:26 2010
@@ -12,10 +12,12 @@
 t/island.t
 t/iterator.t
 t/member.t
+t/ord.t
 t/overload.t
 t/real_set.t
 t/relation.t
 t/set_spec.t
+t/span_ord.t
 t/spans.t
 t/subclass.t
 t/unary.t

Modified: trunk/libset-intspan-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-intspan-perl/META.yml?rev=64578&op=diff
==============================================================================
--- trunk/libset-intspan-perl/META.yml (original)
+++ trunk/libset-intspan-perl/META.yml Fri Nov  5 08:20:26 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Set-IntSpan
-version:            1.14
+version:            1.15
 abstract:           Manages sets of integers, newsrc style
 author:
     - Steven McDougall (swmcd at world.std.com)

Modified: trunk/libset-intspan-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libset-intspan-perl/debian/changelog?rev=64578&op=diff
==============================================================================
--- trunk/libset-intspan-perl/debian/changelog (original)
+++ trunk/libset-intspan-perl/debian/changelog Fri Nov  5 08:20:26 2010
@@ -1,12 +1,13 @@
-libset-intspan-perl (1.14-2) UNRELEASED; urgency=low
+libset-intspan-perl (1.15-1) UNRELEASED; urgency=low
 
   [ Ansgar Burchardt ]
   * Update my email address.
 
   [ Nicholas Bamber ]
   * Added myself to Uploaders
+  * New upstream release
 
- -- Ansgar Burchardt <ansgar at debian.org>  Mon, 01 Nov 2010 11:17:22 +0100
+ -- Nicholas Bamber <nicholas at periapt.co.uk>  Fri, 05 Nov 2010 08:20:59 +0000
 
 libset-intspan-perl (1.14-1) unstable; urgency=low
 




More information about the Pkg-perl-cvs-commits mailing list