All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DenseRow.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_DENSEROW_H_
36 #define _BLAZE_MATH_DENSEROW_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
48 #include <blaze/math/views/Row.h>
49 #include <blaze/util/Random.h>
50 
51 
52 namespace blaze {
53 
54 //=================================================================================================
55 //
56 // RAND SPECIALIZATION
57 //
58 //=================================================================================================
59 
60 //*************************************************************************************************
67 template< typename MT // Type of the dense matrix
68  , bool SO > // Storage order
69 class Rand< DenseRow<MT,SO> >
70 {
71  public:
72  //**Randomize functions*************************************************************************
75  inline void randomize( DenseRow<MT,SO>& row ) const;
76 
77  template< typename Arg >
78  inline void randomize( DenseRow<MT,SO>& row, const Arg& min, const Arg& max ) const;
80  //**********************************************************************************************
81 };
83 //*************************************************************************************************
84 
85 
86 //*************************************************************************************************
93 template< typename MT // Type of the dense matrix
94  , bool SO > // Storage order
95 inline void Rand< DenseRow<MT,SO> >::randomize( DenseRow<MT,SO>& row ) const
96 {
97  using blaze::randomize;
98 
99  for( size_t i=0UL; i<row.size(); ++i ) {
100  randomize( row[i] );
101  }
102 }
104 //*************************************************************************************************
105 
106 
107 //*************************************************************************************************
116 template< typename MT // Type of the dense matrix
117  , bool SO > // Storage order
118 template< typename Arg > // Min/max argument type
119 inline void Rand< DenseRow<MT,SO> >::randomize( DenseRow<MT,SO>& row,
120  const Arg& min, const Arg& max ) const
121 {
122  using blaze::randomize;
123 
124  for( size_t i=0UL; i<row.size(); ++i ) {
125  randomize( row[i], min, max );
126  }
127 }
129 //*************************************************************************************************
130 
131 } // namespace blaze
132 
133 #endif
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:994
void randomize(T &value)
Randomization of a given variable.
Definition: Random.h:1043
Implementation of a random number generator.
Header file for the DenseColumn class template.
Header file for the dense vector SMP implementation.
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:947
Header file for all restructuring column functions.
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename RowExprTrait< MT >::Type >::Type row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:103
Header file for the DenseRow class template.
Header file for the sparse vector SMP implementation.
Header file for all restructuring row functions.