All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DynamicVector.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_MATH_DYNAMICVECTOR_H_
23 #define _BLAZE_MATH_DYNAMICVECTOR_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
31 #include <blaze/math/DenseVector.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 vector
53  , bool TF > // Transpose flag
54 class Rand< DynamicVector<Type,TF> >
55 {
56  public:
57  //**Constructors********************************************************************************
60  explicit inline Rand( size_t n );
62  //**********************************************************************************************
63 
64  //**Conversion operators************************************************************************
67  inline operator DynamicVector<Type,TF>() const;
69  //**********************************************************************************************
70 
71  private:
72  //**Member variables****************************************************************************
75  DynamicVector<Type,TF> vector_;
76 
77  //**********************************************************************************************
78 };
80 //*************************************************************************************************
81 
82 
83 //*************************************************************************************************
89 template< typename Type // Data type of the vector
90  , bool TF > // Transpose flag
91 inline Rand< DynamicVector<Type,TF> >::Rand( size_t n )
92  : vector_( n ) // The random vector
93 {
94  for( size_t i=0UL; i<n; ++i ) {
95  vector_[i] = rand<Type>();
96  }
97 }
99 //*************************************************************************************************
100 
101 
102 //*************************************************************************************************
108 template< typename Type // Data type of the vector
109  , bool TF > // Transpose flag
110 inline Rand< DynamicVector<Type,TF> >::operator DynamicVector<Type,TF>() const
111 {
112  return vector_;
113 }
115 //*************************************************************************************************
116 
117 
118 
119 
120 //=================================================================================================
121 //
122 // TYPE DEFINITIONS
123 //
124 //=================================================================================================
125 
126 //*************************************************************************************************
131 //*************************************************************************************************
132 
133 
134 //*************************************************************************************************
139 //*************************************************************************************************
140 
141 
142 //*************************************************************************************************
147 //*************************************************************************************************
148 
149 } // namespace blaze
150 
151 #endif