Gromacs  2020.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions
gmx::RangePartitioning Class Reference

#include <gromacs/topology/block.h>


Division of a range of indices into consecutive blocks.

A range of consecutive indices 0 to full.range.end() is divided into numBlocks() consecutive blocks of consecutive indices. Block b contains indices i for which block(b).begin() <= i < block(b).end().

Public Types

using Block = Range< int >
 A block defined by a range of atom indices.

Public Member Functions

int numBlocks () const
 Returns the number of blocks.
Block block (int blockIndex) const
 Returns the size of the block with index blockIndex.
Block fullRange () const
 Returns the full range.
Block subRange (int blockIndexBegin, int blockIndexEnd) const
 Returns a range starting at blockIndexBegin and ending at blockIndexEnd.
bool allBlocksHaveSizeOne () const
 Returns true when all blocks have size 0 or numBlocks()=0.
void appendBlock (int blockSize)
 Appends a block of size blockSize at the end of the range. More...
void clear ()
 Removes all blocks.
void reduceNumBlocks (int newNumBlocks)
 Reduces the number of blocks to newNumBlocks. More...
void setAllBlocksSizeOne (int numBlocks)
 Sets the partitioning to numBlocks blocks each of size 1.
std::vector< int > & rawIndex ()
 Returns the raw block index array, avoid using this.

Member Function Documentation

void gmx::RangePartitioning::appendBlock ( int  blockSize)

Appends a block of size blockSize at the end of the range.

blocksize has to be >= 1
void gmx::RangePartitioning::reduceNumBlocks ( int  newNumBlocks)

Reduces the number of blocks to newNumBlocks.

newNumBlocks should be <= numBlocks().

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