35#ifndef _BLAZE_MATH_ADAPTORS_DIAGONALMATRIX_DENSE_H_
36#define _BLAZE_MATH_ADAPTORS_DIAGONALMATRIX_DENSE_H_
113class DiagonalMatrix<MT,SO,true>
114 :
public DenseMatrix< DiagonalMatrix<MT,SO,true>, SO >
118 using OT = OppositeType_t<MT>;
119 using TT = TransposeType_t<MT>;
120 using ET = ElementType_t<MT>;
125 using This = DiagonalMatrix<MT,SO,true>;
126 using BaseType = DenseMatrix<This,SO>;
127 using ResultType = This;
128 using OppositeType = DiagonalMatrix<OT,!SO,true>;
129 using TransposeType = DiagonalMatrix<TT,!SO,true>;
130 using ElementType = ET;
131 using SIMDType = SIMDType_t<MT>;
132 using TagType = TagType_t<MT>;
133 using ReturnType = ReturnType_t<MT>;
134 using CompositeType =
const This&;
135 using Reference = DiagonalProxy<MT>;
136 using ConstReference = ConstReference_t<MT>;
137 using Pointer = Pointer_t<MT>;
138 using ConstPointer = ConstPointer_t<MT>;
139 using ConstIterator = ConstIterator_t<MT>;
145 template<
typename NewType >
148 using Other = DiagonalMatrix< typename MT::template Rebind<NewType>::Other >;
155 template<
size_t NewM
159 using Other = DiagonalMatrix< typename MT::template Resize<NewM,NewN>::Other >;
170 using IteratorCategory = std::random_access_iterator_tag;
171 using ValueType = ElementType_t<MT>;
172 using PointerType = DiagonalProxy<MT>;
173 using ReferenceType = DiagonalProxy<MT>;
177 using iterator_category = IteratorCategory;
178 using value_type = ValueType;
179 using pointer = PointerType;
180 using reference = ReferenceType;
181 using difference_type = DifferenceType;
187 inline Iterator() noexcept
201 inline Iterator( MT& matrix,
size_t row,
size_t column ) noexcept
214 inline Iterator&
operator+=(
size_t inc )
noexcept {
215 ( SO )?( row_ += inc ):( column_ += inc );
226 inline Iterator&
operator-=(
size_t dec )
noexcept {
227 ( SO )?( row_ -= dec ):( column_ -= dec );
237 inline Iterator& operator++() noexcept {
238 ( SO )?( ++row_ ):( ++column_ );
248 inline const Iterator operator++(
int )
noexcept {
249 const Iterator tmp( *
this );
260 inline Iterator& operator--() noexcept {
261 ( SO )?( --row_ ):( --column_ );
271 inline const Iterator operator--(
int )
noexcept {
272 const Iterator tmp( *
this );
284 return ReferenceType( *matrix_, row_, column_ );
293 inline PointerType operator->()
const {
294 return PointerType( *matrix_, row_, column_ );
308 inline SIMDType load()
const {
309 return (*matrix_).load(row_,column_);
323 inline SIMDType
loada()
const {
324 return (*matrix_).loada(row_,column_);
338 inline SIMDType
loadu()
const {
339 return (*matrix_).loadu(row_,column_);
348 inline operator ConstIterator()
const {
350 return matrix_->begin( column_ ) + row_;
352 return matrix_->begin( row_ ) + column_;
363 friend inline bool operator==(
const Iterator& lhs,
const Iterator& rhs )
noexcept {
364 return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
375 friend inline bool operator==(
const Iterator& lhs,
const ConstIterator& rhs ) {
376 return ( ConstIterator( lhs ) == rhs );
387 friend inline bool operator==(
const ConstIterator& lhs,
const Iterator& rhs ) {
388 return ( lhs == ConstIterator( rhs ) );
399 friend inline bool operator!=(
const Iterator& lhs,
const Iterator& rhs )
noexcept {
400 return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
411 friend inline bool operator!=(
const Iterator& lhs,
const ConstIterator& rhs ) {
412 return ( ConstIterator( lhs ) != rhs );
423 friend inline bool operator!=(
const ConstIterator& lhs,
const Iterator& rhs ) {
424 return ( lhs != ConstIterator( rhs ) );
435 friend inline bool operator<(
const Iterator& lhs,
const Iterator& rhs )
noexcept {
436 return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
447 friend inline bool operator<(
const Iterator& lhs,
const ConstIterator& rhs ) {
448 return ( ConstIterator( lhs ) < rhs );
459 friend inline bool operator<(
const ConstIterator& lhs,
const Iterator& rhs ) {
460 return ( lhs < ConstIterator( rhs ) );
471 friend inline bool operator>(
const Iterator& lhs,
const Iterator& rhs )
noexcept {
472 return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
483 friend inline bool operator>(
const Iterator& lhs,
const ConstIterator& rhs ) {
484 return ( ConstIterator( lhs ) > rhs );
495 friend inline bool operator>(
const ConstIterator& lhs,
const Iterator& rhs ) {
496 return ( lhs > ConstIterator( rhs ) );
507 friend inline bool operator<=(
const Iterator& lhs,
const Iterator& rhs )
noexcept {
508 return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
519 friend inline bool operator<=(
const Iterator& lhs,
const ConstIterator& rhs ) {
520 return ( ConstIterator( lhs ) <= rhs );
531 friend inline bool operator<=(
const ConstIterator& lhs,
const Iterator& rhs ) {
532 return ( lhs <= ConstIterator( rhs ) );
543 friend inline bool operator>=(
const Iterator& lhs,
const Iterator& rhs )
noexcept {
544 return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
555 friend inline bool operator>=(
const Iterator& lhs,
const ConstIterator& rhs ) {
556 return ( ConstIterator( lhs ) >= rhs );
567 friend inline bool operator>=(
const ConstIterator& lhs,
const Iterator& rhs ) {
568 return ( lhs >= ConstIterator( rhs ) );
578 inline DifferenceType
operator-(
const Iterator& rhs )
const noexcept {
579 return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
590 friend inline const Iterator
operator+(
const Iterator& it,
size_t inc )
noexcept {
592 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
594 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
605 friend inline const Iterator
operator+(
size_t inc,
const Iterator& it )
noexcept {
607 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
609 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
620 friend inline const Iterator
operator-(
const Iterator& it,
size_t dec )
noexcept {
622 return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
624 return Iterator( *it.matrix_, it.row_, it.column_ - dec );
639 static constexpr bool simdEnabled = MT::simdEnabled;
642 static constexpr bool smpAssignable = MT::smpAssignable;
648 inline DiagonalMatrix();
649 template<
typename A1 >
explicit inline DiagonalMatrix(
const A1& a1 );
650 inline DiagonalMatrix(
size_t n,
const ElementType& init );
654 template<
typename Other >
655 inline DiagonalMatrix(
size_t n,
const Other* array );
657 template<
typename Other,
size_t N >
658 inline DiagonalMatrix(
const Other (&array)[N][N] );
660 inline DiagonalMatrix( ElementType* ptr,
size_t n );
661 inline DiagonalMatrix( ElementType* ptr,
size_t n,
size_t nn );
663 inline DiagonalMatrix(
const DiagonalMatrix& m );
664 inline DiagonalMatrix( DiagonalMatrix&& m )
noexcept;
671 ~DiagonalMatrix() =
default;
678 inline Reference operator()(
size_t i,
size_t j );
679 inline ConstReference operator()(
size_t i,
size_t j )
const;
680 inline Reference at(
size_t i,
size_t j );
681 inline ConstReference at(
size_t i,
size_t j )
const;
682 inline ConstPointer
data () const noexcept;
683 inline ConstPointer
data (
size_t i ) const noexcept;
684 inline Iterator
begin (
size_t i );
685 inline ConstIterator
begin (
size_t i ) const;
686 inline ConstIterator
cbegin(
size_t i ) const;
687 inline Iterator
end (
size_t i );
688 inline ConstIterator
end (
size_t i ) const;
689 inline ConstIterator
cend (
size_t i ) const;
696 inline DiagonalMatrix& operator=( const ElementType& rhs );
699 template< typename Other,
size_t N >
700 inline DiagonalMatrix& operator=( const Other (&array)[N][N] );
702 inline DiagonalMatrix& operator=( const DiagonalMatrix& rhs );
703 inline DiagonalMatrix& operator=( DiagonalMatrix&& rhs ) noexcept;
705 template< typename MT2,
bool SO2 >
706 inline auto operator=( const Matrix<MT2,SO2>& rhs )
709 template< typename MT2,
bool SO2 >
710 inline auto operator=( const Matrix<MT2,SO2>& rhs )
713 template< typename MT2,
bool SO2 >
714 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
717 template< typename MT2,
bool SO2 >
718 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
721 template< typename MT2,
bool SO2 >
722 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
725 template< typename MT2,
bool SO2 >
726 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
729 template< typename MT2,
bool SO2 >
730 inline auto operator%=( const Matrix<MT2,SO2>& rhs ) -> DiagonalMatrix&;
732 template< typename ST >
735 template< typename ST >
743 inline
size_t rows() const noexcept;
744 inline
size_t columns() const noexcept;
745 inline
size_t spacing() const noexcept;
746 inline
size_t capacity() const noexcept;
747 inline
size_t capacity(
size_t i ) const noexcept;
749 inline
size_t nonZeros(
size_t i ) const;
751 inline
void reset(
size_t i );
753 void resize (
size_t n,
bool preserve=true );
754 inline
void extend (
size_t n,
bool preserve=true );
755 inline
void reserve(
size_t elements );
757 inline
void swap( DiagonalMatrix& m ) noexcept;
764 template< typename Other > inline DiagonalMatrix& scale( const Other& scalar );
771 inline
bool isIntact() const noexcept;
778 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
779 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
781 inline
bool isAligned () const noexcept;
782 inline
bool canSMPAssign() const noexcept;
794 inline const MT construct(
size_t n ,
TrueType );
795 inline const MT construct( const ElementType& value,
FalseType );
797 template< typename MT2,
bool SO2, typename T >
798 inline const MT construct( const Matrix<MT2,SO2>& m, T );
810 template< typename MT2,
bool SO2,
bool DF2 >
811 friend MT2& derestrict( DiagonalMatrix<MT2,SO2,DF2>& m );
850inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix()
880template<
typename A1 >
881inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix(
const A1& a1 )
882 : matrix_( construct( a1, IsResizable<MT>() ) )
900inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix(
size_t n,
const ElementType& init )
901 : matrix_( n, n, ElementType() )
905 for(
size_t i=0UL; i<n; ++i )
982template<
typename Other >
983inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix(
size_t n,
const Other* array )
984 : matrix_( n, n, array )
1019template<
typename MT
1021template<
typename Other
1023inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix(
const Other (&array)[N][N] )
1068template<
typename MT
1070inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix( ElementType* ptr,
size_t n )
1071 : matrix_( ptr, n, n )
1117template<
typename MT
1119inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix( ElementType* ptr,
size_t n,
size_t nn )
1120 : matrix_( ptr, n, n, nn )
1138template<
typename MT
1140inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix(
const DiagonalMatrix& m )
1141 : matrix_( m.matrix_ )
1156template<
typename MT
1158inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix( DiagonalMatrix&& m ) noexcept
1159 : matrix_( std::move( m.matrix_ ) )
1192template<
typename MT
1194inline typename DiagonalMatrix<MT,SO,true>::Reference
1195 DiagonalMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
1200 return Reference( matrix_, i, j );
1222template<
typename MT
1224inline typename DiagonalMatrix<MT,SO,true>::ConstReference
1225 DiagonalMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
const
1230 return matrix_(i,j);
1253template<
typename MT
1255inline typename DiagonalMatrix<MT,SO,true>::Reference
1256 DiagonalMatrix<MT,SO,true>::at(
size_t i,
size_t j )
1264 return (*
this)(i,j);
1287template<
typename MT
1289inline typename DiagonalMatrix<MT,SO,true>::ConstReference
1290 DiagonalMatrix<MT,SO,true>::at(
size_t i,
size_t j )
const
1298 return (*
this)(i,j);
1317template<
typename MT
1319inline typename DiagonalMatrix<MT,SO,true>::ConstPointer
1322 return matrix_.data();
1337template<
typename MT
1339inline typename DiagonalMatrix<MT,SO,true>::ConstPointer
1342 return matrix_.data(i);
1360template<
typename MT
1362inline typename DiagonalMatrix<MT,SO,true>::Iterator
1366 return Iterator( matrix_, 0UL, i );
1368 return Iterator( matrix_, i, 0UL );
1386template<
typename MT
1388inline typename DiagonalMatrix<MT,SO,true>::ConstIterator
1391 return matrix_.begin(i);
1409template<
typename MT
1411inline typename DiagonalMatrix<MT,SO,true>::ConstIterator
1414 return matrix_.cbegin(i);
1432template<
typename MT
1434inline typename DiagonalMatrix<MT,SO,true>::Iterator
1438 return Iterator( matrix_,
rows(), i );
1440 return Iterator( matrix_, i,
columns() );
1458template<
typename MT
1460inline typename DiagonalMatrix<MT,SO,true>::ConstIterator
1463 return matrix_.end(i);
1481template<
typename MT
1483inline typename DiagonalMatrix<MT,SO,true>::ConstIterator
1486 return matrix_.cend(i);
1507template<
typename MT
1509inline DiagonalMatrix<MT,SO,true>&
1510 DiagonalMatrix<MT,SO,true>::operator=(
const ElementType& rhs )
1512 for(
size_t i=0UL; i<
rows(); ++i )
1546template<
typename MT
1548inline DiagonalMatrix<MT,SO,true>&
1551 const InitializerMatrix<ElementType> tmp( list, list.size() );
1592template<
typename MT
1594template<
typename Other
1596inline DiagonalMatrix<MT,SO,true>&
1597 DiagonalMatrix<MT,SO,true>::operator=(
const Other (&array)[N][N] )
1605 matrix_ = std::move( tmp );
1626template<
typename MT
1628inline DiagonalMatrix<MT,SO,true>&
1629 DiagonalMatrix<MT,SO,true>::operator=(
const DiagonalMatrix& rhs )
1631 matrix_ = rhs.matrix_;
1649template<
typename MT
1651inline DiagonalMatrix<MT,SO,true>&
1652 DiagonalMatrix<MT,SO,true>::operator=( DiagonalMatrix&& rhs )
noexcept
1654 matrix_ = std::move( rhs.matrix_ );
1678template<
typename MT
1680template<
typename MT2
1682inline auto DiagonalMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1683 -> DisableIf_t< IsComputation_v<MT2>, DiagonalMatrix& >
1685 if( !IsDiagonal_v<MT2> && !
isDiagonal( *rhs ) ) {
1713template<
typename MT
1715template<
typename MT2
1717inline auto DiagonalMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1718 -> EnableIf_t< IsComputation_v<MT2>, DiagonalMatrix& >
1720 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1724 if( IsDiagonal_v<MT2> ) {
1734 matrix_ = std::move( tmp );
1759template<
typename MT
1761template<
typename MT2
1764 -> DisableIf_t< IsComputation_v<MT2>, DiagonalMatrix& >
1766 if( !IsDiagonal_v<MT2> && !
isDiagonal( *rhs ) ) {
1794template<
typename MT
1796template<
typename MT2
1799 -> EnableIf_t< IsComputation_v<MT2>, DiagonalMatrix& >
1801 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1805 if( IsDiagonal_v<MT2> ) {
1809 const ResultType_t<MT2> tmp( *rhs );
1840template<
typename MT
1842template<
typename MT2
1845 -> DisableIf_t< IsComputation_v<MT2>, DiagonalMatrix& >
1847 if( !IsDiagonal_v<MT2> && !
isDiagonal( *rhs ) ) {
1875template<
typename MT
1877template<
typename MT2
1880 -> EnableIf_t< IsComputation_v<MT2>, DiagonalMatrix& >
1882 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1886 if( IsDiagonal_v<MT2> ) {
1890 const ResultType_t<MT2> tmp( *rhs );
1919template<
typename MT
1921template<
typename MT2
1923inline auto DiagonalMatrix<MT,SO,true>::operator%=(
const Matrix<MT2,SO2>& rhs )
1926 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1949template<
typename MT
1951template<
typename ST >
1953 -> EnableIf_t< IsScalar_v<ST>, DiagonalMatrix& >
1971template<
typename MT
1973template<
typename ST >
1975 -> EnableIf_t< IsScalar_v<ST>, DiagonalMatrix& >
1999template<
typename MT
2003 return matrix_.rows();
2015template<
typename MT
2019 return matrix_.columns();
2036template<
typename MT
2040 return matrix_.spacing();
2052template<
typename MT
2056 return matrix_.capacity();
2074template<
typename MT
2078 return matrix_.capacity(i);
2090template<
typename MT
2094 return matrix_.nonZeros();
2112template<
typename MT
2116 return matrix_.nonZeros(i);
2128template<
typename MT
2134 for(
size_t i=0UL; i<
rows(); ++i )
2135 clear( matrix_(i,i) );
2154template<
typename MT
2160 clear( matrix_(i,i) );
2178template<
typename MT
2227template<
typename MT
2237 const size_t oldsize( matrix_.rows() );
2239 matrix_.resize( n, n,
true );
2242 const size_t increment( n - oldsize );
2243 submatrix( matrix_, 0UL, oldsize, n, increment ).reset();
2244 submatrix( matrix_, oldsize, 0UL, increment, increment ).reset();
2264template<
typename MT
2266inline void DiagonalMatrix<MT,SO,true>::extend(
size_t n,
bool preserve )
2288template<
typename MT
2290inline void DiagonalMatrix<MT,SO,true>::reserve(
size_t elements )
2308template<
typename MT
2312 matrix_.shrinkToFit();
2325template<
typename MT
2331 swap( matrix_, m.matrix_ );
2363template<
typename MT
2365template<
typename Other >
2366inline DiagonalMatrix<MT,SO,true>& DiagonalMatrix<MT,SO,true>::scale(
const Other& scalar )
2368 matrix_.scale( scalar );
2393template<
typename MT
2424template<
typename MT
2426template<
typename Other >
2427inline bool DiagonalMatrix<MT,SO,true>::canAlias(
const Other* alias )
const noexcept
2429 return matrix_.canAlias( alias );
2446template<
typename MT
2448template<
typename Other >
2449inline bool DiagonalMatrix<MT,SO,true>::isAliased(
const Other* alias )
const noexcept
2451 return matrix_.isAliased( alias );
2467template<
typename MT
2469inline bool DiagonalMatrix<MT,SO,true>::isAligned() const noexcept
2471 return matrix_.isAligned();
2488template<
typename MT
2490inline bool DiagonalMatrix<MT,SO,true>::canSMPAssign() const noexcept
2492 return matrix_.canSMPAssign();
2514template<
typename MT
2517 DiagonalMatrix<MT,SO,true>::load(
size_t i,
size_t j )
const noexcept
2519 return matrix_.load( i, j );
2541template<
typename MT
2546 return matrix_.loada( i, j );
2568template<
typename MT
2573 return matrix_.loadu( i, j );
2594template<
typename MT
2596inline const MT DiagonalMatrix<MT,SO,true>::construct(
size_t n,
TrueType )
2600 return MT( n, n, ElementType() );
2613template<
typename MT
2615inline const MT DiagonalMatrix<MT,SO,true>::construct(
const ElementType& init,
FalseType )
2622 for(
size_t i=0UL; i<tmp.rows(); ++i )
2642template<
typename MT
2644template<
typename MT2
2647inline const MT DiagonalMatrix<MT,SO,true>::construct(
const Matrix<MT2,SO2>& m, T )
2651 if( !IsDiagonal_v<MT2> && !
isDiagonal( tmp ) ) {
Header file for auxiliary alias declarations.
Header file for run time assertion macros.
Constraint on the data type.
constexpr const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:751
constexpr const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:719
Header file for the DiagonalProxy class.
Header file for the EnableIf class template.
Constraint on the data type.
Header file for the If class template.
Header file for the IntegralConstant class template.
Header file for the IsBuiltin type trait.
Header file for the IsComplex type trait.
Header file for the IsComputation type trait class.
Header file for the isDefault shim.
Header file for the IsDiagonal type trait.
Header file for the IsFloatingPoint type trait.
Header file for the IsInvertible type trait.
Header file for the IsResizable type trait.
Header file for the IsScalar type trait.
Header file for the IsSquare type trait.
Constraint on the data type.
Header file for the MAYBE_UNUSED function template.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the UnderlyingBuiltin type trait.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of the base template of the DiagonalMatrix.
Initializer list type of the Blaze library.
Pointer difference type of the Blaze library.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for utility functions for dense matrices.
Header file for the implementation of a matrix representation of an initializer list.
Header file for the DenseMatrix base class.
decltype(auto) diagonal(Matrix< MT, SO > &matrix, RDAs... args)
Creating a view on the diagonal of the given matrix.
Definition: Band.h:380
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:137
#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
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( ).
Definition: DenseMatrix.h:574
decltype(auto) decldiag(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as diagonal.
Definition: DMatDeclDiagExpr.h:978
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:182
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:386
auto operator*=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:510
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:265
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:9640
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:448
bool isDiagonal(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is diagonal.
Definition: DenseMatrix.h:2456
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:207
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:225
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:143
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VIEW_TYPE(T)
Constraint on the data type.
Definition: View.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Hermitian.h:79
#define BLAZE_CONSTRAINT_MUST_BE_SQUARE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Square.h:60
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Upper.h:81
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: DenseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE_TYPE(T)
Constraint on the data type.
Definition: Resizable.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(T)
Constraint on the data type.
Definition: Resizable.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSFORMATION_TYPE(T)
Constraint on the data type.
Definition: Transformation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.
Definition: StorageOrder.h:63
constexpr bool IsScalar_v
Auxiliary variable template for the IsScalar type trait.
Definition: IsScalar.h:104
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.
Definition: Size.h:176
constexpr bool IsComputation_v
Auxiliary variable template for the IsComputation type trait.
Definition: IsComputation.h:90
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:370
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:253
constexpr bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:332
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:446
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
constexpr bool operator<=(const NegativeAccuracy< A > &, const T &rhs)
Less-or-equal-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:408
constexpr void clear(Matrix< MT, SO > &matrix)
Clearing the given matrix.
Definition: Matrix.h:960
MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:628
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
MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:562
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:692
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition: Matrix.h:806
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:660
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:1108
MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:584
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:518
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:1169
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:1383
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:137
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition: Assert.h:117
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition: StaticAssert.h:112
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:181
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
BoolConstant< true > TrueType
Type traits base class.
Definition: IntegralConstant.h:132
BoolConstant< false > FalseType
Type/value traits base class.
Definition: IntegralConstant.h:121
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
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
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:175
Header file for the exception macros of the math module.
Header file for the extended initializer_list functionality.
Constraints on the storage order of matrix types.
Header file for the Size type trait.
Header file for the clear shim.
Header file for the isZero shim.
System settings for the inline keywords.
Header file for basic type definitions.
Header file for the implementation of the Band view.
Header file for the implementation of the Submatrix view.