@@ -116,7 +116,7 @@ struct BigBitv {
116
116
}
117
117
118
118
/**
119
- * a mask that has a 1 for each defined bit in the nth element of a big_bitv ,
119
+ * A mask that has a 1 for each defined bit in the n'th element of a `BigBitv` ,
120
120
* assuming n bits.
121
121
*/
122
122
#[ inline]
@@ -284,7 +284,7 @@ impl Bitv {
284
284
* Calculates the union of two bitvectors
285
285
*
286
286
* Sets `self` to the union of `self` and `v1`. Both bitvectors must be
287
- * the same length. Returns ' true' if `self` changed.
287
+ * the same length. Returns ` true` if `self` changed.
288
288
*/
289
289
#[ inline]
290
290
pub fn union ( & mut self , v1 : & Bitv ) -> bool { self . do_op ( Union , v1) }
@@ -293,7 +293,7 @@ impl Bitv {
293
293
* Calculates the intersection of two bitvectors
294
294
*
295
295
* Sets `self` to the intersection of `self` and `v1`. Both bitvectors
296
- * must be the same length. Returns ' true' if `self` changed.
296
+ * must be the same length. Returns ` true` if `self` changed.
297
297
*/
298
298
#[ inline]
299
299
pub fn intersect ( & mut self , v1 : & Bitv ) -> bool {
@@ -395,7 +395,7 @@ impl Bitv {
395
395
self . do_op ( Difference , v)
396
396
}
397
397
398
- /// Returns true if all bits are 1
398
+ /// Returns ` true` if all bits are 1
399
399
#[ inline]
400
400
pub fn is_true ( & self ) -> bool {
401
401
match self . rep {
@@ -417,7 +417,7 @@ impl Bitv {
417
417
self . iter ( ) . invert ( )
418
418
}
419
419
420
- /// Returns true if all bits are 0
420
+ /// Returns ` true` if all bits are 0
421
421
pub fn is_false ( & self ) -> bool {
422
422
match self . rep {
423
423
Small ( ref b) => b. is_false ( self . nbits ) ,
@@ -433,18 +433,18 @@ impl Bitv {
433
433
}
434
434
435
435
/**
436
- * Converts `self` to a vector of uint with the same length.
436
+ * Converts `self` to a vector of ` uint` with the same length.
437
437
*
438
- * Each uint in the resulting vector has either value 0u or 1u .
438
+ * Each ` uint` in the resulting vector has either value `0u` or `1u` .
439
439
*/
440
440
pub fn to_vec ( & self ) -> ~[ uint ] {
441
441
vec:: from_fn ( self . nbits , |x| self . init_to_vec ( x) )
442
442
}
443
443
444
444
/**
445
445
* Organise the bits into bytes, such that the first bit in the
446
- * bitv becomes the high-order bit of the first byte. If the
447
- * size of the bitv is not a multiple of 8 then trailing bits
446
+ * `Bitv` becomes the high-order bit of the first byte. If the
447
+ * size of the `Bitv` is not a multiple of 8 then trailing bits
448
448
* will be filled-in with false/0
449
449
*/
450
450
pub fn to_bytes ( & self ) -> ~[ u8 ] {
@@ -472,7 +472,7 @@ impl Bitv {
472
472
}
473
473
474
474
/**
475
- * Transform self into a [bool] by turning each bit into a bool
475
+ * Transform ` self` into a ` [bool]` by turning each bit into a ` bool`.
476
476
*/
477
477
pub fn to_bools ( & self ) -> ~[ bool ] {
478
478
vec:: from_fn ( self . nbits , |i| self [ i] )
@@ -498,7 +498,7 @@ impl Bitv {
498
498
499
499
500
500
/**
501
- * Compare a bitvector to a vector of bool.
501
+ * Compare a bitvector to a vector of ` bool` .
502
502
*
503
503
* Both the bitvector and vector must have the same length.
504
504
*/
@@ -519,9 +519,9 @@ impl Bitv {
519
519
}
520
520
521
521
/**
522
- * Transform a byte-vector into a bitv . Each byte becomes 8 bits,
522
+ * Transform a byte-vector into a `Bitv` . Each byte becomes 8 bits,
523
523
* with the most significant bits of each byte coming first. Each
524
- * bit becomes true if equal to 1 or false if equal to 0.
524
+ * bit becomes ` true` if equal to 1 or ` false` if equal to 0.
525
525
*/
526
526
pub fn from_bytes ( bytes : & [ u8 ] ) -> Bitv {
527
527
from_fn ( bytes. len ( ) * 8 , |i| {
@@ -532,15 +532,15 @@ pub fn from_bytes(bytes: &[u8]) -> Bitv {
532
532
}
533
533
534
534
/**
535
- * Transform a [bool] into a bitv by converting each bool into a bit.
535
+ * Transform a ` [bool]` into a `Bitv` by converting each ` bool` into a bit.
536
536
*/
537
537
pub fn from_bools ( bools : & [ bool ] ) -> Bitv {
538
538
from_fn ( bools. len ( ) , |i| bools[ i] )
539
539
}
540
540
541
541
/**
542
- * Create a bitv of the specified length where the value at each
543
- * index is f(index).
542
+ * Create a `Bitv` of the specified length where the value at each
543
+ * index is ` f(index)` .
544
544
*/
545
545
pub fn from_fn ( len : uint , f : & fn ( index : uint ) -> bool ) -> Bitv {
546
546
let mut bitv = Bitv :: new ( len, false ) ;
@@ -571,7 +571,7 @@ fn iterate_bits(base: uint, bits: uint, f: &fn(uint) -> bool) -> bool {
571
571
return true ;
572
572
}
573
573
574
- /// An iterator for Bitv
574
+ /// An iterator for ` Bitv`.
575
575
pub struct BitvIterator < ' self > {
576
576
priv bitv : & ' self Bitv ,
577
577
priv next_idx : uint ,
@@ -631,12 +631,12 @@ impl<'self> RandomAccessIterator<bool> for BitvIterator<'self> {
631
631
///
632
632
/// It should also be noted that the amount of storage necessary for holding a
633
633
/// set of objects is proportional to the maximum of the objects when viewed
634
- /// as a uint.
634
+ /// as a ` uint` .
635
635
#[ deriving( Clone ) ]
636
636
pub struct BitvSet {
637
637
priv size : uint ,
638
638
639
- // In theory this is a Bitv instead of always a BigBitv, but knowing that
639
+ // In theory this is a ` Bitv` instead of always a ` BigBitv` , but knowing that
640
640
// there's an array of storage makes our lives a whole lot easier when
641
641
// performing union/intersection/etc operations
642
642
priv bitv : BigBitv
@@ -861,7 +861,7 @@ impl MutableSet<uint> for BitvSet {
861
861
}
862
862
863
863
impl BitvSet {
864
- /// Visits each of the words that the two bit vectors (self and other)
864
+ /// Visits each of the words that the two bit vectors (` self` and ` other` )
865
865
/// both have in common. The three yielded arguments are (bit location,
866
866
/// w1, w2) where the bit location is the number of bits offset so far,
867
867
/// and w1/w2 are the words coming from the two vectors self, other.
@@ -874,13 +874,13 @@ impl BitvSet {
874
874
. map ( |( ( i, & w) , o_store) | ( i * uint:: bits, w, o_store[ i] ) )
875
875
}
876
876
877
- /// Visits each word in self or other that extends beyond the other. This
877
+ /// Visits each word in ` self` or ` other` that extends beyond the other. This
878
878
/// will only iterate through one of the vectors, and it only iterates
879
879
/// over the portion that doesn't overlap with the other one.
880
880
///
881
- /// The yielded arguments are a bool, the bit offset, and a word. The bool
882
- /// is true if the word comes from ' self' , and false if it comes from
883
- /// ' other' .
881
+ /// The yielded arguments are a ` bool` , the bit offset, and a word. The ` bool`
882
+ /// is true if the word comes from ` self` , and ` false` if it comes from
883
+ /// ` other` .
884
884
fn outlier_iter < ' a > ( & ' a self , other : & ' a BitvSet )
885
885
-> Map < ' static , ( ( uint , & ' a uint ) , uint ) , ( bool , uint , uint ) ,
886
886
Zip < Enumerate < vec:: VecIterator < ' a , uint > > , Repeat < uint > > > {
0 commit comments