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

Container based on a map suitable for system with a non-uniform or low member density. More...

#include <celllistimpl.h>

Inheritance diagram for Faunus::CellList::Container::SparseContainer< TMember, TIndex >:
Inheritance graph
[legend]
Collaboration diagram for Faunus::CellList::Container::SparseContainer< 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 indicis that may contain members. More...
 
 SparseContainer (std::size_t size)
 

Protected Member Functions

Index indexEnd () const
 

Detailed Description

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

Container based on a map suitable for system with a non-uniform or low member density.

Only cells with members reside in memory. Smaller memory footprint at expense of slower access.

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

Member Function Documentation

◆ indices()

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

Return all cell indicis that may contain members.

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

Returns
vector of cell indices

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


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