faunus
Public Types | Public Member Functions | Protected Member Functions | List of all members
Faunus::CellList::Container::DenseContainer< TMember, TIndex > Class Template Reference

Container based on a vector suitable for system with a uniform and high member density. More...

#include <celllistimpl.h>

Inheritance diagram for Faunus::CellList::Container::DenseContainer< TMember, TIndex >:
Inheritance graph
[legend]
Collaboration diagram for Faunus::CellList::Container::DenseContainer< TMember, TIndex >:
Collaboration graph
[legend]

Public Types

using ContainerType = AbstractContainer< TMember, TIndex >
 
using Index = TIndex
 the cell index (key) type
 
using Members = std::vector< Member >
 the cell members type
 
- Public Types inherited from Faunus::CellList::Container::AbstractContainer< TMember, TIndex >
using ContainerType = AbstractContainer< TMember, TIndex >
 
using Index = TIndex
 the cell index (key) type
 
using Member = TMember
 the cell member (primitive value) type
 
using Members = std::vector< Member >
 the cell members type
 

Public Member Functions

const Membersget (Index index) const override
 Gets cell members at the given cell index.
 
Membersget (Index index) override
 Gets cell members at the given cell index.
 
const MembersgetEmpty () const override
 Gets cell members of an empty cell. Allows non-existing cells.
 
std::vector< Indexindices () const override
 Return all cell indices that may contain members. More...
 
 DenseContainer (std::size_t size)
 

Protected Member Functions

Index indexEnd () const
 

Detailed Description

template<typename TMember, typename TIndex>
class Faunus::CellList::Container::DenseContainer< TMember, TIndex >

Container based on a vector suitable for system with a uniform and high member density.

As all cells (even the empty ones) reside in memory, the vector has size of gridBase::size(). Very fast access at the expense of a bigger memory footprint, expecialy in sparse systems.

Template Parameters
TMembermember (value)
TIndexindex (key); corresponds do the CellIndex of GridType

Member Function Documentation

◆ indices()

template<typename TMember , typename TIndex >
std::vector<Index> Faunus::CellList::Container::DenseContainer< TMember, TIndex >::indices ( ) const
inlineoverridevirtual

Return all cell indices that may contain members.

It is not guaranteed that all returned cells are non-empty though. However all non-empty cells are returned.

Returns
vector of cell indices

Implements Faunus::CellList::Container::AbstractContainer< TMember, TIndex >.


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