OpenMD 3.1
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
OpenMD::SelectionSet Class Reference

Public Member Functions

 SelectionSet (std::vector< int > nbits)
 
std::vector< int > countBits ()
 Returns the number of bits set to true in this SelectionSet.
 
void flip (std::vector< int > bitIndex)
 Sets the bit at the specified index to to the complement of its current value.
 
void 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.
 
void flip ()
 Sets each bit to the complement of its current value.
 
std::vector< bool > get (std::vector< int > bitIndex)
 Returns the value of the bit with the specified index.
 
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).
 
std::vector< bool > any ()
 Returns true if any bits are set to true.
 
std::vector< bool > none ()
 Returns true if no bits are set to true.
 
std::vector< int > firstOffBit () const
 
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 starting index.
 
std::vector< int > firstOnBit () const
 
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 index.
 
void andOperator (const SelectionSet &bs)
 Performs a logical AND of this target bit set with the argument bit set.
 
void orOperator (const SelectionSet &bs)
 Performs a logical OR of this bit set with the bit set argument.
 
void xorOperator (const SelectionSet &bs)
 Performs a logical XOR of this bit set with the bit set argument.
 
void setBitOn (std::vector< int > bitIndex)
 
void setBitOff (std::vector< int > bitIndex)
 
void clearAll ()
 Sets all of the bits in this SelectionSet to false.
 
void setAll ()
 
std::vector< int > size () const
 Returns the number of bits of space actually in use by this SelectionSet to represent bit values.
 
void resize (std::vector< int > nbits)
 Changes the size of SelectionSet.
 
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 &os, const SelectionSet &bs)
 

Detailed Description

Definition at line 70 of file SelectionSet.hpp.

Constructor & Destructor Documentation

◆ SelectionSet() [1/2]

OpenMD::SelectionSet::SelectionSet ( )
inline

Definition at line 73 of file SelectionSet.hpp.

◆ SelectionSet() [2/2]

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

Definition at line 58 of file SelectionSet.cpp.

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 147 of file SelectionSet.cpp.

◆ any()

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

Returns true if any bits are set to true.

Definition at line 105 of file SelectionSet.cpp.

References any().

Referenced by any().

◆ clearAll()

void OpenMD::SelectionSet::clearAll ( )

Sets all of the bits in this SelectionSet to false.

Definition at line 168 of file SelectionSet.cpp.

References clearAll().

Referenced by clearAll().

◆ countBits()

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

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


Definition at line 65 of file SelectionSet.cpp.

References countBits().

Referenced by countBits().

◆ firstOffBit()

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

Definition at line 119 of file SelectionSet.cpp.

◆ firstOnBit()

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

Definition at line 133 of file SelectionSet.cpp.

◆ flip() [1/3]

void OpenMD::SelectionSet::flip ( )

Sets each bit to the complement of its current value.

Definition at line 83 of file SelectionSet.cpp.

References flip().

Referenced by flip(), flip(), and flip().

◆ flip() [2/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 72 of file SelectionSet.cpp.

References flip().

◆ flip() [3/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 77 of file SelectionSet.cpp.

References flip().

◆ 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 88 of file SelectionSet.cpp.

References get().

Referenced by get().

◆ 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 95 of file SelectionSet.cpp.

◆ 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 126 of file SelectionSet.cpp.

References nextOffBit().

Referenced by nextOffBit().

◆ 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 140 of file SelectionSet.cpp.

References nextOnBit().

Referenced by nextOnBit().

◆ none()

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

Returns true if no bits are set to true.

Definition at line 112 of file SelectionSet.cpp.

References none().

Referenced by none().

◆ operator&=()

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

Definition at line 148 of file SelectionSet.hpp.

◆ operator-=()

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

Definition at line 160 of file SelectionSet.hpp.

◆ operator[]()

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

Definition at line 168 of file SelectionSet.hpp.

◆ operator^=()

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

Definition at line 156 of file SelectionSet.hpp.

◆ operator|=()

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

Definition at line 152 of file SelectionSet.hpp.

◆ orOperator()

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

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

Definition at line 152 of file SelectionSet.cpp.

◆ parallelReduce()

SelectionSet OpenMD::SelectionSet::parallelReduce ( )

Definition at line 227 of file SelectionSet.cpp.

◆ resize()

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

Changes the size of SelectionSet.

Definition at line 185 of file SelectionSet.cpp.

References resize().

Referenced by resize().

◆ setAll()

void OpenMD::SelectionSet::setAll ( )

Definition at line 173 of file SelectionSet.cpp.

◆ 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 178 of file SelectionSet.cpp.

References size().

Referenced by size().

◆ xorOperator()

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

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

Definition at line 157 of file SelectionSet.cpp.

Friends And Related Symbol Documentation

◆ operator&

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

Definition at line 197 of file SelectionSet.cpp.

◆ operator-

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

Definition at line 211 of file SelectionSet.cpp.

◆ operator<<

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

Definition at line 240 of file SelectionSet.cpp.

◆ operator==

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

Definition at line 218 of file SelectionSet.cpp.

◆ operator^

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

Definition at line 204 of file SelectionSet.cpp.

◆ operator|

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

Definition at line 190 of file SelectionSet.cpp.

Member Data Documentation

◆ bitsets_

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

Definition at line 189 of file SelectionSet.hpp.


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