35#ifndef _BLAZE_MATH_ROWS_H_
36#define _BLAZE_MATH_ROWS_H_
75class Rand< Rows<MT,SO,true,SF,CRAs...> >
84 template<
typename RT >
95 for(
size_t i=0UL; i<
rows.rows(); ++i ) {
96 for(
size_t j=0UL; j<
rows.columns(); ++j ) {
102 for(
size_t j=0UL; j<
rows.columns(); ++j ) {
103 for(
size_t i=0UL; i<
rows.rows(); ++i ) {
119 template<
typename RT
131 for(
size_t i=0UL; i<
rows.rows(); ++i ) {
132 for(
size_t j=0UL; j<
rows.columns(); ++j ) {
138 for(
size_t j=0UL; j<
rows.columns(); ++j ) {
139 for(
size_t i=0UL; i<
rows.rows(); ++i ) {
170class Rand< Rows<MT,SO,false,SF,CRAs...> >
179 template<
typename RT >
183 using ElementType = ElementType_t<RowsType>;
188 const size_t m(
rows.rows() );
189 const size_t n(
rows.columns() );
191 if( m == 0UL || n == 0UL )
return;
193 const size_t nonzeros(
rand<size_t>( 1UL, std::ceil( 0.5*m*n ) ) );
196 rows.reserve( nonzeros );
198 while(
rows.nonZeros() < nonzeros ) {
212 template<
typename RT >
216 using ElementType = ElementType_t<RowsType>;
221 const size_t m(
rows.rows() );
222 const size_t n(
rows.columns() );
224 if( nonzeros > m*n ) {
228 if( m == 0UL || n == 0UL )
return;
231 rows.reserve( nonzeros );
233 while(
rows.nonZeros() < nonzeros ) {
247 template<
typename RT
252 using ElementType = ElementType_t<RowsType>;
257 const size_t m(
rows.rows() );
258 const size_t n(
rows.columns() );
260 if( m == 0UL || n == 0UL )
return;
262 const size_t nonzeros(
rand<size_t>( 1UL, std::ceil( 0.5*m*n ) ) );
265 rows.reserve( nonzeros );
267 while(
rows.nonZeros() < nonzeros ) {
283 template<
typename RT
288 using ElementType = ElementType_t<RowsType>;
293 const size_t m(
rows.rows() );
294 const size_t n(
rows.columns() );
296 if( nonzeros > m*n ) {
300 if( m == 0UL || n == 0UL )
return;
303 rows.reserve( nonzeros );
305 while(
rows.nonZeros() < nonzeros ) {
Header file for auxiliary alias declarations.
Header file for the RemoveReference type trait.
Default implementation of the Rand class.
Definition Random.h:230
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
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
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition DenseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition SparseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_ROWS_TYPE(T)
Constraint on the data type.
Definition Rows.h:61
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition Matrix.h:644
T rand()
Random number function.
Definition Random.h:583
void randomize(T &&value)
Randomization of a given variable.
Definition Random.h:626
typename RemoveReference< T >::Type RemoveReference_t
Auxiliary alias declaration for the RemoveReference type trait.
Definition RemoveReference.h:95
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition Exception.h:235
Header file for the exception macros of the math module.
Header file for the dense matrix SMP implementation.
Header file for the sparse matrix SMP implementation.
Implementation of a random number generator.
Header file for the implementation of the Columns view.
Header file for the implementation of the Rows view.