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 
51 #include <blaze/util/Random.h>
52 
53 
54 namespace blaze {
55 
56 //=================================================================================================
57 //
58 // RAND SPECIALIZATION
59 //
60 //=================================================================================================
61 
62 //*************************************************************************************************
69 template< typename VT // Type of the dense vector
70  , bool AF // Alignment flag
71  , bool TF > // Transpose flag
72 class Rand< DenseSubvector<VT,AF,TF> >
73 {
74  public:
75  //**Randomize functions*************************************************************************
78  inline void randomize( DenseSubvector<VT,AF,TF>& subvector ) const;
79 
80  template< typename Arg >
81  inline void randomize( DenseSubvector<VT,AF,TF>& subvector, const Arg& min, const Arg& max ) const;
83  //**********************************************************************************************
84 };
86 //*************************************************************************************************
87 
88 
89 //*************************************************************************************************
96 template< typename VT // Type of the dense vector
97  , bool AF // Alignment flag
98  , bool TF > // Transpose flag
99 inline void Rand< DenseSubvector<VT,AF,TF> >::randomize( DenseSubvector<VT,AF,TF>& subvector ) const
100 {
101  using blaze::randomize;
102 
103  for( size_t i=0UL; i<subvector.size(); ++i ) {
104  randomize( subvector[i] );
105  }
106 }
108 //*************************************************************************************************
109 
110 
111 //*************************************************************************************************
120 template< typename VT // Type of the dense vector
121  , bool AF // Alignment flag
122  , bool TF > // Transpose flag
123 template< typename Arg > // Min/max argument type
124 inline void Rand< DenseSubvector<VT,AF,TF> >::randomize( DenseSubvector<VT,AF,TF>& subvector,
125  const Arg& min, const Arg& max ) const
126 {
127  using blaze::randomize;
128 
129  for( size_t i=0UL; i<subvector.size(); ++i ) {
130  randomize( subvector[i], min, max );
131  }
132 }
134 //*************************************************************************************************
135 
136 } // namespace blaze
137 
138 #endif
Header file for all restructuring submatrix functions.
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1649
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.
Header file for the dense vector SMP implementation.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
void randomize(T &value) const
Randomization of the given variable with a new value in the range .
Definition: Random.h:262
const MT::ElementType min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1602
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:140
Header file for the DenseSubvector class template.
Header file for the sparse vector SMP implementation.
Header file for the SparseSubmatrix class template.