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  // No explicitly declared copy constructor.
96  //**********************************************************************************************
97 
98  //**Destructor**********************************************************************************
99  // No explicitly declared destructor.
100  //**********************************************************************************************
101 
102  //**Assignment operators************************************************************************
103  ColumnData& operator=( const ColumnData& ) = delete;
104  //**********************************************************************************************
105 
106  //**Utility functions***************************************************************************
109  inline size_t column() const noexcept;
111  //**********************************************************************************************
112 
113  private:
114  //**Member variables****************************************************************************
117  const size_t column_;
118 
119  //**********************************************************************************************
120 };
122 //*************************************************************************************************
123 
124 
125 //*************************************************************************************************
132 template< typename... RCAs > // Optional column arguments
133 inline ColumnData<>::ColumnData( size_t index, RCAs... args )
134  : column_( index ) // The index of the column in the matrix
135 {
136  UNUSED_PARAMETER( args... );
137 }
139 //*************************************************************************************************
140 
141 
142 //*************************************************************************************************
148 inline size_t ColumnData<>::column() const noexcept
149 {
150  return column_;
151 }
153 //*************************************************************************************************
154 
155 
156 
157 
158 //=================================================================================================
159 //
160 // CLASS TEMPLATE SPECIALIZATION FOR ONE COMPILE TIME COLUMN INDEX
161 //
162 //=================================================================================================
163 
164 //*************************************************************************************************
172 template< size_t I > // Compile time column index
173 struct ColumnData<I>
174 {
175  public:
176  //**Constructors********************************************************************************
179  template< typename... RCAs >
180  explicit inline ColumnData( RCAs... args );
181  // No explicitly declared copy constructor.
183  //**********************************************************************************************
184 
185  //**Destructor**********************************************************************************
186  // No explicitly declared destructor.
187  //**********************************************************************************************
188 
189  //**Assignment operators************************************************************************
190  ColumnData& operator=( const ColumnData& ) = delete;
191  //**********************************************************************************************
192 
193  //**Utility functions***************************************************************************
196  static inline constexpr size_t column() noexcept;
198  //**********************************************************************************************
199 };
201 //*************************************************************************************************
202 
203 
204 //*************************************************************************************************
210 template< size_t I > // Compile time column index
211 template< typename... RCAs > // Optional column arguments
212 inline ColumnData<I>::ColumnData( RCAs... args )
213 {
214  UNUSED_PARAMETER( args... );
215 }
217 //*************************************************************************************************
218 
219 
220 //*************************************************************************************************
226 template< size_t I > // Compile time column index
227 inline constexpr size_t ColumnData<I>::column() noexcept
228 {
229  return I;
230 }
232 //*************************************************************************************************
233 
234 } // namespace blaze
235 
236 #endif
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:131
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
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81