35 #ifndef _BLAZE_MATH_DENSE_INITIALIZERMATRIX_H_ 36 #define _BLAZE_MATH_DENSE_INITIALIZERMATRIX_H_ 181 template<
typename Type >
183 :
public DenseMatrix< InitializerMatrix<Type>, false >
208 template<
typename NewType >
217 template<
size_t NewM
230 enum :
bool { simdEnabled =
false };
236 enum :
bool { smpAssignable =
false };
276 inline size_t rows()
const noexcept;
277 inline size_t columns()
const noexcept;
278 inline size_t spacing()
const noexcept;
279 inline size_t capacity()
const noexcept;
280 inline size_t capacity(
size_t i )
const noexcept;
282 inline size_t nonZeros(
size_t i )
const;
290 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
291 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
339 template<
typename Type >
356 template<
typename Type >
372 template<
typename Type >
403 template<
typename Type >
412 if( j < list.size() )
413 return list.begin()[j];
431 template<
typename Type >
458 template<
typename Type >
462 return list_.begin()->begin();
475 template<
typename Type >
480 return list_.begin()[i].begin();
493 template<
typename Type >
511 template<
typename Type >
529 template<
typename Type >
547 template<
typename Type >
570 template<
typename Type >
583 template<
typename Type >
599 template<
typename Type >
612 template<
typename Type >
628 template<
typename Type >
643 template<
typename Type >
646 size_t nonzeros( 0 );
648 for(
const auto& rowList :
list_ ) {
649 for(
size_t i=0UL; i<rowList.size(); ++i ) {
668 template<
typename Type >
686 template<
typename Type >
716 template<
typename Type >
717 template<
typename Other >
720 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
735 template<
typename Type >
736 template<
typename Other >
739 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
755 template<
typename Type >
758 template<
typename Type >
781 template<
typename Type >
799 template<
typename Type >
817 template<
typename T >
835 template<
typename T >
853 template<
typename T1,
typename T2 >
854 struct HighType< InitializerMatrix<T1>, InitializerMatrix<T2> >
872 template<
typename T1,
typename T2 >
873 struct LowType< InitializerMatrix<T1>, InitializerMatrix<T2> >
891 template<
typename T,
size_t I,
size_t J,
size_t M,
size_t N >
897 template<
typename T >
916 template<
typename T,
size_t... CRAs >
917 struct RowTrait< InitializerMatrix<T>, CRAs... >
935 template<
typename T,
size_t... CRAs >
936 struct RowsTrait< InitializerMatrix<T>, CRAs... >
954 template<
typename T,
size_t... CCAs >
955 struct ColumnTrait< InitializerMatrix<T>, CCAs... >
973 template<
typename T,
size_t... CCAs >
992 template<
typename T,
ptrdiff_t... CBAs >
993 struct BandTrait< InitializerMatrix<T>, CBAs... >
ConstReference at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: InitializerMatrix.h:433
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
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
Pointer difference type of the Blaze library.
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
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, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the UNUSED_PARAMETER function template.
Header file for basic type definitions.
Implementation of an iterator for (extended) initializer lists.The InitializerIterator represents a g...
Definition: InitializerIterator.h:56
Header file for the row trait.
Base template for the SubmatrixTrait class.
Definition: SubmatrixTrait.h:109
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:108
Dense matrix representation of an initializer list.The InitializerMatrix class template is a dense ma...
Definition: InitializerMatrix.h:182
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
static const Type zero_
Neutral element for accesses to zero elements.
Definition: InitializerMatrix.h:315
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: InitializerMatrix.h:199
const Type & Reference
Reference to a non-constant matrix value.
Definition: InitializerMatrix.h:196
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
size_t m_
The current number of rows of the matrix.
Definition: InitializerMatrix.h:303
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:560
const Type * Pointer
Pointer to a non-constant matrix value.
Definition: InitializerMatrix.h:198
Efficient implementation of an arbitrary sized vector.The DynamicVector class template is the represe...
Definition: DynamicVector.h:185
Header file for the extended initializer_list functionality.
Efficient implementation of a dynamic matrix.The DynamicMatrix class template is the representation ...
Definition: DynamicMatrix.h:217
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: InitializerMatrix.h:644
Base template for the RowsTrait class.
Definition: RowsTrait.h:109
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
Header file for the band trait.
Constraint on the data type.
Base template for the RowTrait class.
Definition: RowTrait.h:109
InitializerIterator< Type > ConstIterator
Iterator over constant elements.
Definition: InitializerMatrix.h:202
Header file for the LowType type trait.
Base template for the HighType type trait.
Definition: HighType.h:133
ConstIterator begin(size_t i) const noexcept
Returns an iterator to the first element of row i.
Definition: InitializerMatrix.h:495
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5908
ListType list_
The initializer list represented by the matrix.
Definition: InitializerMatrix.h:305
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: InitializerMatrix.h:571
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: InitializerMatrix.h:584
Header file for all forward declarations of the math module.
#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
Efficient implementation of a fixed-sized matrix.The StaticMatrix class template is the representatio...
Definition: Forward.h:60
Header file for the DenseMatrix base class.
Constraint on the data type.
size_t spacing() const noexcept
Returns the spacing between the beginning of two rows.
Definition: InitializerMatrix.h:600
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: InitializerMatrix.h:718
Rebind mechanism to obtain a InitializerMatrix with different data/element type.
Definition: InitializerMatrix.h:209
ConstPointer data() const noexcept
Low-level data access to the matrix elements.
Definition: InitializerMatrix.h:460
Type ElementType
Type of the matrix elements.
Definition: InitializerMatrix.h:192
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:549
Compile time check for custom data types.This type trait tests whether the given data type represents...
Definition: IsInitializer.h:82
ConstReference operator()(size_t i, size_t j) const noexcept
2D-access to the matrix elements.
Definition: InitializerMatrix.h:405
Base template for the LowType type trait.
Definition: LowType.h:133
Header file for the HasConstDataAccess type trait.
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
Header file for run time assertion macros.
Header file for the submatrix trait.
Constraint on the data type.
Header file for the columns trait.
Resize mechanism to obtain a InitializerMatrix with different fixed dimensions.
Definition: InitializerMatrix.h:219
ConstIterator cbegin(size_t i) const noexcept
Returns an iterator to the first element of row i.
Definition: InitializerMatrix.h:513
#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, a compilation error is created.
Definition: Reference.h:79
Header file for the column trait.
Constraint on the data type.
void swap(InitializerMatrix &m) noexcept
Swapping the contents of two matrices.
Definition: InitializerMatrix.h:687
Header file for the rows trait.
InitializerMatrix(initializer_list< initializer_list< Type > > list) noexcept
Constructor for InitializerMatrix.
Definition: InitializerMatrix.h:357
ConstIterator end(size_t i) const noexcept
Returns an iterator just past the last element of row i.
Definition: InitializerMatrix.h:531
size_t n_
The current number of columns of the matrix.
Definition: InitializerMatrix.h:304
Base template for the ColumnsTrait class.
Definition: ColumnsTrait.h:109
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: InitializerMatrix.h:737
Initializer list type of the Blaze library.
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:254
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
const Type & ConstReference
Reference to a constant matrix value.
Definition: InitializerMatrix.h:197
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
size_t capacity() const noexcept
Returns the maximum capacity of the matrix.
Definition: InitializerMatrix.h:613
const Type & ReturnType
Return type for expression template evaluations.
Definition: InitializerMatrix.h:193
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.
Base template for the BandTrait class.
Definition: BandTrait.h:109