BioDynaMo  v1.03.58-27764645
Public Member Functions | Private Attributes | Friends | List of all members
bdm::AgentVector< T > Class Template Reference

#include <agent_vector.h>

Collaboration diagram for bdm::AgentVector< T >:
[legend]

Public Member Functions

 AgentVector ()
 NB: Elements will not be initilized. More...
 
void reserve ()
 
void clear ()
 
size_t size (uint16_t numa_node)
 
const T & operator[] (const AgentHandle &handle) const
 
T & operator[] (const AgentHandle &handle)
 
bool operator== (const AgentVector< T > &other) const
 
bool operator!= (const AgentVector< T > &other) const
 

Private Attributes

std::vector< std::vector< T > > data_
 one std::vector<T> for each numa node More...
 
std::vector< size_t > size_
 
ThreadInfothread_info_ = ThreadInfo::GetInstance()
 

Friends

struct detail::InitializeGPUData
 
struct MechanicalForcesOpCuda
 

Detailed Description

template<typename T>
class bdm::AgentVector< T >

Two dimensional vector. Holds one element of type T for each agent in the simulation.

Definition at line 31 of file agent_vector.h.

Constructor & Destructor Documentation

◆ AgentVector()

template<typename T >
bdm::AgentVector< T >::AgentVector ( )
inline

NB: Elements will not be initilized.

Definition at line 37 of file agent_vector.h.

Member Function Documentation

◆ clear()

template<typename T >
void bdm::AgentVector< T >::clear ( )
inline

Definition at line 62 of file agent_vector.h.

◆ operator!=()

template<typename T >
bool bdm::AgentVector< T >::operator!= ( const AgentVector< T > &  other) const
inline

Definition at line 98 of file agent_vector.h.

◆ operator==()

template<typename T >
bool bdm::AgentVector< T >::operator== ( const AgentVector< T > &  other) const
inline

Definition at line 82 of file agent_vector.h.

◆ operator[]() [1/2]

template<typename T >
T& bdm::AgentVector< T >::operator[] ( const AgentHandle handle)
inline

Definition at line 78 of file agent_vector.h.

◆ operator[]() [2/2]

template<typename T >
const T& bdm::AgentVector< T >::operator[] ( const AgentHandle handle) const
inline

Definition at line 74 of file agent_vector.h.

◆ reserve()

template<typename T >
void bdm::AgentVector< T >::reserve ( )
inline

Reserves enough memory to hold N instances of type T (N being the number of agents in the simulation). e.g. ResourceManager has two types A and B. A has 10 elements and B 20. data_[0] corresponds to A and reserves 10 elements, while data_[1] corresponds to B and reserves 20 elements. NB: Elements will not be initilized.

Definition at line 49 of file agent_vector.h.

◆ size()

template<typename T >
size_t bdm::AgentVector< T >::size ( uint16_t  numa_node)
inline

Definition at line 72 of file agent_vector.h.

Friends And Related Function Documentation

◆ detail::InitializeGPUData

template<typename T >
friend struct detail::InitializeGPUData
friend

Definition at line 32 of file agent_vector.h.

◆ MechanicalForcesOpCuda

template<typename T >
friend struct MechanicalForcesOpCuda
friend

Definition at line 33 of file agent_vector.h.

Member Data Documentation

◆ data_

template<typename T >
std::vector<std::vector<T> > bdm::AgentVector< T >::data_
private

one std::vector<T> for each numa node

Definition at line 104 of file agent_vector.h.

◆ size_

template<typename T >
std::vector<size_t> bdm::AgentVector< T >::size_
private

Definition at line 105 of file agent_vector.h.

◆ thread_info_

template<typename T >
ThreadInfo* bdm::AgentVector< T >::thread_info_ = ThreadInfo::GetInstance()
private

Definition at line 106 of file agent_vector.h.


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