QMCPACK
double_hyperslab_proxy< CT, MAXDIM > Struct Template Reference

class to use hyperslabs in both file and memory spaces More...

+ Inheritance diagram for double_hyperslab_proxy< CT, MAXDIM >:
+ Collaboration diagram for double_hyperslab_proxy< CT, MAXDIM >:

Public Types

enum  { element_size = container_proxy<CT>::DIM }
 determine the size of value_type More...
 
- Public Types inherited from container_proxy< CT >
enum  
 
using pointer = typename scalar_traits< CT >::real_type *
 

Public Member Functions

 double_hyperslab_proxy (CT &a)
 1D More...
 
template<typename IC >
 double_hyperslab_proxy (CT &a, const IC &dims_in, const IC &dims_loc, const IC &offsets_in, const IC &mem_dims_in, const IC &mem_dims_loc, const IC &mem_offsets_in)
 
hsize_t size (int i) const
 return the size of the i-th dimension More...
 
void change_shape ()
 
- Public Member Functions inherited from container_proxy< CT >
 container_proxy (CT &a)
 
size_t size () const
 
pointer data ()
 

Public Attributes

int slab_rank
 rank of hyperslab More...
 
int mem_rank
 
bool use_slab
 true, if hyperslab is used More...
 
TinyVector< hsize_t, MAXDIM+1 > slab_dims
 global dimension of the hyperslab More...
 
TinyVector< hsize_t, MAXDIM+1 > slab_dims_local
 local dimension of the hyperslab More...
 
TinyVector< hsize_t, MAXDIM+1 > slab_offset
 offset of the hyperslab More...
 
TinyVector< hsize_t, MAXDIM+1 > mem_dims
 global dimension of the hyperslab More...
 
TinyVector< hsize_t, MAXDIM+1 > mem_dims_local
 local dimension of the hyperslab More...
 
TinyVector< hsize_t, MAXDIM+1 > mem_offset
 offset of the hyperslab More...
 
- Public Attributes inherited from container_proxy< CT >
CT & ref
 

Detailed Description

template<typename CT, unsigned MAXDIM>
struct qmcplusplus::double_hyperslab_proxy< CT, MAXDIM >

class to use hyperslabs in both file and memory spaces

container_proxy<CT> handles the size and datatype

Definition at line 26 of file hdf_double_hyperslab.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

determine the size of value_type

Enumerator
element_size 

Definition at line 29 of file hdf_double_hyperslab.h.

Constructor & Destructor Documentation

◆ double_hyperslab_proxy() [1/2]

double_hyperslab_proxy ( CT &  a)
inline

1D

Definition at line 51 of file hdf_double_hyperslab.h.

References double_hyperslab_proxy< CT, MAXDIM >::slab_dims, double_hyperslab_proxy< CT, MAXDIM >::slab_dims_local, and double_hyperslab_proxy< CT, MAXDIM >::use_slab.

52  : container_proxy<CT>(a), slab_rank(a.slab_rank), slab_dims(a.slab_dims), slab_offset(a.slab_offset)
53  {
55  use_slab = false;
56  }
TinyVector< hsize_t, MAXDIM+1 > slab_dims
global dimension of the hyperslab
bool use_slab
true, if hyperslab is used
TinyVector< hsize_t, MAXDIM+1 > slab_dims_local
local dimension of the hyperslab
TinyVector< hsize_t, MAXDIM+1 > slab_offset
offset of the hyperslab

◆ double_hyperslab_proxy() [2/2]

double_hyperslab_proxy ( CT &  a,
const IC &  dims_in,
const IC &  dims_loc,
const IC &  offsets_in,
const IC &  mem_dims_in,
const IC &  mem_dims_loc,
const IC &  mem_offsets_in 
)
inline

Definition at line 59 of file hdf_double_hyperslab.h.

References double_hyperslab_proxy< CT, MAXDIM >::element_size, double_hyperslab_proxy< CT, MAXDIM >::mem_dims, double_hyperslab_proxy< CT, MAXDIM >::mem_dims_local, double_hyperslab_proxy< CT, MAXDIM >::mem_offset, double_hyperslab_proxy< CT, MAXDIM >::mem_rank, double_hyperslab_proxy< CT, MAXDIM >::slab_dims, double_hyperslab_proxy< CT, MAXDIM >::slab_dims_local, double_hyperslab_proxy< CT, MAXDIM >::slab_offset, double_hyperslab_proxy< CT, MAXDIM >::slab_rank, and double_hyperslab_proxy< CT, MAXDIM >::use_slab.

