35#ifndef _BLAZE_MATH_DENSE_INITIALIZERVECTOR_H_
36#define _BLAZE_MATH_DENSE_INITIALIZERVECTOR_H_
177template<
typename Type
181 :
public DenseVector< InitializerVector<Type,TF,Tag>, TF >
211 template<
typename NewType >
220 template<
size_t NewN >
281 inline
size_t size() const noexcept;
282 inline
size_t spacing() const noexcept;
283 inline
size_t capacity() const noexcept;
292 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
293 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
337template< typename Type
356template<
typename Type
360 :
size_( list.size() )
373template<
typename Type
380 if( n < list.size() ) {
404template<
typename Type
411 if( index < list_.size() )
412 return list_.begin()[index];
429template<
typename Type
435 if( index >= size_ ) {
438 return (*
this)[index];
450template<
typename Type
456 return list_.begin();
466template<
typename Type
482template<
typename Type
498template<
typename Type
514template<
typename Type
538template<
typename Type
556template<
typename Type
571template<
typename Type
590template<
typename Type
595 size_t nonzeros( 0 );
597 for(
size_t i=0UL; i<list_.size(); ++i ) {
598 if( !isDefault<strict>( list_.begin()[i] ) )
613template<
typename Type
620 swap( size_, v.size_ );
621 swap( list_, v.list_ );
644template<
typename Type
647template<
typename Other >
650 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
665template<
typename Type
668template<
typename Other >
671 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
687template<
typename Type,
bool TF,
typename Tag >
690template<
typename Type,
bool TF,
typename Tag >
714template<
typename Type
734template<
typename Type
754template<
typename T,
bool TF,
typename Tag >
755struct HasConstDataAccess< InitializerVector<T,TF,Tag> >
772template<
typename T,
bool TF,
typename Tag >
773struct IsInitializer< InitializerVector<T,TF,Tag> >
790template<
typename T1,
bool TF,
typename Tag,
typename T2 >
791struct HighType< InitializerVector<T1,TF,Tag>, InitializerVector<T2,TF,Tag> >
793 using Type = InitializerVector< typename HighType<T1,T2>::Type, TF, Tag >;
809template<
typename T1,
bool TF,
typename Tag,
typename T2 >
810struct LowType< InitializerVector<T1,TF,Tag>, InitializerVector<T2,TF,Tag> >
812 using Type = InitializerVector< typename LowType<T1,T2>::Type, TF, Tag >;
Header file for run time assertion macros.
Constraint on the data type.
Header file for the HasConstDataAccess type trait.
Header file for the HighType type trait.
Header file for the InitializerIterator class template.
Header file for the IntegralConstant class template.
Header file for the isDefault shim.
Header file for the IsInitializer type trait.
Header file for the LowType type trait.
Header file for the MAYBE_UNUSED function template.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Base class for N-dimensional dense vectors.
Definition: DenseVector.h:77
Efficient implementation of an arbitrary sized vector.
Definition: DynamicVector.h:223
Implementation of an iterator for (extended) initializer lists.
Definition: InitializerIterator.h:57
Dense vector representation of an initializer list.
Definition: InitializerVector.h:182
const Type & Reference
Reference to a non-constant vector value.
Definition: InitializerVector.h:199
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: InitializerVector.h:238
ConstIterator cbegin() const noexcept
Returns an iterator to the first element of the initializer vector.
Definition: InitializerVector.h:486
initializer_list< Type > ListType
Type of the represented initializer list.
Definition: InitializerVector.h:299
const Type & ReturnType
Return type for expression template evaluations.
Definition: InitializerVector.h:196
const Type & ConstReference
Reference to a constant vector value.
Definition: InitializerVector.h:200
size_t capacity() const noexcept
Returns the maximum capacity of the vector.
Definition: InitializerVector.h:574
Tag TagType
Tag type of this InitializerVector instance.
Definition: InitializerVector.h:195
InitializerVector(initializer_list< Type > list) noexcept
Constructor for InitializerVector.
Definition: InitializerVector.h:359
ConstReference operator[](size_t index) const noexcept
Subscript operator for the direct access to the vector elements.
Definition: InitializerVector.h:408
ConstIterator cend() const noexcept
Returns an iterator just past the last element of the initializer vector.
Definition: InitializerVector.h:518
const Type * Pointer
Pointer to a non-constant vector value.
Definition: InitializerVector.h:201
static const Type zero_
Neutral element for accesses to zero elements.
Definition: InitializerVector.h:313
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: InitializerVector.h:648
ConstReference at(size_t index) const
Checked access to the vector elements.
Definition: InitializerVector.h:433
size_t spacing() const noexcept
Returns the minimum capacity of the vector.
Definition: InitializerVector.h:559
const Type * ConstPointer
Pointer to a constant vector value.
Definition: InitializerVector.h:202
size_t nonZeros() const
Returns the number of non-zero elements in the vector.
Definition: InitializerVector.h:593
ConstPointer data() const noexcept
Low-level data access to the vector elements.
Definition: InitializerVector.h:454
Type ElementType
Type of the vector elements.
Definition: InitializerVector.h:194
void swap(InitializerVector &v) noexcept
Swapping the contents of two vectors.
Definition: InitializerVector.h:616
size_t size_
The current size/dimension of the vector.
Definition: InitializerVector.h:305
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: InitializerVector.h:669
static constexpr bool simdEnabled
Compilation flag for SIMD optimization.
Definition: InitializerVector.h:232
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: InitializerVector.h:541
ConstIterator begin() const noexcept
Returns an iterator to the first element of the initializer vector.
Definition: InitializerVector.h:470
ConstIterator end() const noexcept
Returns an iterator just past the last element of the initializer vector.
Definition: InitializerVector.h:502
ListType list_
The initializer list represented by the vector.
Definition: InitializerVector.h:306
Header file for the DenseVector base class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.
Definition: Volatile.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.
Definition: Pointer.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.
Definition: Const.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.
Definition: Reference.h:79
void swap(InitializerVector< Type, TF, Tag > &a, InitializerVector< Type, TF, Tag > &b) noexcept
Swapping the contents of two vectors.
Definition: InitializerVector.h:737
bool isIntact(const InitializerVector< Type, TF, Tag > &v) noexcept
Returns whether the invariants of the given initializer vector are intact.
Definition: InitializerVector.h:717
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition: Assert.h:117
BoolConstant< true > TrueType
Type traits base class.
Definition: IntegralConstant.h:132
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition: Exception.h:331
#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 all forward declarations of the math module.
Header file for the extended initializer_list functionality.
Rebind mechanism to obtain a InitializerVector with different data/element type.
Definition: InitializerVector.h:212
Resize mechanism to obtain a InitializerVector with a different fixed number of elements.
Definition: InitializerVector.h:221
Header file for basic type definitions.