OpenMD  2.5
Molecular Dynamics in the Open
OpenMD::SelectionSet Class Reference

#include <SelectionSet.hpp>

Public Member Functions

 SelectionSet ()
 
 SelectionSet (std::vector< int > nbits)
 
std::vector< int > countBits ()
 
void flip (std::vector< int > bitIndex)
 
void flip (std::vector< int > fromIndex, std::vector< int > toIndex)
 
void flip ()
 
std::vector< bool > get (std::vector< int > bitIndex)
 
SelectionSet get (std::vector< int > fromIndex, std::vector< int > toIndex)
 
std::vector< bool > any ()
 
std::vector< bool > none ()
 
std::vector< int > firstOffBit () const
 
std::vector< int > nextOffBit (std::vector< int > fromIndex) const
 
std::vector< int > firstOnBit () const
 
std::vector< int > nextOnBit (std::vector< int > fromIndex) const
 
void andOperator (const SelectionSet &bs)
 
void orOperator (const SelectionSet &bs)
 
void xorOperator (const SelectionSet &bs)
 
void setBitOn (std::vector< int > bitIndex)
 
void setBitOff (std::vector< int > bitIndex)
 
void clearAll ()
 
void setAll ()
 
std::vector< int > size () const
 
void resize (std::vector< int > nbits)
 
SelectionSetoperator &= (const SelectionSet &ss)
 
SelectionSetoperator|= (const SelectionSet &ss)
 
SelectionSetoperator^= (const SelectionSet &ss)
 
SelectionSetoperator-= (const SelectionSet &ss)
 
SelectionSet parallelReduce ()
 
std::vector< bool > operator[] (std::vector< int > bitIndex) const
 

Public Attributes

std::vector< OpenMDBitSetbitsets_
 

Friends

SelectionSet operator| (const SelectionSet &bs1, const SelectionSet &bs2)
 
SelectionSet operator & (const SelectionSet &bs1, const SelectionSet &bs2)
 
SelectionSet operator^ (const SelectionSet &bs1, const SelectionSet &bs2)
 
SelectionSet operator- (const SelectionSet &bs1, const SelectionSet &bs2)
 
bool operator== (const SelectionSet &bs1, const SelectionSet &bs2)
 
std::ostream & operator<< (std::ostream &, const SelectionSet &bs)
 

Detailed Description

Definition at line 67 of file SelectionSet.hpp.

Constructor & Destructor Documentation

◆ SelectionSet() [1/2]

◆ SelectionSet() [2/2]

OpenMD::SelectionSet::SelectionSet ( std::vector< int >  nbits)

Definition at line 57 of file SelectionSet.cpp.

References bitsets_, clearAll(), and OpenMD::N_SELECTIONTYPES.

Member Function Documentation

◆ andOperator()

void OpenMD::SelectionSet::andOperator ( const SelectionSet bs)

Performs a logical AND of this target bit set with the argument bit set.

Definition at line 146 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

Referenced by operator &=(), and SelectionSet().

◆ any()

std::vector< bool > OpenMD::SelectionSet::any ( )

Returns true if any bits are set to true

Definition at line 104 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

Referenced by SelectionSet().

◆ clearAll()

void OpenMD::SelectionSet::clearAll ( )

Sets all of the bits in this SelectionSet to false.

Definition at line 167 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

Referenced by SelectionSet(), and OpenMD::SelectionEvaluator::withinInstruction().

◆ countBits()

std::vector< int > OpenMD::SelectionSet::countBits ( )

Returns the number of bits set to true in this SelectionSet.

Definition at line 64 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

Referenced by SelectionSet().

◆ firstOffBit()

std::vector< int > OpenMD::SelectionSet::firstOffBit ( ) const

Definition at line 118 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

Referenced by SelectionSet().

◆ firstOnBit()

std::vector< int > OpenMD::SelectionSet::firstOnBit ( ) const

Definition at line 132 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

Referenced by SelectionSet().

◆ flip() [1/3]

void OpenMD::SelectionSet::flip ( std::vector< int >  bitIndex)

Sets the bit at the specified index to to the complement of its current value.

Definition at line 71 of file SelectionSet.cpp.

References bitsets_, flip(), and OpenMD::N_SELECTIONTYPES.

◆ flip() [2/3]

void OpenMD::SelectionSet::flip ( std::vector< int >  fromIndex,
std::vector< int >  toIndex 
)

Sets each bit from the specified fromIndex(inclusive) to the specified toIndex(exclusive) to the complement of its current value.

Definition at line 76 of file SelectionSet.cpp.

References bitsets_, flip(), and OpenMD::N_SELECTIONTYPES.

