DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::MatrixBatch< real_T > Class Template Reference

Packed variable-shape matrix-batch layout inside a flat buffer. More...

#include <ArrayEigenMatrixBatch_DeviceView.hpp>

Classes

struct  UInt16QuadIn64
 
struct  UInt32PairIn64
 

Public Types

using t_matrix = Eigen::Matrix< std::remove_cv_t< real_T >, Eigen::Dynamic, Eigen::Dynamic >
 
using t_map_const = Eigen::Map< const t_matrix, Eigen::Unaligned >
 
using t_map = std::conditional_t< std::is_const_v< real_T >, t_map_const, Eigen::Map< t_matrix, Eigen::Unaligned > >
 

Public Member Functions

DNDS_DEVICE_CALLABLE MatrixBatch (real_T *n_buf, rowsize new_size)
 
DNDS_DEVICE_CALLABLE uint64_t & Size () const
 
DNDS_DEVICE_CALLABLE uint16_t getNRow (rowsize k) const
 
DNDS_DEVICE_CALLABLE uint16_t getNCol (rowsize k) const
 
DNDS_DEVICE_CALLABLE uint32_t getOffset (rowsize k) const
 
DNDS_DEVICE_CALLABLE void setNRow (rowsize k, uint16_t v)
 
DNDS_DEVICE_CALLABLE void setNCol (rowsize k, uint16_t v)
 
DNDS_DEVICE_CALLABLE void setOffset (rowsize k, uint32_t v)
 
template<class t_matrices_elem >
void CompressIn (const std::vector< t_matrices_elem > &matrices)
 
DNDS_DEVICE_CALLABLE t_map operator[] (rowsize k)
 
DNDS_DEVICE_CALLABLE t_map_const operator[] (rowsize k) const
 

Static Public Member Functions

template<class t_matrices_elem >
static rowsize getBufSize (const std::vector< t_matrices_elem > &matrices)
 

Detailed Description

template<class real_T = real>
class DNDS::MatrixBatch< real_T >

Packed variable-shape matrix-batch layout inside a flat buffer.

Each row of ArrayEigenMatrixBatch stores several matrices whose shapes may differ. MatrixBatch provides:

  • nested UInt32PairIn64 / UInt16QuadIn64 helpers to pack two 32-bit (or four 16-bit) integers into a single 64-bit word (matrix shape headers);
  • size computation (getBufSize) and compression (CompressIn) for an input vector of Eigen matrices;
  • operator()(j) that returns an Eigen::Map onto the j-th matrix inside the already-compressed row buffer.

The templated real_T allows both mutable and const variants.

Definition at line 35 of file ArrayEigenMatrixBatch_DeviceView.hpp.

Member Typedef Documentation

◆ t_map

template<class real_T = real>
using DNDS::MatrixBatch< real_T >::t_map = std::conditional_t<std::is_const_v<real_T>, t_map_const, Eigen::Map<t_matrix, Eigen::Unaligned> >

Definition at line 65 of file ArrayEigenMatrixBatch_DeviceView.hpp.

◆ t_map_const

template<class real_T = real>
using DNDS::MatrixBatch< real_T >::t_map_const = Eigen::Map<const t_matrix, Eigen::Unaligned>

Definition at line 64 of file ArrayEigenMatrixBatch_DeviceView.hpp.

◆ t_matrix

template<class real_T = real>
using DNDS::MatrixBatch< real_T >::t_matrix = Eigen::Matrix<std::remove_cv_t<real_T>, Eigen::Dynamic, Eigen::Dynamic>

Definition at line 63 of file ArrayEigenMatrixBatch_DeviceView.hpp.

Constructor & Destructor Documentation

◆ MatrixBatch()

template<class real_T = real>
DNDS_DEVICE_CALLABLE DNDS::MatrixBatch< real_T >::MatrixBatch ( real_T *  n_buf,
rowsize  new_size 
)
inline

Definition at line 98 of file ArrayEigenMatrixBatch_DeviceView.hpp.

Member Function Documentation

◆ CompressIn()

template<class real_T = real>
template<class t_matrices_elem >
void DNDS::MatrixBatch< real_T >::CompressIn ( const std::vector< t_matrices_elem > &  matrices)
inline

Definition at line 145 of file ArrayEigenMatrixBatch_DeviceView.hpp.

Here is the call graph for this function:

◆ getBufSize()

template<class real_T = real>
template<class t_matrices_elem >
static rowsize DNDS::MatrixBatch< real_T >::getBufSize ( const std::vector< t_matrices_elem > &  matrices)
inlinestatic

Definition at line 71 of file ArrayEigenMatrixBatch_DeviceView.hpp.

Here is the caller graph for this function:

◆ getNCol()

template<class real_T = real>
DNDS_DEVICE_CALLABLE uint16_t DNDS::MatrixBatch< real_T >::getNCol ( rowsize  k) const
inline

Definition at line 114 of file ArrayEigenMatrixBatch_DeviceView.hpp.

Here is the caller graph for this function:

◆ getNRow()

template<class real_T = real>
DNDS_DEVICE_CALLABLE uint16_t DNDS::MatrixBatch< real_T >::getNRow ( rowsize  k) const
inline

Definition at line 108 of file ArrayEigenMatrixBatch_DeviceView.hpp.

Here is the caller graph for this function:

◆ getOffset()

template<class real_T = real>
DNDS_DEVICE_CALLABLE uint32_t DNDS::MatrixBatch< real_T >::getOffset ( rowsize  k) const
inline

Definition at line 120 of file ArrayEigenMatrixBatch_DeviceView.hpp.

Here is the caller graph for this function:

◆ operator[]() [1/2]

template<class real_T = real>
DNDS_DEVICE_CALLABLE t_map DNDS::MatrixBatch< real_T >::operator[] ( rowsize  k)
inline

Definition at line 166 of file ArrayEigenMatrixBatch_DeviceView.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator[]() [2/2]

template<class real_T = real>
DNDS_DEVICE_CALLABLE t_map_const DNDS::MatrixBatch< real_T >::operator[] ( rowsize  k) const
inline

Definition at line 176 of file ArrayEigenMatrixBatch_DeviceView.hpp.

Here is the call graph for this function:

◆ setNCol()

template<class real_T = real>
DNDS_DEVICE_CALLABLE void DNDS::MatrixBatch< real_T >::setNCol ( rowsize  k,
uint16_t  v 
)
inline

Definition at line 132 of file ArrayEigenMatrixBatch_DeviceView.hpp.

Here is the caller graph for this function:

◆ setNRow()

template<class real_T = real>
DNDS_DEVICE_CALLABLE void DNDS::MatrixBatch< real_T >::setNRow ( rowsize  k,
uint16_t  v 
)
inline

Definition at line 126 of file ArrayEigenMatrixBatch_DeviceView.hpp.

Here is the caller graph for this function:

◆ setOffset()

template<class real_T = real>
DNDS_DEVICE_CALLABLE void DNDS::MatrixBatch< real_T >::setOffset ( rowsize  k,
uint32_t  v 
)
inline

Definition at line 138 of file ArrayEigenMatrixBatch_DeviceView.hpp.

Here is the caller graph for this function:

◆ Size()

template<class real_T = real>
DNDS_DEVICE_CALLABLE uint64_t & DNDS::MatrixBatch< real_T >::Size ( ) const
inline

Definition at line 102 of file ArrayEigenMatrixBatch_DeviceView.hpp.

Here is the caller graph for this function:

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