QMCPACK
container_traits< Matrix< T, ALLOC > > Struct Template Reference
+ Collaboration diagram for container_traits< Matrix< T, ALLOC > >:

Public Types

using element_type = T
 
using CT = Matrix< T, ALLOC >
 

Static Public Member Functions

template<typename I >
static void resize (CT &ref, I *n, int d)
 
static size_t getSize (const CT &ref)
 
static auto getElementPtr (CT &ref)
 

Detailed Description

template<typename T, class ALLOC>
struct qmcplusplus::container_traits< Matrix< T, ALLOC > >

Definition at line 46 of file container_traits_ohmms.h.

Member Typedef Documentation

◆ CT

using CT = Matrix<T, ALLOC>

Definition at line 49 of file container_traits_ohmms.h.

◆ element_type

using element_type = T

Definition at line 48 of file container_traits_ohmms.h.

Member Function Documentation

◆ getElementPtr()

static auto getElementPtr ( CT ref)
inlinestatic

Definition at line 65 of file container_traits_ohmms.h.

References Matrix< T, Alloc >::data().

65 { return ref.data(); }

◆ getSize()

static size_t getSize ( const CT ref)
inlinestatic

Definition at line 63 of file container_traits_ohmms.h.

References Matrix< T, Alloc >::size().

63 { return ref.size(); }

◆ resize()

static void resize ( CT ref,
I n,
int  d 
)
inlinestatic

Definition at line 52 of file container_traits_ohmms.h.

References qmcplusplus::n, and Matrix< T, Alloc >::resize().

53  {
54  if (d != 2)
55  {
56  std::ostringstream err_msg;
57  err_msg << "Matrix cannot be resized. Requested dimension = " << d << std::endl;
58  throw std::runtime_error(err_msg.str());
59  }
60  ref.resize(n[0], n[1]);
61  }

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