Blaze 3.9
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
44#include <blaze/util/Types.h>
45
46
47namespace blaze {
48
49//=================================================================================================
50//
51// CLASS DEFINITION
52//
53//=================================================================================================
54
55//*************************************************************************************************
63template< size_t... CRAs > // Compile time row arguments
65{};
66//*************************************************************************************************
67
68
69
70
71//=================================================================================================
72//
73// CLASS TEMPLATE SPECIALIZATION FOR ZERO COMPILE TIME ROW INDICES
74//
75//=================================================================================================
76
77//*************************************************************************************************
85template<>
86class RowData<>
87{
88 public:
89 //**Compile time flags**************************************************************************
91
95 static constexpr bool compileTimeArgs = false;
96 //**********************************************************************************************
97
98 //**Constructors********************************************************************************
101 template< typename... RRAs >
102 explicit inline RowData( size_t index, RRAs... args );
103
104 RowData( const RowData& ) = default;
106 //**********************************************************************************************
107
108 //**Destructor**********************************************************************************
111 ~RowData() = default;
113 //**********************************************************************************************
114
115 //**Assignment operators************************************************************************
118 RowData& operator=( const RowData& ) = delete;
120 //**********************************************************************************************
121
122 //**Utility functions***************************************************************************
125 inline size_t row() const noexcept;
127 //**********************************************************************************************
128
129 private:
130 //**Member variables****************************************************************************
133 const size_t row_;
135 //**********************************************************************************************
136};
138//*************************************************************************************************
139
140
141//*************************************************************************************************
148template< typename... RRAs > // Optional row arguments
149inline RowData<>::RowData( size_t index, RRAs... args )
150 : row_( index ) // The index of the row in the matrix
151{
152 MAYBE_UNUSED( args... );
153}
155//*************************************************************************************************
156
157
158//*************************************************************************************************
164inline size_t RowData<>::row() const noexcept
165{
166 return row_;
167}
169//*************************************************************************************************
170
171
172
173
174//=================================================================================================
175//
176// CLASS TEMPLATE SPECIALIZATION FOR ONE COMPILE TIME ROW INDEX
177//
178//=================================================================================================
179
180//*************************************************************************************************
188template< size_t Index > // Compile time row index
189class RowData<Index>
190{
191 public:
192 //**Compile time flags**************************************************************************
194
198 static constexpr bool compileTimeArgs = true;
199 //**********************************************************************************************
200
201 //**Constructors********************************************************************************
204 template< typename... RRAs >
205 explicit inline RowData( RRAs... args );
206
207 RowData( const RowData& ) = default;
209 //**********************************************************************************************
210
211 //**Destructor**********************************************************************************
214 ~RowData() = default;
216 //**********************************************************************************************
217
218 //**Assignment operators************************************************************************
221 RowData& operator=( const RowData& ) = delete;
223 //**********************************************************************************************
224
225 //**Utility functions***************************************************************************
228 static constexpr size_t row() noexcept;
230 //**********************************************************************************************
231};
233//*************************************************************************************************
234
235
236//*************************************************************************************************
242template< size_t Index > // Compile time row index
243template< typename... RRAs > // Optional row arguments
244inline RowData<Index>::RowData( RRAs... args )
245{
246 MAYBE_UNUSED( args... );
247}
249//*************************************************************************************************
250
251
252//*************************************************************************************************
258template< size_t Index > // Compile time row index
259constexpr size_t RowData<Index>::row() noexcept
260{
261 return Index;
262}
264//*************************************************************************************************
265
266} // namespace blaze
267
268#endif
Header file for the MAYBE_UNUSED function template.
Auxiliary class template for the data members of the Row class.
Definition: RowData.h:65
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:137
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Header file for basic type definitions.