35 #ifndef _BLAZE_UTIL_INDICES_H_ 36 #define _BLAZE_UTIL_INDICES_H_ 82 inline size_t size ()
const;
127 const size_t maxNumber(
max + 1UL -
min );
129 if( number > maxNumber ) {
133 if( number == 0UL ) {
137 if( number <=
size_t( maxNumber * 0.5 ) )
143 const size_t value = rand<size_t>(
min,
max);
145 const auto pos = std::lower_bound(
indices_.begin(),
indices_.end(), value );
147 if( pos ==
indices_.end() || *pos != value ) {
159 const size_t value = rand<size_t>(
min,
max);
161 const auto pos = std::lower_bound(
indices_.begin(),
indices_.end(), value );
163 if( pos !=
indices_.end() && *pos == value ) {
ConstIterator end() const
Returns an iterator just past the last element of the vector.
Definition: Indices.h:209
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Auxiliary class for the generation of random indices.
Definition: Indices.h:65
Header file for basic type definitions.
Header file for exception macros.
Indices(size_t min, size_t max, size_t number)
The constructor for the Indices class.
Definition: Indices.h:120
Implementation of a random number generator.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
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:1162
std::vector< size_t > indices_
The generated indices.
Definition: Indices.h:92
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:1198
std::vector< size_t >::const_iterator ConstIterator
Iterator over the generated indices.
Definition: Indices.h:69
ConstIterator begin() const
Returns an iterator to the beginning of the vector.
Definition: Indices.h:197
size_t size() const
Returns the total number of random indices.
Definition: Indices.h:185
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101