ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ModuleBase::Array_Pool< T > Class Template Reference

Array_Pool is a class designed for dynamically allocating a two-dimensional array with all its elements contiguously arranged in memory. Compared to a two-dimensional vector, it offers better data locality because all elements are stored in a continuous block of memory. More...

#include <array_pool.h>

Collaboration diagram for ModuleBase::Array_Pool< T >:

Public Member Functions

 Array_Pool ()=default
 
 Array_Pool (const int nr_in, const int nc_in)
 
 Array_Pool (Array_Pool< T > &&other)
 
Array_Pooloperator= (Array_Pool< T > &&other)
 
 ~Array_Pool ()
 
 Array_Pool (const Array_Pool< T > &other)=delete
 
Array_Pooloperator= (const Array_Pool &other)=delete
 
T ** get_ptr_2D () const
 
Tget_ptr_1D () const
 
int get_nr () const
 
int get_nc () const
 
Toperator[] (const int ir) const
 

Private Attributes

T ** ptr_2D = nullptr
 
Tptr_1D = nullptr
 
int nr = 0
 
int nc = 0
 

Detailed Description

template<typename T>
class ModuleBase::Array_Pool< T >

Array_Pool is a class designed for dynamically allocating a two-dimensional array with all its elements contiguously arranged in memory. Compared to a two-dimensional vector, it offers better data locality because all elements are stored in a continuous block of memory.

Template Parameters
T

Constructor & Destructor Documentation

◆ Array_Pool() [1/4]

template<typename T >
ModuleBase::Array_Pool< T >::Array_Pool ( )
default

◆ Array_Pool() [2/4]

template<typename T >
ModuleBase::Array_Pool< T >::Array_Pool ( const int  nr_in,
const int  nc_in 
)

◆ Array_Pool() [3/4]

template<typename T >
ModuleBase::Array_Pool< T >::Array_Pool ( Array_Pool< T > &&  other)

◆ ~Array_Pool()

template<typename T >
ModuleBase::Array_Pool< T >::~Array_Pool ( )

◆ Array_Pool() [4/4]

template<typename T >
ModuleBase::Array_Pool< T >::Array_Pool ( const Array_Pool< T > &  other)
delete

Member Function Documentation

◆ get_nc()

template<typename T >
int ModuleBase::Array_Pool< T >::get_nc ( ) const
inline

◆ get_nr()

template<typename T >
int ModuleBase::Array_Pool< T >::get_nr ( ) const
inline

◆ get_ptr_1D()

template<typename T >
T * ModuleBase::Array_Pool< T >::get_ptr_1D ( ) const
inline
Here is the caller graph for this function:

◆ get_ptr_2D()

template<typename T >
T ** ModuleBase::Array_Pool< T >::get_ptr_2D ( ) const
inline
Here is the caller graph for this function:

◆ operator=() [1/2]

template<typename T >
Array_Pool< T > & ModuleBase::Array_Pool< T >::operator= ( Array_Pool< T > &&  other)

◆ operator=() [2/2]

template<typename T >
Array_Pool & ModuleBase::Array_Pool< T >::operator= ( const Array_Pool< T > &  other)
delete

◆ operator[]()

template<typename T >
T * ModuleBase::Array_Pool< T >::operator[] ( const int  ir) const
inline

Member Data Documentation

◆ nc

template<typename T >
int ModuleBase::Array_Pool< T >::nc = 0
private

◆ nr

template<typename T >
int ModuleBase::Array_Pool< T >::nr = 0
private

◆ ptr_1D

template<typename T >
T* ModuleBase::Array_Pool< T >::ptr_1D = nullptr
private

◆ ptr_2D

template<typename T >
T** ModuleBase::Array_Pool< T >::ptr_2D = nullptr
private

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