◆ flip() [3/3]

void OpenMD::SelectionSet::flip ( )

Sets each bit to the complement of its current value.

Definition at line 82 of file SelectionSet.cpp.

References bitsets_, flip(), and OpenMD::N_SELECTIONTYPES.

Referenced by flip(), and SelectionSet().

◆ get() [1/2]

std::vector< bool > OpenMD::SelectionSet::get ( std::vector< int >  bitIndex)

Returns the value of the bit with the specified index.

Definition at line 87 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

◆ get() [2/2]

SelectionSet OpenMD::SelectionSet::get ( std::vector< int >  fromIndex,
std::vector< int >  toIndex 
)

Returns a new SelectionSet composed of bits from this SelectionSet from fromIndex(inclusive) to toIndex(exclusive).

Definition at line 94 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

◆ nextOffBit()

std::vector< int > OpenMD::SelectionSet::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 starting index.

Definition at line 125 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

Referenced by SelectionSet().

◆ nextOnBit()

std::vector< int > OpenMD::SelectionSet::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 index.

Definition at line 139 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

Referenced by SelectionSet().

◆ none()

std::vector< bool > OpenMD::SelectionSet::none ( )

Returns true if no bits are set to true

Definition at line 111 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

Referenced by SelectionSet().

◆ operator &=()

SelectionSet& OpenMD::SelectionSet::operator&= ( const SelectionSet ss)
inline

Definition at line 136 of file SelectionSet.hpp.

References andOperator().

◆ operator-=()

SelectionSet& OpenMD::SelectionSet::operator-= ( const SelectionSet ss)
inline

Definition at line 139 of file SelectionSet.hpp.

References parallelReduce().

◆ operator[]()

std::vector<bool> OpenMD::SelectionSet::operator[] ( std::vector< int >  bitIndex) const
inline

◆ operator^=()

SelectionSet& OpenMD::SelectionSet::operator^= ( const SelectionSet ss)
inline

Definition at line 138 of file SelectionSet.hpp.

References xorOperator().

◆ operator|=()

SelectionSet& OpenMD::SelectionSet::operator|= ( const SelectionSet ss)
inline

Definition at line 137 of file SelectionSet.hpp.

References orOperator().

◆ orOperator()

void OpenMD::SelectionSet::orOperator ( const SelectionSet bs)

Performs a logical OR of this bit set with the bit set argument.

Definition at line 151 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

Referenced by operator|=(), and SelectionSet().

◆ parallelReduce()

◆ resize()

void OpenMD::SelectionSet::resize ( std::vector< int >  nbits)

Changes the size of SelectionSet

Definition at line 184 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

Referenced by OpenMD::NameFinder::createNode(), OpenMD::NameFinder::loadNames(), and SelectionSet().

◆ setAll()

void OpenMD::SelectionSet::setAll ( )

Definition at line 172 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

Referenced by OpenMD::NameFinder::loadNames(), and SelectionSet().

◆ setBitOff()

void OpenMD::SelectionSet::setBitOff ( std::vector< int >  bitIndex)

Referenced by SelectionSet().

◆ setBitOn()

void OpenMD::SelectionSet::setBitOn ( std::vector< int >  bitIndex)

Referenced by SelectionSet().

◆ size()

std::vector< int > OpenMD::SelectionSet::size ( ) const

Returns the number of bits of space actually in use by this SelectionSet to represent bit values.

Definition at line 177 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

Referenced by OpenMD::SelectionEvaluator::expression(), OpenMD::DistanceFinder::find(), and SelectionSet().

◆ xorOperator()

void OpenMD::SelectionSet::xorOperator ( const SelectionSet bs)

Performs a logical XOR of this bit set with the bit set argument.

Definition at line 156 of file SelectionSet.cpp.

References bitsets_, and OpenMD::N_SELECTIONTYPES.

Referenced by operator^=(), and SelectionSet().

Friends And Related Function Documentation

◆ operator &

SelectionSet operator& ( const SelectionSet bs1,
const SelectionSet bs2 
)
friend

Definition at line 196 of file SelectionSet.cpp.

Referenced by operator[]().

◆ operator-

SelectionSet operator- ( const SelectionSet bs1,
const SelectionSet bs2 
)
friend

Definition at line 210 of file SelectionSet.cpp.

Referenced by operator[]().

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const SelectionSet bs 
)
friend

Definition at line 243 of file SelectionSet.cpp.

Referenced by operator[]().

◆ operator==

bool operator== ( const SelectionSet bs1,
const SelectionSet bs2 
)
friend

Definition at line 217 of file SelectionSet.cpp.

Referenced by operator[]().

◆ operator^

