#include <bitvector.h>
Collaboration diagram for atlas::bitvector::BitVector< dim >:

Public Member Functions | |
| BitVector () | |
| BitVector (size_t n) | |
| BitVector (size_t n, size_t j) | |
| BitVector (bitset::BitSet< dim > data, size_t n) | |
| BitVector (const latticetypes::LatticeElt &weight) | |
| ~BitVector () | |
| BitVector (const BitVector &v) | |
| BitVector & | operator= (const BitVector &v) |
| bool | operator< (const BitVector &v) const |
| bool | operator== (const BitVector &v) const |
| bool | operator!= (const BitVector &v) const |
| bool | operator[] (size_t i) const |
| size_t | count () |
| const bitset::BitSet< dim > & | data () const |
| size_t | firstBit () const |
| bool | isZero () const |
| bool | nonZero () const |
| size_t | size () const |
| BitVector & | operator+= (const BitVector &v) |
| BitVector & | operator-= (const BitVector &v) |
| BitVector & | operator &= (const BitVector &v) |
| BitVector & | operator>>= (size_t pos) |
| BitVector & | operator<<= (size_t pos) |
| BitVector & | flip (size_t i) |
| BitVector & | pushBack (bool) |
| Adds b to the bitvector (as the last coordinate), increasing the size by one. | |
| BitVector & | set (size_t i) |
| void | set (size_t i, bool b) |
| void | set_mod2 (size_t i, unsigned long v) |
| BitVector & | reset () |
| BitVector & | reset (size_t i) |
| void | resize (size_t n) |
| void | slice (const bitset::BitSet< dim > &mask) |
| Extracts the bits flagged by |t|, and packs their value into consecutive positions; resets the size to the number of bits so packed. | |
| void | unslice (bitset::BitSet< dim > mask, size_t new_size) |
| Undoes the effect of |slice|, inserting zero bits where needed. | |
Private Attributes | |
| bitset::BitSet< dim > | d_data |
| size_t | d_size |
Friends | |
| void | BitMatrix (BitVector< dim > &, const BitVector< dim > &) const |
The software envisions dim between 0 and four times the machine word length (precisely, four times the constant |longBits|, which is the number of bits in an unsigned long integer). What is now fully implemented allows |dim| to be one or two times the word length (see the discussion in the description of the class BitSet<n>). It seems that only BitVector<RANK_MAX> and BitVector<2*RANK_MAX> are now instantiated, (that is <16> or <32>), so |dim| is not very relevant; one could imagine |dim==longBits| throughout.
Let the integer |m| be
(quotient rounded upwards) . The vector is stored as the BitSet<dim> |d_data|, which is a (fixed size) array of |m| words of memory. (On a 32 bit machine with RANK_MAX=16 one always has |m==1|, so that |d_data| is a single word of memory.) We look only at the first |d_size| bits of |d_data|; but |d_size| can be changed by manipulators (like the member functions resize and pushBack). [Maybe |d_size| never exceeds |RANK_MAX+1|, even for variables declared as |BitVector<2*RANK_MAX>| MvL]
Given the number of methods that are passed on to the |BitSet<dim>| field |d_data|, one might wonder if it would not have been better to publicly derive from |BitSet<dim>|, MvL.
A BitVector should be thought of as a column vector. A Bitmatrix will in general act on it on the left. [I thought that Fokko always prefers matrices acting on the right on row vectors; but if I am reading this correctly, that preference didn't make it into this software. DV]
Definition at line 147 of file bitvector.h.
|
|||||||||
|
Definition at line 160 of file bitvector.h. |
|
||||||||||
|
Definition at line 164 of file bitvector.h. |
|
||||||||||||||||
|
Definition at line 168 of file bitvector.h. References atlas::bitset::set(). |
|
||||||||||||||||
|
Definition at line 174 of file bitvector.h. |
|
||||||||||
|
Definition at line 37 of file bitvector_def.h. References atlas::bitvector::BitVector< dim >::d_data, atlas::bitvector::BitVector< dim >::d_size, and atlas::bitset::BitSet< n >::set(). |
|
|||||||||
|
Definition at line 180 of file bitvector.h. |
|
||||||||||
|
Definition at line 184 of file bitvector.h. |
|
|||||||||
|
Definition at line 217 of file bitvector.h. References atlas::bitset::BitSet< n >::count(). Referenced by atlas::bitvector::scalarProduct(). |
|
|||||||||
|
|||||||||
|
Definition at line 225 of file bitvector.h. References atlas::bitset::BitSet< n >::firstBit(). Referenced by atlas::bitvector::firstSolution(), atlas::bitvector::normalSpanAdd(), atlas::bitvector::FirstBit< dim >::operator()(), and atlas::bitvector::spanAdd(). |
|
||||||||||
|
Definition at line 271 of file bitvector.h. References atlas::bitset::BitSet< n >::flip(). |
|
|||||||||
|
Definition at line 229 of file bitvector.h. References atlas::bitset::BitSet< n >::none(). Referenced by atlas::subquotient::Subspace< dim >::contains(), atlas::bitvector::firstSolution(), atlas::bitvector::normalSpanAdd(), and atlas::bitvector::spanAdd(). |
|
|||||||||
|
Definition at line 233 of file bitvector.h. References atlas::bitset::BitSet< n >::any(). |
|
||||||||||
|
Definition at line 255 of file bitvector.h. References atlas::bitvector::BitVector< dim >::d_data, and atlas::bitvector::BitVector< dim >::d_size. |
|
||||||||||
|
Definition at line 207 of file bitvector.h. References atlas::bitvector::BitVector< dim >::d_data, and atlas::bitvector::BitVector< dim >::d_size. |
|
||||||||||
|
Definition at line 243 of file bitvector.h. References atlas::bitvector::BitVector< dim >::d_data, and atlas::bitvector::BitVector< dim >::d_size. |
|
||||||||||
|
Definition at line 249 of file bitvector.h. References atlas::bitvector::BitVector< dim >::d_data, and atlas::bitvector::BitVector< dim >::d_size. |
|
||||||||||
|
Definition at line 197 of file bitvector.h. References atlas::bitvector::BitVector< dim >::d_data, and atlas::bitvector::BitVector< dim >::d_size. |
|
||||||||||
|
Definition at line 266 of file bitvector.h. |
|
||||||||||
|
Definition at line 189 of file bitvector.h. References atlas::bitvector::BitVector< dim >::d_data, and atlas::bitvector::BitVector< dim >::d_size. |
|
||||||||||
|
Definition at line 202 of file bitvector.h. References atlas::bitvector::BitVector< dim >::d_data, and atlas::bitvector::BitVector< dim >::d_size. |
|
||||||||||
|
Definition at line 261 of file bitvector.h. |
|
||||||||||
|
Definition at line 212 of file bitvector.h. |
|
||||||||||
|
Adds b to the bitvector (as the last coordinate), increasing the size by one. It is the user's responsibility to make sure that the |size| does not exceed |dim|. This is typically applied with |d_size<=RANK_MAX| initially, and |dim>=RANK_MAX+1|. Definition at line 55 of file bitvector_def.h. References atlas::bitvector::BitVector< dim >::d_data, atlas::bitvector::BitVector< dim >::d_size, and atlas::bitset::BitSet< n >::set(). Referenced by atlas::compactEquations(), and atlas::kgb::KGBHelp::grading_seed(). |
|
||||||||||
|
Definition at line 299 of file bitvector.h. References atlas::bitset::BitSet< n >::reset(). |
|
|||||||||
|
Definition at line 294 of file bitvector.h. References atlas::bitset::BitSet< n >::reset(). Referenced by atlas::bitvector::combination(), atlas::bitvector::firstSolution(), and atlas::bitvector::BitMatrix< dim >::row(). |
|
||||||||||
|
Definition at line 305 of file bitvector.h. Referenced by atlas::bitvector::firstSolution(), atlas::lattice::mod2(), and atlas::bitvector::BitMatrix< dim >::row(). |
|
||||||||||||||||
|
Definition at line 285 of file bitvector.h. References atlas::bitset::BitSet< n >::set(). |
|
||||||||||
|
Definition at line 279 of file bitvector.h. References atlas::bitset::BitSet< n >::set(). Referenced by atlas::bitvector::firstSolution(), atlas::cartanclass::Fiber::gradingGroup(), atlas::bitvector::BitMatrix< dim >::kernel(), atlas::cartanclass::Fiber::makeFiberMap(), atlas::rGenerators(), and atlas::bitvector::BitMatrix< dim >::row(). |
|
||||||||||||||||
|
Definition at line 290 of file bitvector.h. References atlas::bitset::set(). Referenced by atlas::lattice::mod2(). |
|
|||||||||
|
||||||||||
|
Extracts the bits flagged by |t|, and packs their value into consecutive positions; resets the size to the number of bits so packed. This is value is useful to transform an element known to lie in a subspace to the canonical basis of the subspace; that notion is so defined as to make this base change just a selection of coordinate values at increasing positions. This is so because the canonical basis $b$ comes with a set of coordinate positions $j$ such that only one $b_i$ has $b_i[j]==1; for a linear combination of basis vectors to be equal to $v$, the coefficient of $b_i$ must then be $v[j]$. Note that |slice| changes (weakly decreases) the size of its |BitVector|. Definition at line 80 of file bitvector_def.h. References atlas::bitvector::BitVector< dim >::d_data, atlas::bitvector::BitVector< dim >::d_size, atlas::bitset::BitSet< n >::set(), and atlas::bitvector::BitVector< dim >::size(). Referenced by atlas::subquotient::Subquotient< constants::RANK_MAX >::toBasis(), and atlas::subquotient::Subspace< dim >::toBasis(). |
|
||||||||||||||||
|
Undoes the effect of |slice|, inserting zero bits where needed. This cannot be used to undo the use of |slice| to express a vector on a subspace basis (you need to form a linear combination of the basis for that), but when |slice| is used during a projection modulo a subspace (as happens in subquotients), then |unslice| can reconstruct a preimage. Note that |unslice| changes (weakly increases) the size of its |BitVector|. Definition at line 108 of file bitvector_def.h. References atlas::bitset::BitSet< n >::begin(), atlas::bitvector::BitVector< dim >::d_data, atlas::bitvector::BitVector< dim >::d_size, and atlas::bitset::BitSet< n >::set(). Referenced by atlas::subquotient::Subquotient< constants::RANK_MAX >::fromBasis(). |
|
||||||||||||||||
|
|
|
|||||
|
|||||
1.3.9.1