DenseColumn.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_DENSECOLUMN_H_
36 #define _BLAZE_MATH_DENSECOLUMN_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< DenseColumn<MT,SO> >
70 {
71  public:
72  //**Randomize functions*************************************************************************
75  inline void randomize( DenseColumn<MT,SO>& column ) const;
76 
77  template< typename Arg >
78  inline void randomize( DenseColumn<MT,SO>& column, 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< DenseColumn<MT,SO> >::randomize( DenseColumn<MT,SO>& column ) const
96 {
97  using blaze::randomize;
98 
99  for( size_t i=0UL; i<column.size(); ++i ) {
100  randomize( column[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< DenseColumn<MT,SO> >::randomize( DenseColumn<MT,SO>& column,
120  const Arg& min, const Arg& max ) const
121 {
122  using blaze::randomize;
123 
124  for( size_t i=0UL; i<column.size(); ++i ) {
125  randomize( column[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:1649
void randomize(T &value)
Randomization of a given variable.
Definition: Random.h:1043
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename ColumnExprTrait< MT >::Type >::Type column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:103
Implementation of a random number generator.
Header file for the DenseColumn 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 all restructuring column functions.
Header file for the DenseRow class template.
Header file for the sparse vector SMP implementation.
Header file for all restructuring row functions.