InitializerList.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_INITIALIZERLIST_H_
36 #define _BLAZE_MATH_INITIALIZERLIST_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <initializer_list>
44 #include <blaze/math/Functions.h>
45 
46 
47 namespace blaze {
48 
49 //=================================================================================================
50 //
51 // TYPE DEFINITIONS
52 //
53 //=================================================================================================
54 
55 //*************************************************************************************************
60 using std::initializer_list;
61 //*************************************************************************************************
62 
63 
64 
65 
66 //=================================================================================================
67 //
68 // UTILITY FUNCTIONS
69 //
70 //=================================================================================================
71 
72 //*************************************************************************************************
79 template< typename Type >
80 inline size_t determineColumns( initializer_list< initializer_list<Type> > list ) noexcept
81 {
82  size_t cols( 0UL );
83  for( const auto& rowList : list )
84  cols = max( cols, rowList.size() );
85  return cols;
86 }
87 //*************************************************************************************************
88 
89 } // namespace blaze
90 
91 #endif
Header file for mathematical functions.
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1716
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
size_t determineColumns(initializer_list< initializer_list< Type > > list) noexcept
Determine the maximum number of columns specified by the given initializer list.
Definition: InitializerList.h:80
Initializer list type of the Blaze library.