35#ifndef _BLAZE_MATH_DENSE_INITIALIZERMATRIX_H_
36#define _BLAZE_MATH_DENSE_INITIALIZERMATRIX_H_
181template<
typename Type
184 :
public DenseMatrix< InitializerMatrix<Type,Tag>, false >
215 template<
typename NewType >
224 template<
size_t NewM
249 inline InitializerMatrix( initializer_list< initializer_list<Type> > list )
noexcept;
250 inline InitializerMatrix( initializer_list< initializer_list<Type> > list,
size_t n );
287 inline
size_t rows() const noexcept;
288 inline
size_t columns() const noexcept;
289 inline
size_t spacing() const noexcept;
290 inline
size_t capacity() const noexcept;
291 inline
size_t capacity(
size_t i ) const noexcept;
293 inline
size_t nonZeros(
size_t i ) const;
301 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
302 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
308 using
ListType = initializer_list< initializer_list<Type> >;
350template< typename Type
368template<
typename Type
385template<
typename Type
417template<
typename Type
425 const initializer_list<Type>& list( list_.begin()[i] );
427 if( j < list.size() )
428 return list.begin()[j];
446template<
typename Type
474template<
typename Type
479 return list_.begin()->begin();
492template<
typename Type
498 return list_.begin()[i].begin();
511template<
typename Type
530template<
typename Type
549template<
typename Type
568template<
typename Type
592template<
typename Type
606template<
typename Type
623template<
typename Type
637template<
typename Type
654template<
typename Type
674template<
typename Type
678 size_t nonzeros( 0 );
680 for(
const auto& rowList : list_ ) {
681 for(
size_t i=0UL; i<rowList.size(); ++i ) {
682 if( !isDefault<strict>( rowList.begin()[i] ) )
701template<
typename Type
709 return nonZeros( list_.begin()[i] );
720template<
typename Type
728 swap( list_, m.list_ );
751template<
typename Type
753template<
typename Other >
756 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
771template<
typename Type
773template<
typename Other >
776 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
792template<
typename Type,
typename Tag >
795template<
typename Type,
typename Tag >
818template<
typename Type
837template<
typename Type
856template<
typename T,
typename Tag >
857struct HasConstDataAccess< InitializerMatrix<T,Tag> >
874template<
typename T,
typename Tag >
875struct IsInitializer< InitializerMatrix<T,Tag> >
892template<
typename T1,
typename Tag,
typename T2 >
893struct HighType< InitializerMatrix<T1,Tag>, InitializerMatrix<T2,Tag> >
895 using Type = InitializerMatrix< typename HighType<T1,T2>::Type, Tag >;
911template<
typename T1,
typename Tag,
typename T2 >
912struct LowType< InitializerMatrix<T1,Tag>, InitializerMatrix<T2,Tag> >
914 using Type = InitializerMatrix< typename LowType<T1,T2>::Type, 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 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 dense matrices.
Definition: DenseMatrix.h:82
Efficient implementation of a dynamic matrix.
Definition: DynamicMatrix.h:242
Implementation of an iterator for (extended) initializer lists.
Definition: InitializerIterator.h:57
Dense matrix representation of an initializer list.
Definition: InitializerMatrix.h:185
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: InitializerMatrix.h:594
Type ElementType
Type of the matrix elements.
Definition: InitializerMatrix.h:198
ConstIterator cbegin(size_t i) const noexcept
Returns an iterator to the first element of row i.
Definition: InitializerMatrix.h:533
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: InitializerMatrix.h:243
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: InitializerMatrix.h:754
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: InitializerMatrix.h:676
ConstPointer data() const noexcept
Low-level data access to the matrix elements.
Definition: InitializerMatrix.h:477
ConstReference operator()(size_t i, size_t j) const noexcept
2D-access to the matrix elements.
Definition: InitializerMatrix.h:420
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: InitializerMatrix.h:206
const Type & Reference
Reference to a non-constant matrix value.
Definition: InitializerMatrix.h:203
size_t spacing() const noexcept
Returns the spacing between the beginning of two rows.
Definition: InitializerMatrix.h:625
ConstIterator end(size_t i) const noexcept
Returns an iterator just past the last element of row i.
Definition: InitializerMatrix.h:552
Tag TagType
Tag type of this InitializerVector instance.
Definition: InitializerMatrix.h:199
size_t m_
The current number of rows of the matrix.
Definition: InitializerMatrix.h:314
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: InitializerMatrix.h:774
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: InitializerMatrix.h:608
static constexpr bool simdEnabled
Compilation flag for SIMD optimization.
Definition: InitializerMatrix.h:237
void swap(InitializerMatrix &m) noexcept
Swapping the contents of two matrices.
Definition: InitializerMatrix.h:722
ConstIterator cend(size_t i) const noexcept
Returns an iterator just past the last element of row i.
Definition: InitializerMatrix.h:571
ConstReference at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: InitializerMatrix.h:449
InitializerMatrix(initializer_list< initializer_list< Type > > list) noexcept
Constructor for InitializerMatrix.
Definition: InitializerMatrix.h:370
const Type & ConstReference
Reference to a constant matrix value.
Definition: InitializerMatrix.h:204
static const Type zero_
Neutral element for accesses to zero elements.
Definition: InitializerMatrix.h:326
size_t capacity() const noexcept
Returns the maximum capacity of the matrix.
Definition: InitializerMatrix.h:639
size_t n_
The current number of columns of the matrix.
Definition: InitializerMatrix.h:315
ListType list_
The initializer list represented by the matrix.
Definition: InitializerMatrix.h:316
const Type * Pointer
Pointer to a non-constant matrix value.
Definition: InitializerMatrix.h:205
initializer_list< initializer_list< Type > > ListType
Type of the represented initializer list.
Definition: InitializerMatrix.h:308
const Type & ReturnType
Return type for expression template evaluations.
Definition: InitializerMatrix.h:200
ConstIterator begin(size_t i) const noexcept
Returns an iterator to the first element of row i.
Definition: InitializerMatrix.h:514
Header file for the DenseMatrix 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(InitializerMatrix< Type, Tag > &a, InitializerMatrix< Type, Tag > &b) noexcept
Swapping the contents of two initializer matrices.
Definition: InitializerMatrix.h:839
bool isIntact(const InitializerMatrix< Type, Tag > &m) noexcept
Returns whether the invariants of the given initializer matrix are intact.
Definition: InitializerMatrix.h:820
constexpr size_t determineColumns(initializer_list< initializer_list< Type > > list) noexcept
Determines the maximum number of columns specified by the given initializer list.
Definition: InitializerList.h:107
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:644
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:730
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:676
#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 InitializerMatrix with different data/element type.
Definition: InitializerMatrix.h:216
Resize mechanism to obtain a InitializerMatrix with different fixed dimensions.
Definition: InitializerMatrix.h:226
Header file for basic type definitions.