All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DenseSubvector.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_DENSESUBVECTOR_H_
36 #define _BLAZE_MATH_DENSESUBVECTOR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
49 #include <blaze/util/Random.h>
50 
51 
52 namespace blaze {
53 
54 //=================================================================================================
55 //
56 // RAND SPECIALIZATION
57 //
58 //=================================================================================================
59 
60 //*************************************************************************************************
67 template< typename VT // Type of the dense vector
68  , bool AF // Alignment flag
69  , bool TF > // Transpose flag
70 class Rand< DenseSubvector<VT,AF,TF> >
71 {
72  public:
73  //**Randomize functions*************************************************************************
76  inline void randomize( DenseSubvector<VT,AF,TF>& subvector ) const;
77 
78  template< typename Arg >
79  inline void randomize( DenseSubvector<VT,AF,TF>& subvector, const Arg& min, const Arg& max ) const;
81  //**********************************************************************************************
82 };
84 //*************************************************************************************************
85 
86 
87 //*************************************************************************************************
94 template< typename VT // Type of the dense vector
95  , bool AF // Alignment flag
96  , bool TF > // Transpose flag
97 inline void Rand< DenseSubvector<VT,AF,TF> >::randomize( DenseSubvector<VT,AF,TF>& subvector ) const
98 {
99  using blaze::randomize;
100 
101  for( size_t i=0UL; i<subvector.size(); ++i ) {
102  randomize( subvector[i] );
103  }
104 }
106 //*************************************************************************************************
107 
108 
109 //*************************************************************************************************
118 template< typename VT // Type of the dense vector
119  , bool AF // Alignment flag
120  , bool TF > // Transpose flag
121 template< typename Arg > // Min/max argument type
122 inline void Rand< DenseSubvector<VT,AF,TF> >::randomize( DenseSubvector<VT,AF,TF>& subvector,
123  const Arg& min, const Arg& max ) const
124 {
125  using blaze::randomize;
126 
127  for( size_t i=0UL; i<subvector.size(); ++i ) {
128  randomize( subvector[i], min, max );
129  }
130 }
132 //*************************************************************************************************
133 
134 } // namespace blaze
135 
136 #endif
Header file for all restructuring submatrix functions.
void randomize(T &value)
Randomization of a given variable.
Definition: Random.h:1043
Implementation of a random number generator.
Header file for all restructuring subvector functions.
Header file for the DenseSubmatrix class template.
void randomize(T &value) const
Randomization of the given variable with a new value in the range .
Definition: Random.h:262
Header file for the SparseSubvector class template.
SubvectorExprTrait< VT, unaligned >::Type subvector(Vector< VT, TF > &vector, size_t index, size_t size)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:133
Header file for the DenseSubvector class template.
Header file for the SparseSubmatrix class template.