OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
mul_array_extents.hpp
1/*
2 * mul_array_extents.hpp
3 *
4 * Created on: Dec 2, 2015
5 * Author: i-bird
6 */
7
8#ifndef OPENFPM_DATA_SRC_UTIL_MUL_ARRAY_EXTENTS_HPP_
9#define OPENFPM_DATA_SRC_UTIL_MUL_ARRAY_EXTENTS_HPP_
10
17template<typename T>
19{
20 static inline size_t mul()
21 {
22 return 1;
23 }
24};
25
32template<typename T,size_t N1>
33struct array_extents<T[N1]>
34{
35 static inline size_t mul()
36 {
37 return N1;
38 }
39};
40
47template<typename T,size_t N1,size_t N2>
48struct array_extents<T[N1][N2]>
49{
50 static inline size_t mul()
51 {
52 return N1 * N2;
53 }
54};
55
62template<typename T,size_t N1,size_t N2,size_t N3>
63struct array_extents<T[N1][N2][N3]>
64{
65 static inline size_t mul()
66 {
67 return N1 * N2 * N3;
68 }
69};
70
71
72#endif /* OPENFPM_DATA_SRC_UTIL_MUL_ARRAY_EXTENTS_HPP_ */
Struct that give functionalities on array extensions.
It model an expression expr1 * expr2.
Definition mul.hpp:120