45#ifndef SELECTION_SELECTIONSET_HPP
46#define SELECTION_SELECTIONSET_HPP
51#include "utils/OpenMDBitSet.hpp"
82 void flip(std::vector<int> bitIndex);
86 void flip(std::vector<int> fromIndex, std::vector<int> toIndex);
92 std::vector<bool>
get(std::vector<int> bitIndex);
99 std::vector<bool>
any();
102 std::vector<bool>
none();
104 std::vector<int> firstOffBit()
const;
108 std::vector<int>
nextOffBit(std::vector<int> fromIndex)
const;
110 std::vector<int> firstOnBit()
const;
114 std::vector<int>
nextOnBit(std::vector<int> fromIndex)
const;
126 void setBitOn(std::vector<int> bitIndex);
128 void setBitOff(std::vector<int> bitIndex);
143 std::vector<int>
size()
const;
146 void resize(std::vector<int> nbits);
168 std::vector<bool> operator[](std::vector<int> bitIndex)
const {
169 std::vector<bool> result(N_SELECTIONTYPES);
170 for (
int i = 0; i < N_SELECTIONTYPES; i++)
171 result[i] = bitsets_[i][bitIndex[i]];
187 friend std::ostream& operator<<(std::ostream&,
const SelectionSet& bs);
189 std::vector<OpenMDBitSet> bitsets_;
std::vector< int > size() const
Returns the number of bits of space actually in use by this SelectionSet to represent bit values.
std::vector< int > nextOffBit(std::vector< int > fromIndex) const
Returns the index of the first bit that is set to false that occurs on or after the specified startin...
std::vector< bool > get(std::vector< int > bitIndex)
Returns the value of the bit with the specified index.
void clearAll()
Sets all of the bits in this SelectionSet to false.
void xorOperator(const SelectionSet &bs)
Performs a logical XOR of this bit set with the bit set argument.
void flip()
Sets each bit to the complement of its current value.
std::vector< int > countBits()
Returns the number of bits set to true in this SelectionSet.
std::vector< bool > none()
Returns true if no bits are set to true.
std::vector< int > nextOnBit(std::vector< int > fromIndex) const
Returns the index of the first bit that is set to true that occurs on or after the specified starting...
void andOperator(const SelectionSet &bs)
Performs a logical AND of this target bit set with the argument bit set.
void resize(std::vector< int > nbits)
Changes the size of SelectionSet.
void orOperator(const SelectionSet &bs)
Performs a logical OR of this bit set with the bit set argument.
std::vector< bool > any()
Returns true if any bits are set to true.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
SelectionType
The SelectionType enum.
@ STUNTDOUBLE
StuntDoubles (Atoms & RigidBodies)