All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DynamicMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_MATH_DYNAMICMATRIX_H_
23 #define _BLAZE_MATH_DYNAMICMATRIX_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
31 #include <blaze/math/DenseMatrix.h>
33 #include <blaze/system/Precision.h>
34 #include <blaze/util/Random.h>
35 
36 
37 namespace blaze {
38 
39 //=================================================================================================
40 //
41 // RAND SPECIALIZATION
42 //
43 //=================================================================================================
44 
45 //*************************************************************************************************
52 template< typename Type // Data type of the matrix
53  , bool SO > // Storage order
54 class Rand< DynamicMatrix<Type,SO> >
55 {
56  public:
57  //**Constructors********************************************************************************
60  explicit inline Rand( size_t m, size_t n );
62  //**********************************************************************************************
63 
64  //**Conversion operators************************************************************************
67  inline operator DynamicMatrix<Type,SO>() const;
69  //**********************************************************************************************
70 
71  private:
72  //**Member variables****************************************************************************
75  DynamicMatrix<Type,SO> matrix_;
76 
77  //**********************************************************************************************
78 };
80 //*************************************************************************************************
81 
82 
83 //*************************************************************************************************
90 template< typename Type // Data type of the matrix
91  , bool SO > // Storage order
92 inline Rand< DynamicMatrix<Type,SO> >::Rand( size_t m, size_t n )
93  : matrix_( m, n ) // The random matrix
94 {
95  for( size_t i=0UL; i<m; ++i ) {
96  for( size_t j=0UL; j<n; ++j ) {
97  matrix_(i,j) = rand<Type>();
98  }
99  }
100 }
102 //*************************************************************************************************
103 
104 
105 //*************************************************************************************************
111 template< typename Type // Data type of the matrix
112  , bool SO > // Storage order
113 inline Rand< DynamicMatrix<Type,SO> >::operator DynamicMatrix<Type,SO>() const
114 {
115  return matrix_;
116 }
118 //*************************************************************************************************
119 
120 
121 
122 
123 //=================================================================================================
124 //
125 // TYPE DEFINITIONS
126 //
127 //=================================================================================================
128 
129 //*************************************************************************************************
134 //*************************************************************************************************
135 
136 
137 //*************************************************************************************************
142 //*************************************************************************************************
143 
144 
145 //*************************************************************************************************
150 //*************************************************************************************************
151 
152 } // namespace blaze
153 
154 #endif