BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
SimMat Namespace Reference

Functions

template<class T>
void pack2d (int n, const T *sm, T *pac_sm)
int get_idx (int i, int j)
template<class T>
get_element (const T *pac_sm, int i, int j)
template<class T>
void unpack2d (int n, T *sm, const T *pac_sm)

Function Documentation

◆ get_element()

◆ get_idx()

int SimMat::get_idx ( int i,
int j )
inline

Definition at line 20 of file Event/RootEventData/include/RootEventData/SimMatr.h.

20 {
21 return ( i > j ) ? i * ( i + 1 ) / 2 + j : j * ( j + 1 ) / 2 + i;
22 }

Referenced by get_element().

◆ pack2d()

template<class T>
void SimMat::pack2d ( int n,
const T * sm,
T * pac_sm )
inline

◆ unpack2d()

template<class T>
void SimMat::unpack2d ( int n,
T * sm,
const T * pac_sm )
inline

Definition at line 31 of file Event/RootEventData/include/RootEventData/SimMatr.h.

31 {
32 for ( int i = 0; i < n; i++ )
33 {
34 for ( int j = 0; j <= i; j++ )
35 {
36 int k = i * ( i + 1 ) / 2 + j;
37 sm[i * n + j] = sm[i + j * n] = pac_sm[k];
38 }
39 }
40 }