RowData.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_VIEWS_ROW_ROWDATA_H_
36 #define _BLAZE_MATH_VIEWS_ROW_ROWDATA_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/util/Types.h>
44 #include <blaze/util/Unused.h>
45 
46 
47 namespace blaze {
48 
49 //=================================================================================================
50 //
51 // CLASS DEFINITION
52 //
53 //=================================================================================================
54 
55 //*************************************************************************************************
63 template< size_t... CRAs > // Compile time row arguments
64 struct RowData
65 {};
66 //*************************************************************************************************
67 
68 
69 
70 
71 //=================================================================================================
72 //
73 // CLASS TEMPLATE SPECIALIZATION FOR ZERO COMPILE TIME ROW INDICES
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
85 template<>
86 struct RowData<>
87 {
88  public:
89  //**Constructors********************************************************************************
92  template< typename... RRAs >
93  explicit inline RowData( size_t index, RRAs... args );
94 
95  RowData( const RowData& ) = default;
97  //**********************************************************************************************
98 
99  //**Destructor**********************************************************************************
102  ~RowData() = default;
104  //**********************************************************************************************
105 
106  //**Assignment operators************************************************************************
109  RowData& operator=( const RowData& ) = delete;
111  //**********************************************************************************************
112 
113  //**Utility functions***************************************************************************
116  inline size_t row() const noexcept;
118  //**********************************************************************************************
119 
120  private:
121  //**Member variables****************************************************************************
124  const size_t row_;
125 
126  //**********************************************************************************************
127 };
129 //*************************************************************************************************
130 
131 
132 //*************************************************************************************************
139 template< typename... RRAs > // Optional row arguments
140 inline RowData<>::RowData( size_t index, RRAs... args )
141  : row_( index ) // The index of the row in the matrix
142 {
143  UNUSED_PARAMETER( args... );
144 }
146 //*************************************************************************************************
147 
148 
149 //*************************************************************************************************
155 inline size_t RowData<>::row() const noexcept
156 {
157  return row_;
158 }
160 //*************************************************************************************************
161 
162 
163 
164 
165 //=================================================================================================
166 //
167 // CLASS TEMPLATE SPECIALIZATION FOR ONE COMPILE TIME ROW INDEX
168 //
169 //=================================================================================================
170 
171 //*************************************************************************************************
179 template< size_t Index > // Compile time row index
180 struct RowData<Index>
181 {
182  public:
183  //**Constructors********************************************************************************
186  template< typename... RRAs >
187  explicit inline RowData( RRAs... args );
188 
189  RowData( const RowData& ) = default;
191  //**********************************************************************************************
192 
193  //**Destructor**********************************************************************************
196  ~RowData() = default;
198  //**********************************************************************************************
199 
200  //**Assignment operators************************************************************************
203  RowData& operator=( const RowData& ) = delete;
205  //**********************************************************************************************
206 
207  //**Utility functions***************************************************************************
210  static inline constexpr size_t row() noexcept;
212  //**********************************************************************************************
213 };
215 //*************************************************************************************************
216 
217 
218 //*************************************************************************************************
224 template< size_t Index > // Compile time row index
225 template< typename... RRAs > // Optional row arguments
226 inline RowData<Index>::RowData( RRAs... args )
227 {
228  UNUSED_PARAMETER( args... );
229 }
231 //*************************************************************************************************
232 
233 
234 //*************************************************************************************************
240 template< size_t Index > // Compile time row index
241 inline constexpr size_t RowData<Index>::row() noexcept
242 {
243  return Index;
244 }
246 //*************************************************************************************************
247 
248 } // namespace blaze
249 
250 #endif
Header file for the UNUSED_PARAMETER function template.
Header file for basic type definitions.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
Auxiliary class template for the data members of the Row class.The auxiliary RowData class template r...
Definition: RowData.h:64