66  : container_proxy<CT>(a)
67  {
68  slab_rank = dims_in.size();
69  for (int i = 0; i < dims_in.size(); ++i)
70  slab_dims[i] = static_cast<hsize_t>(dims_in[i]);
71  for (int i = 0; i < dims_loc.size(); ++i)
72  slab_dims_local[i] = static_cast<hsize_t>(dims_loc[i]);
73  for (int i = 0; i < dims_in.size(); ++i)
74  slab_offset[i] = static_cast<hsize_t>(offsets_in[i]);
75 
76  mem_rank = mem_dims_in.size();
77  for (int i = 0; i < mem_dims_in.size(); ++i)
78  mem_dims[i] = static_cast<hsize_t>(mem_dims_in[i]);
79  for (int i = 0; i < mem_dims_loc.size(); ++i)
80  mem_dims_local[i] = static_cast<hsize_t>(mem_dims_loc[i]);
81  for (int i = 0; i < mem_dims_in.size(); ++i)
82  mem_offset[i] = static_cast<hsize_t>(mem_offsets_in[i]);
83  if (element_size > 1)
84  {
88  slab_rank += 1;
91  mem_offset[mem_rank] = 0;
92  mem_rank += 1;
93  }
94 
95  use_slab = true;
96  }
TinyVector< hsize_t, MAXDIM+1 > slab_dims
global dimension of the hyperslab
bool use_slab
true, if hyperslab is used
TinyVector< hsize_t, MAXDIM+1 > slab_dims_local
local dimension of the hyperslab
TinyVector< hsize_t, MAXDIM+1 > mem_dims
global dimension of the hyperslab
TinyVector< hsize_t, MAXDIM+1 > mem_offset
offset of the hyperslab
TinyVector< hsize_t, MAXDIM+1 > slab_offset
offset of the hyperslab
TinyVector< hsize_t, MAXDIM+1 > mem_dims_local
local dimension of the hyperslab

Member Function Documentation

◆ change_shape()

void change_shape ( )
inline

Definition at line 103 of file hdf_double_hyperslab.h.

References TinyVector< T, D >::data(), and double_hyperslab_proxy< CT, MAXDIM >::slab_dims.

103 { this->resize(slab_dims.data(), MAXDIM + 1); }
TinyVector< hsize_t, MAXDIM+1 > slab_dims
global dimension of the hyperslab

◆ size()

hsize_t size ( int  i) const
inline

return the size of the i-th dimension

Parameters
idimension

Definition at line 101 of file hdf_double_hyperslab.h.

References double_hyperslab_proxy< CT, MAXDIM >::slab_dims.

101 { return (i > MAXDIM) ? 0 : slab_dims[i]; }
TinyVector< hsize_t, MAXDIM+1 > slab_dims
global dimension of the hyperslab

Member Data Documentation

◆ mem_dims

TinyVector<hsize_t, MAXDIM + 1> mem_dims

global dimension of the hyperslab

Definition at line 45 of file hdf_double_hyperslab.h.

Referenced by double_hyperslab_proxy< CT, MAXDIM >::double_hyperslab_proxy().

◆ mem_dims_local

TinyVector<hsize_t, MAXDIM + 1> mem_dims_local

local dimension of the hyperslab

Definition at line 47 of file hdf_double_hyperslab.h.

Referenced by double_hyperslab_proxy< CT, MAXDIM >::double_hyperslab_proxy().

◆ mem_offset

TinyVector<hsize_t, MAXDIM + 1> mem_offset

offset of the hyperslab

Definition at line 49 of file hdf_double_hyperslab.h.

Referenced by double_hyperslab_proxy< CT, MAXDIM >::double_hyperslab_proxy().

◆ mem_rank

int mem_rank

◆ slab_dims

◆ slab_dims_local

TinyVector<hsize_t, MAXDIM + 1> slab_dims_local

local dimension of the hyperslab

Definition at line 41 of file hdf_double_hyperslab.h.

Referenced by double_hyperslab_proxy< CT, MAXDIM >::double_hyperslab_proxy().

◆ slab_offset

TinyVector<hsize_t, MAXDIM + 1> slab_offset

offset of the hyperslab

Definition at line 43 of file hdf_double_hyperslab.h.

Referenced by double_hyperslab_proxy< CT, MAXDIM >::double_hyperslab_proxy().

◆ slab_rank

int slab_rank

rank of hyperslab

Definition at line 34 of file hdf_double_hyperslab.h.

Referenced by double_hyperslab_proxy< CT, MAXDIM >::double_hyperslab_proxy().

◆ use_slab

bool use_slab

true, if hyperslab is used

Definition at line 37 of file hdf_double_hyperslab.h.

Referenced by double_hyperslab_proxy< CT, MAXDIM >::double_hyperslab_proxy().


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