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  // No explicitly declared copy constructor.
96  //**********************************************************************************************
97 
98  //**Destructor**********************************************************************************
99  // No explicitly declared destructor.
100  //**********************************************************************************************
101 
102  //**Assignment operators************************************************************************
103  RowData& operator=( const RowData& ) = delete;
104  //**********************************************************************************************
105 
106  //**Utility functions***************************************************************************
109  inline size_t row() const noexcept;
111  //**********************************************************************************************
112 
113  private:
114  //**Member variables****************************************************************************
117  const size_t row_;
118 
119  //**********************************************************************************************
120 };
122 //*************************************************************************************************
123 
124 
125 //*************************************************************************************************
132 template< typename... RRAs > // Optional row arguments
133 inline RowData<>::RowData( size_t index, RRAs... args )
134  : row_( index ) // The index of the row in the matrix
135 {
136  UNUSED_PARAMETER( args... );
137 }
139 //*************************************************************************************************
140 
141 
142 //*************************************************************************************************
148 inline size_t RowData<>::row() const noexcept
149 {
150  return row_;
151 }
153 //*************************************************************************************************
154 
155 
156 
157 
158 //=================================================================================================
159 //
160 // CLASS TEMPLATE SPECIALIZATION FOR ONE COMPILE TIME ROW INDEX
161 //
162 //=================================================================================================
163 
164 //*************************************************************************************************
172 template< size_t Index > // Compile time row index
173 struct RowData<Index>
174 {
175  public:
176  //**Constructors********************************************************************************
179  template< typename... RRAs >
180  explicit inline RowData( RRAs... args );
181  // No explicitly declared copy constructor.
183  //**********************************************************************************************
184 
185  //**Destructor**********************************************************************************
186  // No explicitly declared destructor.
187  //**********************************************************************************************
188 
189  //**Assignment operators************************************************************************
190  RowData& operator=( const RowData& ) = delete;
191  //**********************************************************************************************
192 
193  //**Utility functions***************************************************************************
196  static inline constexpr size_t row() noexcept;
198  //**********************************************************************************************
199 };
201 //*************************************************************************************************
202 
203 
204 //*************************************************************************************************
210 template< size_t Index > // Compile time row index
211 template< typename... RRAs > // Optional row arguments
212 inline RowData<Index>::RowData( RRAs... args )
213 {
214  UNUSED_PARAMETER( args... );
215 }
217 //*************************************************************************************************
218 
219 
220 //*************************************************************************************************
226 template< size_t Index > // Compile time row index
227 inline constexpr size_t RowData<Index>::row() noexcept
228 {
229  return Index;
230 }
232 //*************************************************************************************************
233 
234 } // namespace blaze
235 
236 #endif
Header file for the UNUSED_PARAMETER function template.
Header file for basic type definitions.
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:131
Auxiliary class template for the data members of the Row class.The auxiliary RowData class template r...
Definition: RowData.h:64
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81