SelectionSet operator^ ( const SelectionSet bs1,
const SelectionSet bs2 
)
friend

Definition at line 203 of file SelectionSet.cpp.

Referenced by operator[]().

◆ operator|

SelectionSet operator| ( const SelectionSet bs1,
const SelectionSet bs2 
)
friend

Definition at line 189 of file SelectionSet.cpp.

Referenced by operator[]().

Member Data Documentation

◆ bitsets_

std::vector<OpenMDBitSet> OpenMD::SelectionSet::bitsets_

Definition at line 164 of file SelectionSet.hpp.

Referenced by OpenMD::SelectionManager::addBendSelectionSet(), OpenMD::SelectionManager::addBondSelectionSet(), OpenMD::SelectionManager::addInversionSelectionSet(), OpenMD::SelectionManager::addMoleculeSelectionSet(), OpenMD::SelectionManager::addSelection(), OpenMD::SelectionManager::addSelectionSet(), OpenMD::SelectionManager::addTorsionSelectionSet(), OpenMD::SelectionEvaluator::allInstruction(), andOperator(), any(), OpenMD::SelectionManager::beginSelected(), OpenMD::SelectionManager::beginSelectedBend(), OpenMD::SelectionManager::beginSelectedBond(), OpenMD::SelectionManager::beginSelectedInversion(), OpenMD::SelectionManager::beginSelectedMolecule(), OpenMD::SelectionManager::beginSelectedTorsion(), OpenMD::SelectionManager::beginUnselected(), OpenMD::SelectionManager::beginUnselectedBend(), OpenMD::SelectionManager::beginUnselectedBond(), OpenMD::SelectionManager::beginUnselectedInversion(), OpenMD::SelectionManager::beginUnselectedMolecule(), OpenMD::SelectionManager::beginUnselectedTorsion(), clearAll(), OpenMD::SelectionManager::clearSelection(), OpenMD::SelectionEvaluator::compareProperty(), countBits(), OpenMD::DistanceFinder::find(), OpenMD::HullFinder::findHull(), firstOffBit(), firstOnBit(), flip(), get(), OpenMD::SelectionManager::getBendSelectionCount(), OpenMD::SelectionManager::getBondSelectionCount(), OpenMD::SelectionManager::getInversionSelectionCount(), OpenMD::SelectionManager::getMoleculeSelectionCount(), OpenMD::SelectionManager::getSelectionCount(), OpenMD::SelectionManager::getSelectionCounts(), OpenMD::SelectionManager::getTorsionSelectionCount(), OpenMD::SelectionEvaluator::indexInstruction(), OpenMD::IndexFinder::init(), OpenMD::SelectionManager::isEmpty(), OpenMD::SelectionManager::isGlobalIDSelected(), OpenMD::SelectionManager::isSelected(), OpenMD::NameFinder::loadNames(), OpenMD::NameFinder::matchInternalIndex(), nextOffBit(), nextOnBit(), OpenMD::SelectionManager::nextSelected(), OpenMD::SelectionManager::nextSelectedBend(), OpenMD::SelectionManager::nextSelectedBond(), OpenMD::SelectionManager::nextSelectedInversion(), OpenMD::SelectionManager::nextSelectedMolecule(), OpenMD::SelectionManager::nextSelectedTorsion(), OpenMD::SelectionManager::nextUnselected(), OpenMD::SelectionManager::nextUnselectedBend(), OpenMD::SelectionManager::nextUnselectedBond(), OpenMD::SelectionManager::nextUnselectedInversion(), OpenMD::SelectionManager::nextUnselectedMolecule(), OpenMD::SelectionManager::nextUnselectedTorsion(), none(), OpenMD::operator &(), OpenMD::SelectionManager::operator &=(), OpenMD::operator-(), OpenMD::SelectionManager::operator-=(), OpenMD::operator<<(), OpenMD::operator==(), operator[](), OpenMD::operator^(), OpenMD::SelectionManager::operator^=(), OpenMD::operator|(), OpenMD::SelectionManager::operator|=(), orOperator(), parallelReduce(), resize(), OpenMD::SelectionManager::selectAll(), SelectionSet(), setAll(), OpenMD::SelectionManager::setBendSelectionSet(), OpenMD::SelectionManager::setBondSelectionSet(), OpenMD::SelectionManager::setInversionSelectionSet(), OpenMD::SelectionManager::setMoleculeSelectionSet(), OpenMD::SelectionManager::setSelection(), OpenMD::SelectionManager::setSelectionSet(), OpenMD::SelectionManager::setTorsionSelectionSet(), size(), OpenMD::SelectionManager::toggleSelection(), and xorOperator().


The documentation for this class was generated from the following files: