YAP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
SpinAmplitudeCache Class Referenceabstract

Caches SpinAmplitudes. More...

#include <SpinAmplitudeCache.h>

Inheritance diagram for SpinAmplitudeCache:
WeakPtrCache< SpinAmplitude > HelicityFormalism ZemachFormalism

Public Member Functions

 SpinAmplitudeCache (Model *model=nullptr)
 
bool equal (const std::shared_ptr< SpinAmplitude > &A, const std::shared_ptr< SpinAmplitude > &B) const override
 Equality.
 
weak_ptr_type find (unsigned two_J, const SpinVector &two_j, unsigned L, unsigned two_S) const
 
std::shared_ptr< SpinAmplitudespinAmplitude (unsigned two_J, const SpinVector &two_j, unsigned L, unsigned two_S)
 
bool consistent () const
 Check consistency of cache. Skips expired entries.
 
- Public Member Functions inherited from WeakPtrCache< SpinAmplitude >
virtual bool equal (const shared_ptr_type &A, const shared_ptr_type &B) const =0
 override to implement equality checking
 
weak_ptr_type find (shared_ptr_type t) const
 
shared_ptr_type operator[] (shared_ptr_type t)
 
bool empty () const
 
size_t size () const
 
size_t count_expired () const
 
void removeExpired ()
 remove expired Cache_ elements
 
virtual std::ostream & print (std::ostream &os) const
 stream the cache elements as a table
 
 WeakPtrCache ()=default
 Default constructor (defaulted)
 
 WeakPtrCache (const WeakPtrCache &)=default
 copy constructor (defaulted)
 
 WeakPtrCache (WeakPtrCache &&)=default
 move constructor (defaulted)
 
 WeakPtrCache (std::vector< shared_ptr_type > V)
 Construct cache from vector.
 
virtual ~WeakPtrCache ()=default
 virtual desctructor (defaulted)
 
WeakPtrCacheoperator= (const WeakPtrCache &)=default
 copy assignment operator (defaulted)
 
WeakPtrCacheoperator= (WeakPtrCache &&)=default
 move assignment operator (defaulted)
 
cache_type::iterator begin ()
 
cache_type::const_iterator begin () const
 
cache_type::iterator end ()
 
cache_type::const_iterator end () const
 

Protected Member Functions

void setModel (Model &model)
 set raw pointer to owning Model
 
std::shared_ptr< SpinAmplitudeunit (Model &m, unsigned two_J, const SpinVector &two_j, unsigned L, unsigned two_S) const
 
- Protected Member Functions inherited from WeakPtrCache< SpinAmplitude >
virtual void addToCache (shared_ptr_type t)
 add element to cache
 

Private Member Functions

virtual std::shared_ptr
< SpinAmplitude
create (Model &m, unsigned two_J, const SpinVector &two_j, unsigned L, unsigned two_S) const =0
 

Private Attributes

ModelModel_
 raw pointer to Model this cache belongs to
 

Friends

class Model
 grant friend status to Model to set itself owner
 

Additional Inherited Members

- Public Types inherited from WeakPtrCache< SpinAmplitude >
using type = SpinAmplitude
 object_type
 
using shared_ptr_type = std::shared_ptr< SpinAmplitude >
 std::shared_ptr to T More...
 
using weak_ptr_type = std::weak_ptr< SpinAmplitude >
 std::weak_ptr to T More...
 
using cache_type = std::set< weak_ptr_type, std::owner_less< weak_ptr_type > >
 A std::set of weak_ptr_type. More...
 

Detailed Description

Caches SpinAmplitudes.

Author
Johannes Rauch, Daniel Greenwald

Constructor & Destructor Documentation

SpinAmplitudeCache ( Model model = nullptr)
inline

Constructor

Parameters
modelraw pointer to Model this cache belongs to

Member Function Documentation

virtual std::shared_ptr<SpinAmplitude> create ( Model m,
unsigned  two_J,
const SpinVector &  two_j,
unsigned  L,
unsigned  two_S 
) const
privatepure virtual

override in inherting classes

Returns
shared_ptr to SpinAmplitude object
Parameters
mOwning model
two_Jtwice the spin of initial state
two_jSpinVector of daughters
Lorbital angular momentum
two_S2 * the total spin angular momentum

Implemented in HelicityFormalism, and ZemachFormalism.

SpinAmplitudeCache::weak_ptr_type find ( unsigned  two_J,
const SpinVector &  two_j,
unsigned  L,
unsigned  two_S 
) const

check if cache contains element matching arguments

Parameters
two_Jtwice the spin of initial state
two_jSpinVector of daughters
Lorbital angular momentum
two_S2 * the total spin angular momentum
std::shared_ptr< SpinAmplitude > spinAmplitude ( unsigned  two_J,
const SpinVector &  two_j,
unsigned  L,
unsigned  two_S 
)

retrieve or create SpinAmplitude

Parameters
two_Jtwice the spin of initial state
two_jSpinVector of daughters
Lorbital angular momentum
two_S2 * the total spin angular momentum
std::shared_ptr<SpinAmplitude> unit ( Model m,
unsigned  two_J,
const SpinVector &  two_j,
unsigned  L,
unsigned  two_S 
) const
inlineprotected
Returns
shared_ptr to UnitSpinAmplitude object
Parameters
mOwning model
two_Jtwice the spin of initial state
two_jSpinVector of daughters
Lorbital angular momentum
two_S2 * the total spin angular momentum

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