Various bit-wise operations, etc. More...
Classes | |
struct | bitInfo |
Functions | |
unsigned int | count (const UList< bool > &bools, const bool val=true) |
bool | all (const UList< bool > &bools) |
bool | any (const UList< bool > &bools) |
bool | none (const UList< bool > &bools) |
void | set (List< bool > &bools, const labelRange &range) |
void | set (labelHashSet &hashset, const labelRange &range) |
void | set (bitSet &bitset, const labelRange &range) |
void | unset (List< bool > &bools, const labelRange &range) |
void | unset (labelHashSet &hashset, const labelRange &range) |
void | unset (bitSet &bitset, const labelRange &range) |
template<class UIntType > | |
unsigned int | bit_count (UIntType x) |
template<> | |
unsigned int | bit_count (uint32_t x) |
template<> | |
unsigned int | bit_count (uint64_t x) |
template<class UIntType , unsigned BitWidth> | |
UIntType | repeat_value (unsigned val) |
template<class UIntType > | |
Ostream & | print (Ostream &os, UIntType value, char off='0', char on='1') |
Various bit-wise operations, etc.
The population count uses the Hamming weight (http://en.wikipedia.org/wiki/Hamming_weight).
Definition at line 75 of file BitOps.H.
References Foam::HashSetOps::bools().
Referenced by geometric::add(), object::addData(), triSurfaceMesh::addFaceToEdge(), IOobjectList::append(), CStringList::asList(), UOPstream::beginRawWrite(), isoSurfaceBase::blockCells(), faPatch::boundaryConnections(), faPatch::boundaryProcSizes(), faMesh::boundaryProcSizes(), probes::classifyFields(), CloudFunctionObjectList< KinematicCloud< Cloud< basicKinematicCollidingParcel > > >::CloudFunctionObjectList(), hexRef8::consistentSlowRefinement(), Foam::stringOps::count(), cellCellStencil::count(), objectRegistry::count(), IOobjectList::count(), isoSurfaceBase::countCutType(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::countEntries(), IOobjectList::countImpl(), objectRegistry::countImpl(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::countKeys(), IOobjectList::countTypeImpl(), objectRegistry::countTypeImpl(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::countValues(), decompositionMethod::decompose(), snappyVoxelMeshDriver::doRefine(), Foam::duplicateOrder(), limitFields::execute(), NURBS3DVolume::findPointsInBox(), ISstream::getLine(), hashedWordList::hashedWordList(), Histogram< List >::Histogram(), InjectionModelList< Foam::KinematicCloud< Foam::DSMCCloud > >::InjectionModelList(), Foam::inplaceSubset(), Foam::inplaceSubsetList(), Foam::inplaceSubsetMatchingStrings(), wordRes::matching(), scalars::matching(), regionProperties::names(), IOobjectList::namesImpl(), objectRegistry::namesImpl(), IOobjectList::namesTypeImpl(), objectRegistry::namesTypeImpl(), UOprocess::newField(), polySurface::nFaceData(), blockMesh::numZonedBlocks(), ParticleForceList< KinematicCloud< Cloud< basicKinematicCollidingParcel > > >::ParticleForceList(), points_delaunay_naive_2d(), ParticleTracks< CloudType >::postFace(), Foam::printHostsSubscription(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::printInfo(), FIRECore::putFireLabels(), ensightReadFile::read(), UIPstream::read(), FixedValueConstraint< Type >::read(), ISstream::read(), masterUncollatedFileOperation::readAndSend(), lumpedPointState::readPlain(), UIPstream::readRaw(), ISstream::readRaw(), FIREMeshReader::readSelections(), MRFZoneList::reset(), porosityModelList::reset(), optionList::reset(), SemiImplicitSource::setFieldData(), lumpedPointDisplacementPointPatchVectorField::setInterpolators(), lumpedPointDisplacementPointPatchVectorField::setPatchControls(), Foam::ListOps::setValue(), Foam::vtk::sizeofData(), ensightFaces::sizes(), ensightCells::sizes(), snappyVoxelMeshDriver::snappyVoxelMeshDriver(), regionProperties::sortedNames(), Foam::subsetMatchingStrings(), surfaceFeatures::surfaceFeatures(), bitSet::toc(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::toc(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::tocEntries(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::tocKeys(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::tocValues(), wordRes::uniq(), hashedWordList::uniq(), Foam::uniqueOrder(), trackingInverseDistance::update(), cellVolumeWeight::update(), inverseDistance::update(), PtrListDetail< T >::write(), prefixOSstream::write(), OSstream::write(), ensightFile::write(), UOPstream::write(), histogram::write(), Foam::writeAllAreaFields(), Foam::writeAllDimFields(), Foam::writeAllPointFields(), Foam::writeAllVolFields(), Foam::writeAreaFields(), Foam::writeChars(), Foam::ensightOutput::writeCloudField(), Foam::writeDimFields(), UList< Foam::wordRe >::writeEntry(), advancingFrontAMI::writeIntersectionOBJ(), Foam::meshTools::writeOBJ(), Foam::writePointFields(), OSstream::writeRaw(), UOPstream::writeRaw(), cellClassification::writeStats(), Foam::vtk::writeValueParallel(), vtkWrite::writeVolFields(), ensightWrite::writeVolFields(), Foam::writeVolFields(), memorybuf::in::xsgetn(), and memorybuf::out::xsputn().
Definition at line 85 of file BitOps.H.
References Foam::constant::physicoChemical::b, and Foam::HashSetOps::bools().
Referenced by decompositionMethod::decompose().
Definition at line 95 of file BitOps.H.
References Foam::constant::physicoChemical::b, and Foam::HashSetOps::bools().
Referenced by boolVector::none(), and bitSet::toc().
Definition at line 105 of file BitOps.H.
References Foam::constant::physicoChemical::b, and Foam::HashSetOps::bools().
Referenced by noiseModel::SPL().
void set | ( | List< bool > & | bools, |
const labelRange & | range | ||
) |
Definition at line 30 of file BitOps.C.
References labelRange::adjust(), labelRange::after(), Foam::HashSetOps::bools(), IntRange< IntType >::empty(), IntRange< IntType >::first(), IntRange< IntType >::last(), range, List::resize(), List::set(), and IntRange< IntType >::start().
Referenced by interfaceDefinitions::add(), fileFieldSelection::addFromFile(), fileFieldSelection::addGeoFieldTypes(), fileFieldSelection::addInternalFieldTypes(), topoSetSource::addOrDelete(), fieldSelection::addRegistered(), volFieldSelection::addRegisteredGeoFields(), cellZoneSet::addSet(), pointZoneSet::addSet(), faceZoneSet::addSet(), topoBitSet::addSet(), topoBoolSet::addSet(), topoSet::addSet(), polyTopoChanger::addTopologyModifiers(), fileFieldSelection::addUniformFieldTypes(), triad::align(), PtrDynList< Foam::profilingInformation >::append(), IOobjectList::append(), singleProcessorFaceSets::apply(), badQualityToCell::applyToSet(), badQualityToFace::applyToSet(), regionsToCell::applyToSet(), boundaryToCell::applyToSet(), boundaryToFace::applyToSet(), nbrToCell::applyToSet(), labelToFace::applyToSet(), faceZoneToFaceZone::applyToSet(), labelToPoint::applyToSet(), labelToCell::applyToSet(), setToCellZone::applyToSet(), nearestToPoint::applyToSet(), nearestToCell::applyToSet(), setToPointZone::applyToSet(), setAndNormalToFaceZone::applyToSet(), setToFaceZone::applyToSet(), faceToFace::applyToSet(), cellToCell::applyToSet(), pointToPoint::applyToSet(), patchToCell::applyToSet(), haloToCell::applyToSet(), patchToFace::applyToSet(), normalToFace::applyToSet(), shapeToCell::applyToSet(), sphereToFace::applyToSet(), sphereToPoint::applyToSet(), sphereToCell::applyToSet(), regionToFace::applyToSet(), searchableSurfaceToFace::applyToSet(), boxToCell::applyToSet(), boxToPoint::applyToSet(), searchableSurfaceToPoint::applyToSet(), searchableSurfaceToCell::applyToSet(), boxToFace::applyToSet(), searchableSurfaceToFaceZone::applyToSet(), setsToFaceZone::applyToSet(), fieldToCell::applyToSet(), cylinderToPoint::applyToSet(), cylinderToCell::applyToSet(), targetVolumeToCell::applyToSet(), cylinderAnnulusToFace::applyToSet(), cylinderToFace::applyToSet(), rotatedBoxToCell::applyToSet(), cylinderAnnulusToCell::applyToSet(), cellToPoint::applyToSet(), faceToPoint::applyToSet(), zoneToPoint::applyToSet(), zoneToCell::applyToSet(), zoneToFace::applyToSet(), pointToCell::applyToSet(), pointToFace::applyToSet(), faceToCell::applyToSet(), planeToFaceZone::applyToSet(), regionToCell::applyToSet(), surfaceToPoint::applyToSet(), faceZoneToCell::applyToSet(), surfaceToCell::applyToSet(), bitSet::assign(), bitSet::bitSet(), primitiveMesh::cellEdges(), primitiveMesh::cellPoints(), CloudFunctionObjectList< KinematicCloud< Cloud< basicKinematicCollidingParcel > > >::CloudFunctionObjectList(), coalCloudList::coalCloudList(), meshRefinement::collectFaces(), nearWallDist::correct(), decompositionMethod::decompose(), topoSet::deleteSet(), PtrList< transferModel >::emplace(), HashPtrTable< exprResult >::emplace(), PtrDynList< Foam::profilingInformation >::emplace(), HashPtrTable< exprResult >::emplace_set(), FieldField< Foam::Field, LUType >::FieldField(), forceList::forceList(), combineFaces::getMergeSets(), fvExprDriver::getTopoSetLabels(), graph::graph(), meshRefinement::growFaceCellFace(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::HashTable(), if(), InjectionModelList< Foam::KinematicCloud< Foam::DSMCCloud > >::InjectionModelList(), injectionModelList::injectionModelList(), regionModel::interRegionAMI(), topoSet::invert(), Foam::max(), cellToCellStencil::merge(), cellToFaceStencil::merge(), zoneCellStencils::merge(), meshRefinement::mergePatchFacesUndo(), Foam::min(), Foam::minMax(), topoSet::New(), triad::normalize(), unionEqOp::operator()(), triad::operator+=(), dictionary::operator<<=(), regExpPosix::operator=(), regExpCxx::operator=(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::operator=(), triad::orthogonalize(), PackedList< 2 >::PackedList(), ParticleForceList< KinematicCloud< Cloud< basicKinematicCollidingParcel > > >::ParticleForceList(), profileModelList::profileModelList(), GeometricField::Boundary::readField(), PtrList< transferModel >::readIstream(), regExpCxx::regExpCxx(), regExpPosix::regExpPosix(), regionModelFunctionObjectList::regionModelFunctionObjectList(), MRFZoneList::reset(), porosityModelList::reset(), optionList::reset(), searchableSurfaces::searchableSurfaces(), PtrListDictionary< phaseModel >::set(), triad::set(), PtrList< transferModel >::set(), PtrDynList< Foam::profilingInformation >::set(), HashPtrTable< exprResult >::set(), dictionary::set(), fvMatrix< Type >::setBounAndInterCoeffs(), bitSet::setMany(), PackedList< 2 >::setPair(), properties::setTrigger(), sigFpe::sigFpe(), sigInt::sigInt(), sigQuit::sigQuit(), sigSegv::sigSegv(), sigStopAtWriteNow::sigStopAtWriteNow(), sigWriteNow::sigWriteNow(), solidBodyMotionSolver::solidBodyMotionSolver(), triad::sortxyz(), dictionary::subDictOrAdd(), cellZoneSet::subset(), pointZoneSet::subset(), faceZoneSet::subset(), topoBoolSet::subset(), topoBitSet::subset(), topoSet::subset(), cellZoneSet::subtractSet(), pointZoneSet::subtractSet(), faceZoneSet::subtractSet(), topoBoolSet::subtractSet(), topoBitSet::subtractSet(), topoSet::subtractSet(), transferModelList::transferModelList(), Foam::vtk::writeCellSetFaces(), Foam::vtk::writeFaceSet(), Foam::vtk::writePointSet(), Foam::vtk::writeTopoSet(), and zoneMotion::zoneMotion().
void set | ( | labelHashSet & | hashset, |
const labelRange & | range | ||
) |
Definition at line 70 of file BitOps.C.
References labelRange::adjust(), IntRange< IntType >::first(), IntRange< IntType >::last(), range, and HashSet::set().
void set | ( | bitSet & | bitset, |
const labelRange & | range | ||
) |
Definition at line 82 of file BitOps.C.
References Foam::HashSetOps::bitset(), range, and bitSet::set().
void unset | ( | List< bool > & | bools, |
const labelRange & | range | ||
) |
Definition at line 89 of file BitOps.C.
References Foam::HashSetOps::bools(), and range.
Referenced by PrimitivePatch<::Foam::List< labelledTri >, pointField >::checkPointManifold(), Foam::debug::listDebugSwitches(), Foam::debug::listInfoSwitches(), Foam::debug::listOptimisationSwitches(), Foam::debug::listRegisteredDebugSwitches(), Foam::debug::listRegisteredInfoSwitches(), Foam::debug::listRegisteredOptimisationSwitches(), Foam::debug::listRegisteredSwitches(), Foam::debug::listSwitches(), Foam::listSwitches(), bitSet::unset(), HashSet< word, Hash< word > >::unset(), sigInt::~sigInt(), sigQuit::~sigQuit(), and sigSegv::~sigSegv().
void unset | ( | labelHashSet & | hashset, |
const labelRange & | range | ||
) |
Definition at line 98 of file BitOps.C.
References range, and HashSet::unset().
void unset | ( | bitSet & | bitset, |
const labelRange & | range | ||
) |
Definition at line 107 of file BitOps.C.
References Foam::HashSetOps::bitset(), range, and bitSet::unset().
|
inline |
Definition at line 155 of file BitOps.H.
Referenced by bitSet::count().
|
inline |
|
inline |
Definition at line 233 of file BitOps.H.
References IOstreamOption::BINARY, and os().
Referenced by if(), Foam::operator<<(), dynamicIndexedOctree::print(), indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::print(), PackedList< 2 >::printBits(), sampledPlane::update(), sampledPatch::update(), and seriesWriter::write().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.