Skip to content
Snippets Groups Projects
Commit ef1c3846 authored by Oliver Sander's avatar Oliver Sander
Browse files

remove deprecated class BitField

[[Imported from SVN: r5490]]
parent 88de94d9
Branches
Tags
No related merge requests found
......@@ -11,7 +11,7 @@ AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/..
commonincludedir = $(includedir)/dune/common
commoninclude_HEADERS = dlist.cc alignment.hh \
arraylist.hh bitfield.hh bitsetvector.hh debugstream.hh deprecated.hh dlist.hh \
arraylist.hh bitsetvector.hh debugstream.hh deprecated.hh dlist.hh \
enumset.hh exceptions.hh fixedarray.hh fmatrix.hh \
fvector.hh genericiterator.hh \
helpertemplates.hh iteratorfacades.hh \
......
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_BITFIELD_HH
#define DUNE_BITFIELD_HH
#warning This file is deprecated! Use bitsetvector.hh instead!
#include <vector>
#include <iostream>
namespace Dune {
/** \brief A dynamic array of booleans
* \ingroup Common
*
* This class is basically std::vector<bool>, but with a few added
* methods.
*/
class BitField : public std::vector<bool> {
public:
//! Default constructor
BitField() : std::vector<bool>() {}
//! Constructor with a given length
explicit BitField(int n) : std::vector<bool>(n) {}
//! Constructor which initializes the field
BitField(int n, bool v) : std::vector<bool>(n) {
this->assign(size(), v);
}
//! Sets all entries to <tt> true </tt>
void setAll() {
this->assign(size(), true);
}
//! Sets all entries to <tt> false </tt>
void unsetAll() {
this->assign(size(), false);
}
//! Returns the number of set bits
int nSetBits() const {
int n = 0;
for (size_t i=0; i<size(); i++)
n += ((*this)[i]) ? 1 : 0;
return n;
}
//! Send bitfield to an output stream
friend std::ostream& operator<< (std::ostream& s, const BitField& v)
{
for (size_t i=0; i<v.size(); i++)
s << v[i] << " ";
s << std::endl;
return s;
}
} DUNE_DEPRECATED;
}
#endif
......@@ -18,7 +18,7 @@
#include <dune/common/alignment.hh>
#include <dune/common/arraylist.hh>
#include <dune/common/bigunsignedint.hh>
#include <dune/common/bitfield.hh>
#include <dune/common/bitsetvector.hh>
#include <dune/common/configparser.hh>
#include <dune/common/debugstream.hh>
#include <dune/common/dlist.hh>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment