MADNESS  version 0.9
Public Member Functions | List of all members
madness::SimpleCache< Q, NDIM > Class Template Reference

Simplified interface around hash_map to cache stuff for 1D. More...

#include <simplecache.h>

Public Member Functions

 SimpleCache ()
 
 SimpleCache (const SimpleCache &c)
 
SimpleCacheoperator= (const SimpleCache &c)
 
const Q * getptr (const Key< NDIM > &key) const
 If key is present return pointer to cached value, otherwise return NULL. More...
 
const Q * getptr (Level n, Translation l) const
 If key=(n,l) is present return pointer to cached value, otherwise return NULL. More...
 
const Q * getptr (Level n, const Key< NDIM > &disp) const
 If key=(n,l) is present return pointer to cached value, otherwise return NULL. More...
 
void set (const Key< NDIM > &key, const Q &val)
 Set value associated with key ... gives ownership of a new copy to the container. More...
 
void set (Level n, Translation l, const Q &val)
 
void set (Level n, const Key< NDIM > &disp, const Q &val)
 

Detailed Description

template<typename Q, std::size_t NDIM>
class madness::SimpleCache< Q, NDIM >

Simplified interface around hash_map to cache stuff for 1D.

This is a write once cache — subsequent writes of elements have no effect (so that pointers/references to cached data cannot be invalidated)

Constructor & Destructor Documentation

template<typename Q, std::size_t NDIM>
madness::SimpleCache< Q, NDIM >::SimpleCache ( )
inline
template<typename Q, std::size_t NDIM>
madness::SimpleCache< Q, NDIM >::SimpleCache ( const SimpleCache< Q, NDIM > &  c)
inline

Member Function Documentation

template<typename Q, std::size_t NDIM>
const Q* madness::SimpleCache< Q, NDIM >::getptr ( const Key< NDIM > &  key) const
inline
template<typename Q, std::size_t NDIM>
const Q* madness::SimpleCache< Q, NDIM >::getptr ( Level  n,
Translation  l 
) const
inline

If key=(n,l) is present return pointer to cached value, otherwise return NULL.

This for the convenience (backward compatibility) of 1D routines

template<typename Q, std::size_t NDIM>
const Q* madness::SimpleCache< Q, NDIM >::getptr ( Level  n,
const Key< NDIM > &  disp 
) const
inline

If key=(n,l) is present return pointer to cached value, otherwise return NULL.

This for the convenience (backward compatibility) of 1D routines

template<typename Q, std::size_t NDIM>
SimpleCache& madness::SimpleCache< Q, NDIM >::operator= ( const SimpleCache< Q, NDIM > &  c)
inline
template<typename Q, std::size_t NDIM>
void madness::SimpleCache< Q, NDIM >::set ( const Key< NDIM > &  key,
const Q &  val 
)
inline
template<typename Q, std::size_t NDIM>
void madness::SimpleCache< Q, NDIM >::set ( Level  n,
Translation  l,
const Q &  val 
)
inline
template<typename Q, std::size_t NDIM>
void madness::SimpleCache< Q, NDIM >::set ( Level  n,
const Key< NDIM > &  disp,
const Q &  val 
)
inline

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