QMCPACK
PooledData.h File Reference

Define a serialized buffer to store anonymous data. More...

+ Include dependency graph for PooledData.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  PooledData< T >
 

Functions

template<class T >
bool operator== (const PooledData< T > &a, const PooledData< T > &b)
 operator to check if two buffers are identical More...
 
template<class T >
bool operator!= (const PooledData< T > &a, const PooledData< T > &b)
 operator to check if two buffers are different More...
 

Detailed Description

Define a serialized buffer to store anonymous data.

JK: Remove iterator version on 2016-01-04

Definition in file PooledData.h.

Function Documentation

◆ operator!=()

bool operator!= ( const PooledData< T > &  a,
const PooledData< T > &  b 
)

operator to check if two buffers are different

Definition at line 261 of file PooledData.h.

References qmcplusplus::abs(), and PooledData< T >::size().

262 {
263  if (a.size() != b.size())
264  return true;
265  //if(a.Current != b.Current) return true;
266  for (typename PooledData<T>::size_type i = 0; i < a.size(); ++i)
267  {
268  if (std::abs(a[i] - b[i]) > std::numeric_limits<T>::epsilon())
269  return true;
270  }
271  return false;
272 }
size_type size() const
return the size of the data
Definition: PooledData.h:48
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)
typename std::vector< T >::size_type size_type
Definition: PooledData.h:33

◆ operator==()

bool operator== ( const PooledData< T > &  a,
const PooledData< T > &  b 
)

operator to check if two buffers are identical

Definition at line 246 of file PooledData.h.

References qmcplusplus::abs(), and PooledData< T >::size().

247 {
248  if (a.size() != b.size())
249  return false;
250  //if(a.Current != b.Current) return false;
251  for (typename PooledData<T>::size_type i = 0; i < a.size(); ++i)
252  {
253  if (std::abs(a[i] - b[i]) > std::numeric_limits<T>::epsilon())
254  return false;
255  }
256  return true;
257 }
size_type size() const
return the size of the data
Definition: PooledData.h:48
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)
typename std::vector< T >::size_type size_type
Definition: PooledData.h:33