1 // -*- C++ -*- 2 /** @file */ 3 #pragma once 4 5 namespace arm_cmsis_dsp { 6 7 template<typename P> 8 struct Vector_Base; 9 10 template<typename T,int stride> 11 struct VectorView; 12 13 template<typename P,int L, 14 template<int> typename Allocator> 15 struct Vector; 16 17 template<typename P,int R,int C, 18 template<int> typename Allocator> 19 struct Matrix; 20 21 template<typename T,int S> 22 struct MatrixView; 23 24 template<typename T> 25 struct NbRows; 26 27 template<typename T> 28 struct NbCols; 29 30 template<typename M> 31 struct Complexity; 32 33 template<typename M> 34 struct OutputVectorDim; 35 36 template<typename M,typename V> 37 struct CompatibleStaticMatMatProduct; 38 39 template<typename M,typename V> 40 struct CompatibleStaticMatVecProduct; 41 42 template<typename M,typename V> 43 struct CompatibleDynamicMatVecProduct; 44 45 template<typename M,typename V> 46 struct CompatibleDynamicMatMatProductStaticStride; 47 48 template<typename M,typename V> 49 struct CompatibleDynamicMatMatProductDynamicStride; 50 51 template<typename M,typename V> 52 struct CompatibleDynamicMatMatProduct; 53 54 template<typename M,typename V> 55 struct OutputVector; 56 57 template<typename MA,typename MB> 58 struct OutputMatrix; 59 60 61 62 /* 63 64 Identifications 65 66 */ 67 68 /* 69 70 Is a contiguous array in memory with scalar indexing 71 (operator[]) 72 It can be an _Expr 73 Vector has a length 74 75 Generally used whe scalar indexing is required or length 76 77 */ 78 template<typename T> 79 struct IsVector; 80 81 /* 82 83 Has matrix indexing (operator()) 84 and matrix operations like transpose, identity. 85 So it cannot be an _Expr because _Expr has no transpose, identity 86 Has rows, columns 87 Matrix may be vectors Vectors (with above definition) 88 89 Generally used when transpose or identity are required. 90 91 */ 92 template<typename T> 93 struct IsMatrix; 94 95 /* 96 97 Has matrix indexing (operator()) 98 but no matrix operator like transpose. 99 It can be an Expr 100 Has rows, columns 101 It may not always be a Vector (MatrixView are not contiguous) 102 103 Generally used only when matrix indexing is mandatory 104 105 */ 106 template<typename T> 107 struct HasMatrixIndexing; 108 109 /* 110 111 112 Type Matrix : IsVector, IsMatrix, HasMatrixIndexing 113 Type MatrixView : , IsMatrix, HasMatrixIndexing 114 Type _Expr with Matrix : IsVector, , HasMatrixIndexing 115 Type _Expr with some MatrixView : HasMatrixIndexing 116 117 */ 118 119 120 /* 121 122 Dimensions only known at runtime 123 124 */ 125 template<typename T> 126 struct IsDynamic; 127 128 /* 129 130 StaticLength if known at build time otherwise 0 131 */ 132 template<typename T> 133 struct StaticLength; 134 135 /* 136 137 Type of elements in vector or matrix 138 139 */ 140 template<typename T> 141 struct ElementType; 142 143 template<typename T> 144 struct HasStaticStride; 145 146 template<typename T> 147 struct StaticStride; 148 149 } 150