25 namespace subquotient {
29 (
const Subquotient<dim>&,
30 const Subquotient<dim>&,
31 const BitMatrix<dim>&);
51 template<
size_t dim>
class Subspace
62 Subspace() : d_basis(), d_support(), d_rank(0) {}
64 explicit Subspace(
size_t n) : d_basis(), d_support(), d_rank(n) {}
66 Subspace(
const BitVectorList<dim>&,
size_t);
72 const BitVector<dim>&
basis(
size_t j)
const 110 bool contains(
const BitVector<dim>&
v)
const;
111 bool contains(
const BitVectorList<dim>& m)
const;
126 void apply (
const BitMatrix<dim>&);
182 : d_space(n), d_subspace(n), d_rel_support()
188 const BitVectorList<dim>& bsub,
size_t n);
196 {
return d_space.dimension() - d_subspace.dimension(); }
199 size_t rank()
const {
return d_space.rank(); }
206 const BitSet<dim>&
support()
const {
return d_rel_support; }
208 const BitVectorList<dim>
basis() const
209 { BitVectorList<dim> result; result.reserve(d_rel_support.count());
210 for (
auto it=d_rel_support.begin(); it(); ++it)
211 result.push_back(d_space.basis(*it));
225 { d_subspace.mod_reduce(w); }
229 {
return d_subspace.mod_image(w); }
233 {
return d_space.support() - d_subspace.support(); }
246 BitVector<dim>
toBasis(
const BitVector<dim>&
v)
const 251 result=d_space.toBasis(result);
252 assert(result.size()==d_space.dimension());
254 result.slice(d_rel_support);
265 v.unslice(d_rel_support,d_space.dimension());
266 return d_space.fromBasis(
v);
270 void apply (
const BitMatrix<dim>&);
BitVector< dim > combination(const std::vector< BitVector< dim > > &b, size_t n, const BitSet< dim > &e)
Puts in |v| the linear combination of the elements of |b| given by |e|.
Definition: bitvector.cpp:470
const BitVectorList< dim > basis() const
Definition: subquotient.h:208
Subspace()
Definition: subquotient.h:62
BitVector< dim > toBasis(const BitVector< dim > &v) const
Definition: subquotient.h:246
BitSet< dim > d_rel_support
Definition: subquotient.h:174
size_t dimension() const
Definition: subquotient.h:195
const BitVectorList< dim > & basis() const
Definition: subquotient.h:78
size_t rank() const
Definition: subquotient.h:199
Subquotient(size_t n)
Definition: subquotient.h:181
void swap(Subspace &)
Definition: subquotient.cpp:169
const BitSet< dim > & support() const
Definition: subquotient.h:81
BitVector< dim > fromBasis(BitVector< dim > v) const
Definition: subquotient.h:261
const BitSet< dim > & support() const
Definition: subquotient.h:206
size_t dimension() const
Definition: subquotient.h:79
BitSet< dim > d_support
pivot (leading nonzero bit) positions
Definition: subquotient.h:54
BitVector< dim > mod_image(const BitVector< dim > &w) const
Definition: subquotient.h:117
Subspace< dim > d_space
Definition: subquotient.h:149
BitVectorList< dim > basis_perp() const
Definition: subquotient.cpp:77
BitVector< dim > mod_image(const BitVector< dim > &w) const
Definition: subquotient.h:228
Subquotient()
Definition: subquotient.h:179
const size_t rank() const
Definition: subquotient.h:80
BitVector< dim > toBasis(BitVector< dim > v) const
Expresses |v| in the subspace basis.
Definition: subquotient.h:89
Subspace< dim > d_subspace
Definition: subquotient.h:150
BitVector< dim > fromBasis(const BitVector< dim > &v) const
Interprets |v| in the subspace basis and returns external form.
Definition: subquotient.h:102
BitSet< dim > support_perp() const
Definition: subquotient.h:85
const Subspace< dim > & denominator() const
Definition: subquotient.h:202
const BitVector< dim > & basis(size_t j) const
Definition: subquotient.h:72
void mod_reduce(BitVector< dim > &w) const
Definition: subquotient.h:123
const Subspace< dim > & space() const
Definition: subquotient.h:201
unsigned long size() const
Definition: subquotient.h:216
unsigned long n
Definition: axis.cpp:77
BitSet< dim > significantBits() const
Definition: subquotient.h:232
BitMatrix< dim > subquotientMap(const Subquotient< dim > &source, const Subquotient< dim > &dest, const BitMatrix< dim > &m)
Definition: subquotient.cpp:271
Subspace(size_t n)
Definition: subquotient.h:64
BitVector< dim > representative(const BitVector< dim > &) const
Return canonical representative of |v| modulo our subspace.
Definition: subquotient.cpp:124
void apply(const BitMatrix< dim > &)
Definition: subquotient.cpp:152
unsigned short int d_rank
Dimension of the ambient vector space.
Definition: subquotient.h:55
void mod_reduce(BitVector< dim > &w) const
Definition: subquotient.h:224
BitVectorList< dim > d_basis
reduced echelon basis
Definition: subquotient.h:53
bool contains(const BitVector< dim > &v) const
Definition: subquotient.cpp:95
Vertex v
Definition: graph.cpp:116