35 #ifndef _BLAZE_MATH_DENSE_INITIALIZERMATRIX_H_ 36 #define _BLAZE_MATH_DENSE_INITIALIZERMATRIX_H_ 175 template<
typename Type >
177 :
public DenseMatrix< InitializerMatrix<Type>, false >
202 template<
typename NewType >
211 template<
size_t NewM
274 inline
size_t rows() const noexcept;
275 inline
size_t columns() const noexcept;
276 inline
size_t spacing() const noexcept;
277 inline
size_t capacity() const noexcept;
278 inline
size_t capacity(
size_t i ) const noexcept;
280 inline
size_t nonZeros(
size_t i ) const;
288 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
289 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
337 template< typename Type >
354 template<
typename Type >
370 template<
typename Type >
401 template<
typename Type >
410 if( j < list.size() )
411 return list.begin()[j];
429 template<
typename Type >
456 template<
typename Type >
460 return list_.begin()->begin();
473 template<
typename Type >
478 return list_.begin()[i].begin();
491 template<
typename Type >
509 template<
typename Type >
527 template<
typename Type >
545 template<
typename Type >
568 template<
typename Type >
581 template<
typename Type >
597 template<
typename Type >
610 template<
typename Type >
626 template<
typename Type >
641 template<
typename Type >
644 size_t nonzeros( 0 );
646 for(
const auto& rowList : list_ ) {
647 for(
size_t i=0UL; i<rowList.size(); ++i ) {
666 template<
typename Type >
673 return nonZeros( list_.begin()[i] );
684 template<
typename Type >
691 swap( list_, m.list_ );
714 template<
typename Type >
715 template<
typename Other >
718 return static_cast<const void*>(
this ) == static_cast<const void*>( alias );
733 template<
typename Type >
734 template<
typename Other >
737 return static_cast<const void*>(
this ) == static_cast<const void*>( alias );
753 template<
typename Type >
756 template<
typename Type >
779 template<
typename Type >
797 template<
typename Type >
815 template<
typename T >
816 struct HasConstDataAccess< InitializerMatrix<T> >
833 template<
typename T >
834 struct IsInitializer< InitializerMatrix<T> >
851 template<
typename T1,
typename T2 >
852 struct HighType< InitializerMatrix<T1>, InitializerMatrix<T2> >
854 using Type = InitializerMatrix< typename HighType<T1,T2>::Type >;
870 template<
typename T1,
typename T2 >
871 struct LowType< InitializerMatrix<T1>, InitializerMatrix<T2> >
873 using Type = InitializerMatrix< typename LowType<T1,T2>::Type >;
ConstReference at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: InitializerMatrix.h:431
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type,...
Definition: Const.h:79
#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
Header file for the IsInitializer type trait.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression,...
Definition: Assert.h:117
Header file for basic type definitions.
Implementation of an iterator for (extended) initializer lists.The InitializerIterator represents a g...
Definition: InitializerIterator.h:56
Dense matrix representation of an initializer list.The InitializerMatrix class template is a dense ma...
Definition: InitializerMatrix.h:176
static const Type zero_
Neutral element for accesses to zero elements.
Definition: InitializerMatrix.h:313
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: InitializerMatrix.h:193
const Type & Reference
Reference to a non-constant matrix value.
Definition: InitializerMatrix.h:190
Header file for the MAYBE_UNUSED function template.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type,...
Definition: Volatile.h:79
size_t m_
The current number of rows of the matrix.
Definition: InitializerMatrix.h:301
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
const Type * Pointer
Pointer to a non-constant matrix value.
Definition: InitializerMatrix.h:192
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: IntegralConstant.h:132
Header file for all forward declarations of the math module.
Header file for the extended initializer_list functionality.
Efficient implementation of a dynamic matrix.The DynamicMatrix class template is the representation ...
Definition: DynamicMatrix.h:221
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: InitializerMatrix.h:642
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes....
Definition: DenseMatrix.h:81
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: InitializerMatrix.h:230
Constraint on the data type.
Header file for the LowType type trait.
ConstIterator begin(size_t i) const noexcept
Returns an iterator to the first element of row i.
Definition: InitializerMatrix.h:493
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
ListType list_
The initializer list represented by the matrix.
Definition: InitializerMatrix.h:303
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: InitializerMatrix.h:569
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: InitializerMatrix.h:582
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
static constexpr bool simdEnabled
Compilation flag for SIMD optimization.
Definition: InitializerMatrix.h:224
Constraint on the data type.
size_t spacing() const noexcept
Returns the spacing between the beginning of two rows.
Definition: InitializerMatrix.h:598
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: InitializerMatrix.h:716
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Rebind mechanism to obtain a InitializerMatrix with different data/element type.
Definition: InitializerMatrix.h:203
ConstPointer data() const noexcept
Low-level data access to the matrix elements.
Definition: InitializerMatrix.h:458
Type ElementType
Type of the matrix elements.
Definition: InitializerMatrix.h:186
Header file for the exception macros of the math module.
ConstIterator cend(size_t i) const noexcept
Returns an iterator just past the last element of row i.
Definition: InitializerMatrix.h:547
ConstReference operator()(size_t i, size_t j) const noexcept
2D-access to the matrix elements.
Definition: InitializerMatrix.h:403
Header file for the HasConstDataAccess type trait.
Header file for run time assertion macros.
Constraint on the data type.
Resize mechanism to obtain a InitializerMatrix with different fixed dimensions.
Definition: InitializerMatrix.h:213
ConstIterator cbegin(size_t i) const noexcept
Returns an iterator to the first element of row i.
Definition: InitializerMatrix.h:511
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type,...
Definition: Reference.h:79
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:282
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
Constraint on the data type.
void swap(InitializerMatrix &m) noexcept
Swapping the contents of two matrices.
Definition: InitializerMatrix.h:685
void swap(InitializerMatrix< Type > &a, InitializerMatrix< Type > &b) noexcept
Swapping the contents of two initializer matrices.
Definition: InitializerMatrix.h:798
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
InitializerMatrix(initializer_list< initializer_list< Type > > list) noexcept
Constructor for InitializerMatrix.
Definition: InitializerMatrix.h:355
ConstIterator end(size_t i) const noexcept
Returns an iterator just past the last element of row i.
Definition: InitializerMatrix.h:529
size_t n_
The current number of columns of the matrix.
Definition: InitializerMatrix.h:302
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: InitializerMatrix.h:735
Initializer list type of the Blaze library.
Header file for the IntegralConstant class template.
Header file for the InitializerIterator class template.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
const Type & ConstReference
Reference to a constant matrix value.
Definition: InitializerMatrix.h:191
size_t capacity() const noexcept
Returns the maximum capacity of the matrix.
Definition: InitializerMatrix.h:611
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:108
const Type & ReturnType
Return type for expression template evaluations.
Definition: InitializerMatrix.h:187
Header file for the HighType type trait.