Blaze 3.9
Loading...
Searching...
No Matches
StaticVector.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_STATICVECTOR_H_
36#define _BLAZE_MATH_STATICVECTOR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
48#include <blaze/util/Random.h>
49
50
51namespace blaze {
52
53//=================================================================================================
54//
55// RAND SPECIALIZATION
56//
57//=================================================================================================
58
59//*************************************************************************************************
66template< typename Type // Data type of the vector
67 , size_t N // Number of elements
68 , bool TF // Transpose flag
69 , AlignmentFlag AF // Alignment flag
70 , PaddingFlag PF // Padding flag
71 , typename Tag > // Type tag
72class Rand< StaticVector<Type,N,TF,AF,PF,Tag> >
73{
74 public:
75 //**********************************************************************************************
80 inline const StaticVector<Type,N,TF,AF,PF,Tag> generate() const
81 {
82 StaticVector<Type,N,TF,AF,PF,Tag> vector;
83 randomize( vector );
84 return vector;
85 }
86 //**********************************************************************************************
87
88 //**********************************************************************************************
95 template< typename Arg > // Min/max argument type
96 inline const StaticVector<Type,N,TF,AF,PF,Tag> generate( const Arg& min, const Arg& max ) const
97 {
98 StaticVector<Type,N,TF,AF,PF,Tag> vector;
99 randomize( vector, min, max );
100 return vector;
101 }
102 //**********************************************************************************************
103
104 //**********************************************************************************************
110 inline void randomize( StaticVector<Type,N,TF,AF,PF,Tag>& vector ) const
111 {
112 using blaze::randomize;
113
114 for( size_t i=0UL; i<N; ++i ) {
115 randomize( vector[i] );
116 }
117 }
118 //**********************************************************************************************
119
120 //**********************************************************************************************
128 template< typename Arg > // Min/max argument type
129 inline void randomize( StaticVector<Type,N,TF,AF,PF,Tag>& vector,
130 const Arg& min, const Arg& max ) const
131 {
132 using blaze::randomize;
133
134 for( size_t i=0UL; i<N; ++i ) {
135 randomize( vector[i], min, max );
136 }
137 }
138 //**********************************************************************************************
139};
141//*************************************************************************************************
142
143} // namespace blaze
144
145#endif
Header file for all basic DenseVector functionality.
Header file for the complete DynamicVector implementation.
Header file for the complete StaticMatrix implementation.
Header file for the complete ZeroVector implementation.
Default implementation of the Rand class.
Definition Random.h:230
Efficient implementation of a fixed-sized vector.
Definition StaticVector.h:230
Header file for the implementation of a fixed-size vector.
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition DMatDMatMapExpr.h:1339
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition DMatDMatMapExpr.h:1375
decltype(auto) generate(size_t m, size_t n, OP op)
Generates a new dense matrix filled via the given custom binary operation.
Definition DMatGenExpr.h:675
PaddingFlag
Padding flag for (un-)padded vectors and matrices.
Definition PaddingFlag.h:77
AlignmentFlag
Alignment flag for (un-)aligned vectors and matrices.
Definition AlignmentFlag.h:63
void randomize(T &&value)
Randomization of a given variable.
Definition Random.h:626
Implementation of a random number generator.