vSMC
vSMC: Scalable Monte Carlo
Public Member Functions | List of all members
vsmc::SingleParticle< T > Class Template Reference

A thin wrapper over a complete Particle. More...

#include <vsmc/core/single_particle.hpp>

Public Member Functions

 SingleParticle (typename Particle< T >::size_type id, Particle< T > *pptr)
 
SingleParticle< T > & operator* ()
 
const SingleParticle< T > & operator* () const
 
template<typename IntType >
SingleParticle operator[] (IntType n)
 

Detailed Description

template<typename T>
class vsmc::SingleParticle< T >

A thin wrapper over a complete Particle.

This is the basic SingleParticle available for any type of Particle. To extend it for type T. One can either specialize vsmc::SingleParticleBaseTypeTrait<T> or define a class template named single_particle_type within T with the following minimum requirement.

template <typename S> // S: StateType, such as StateMatrix<Dim, T>
class single_particle_type
{
public:
using size_type = IntType;
single_particle_type(size_type id, Particle<S> *pptr);
size_type id() const;
Particle<S> &particle() const;
}; // class single_particle_type

Usually you can safely derive single_particle_type<S> from SingleParticleBase<S> and add methods specific to S.

Definition at line 102 of file single_particle.hpp.

Constructor & Destructor Documentation

template<typename T>
vsmc::SingleParticle< T >::SingleParticle ( typename Particle< T >::size_type  id,
Particle< T > *  pptr 
)
inline

Definition at line 105 of file single_particle.hpp.

Member Function Documentation

template<typename T>
SingleParticle<T>& vsmc::SingleParticle< T >::operator* ( )
inline

Definition at line 119 of file single_particle.hpp.

template<typename T>
const SingleParticle<T>& vsmc::SingleParticle< T >::operator* ( ) const
inline

Definition at line 121 of file single_particle.hpp.

template<typename T>
template<typename IntType >
SingleParticle vsmc::SingleParticle< T >::operator[] ( IntType  n)
inline

Definition at line 111 of file single_particle.hpp.