Blaze  3.6
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/MaybeUnused.h>
44 #include <blaze/util/Types.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
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 class ColumnData<>
87 {
88  public:
89  //**Compile time flags**************************************************************************
91 
95  static constexpr bool compileTimeArgs = false;
96  //**********************************************************************************************
97 
98  //**Constructors********************************************************************************
101  template< typename... RCAs >
102  explicit inline ColumnData( size_t index, RCAs... args );
103 
104  ColumnData( const ColumnData& ) = default;
106  //**********************************************************************************************
107 
108  //**Destructor**********************************************************************************
111  ~ColumnData() = default;
113  //**********************************************************************************************
114 
115  //**Assignment operators************************************************************************
118  ColumnData& operator=( const ColumnData& ) = delete;
120  //**********************************************************************************************
121 
122  //**Utility functions***************************************************************************
125  inline size_t column() const noexcept;
127  //**********************************************************************************************
128 
129  private:
130  //**Member variables****************************************************************************
133  const size_t column_;
134 
135  //**********************************************************************************************
136 };
138 //*************************************************************************************************
139 
140 
141 //*************************************************************************************************
148 template< typename... RCAs > // Optional column arguments
149 inline ColumnData<>::ColumnData( size_t index, RCAs... args )
150  : column_( index ) // The index of the column in the matrix
151 {
152  MAYBE_UNUSED( args... );
153 }
155 //*************************************************************************************************
156 
157 
158 //*************************************************************************************************
164 inline size_t ColumnData<>::column() const noexcept
165 {
166  return column_;
167 }
169 //*************************************************************************************************
170 
171 
172 
173 
174 //=================================================================================================
175 //
176 // CLASS TEMPLATE SPECIALIZATION FOR ONE COMPILE TIME COLUMN INDEX
177 //
178 //=================================================================================================
179 
180 //*************************************************************************************************
188 template< size_t I > // Compile time column index
189 class ColumnData<I>
190 {
191  public:
192  //**Compile time flags**************************************************************************
194 
198  static constexpr bool compileTimeArgs = true;
199  //**********************************************************************************************
200 
201  //**Constructors********************************************************************************
204  template< typename... RCAs >
205  explicit inline ColumnData( RCAs... args );
206 
207  ColumnData( const ColumnData& ) = default;
209  //**********************************************************************************************
210 
211  //**Destructor**********************************************************************************
214  ~ColumnData() = default;
216  //**********************************************************************************************
217 
218  //**Assignment operators************************************************************************
221  ColumnData& operator=( const ColumnData& ) = delete;
223  //**********************************************************************************************
224 
225  //**Utility functions***************************************************************************
228  static inline constexpr size_t column() noexcept;
230  //**********************************************************************************************
231 };
233 //*************************************************************************************************
234 
235 
236 //*************************************************************************************************
242 template< size_t I > // Compile time column index
243 template< typename... RCAs > // Optional column arguments
244 inline ColumnData<I>::ColumnData( RCAs... args )
245 {
246  MAYBE_UNUSED( args... );
247 }
249 //*************************************************************************************************
250 
251 
252 //*************************************************************************************************
258 template< size_t I > // Compile time column index
259 inline constexpr size_t ColumnData<I>::column() noexcept
260 {
261  return I;
262 }
264 //*************************************************************************************************
265 
266 } // namespace blaze
267 
268 #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 basic type definitions.
Header file for the MAYBE_UNUSED function template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Auxiliary class template for the data members of the Column class.The auxiliary ColumnData class temp...
Definition: ColumnData.h:64