ColumnData.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_VIEWS_COLUMN_COLUMNDATA_H_
36 #define _BLAZE_MATH_VIEWS_COLUMN_COLUMNDATA_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... CCAs > // Compile time column arguments
64 struct ColumnData
65 {};
66 //*************************************************************************************************
67 
68 
69 
70 
71 //=================================================================================================
72 //
73 // CLASS TEMPLATE SPECIALIZATION FOR ZERO COMPILE TIME COLUMN INDICES
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
85 template<>
86 struct ColumnData<>
87 {
88  public:
89  //**Constructors********************************************************************************
92  template< typename... RCAs >
93  explicit inline ColumnData( size_t index, RCAs... args );
94 
95  ColumnData( const ColumnData& ) = default;
97  //**********************************************************************************************
98 
99  //**Destructor**********************************************************************************
102  ~ColumnData() = default;
104  //**********************************************************************************************
105 
106  //**Assignment operators************************************************************************
109  ColumnData& operator=( const ColumnData& ) = delete;
111  //**********************************************************************************************
112 
113  //**Utility functions***************************************************************************
116  inline size_t column() const noexcept;
118  //**********************************************************************************************
119 
120  private:
121  //**Member variables****************************************************************************
124  const size_t column_;
125 
126  //**********************************************************************************************
127 };
129 //*************************************************************************************************
130 
131 
132 //*************************************************************************************************
139 template< typename... RCAs > // Optional column arguments
140 inline ColumnData<>::ColumnData( size_t index, RCAs... args )
141  : column_( index ) // The index of the column in the matrix
142 {
143  UNUSED_PARAMETER( args... );
144 }
146 //*************************************************************************************************
147 
148 
149 //*************************************************************************************************
155 inline size_t ColumnData<>::column() const noexcept
156 {
157  return column_;
158 }
160 //*************************************************************************************************
161 
162 
163 
164 
165 //=================================================================================================
166 //
167 // CLASS TEMPLATE SPECIALIZATION FOR ONE COMPILE TIME COLUMN INDEX
168 //
169 //=================================================================================================
170 
171 //*************************************************************************************************
179 template< size_t I > // Compile time column index
180 struct ColumnData<I>
181 {
182  public:
183  //**Constructors********************************************************************************
186  template< typename... RCAs >
187  explicit inline ColumnData( RCAs... args );
188 
189  ColumnData( const ColumnData& ) = default;
191  //**********************************************************************************************
192 
193  //**Destructor**********************************************************************************
196  ~ColumnData() = default;
198  //**********************************************************************************************
199 
200  //**Assignment operators************************************************************************
203  ColumnData& operator=( const ColumnData& ) = delete;
205  //**********************************************************************************************
206 
207  //**Utility functions***************************************************************************
210  static inline constexpr size_t column() noexcept;
212  //**********************************************************************************************
213 };
215 //*************************************************************************************************
216 
217 
218 //*************************************************************************************************
224 template< size_t I > // Compile time column index
225 template< typename... RCAs > // Optional column arguments
226 inline ColumnData<I>::ColumnData( RCAs... args )
227 {
228  UNUSED_PARAMETER( args... );
229 }
231 //*************************************************************************************************
232 
233 
234 //*************************************************************************************************
240 template< size_t I > // Compile time column index
241 inline constexpr size_t ColumnData<I>::column() noexcept
242 {
243  return I;
244 }
246 //*************************************************************************************************
247 
248 } // namespace blaze
249 
250 #endif
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
Header file for the UNUSED_PARAMETER function template.
Header file for basic type definitions.
Auxiliary class template for the data members of the Column class.The auxiliary ColumnData class temp...
Definition: ColumnData.h:64
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