35 #ifndef _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_DENSE_H_ 36 #define _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_DENSE_H_ 111 template<
typename MT
113 class HermitianMatrix<MT,SO,true>
114 :
public DenseMatrix< HermitianMatrix<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 = HermitianMatrix<MT,SO,true>;
126 using BaseType = DenseMatrix<This,SO>;
131 using SIMDType = SIMDType_t<MT>;
136 using Pointer = Pointer_t<MT>;
137 using ConstPointer = ConstPointer_t<MT>;
144 template<
typename NewType >
147 using Other = HermitianMatrix< typename MT::template Rebind<NewType>::Other >;
154 template<
size_t NewM
158 using Other = HermitianMatrix< typename MT::template Resize<NewM,NewN>::Other >;
169 using IteratorCategory = std::random_access_iterator_tag;
170 using ValueType = ElementType_t<MT>;
171 using PointerType = HermitianProxy<MT>;
172 using ReferenceType = HermitianProxy<MT>;
173 using DifferenceType = ptrdiff_t;
176 using iterator_category = IteratorCategory;
177 using value_type = ValueType;
178 using pointer = PointerType;
179 using reference = ReferenceType;
180 using difference_type = DifferenceType;
214 ( SO )?( row_ += inc ):( column_ += inc );
226 ( SO )?( row_ -= dec ):( column_ -= dec );
236 inline Iterator& operator++() noexcept {
237 ( SO )?( ++row_ ):( ++column_ );
247 inline const Iterator operator++(
int ) noexcept {
259 inline Iterator& operator--() noexcept {
260 ( SO )?( --row_ ):( --column_ );
270 inline const Iterator operator--(
int ) noexcept {
283 return ReferenceType( *matrix_, row_, column_ );
292 inline PointerType operator->()
const {
293 return PointerType( *matrix_, row_, column_ );
307 inline SIMDType load()
const {
308 return (*matrix_).load(row_,column_);
322 inline SIMDType
loada()
const {
323 return (*matrix_).loada(row_,column_);
337 inline SIMDType
loadu()
const {
338 return (*matrix_).loadu(row_,column_);
353 inline void store(
const SIMDType& value )
const {
354 (*matrix_).store( row_, column_, value );
370 inline void storea(
const SIMDType& value )
const {
371 (*matrix_).storea( row_, column_, value );
387 inline void storeu(
const SIMDType& value )
const {
388 (*matrix_).storeu( row_, column_, value );
404 inline void stream(
const SIMDType& value )
const {
405 (*matrix_).stream( row_, column_, value );
417 return matrix_->begin( column_ ) + row_;
419 return matrix_->begin( row_ ) + column_;
431 return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
467 return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
503 return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
539 return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
575 return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
611 return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
646 return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
659 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
661 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
674 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
676 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
689 return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
691 return Iterator( *it.matrix_, it.row_, it.column_ - dec );
703 const size_t kend(
min( row_+SIMDSIZE, (*matrix_).rows() ) );
704 for(
size_t k=row_; k<kend; ++k )
705 (*matrix_)(column_,k) =
conj( (*matrix_)(k,column_) );
708 const size_t kend(
min( column_+SIMDSIZE, (*matrix_).columns() ) );
709 for(
size_t k=column_; k<kend; ++k )
710 (*matrix_)(k,row_) =
conj( (*matrix_)(row_,k) );
725 static constexpr
bool simdEnabled = MT::simdEnabled;
734 explicit inline HermitianMatrix();
735 explicit inline HermitianMatrix(
size_t n );
736 explicit inline HermitianMatrix( initializer_list< initializer_list<ElementType> > list );
738 template<
typename Other >
739 explicit inline HermitianMatrix(
size_t n,
const Other* array );
741 template<
typename Other,
size_t N >
742 explicit inline HermitianMatrix(
const Other (&array)[N][N] );
744 explicit inline HermitianMatrix(
ElementType* ptr,
size_t n );
745 explicit inline HermitianMatrix(
ElementType* ptr,
size_t n,
size_t nn );
747 inline HermitianMatrix(
const HermitianMatrix& m );
748 inline HermitianMatrix( HermitianMatrix&& m ) noexcept;
750 template<
typename MT2,
bool SO2 >
751 inline HermitianMatrix(
const Matrix<MT2,SO2>& m );
758 ~HermitianMatrix() =
default;
765 inline Reference operator()(
size_t i,
size_t j );
767 inline Reference at(
size_t i,
size_t j );
769 inline ConstPointer
data () const noexcept;
770 inline ConstPointer
data (
size_t i ) const noexcept;
783 inline HermitianMatrix& operator=( initializer_list< initializer_list<
ElementType> > list );
785 template< typename Other,
size_t N >
786 inline HermitianMatrix& operator=( const Other (&array)[N][N] );
788 inline HermitianMatrix& operator=( const HermitianMatrix& rhs );
789 inline HermitianMatrix& operator=( HermitianMatrix&& rhs ) noexcept;
791 template< typename MT2,
bool SO2 >
792 inline auto operator=( const Matrix<MT2,SO2>& rhs )
795 template< typename MT2,
bool SO2 >
796 inline auto operator=( const Matrix<MT2,SO2>& rhs )
799 template< typename MT2 >
800 inline auto operator=( const Matrix<MT2,!SO>& rhs )
803 template< typename MT2,
bool SO2 >
804 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
807 template< typename MT2,
bool SO2 >
808 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
811 template< typename MT2 >
812 inline auto operator+=( const Matrix<MT2,!SO>& rhs )
815 template< typename MT2,
bool SO2 >
816 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
819 template< typename MT2,
bool SO2 >
820 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
823 template< typename MT2 >
824 inline auto operator-=( const Matrix<MT2,!SO>& rhs )
827 template< typename MT2,
bool SO2 >
828 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
831 template< typename MT2,
bool SO2 >
832 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
835 template< typename MT2 >
836 inline auto operator%=( const Matrix<MT2,!SO>& rhs )
839 template< typename ST >
842 template< typename ST >
850 inline
size_t rows() const noexcept;
851 inline
size_t columns() const noexcept;
852 inline
size_t spacing() const noexcept;
853 inline
size_t capacity() const noexcept;
854 inline
size_t capacity(
size_t i ) const noexcept;
856 inline
size_t nonZeros(
size_t i ) const;
858 inline
void reset(
size_t i );
860 void resize (
size_t n,
bool preserve=true );
861 inline
void extend (
size_t n,
bool preserve=true );
862 inline
void reserve(
size_t elements );
864 inline
void swap( HermitianMatrix& m ) noexcept;
874 template< typename Other > inline HermitianMatrix& scale( const Other& scalar );
881 inline
bool isIntact() const noexcept;
888 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
889 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
891 inline
bool isAligned () const noexcept;
892 inline
bool canSMPAssign() const noexcept;
898 inline
void store (
size_t i,
size_t j, const SIMDType& value ) noexcept;
899 inline
void storea(
size_t i,
size_t j, const SIMDType& value ) noexcept;
900 inline
void storeu(
size_t i,
size_t j, const SIMDType& value ) noexcept;
901 inline
void stream(
size_t i,
size_t j, const SIMDType& value ) noexcept;
909 template< typename MT2,
bool SO2, typename T >
910 inline decltype(auto) construct( const Matrix<MT2,SO2>& m, T );
912 template< typename MT2 >
913 inline decltype(auto) construct( const Matrix<MT2,!SO>& m,
TrueType );
919 static constexpr
size_t SIMDSIZE = SIMDTrait<ET>::
size;
930 template<
bool RF, typename MT2,
bool SO2,
bool DF2 >
931 friend
bool isDefault( const HermitianMatrix<MT2,SO2,DF2>& m );
935 friend
void invert( HermitianMatrix<MT2,SO2,true>& m );
971 template< typename MT
973 inline HermitianMatrix<MT,SO,true>::HermitianMatrix()
989 template<
typename MT
991 inline HermitianMatrix<MT,SO,true>::HermitianMatrix(
size_t n )
1030 template<
typename MT
1032 inline HermitianMatrix<MT,SO,true>::HermitianMatrix( initializer_list< initializer_list<ElementType> > list )
1074 template<
typename MT
1076 template<
typename Other >
1077 inline HermitianMatrix<MT,SO,true>::HermitianMatrix(
size_t n,
const Other* array )
1078 : matrix_( n, n, array )
1115 template<
typename MT
1117 template<
typename Other
1119 inline HermitianMatrix<MT,SO,true>::HermitianMatrix(
const Other (&array)[N][N] )
1166 template<
typename MT
1168 inline HermitianMatrix<MT,SO,true>::HermitianMatrix(
ElementType* ptr,
size_t n )
1169 : matrix_( ptr, n, n )
1217 template<
typename MT
1219 inline HermitianMatrix<MT,SO,true>::HermitianMatrix(
ElementType* ptr,
size_t n,
size_t nn )
1220 : matrix_( ptr, n, n, nn )
1238 template<
typename MT
1240 inline HermitianMatrix<MT,SO,true>::HermitianMatrix(
const HermitianMatrix& m )
1241 : matrix_( m.matrix_ )
1256 template<
typename MT
1258 inline HermitianMatrix<MT,SO,true>::HermitianMatrix( HermitianMatrix&& m ) noexcept
1259 : matrix_( std::move( m.matrix_ ) )
1278 template<
typename MT
1280 template<
typename MT2
1282 inline HermitianMatrix<MT,SO,true>::HermitianMatrix(
const Matrix<MT2,SO2>& m )
1283 : matrix_( construct( m, typename IsBuiltin<
ElementType_t<MT2> >::Type() ) )
1285 if( !IsHermitian_v<MT2> && !
isHermitian( matrix_ ) ) {
1319 template<
typename MT
1322 HermitianMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
1349 template<
typename MT
1352 HermitianMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
const 1357 return matrix_(i,j);
1380 template<
typename MT
1383 HermitianMatrix<MT,SO,true>::at(
size_t i,
size_t j )
1391 return (*
this)(i,j);
1414 template<
typename MT
1417 HermitianMatrix<MT,SO,true>::at(
size_t i,
size_t j )
const 1425 return (*
this)(i,j);
1445 template<
typename MT
1447 inline typename HermitianMatrix<MT,SO,true>::ConstPointer
1450 return matrix_.data();
1467 template<
typename MT
1469 inline typename HermitianMatrix<MT,SO,true>::ConstPointer
1472 return matrix_.data(i);
1490 template<
typename MT
1496 return Iterator( matrix_, 0UL, i );
1498 return Iterator( matrix_, i, 0UL );
1516 template<
typename MT
1521 return matrix_.begin(i);
1539 template<
typename MT
1544 return matrix_.cbegin(i);
1562 template<
typename MT
1588 template<
typename MT
1593 return matrix_.end(i);
1611 template<
typename MT
1616 return matrix_.cend(i);
1657 template<
typename MT
1659 inline HermitianMatrix<MT,SO,true>&
1660 HermitianMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1662 const InitializerMatrix<ElementType> tmp( list, list.size() );
1705 template<
typename MT
1707 template<
typename Other
1709 inline HermitianMatrix<MT,SO,true>&
1710 HermitianMatrix<MT,SO,true>::operator=(
const Other (&array)[N][N] )
1718 matrix_ = std::move( tmp );
1739 template<
typename MT
1741 inline HermitianMatrix<MT,SO,true>&
1742 HermitianMatrix<MT,SO,true>::operator=(
const HermitianMatrix& rhs )
1744 matrix_ = rhs.matrix_;
1762 template<
typename MT
1764 inline HermitianMatrix<MT,SO,true>&
1765 HermitianMatrix<MT,SO,true>::operator=( HermitianMatrix&& rhs ) noexcept
1767 matrix_ = std::move( rhs.matrix_ );
1791 template<
typename MT
1793 template<
typename MT2
1795 inline auto HermitianMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1796 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1798 if( !IsHermitian_v<MT2> && !
isHermitian( ~rhs ) ) {
1826 template<
typename MT
1828 template<
typename MT2
1830 inline auto HermitianMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1831 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1833 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1837 if( IsHermitian_v<MT2> ) {
1847 matrix_ = std::move( tmp );
1872 template<
typename MT
1874 template<
typename MT2 >
1875 inline auto HermitianMatrix<MT,SO,true>::operator=(
const Matrix<MT2,!SO>& rhs )
1876 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
1878 return this->operator=(
trans( ~rhs ) );
1897 template<
typename MT
1899 template<
typename MT2
1902 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1904 if( !IsHermitian_v<MT2> && !
isHermitian( ~rhs ) ) {
1932 template<
typename MT
1934 template<
typename MT2
1937 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1939 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1943 if( IsHermitian_v<MT2> ) {
1947 const ResultType_t<MT2> tmp( ~rhs );
1979 template<
typename MT
1981 template<
typename MT2 >
1983 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
2004 template<
typename MT
2006 template<
typename MT2
2009 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
2011 if( !IsHermitian_v<MT2> && !
isHermitian( ~rhs ) ) {
2039 template<
typename MT
2041 template<
typename MT2
2044 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
2046 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
2050 if( IsHermitian_v<MT2> ) {
2054 const ResultType_t<MT2> tmp( ~rhs );
2086 template<
typename MT
2088 template<
typename MT2 >
2090 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
2112 template<
typename MT
2114 template<
typename MT2
2116 inline auto HermitianMatrix<MT,SO,true>::operator%=(
const Matrix<MT2,SO2>& rhs )
2117 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
2119 if( !IsHermitian_v<MT2> && !
isHermitian( ~rhs ) ) {
2148 template<
typename MT
2150 template<
typename MT2
2152 inline auto HermitianMatrix<MT,SO,true>::operator%=(
const Matrix<MT2,SO2>& rhs )
2153 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
2155 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
2159 if( IsHermitian_v<MT2> ) {
2163 const ResultType_t<MT2> tmp( ~rhs );
2195 template<
typename MT
2197 template<
typename MT2 >
2198 inline auto HermitianMatrix<MT,SO,true>::operator%=(
const Matrix<MT2,!SO>& rhs )
2199 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
2201 return this->operator%=(
trans( ~rhs ) );
2215 template<
typename MT
2217 template<
typename ST >
2219 -> EnableIf_t< IsNumeric_v<ST>, HermitianMatrix& >
2235 template<
typename MT
2237 template<
typename ST >
2239 -> EnableIf_t< IsNumeric_v<ST>, HermitianMatrix& >
2264 template<
typename MT
2268 return matrix_.rows();
2280 template<
typename MT
2284 return matrix_.columns();
2302 template<
typename MT
2306 return matrix_.spacing();
2318 template<
typename MT
2322 return matrix_.capacity();
2339 template<
typename MT
2343 return matrix_.capacity(i);
2355 template<
typename MT
2359 return matrix_.nonZeros();
2377 template<
typename MT
2381 return matrix_.nonZeros(i);
2393 template<
typename MT
2439 template<
typename MT
2462 template<
typename MT
2509 template<
typename MT
2519 const size_t oldsize( matrix_.rows() );
2521 matrix_.resize( n, n,
true );
2524 const size_t increment( n - oldsize );
2525 submatrix( matrix_, 0UL, oldsize, oldsize, increment ).reset();
2526 submatrix( matrix_, oldsize, 0UL, increment, n ).reset();
2546 template<
typename MT
2548 inline void HermitianMatrix<MT,SO,true>::extend(
size_t n,
bool preserve )
2569 template<
typename MT
2571 inline void HermitianMatrix<MT,SO,true>::reserve(
size_t elements )
2589 template<
typename MT
2593 matrix_.shrinkToFit();
2606 template<
typename MT
2612 swap( matrix_, m.matrix_ );
2632 template<
typename MT
2636 if( IsComplex_v<ElementType> )
2637 matrix_.transpose();
2650 template<
typename MT
2678 template<
typename MT
2680 template<
typename Other >
2681 inline HermitianMatrix<MT,SO,true>&
2682 HermitianMatrix<MT,SO,true>::scale(
const Other& scalar )
2684 matrix_.scale( scalar );
2709 template<
typename MT
2740 template<
typename MT
2742 template<
typename Other >
2743 inline bool HermitianMatrix<MT,SO,true>::canAlias(
const Other* alias )
const noexcept
2745 return matrix_.canAlias( alias );
2762 template<
typename MT
2764 template<
typename Other >
2765 inline bool HermitianMatrix<MT,SO,true>::isAliased(
const Other* alias )
const noexcept
2767 return matrix_.isAliased( alias );
2783 template<
typename MT
2785 inline bool HermitianMatrix<MT,SO,true>::isAligned() const noexcept
2787 return matrix_.isAligned();
2804 template<
typename MT
2806 inline bool HermitianMatrix<MT,SO,true>::canSMPAssign() const noexcept
2808 return matrix_.canSMPAssign();
2830 template<
typename MT
2833 HermitianMatrix<MT,SO,true>::load(
size_t i,
size_t j )
const noexcept
2835 return matrix_.load( i, j );
2857 template<
typename MT
2862 return matrix_.loada( i, j );
2884 template<
typename MT
2889 return matrix_.loadu( i, j );
2912 template<
typename MT
2915 HermitianMatrix<MT,SO,true>::store(
size_t i,
size_t j,
const SIMDType& value ) noexcept
2917 matrix_.store( i, j, value );
2920 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
2921 for(
size_t k=i; k<kend; ++k )
2922 matrix_(j,k) =
conj( matrix_(k,j) );
2925 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
2926 for(
size_t k=j; k<kend; ++k )
2927 matrix_(k,i) =
conj( matrix_(i,k) );
2951 template<
typename MT
2956 matrix_.storea( i, j, value );
2959 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
2960 for(
size_t k=i; k<kend; ++k )
2961 matrix_(j,k) =
conj( matrix_(k,j) );
2964 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
2965 for(
size_t k=j; k<kend; ++k )
2966 matrix_(k,i) =
conj( matrix_(i,k) );
2990 template<
typename MT
2995 matrix_.storeu( i, j, value );
2998 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
2999 for(
size_t k=i; k<kend; ++k )
3000 matrix_(j,k) =
conj( matrix_(k,j) );
3003 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
3004 for(
size_t k=j; k<kend; ++k )
3005 matrix_(k,i) =
conj( matrix_(i,k) );
3029 template<
typename MT
3034 matrix_.stream( i, j, value );
3037 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
3038 for(
size_t k=i; k<kend; ++k )
3039 matrix_(j,k) =
conj( matrix_(k,j) );
3042 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
3043 for(
size_t k=j; k<kend; ++k )
3044 matrix_(k,i) =
conj( matrix_(i,k) );
3061 template<
typename MT
3063 template<
typename MT2
3066 inline decltype(
auto) HermitianMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
3076 template<
typename MT
3078 template<
typename MT2 >
3079 inline decltype(
auto) HermitianMatrix<MT,SO,true>::construct( const Matrix<MT2,!SO>& m,
TrueType )
Header file for the implementation of the Submatrix view.
#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
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
Headerfile for the generic min algorithm.
Header file for the blaze::checked and blaze::unchecked instances.
Constraint on the data type.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3078
#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
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:354
Header file for the UNUSED_PARAMETER function template.
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
Header file for basic type definitions.
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:750
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:169
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:63
Header file for the isZero shim.
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
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
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
Constraint on the data type.
Header file for the dense matrix inversion flags.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3077
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:799
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5828
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3079
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:851
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
#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 nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:75
Header file for the extended initializer_list functionality.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Constraint on the data type.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
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:482
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:416
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
Constraint on the data type.
Constraint on the data type.
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:252
Header file for the IsSquare type trait.
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:673
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:775
Header file for the DisableIf class template.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3083
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5907
Header file for the If class template.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5890
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
#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
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3080
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1147
#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.
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 > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:446
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
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 IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
Header file for all SIMD functionality.
Constraint on the data type.
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:78
Constraints on the storage order of matrix types.
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:135
constexpr bool IsBuiltin_v
Auxiliary variable template for the IsBuiltin type trait.The IsBuiltin_v variable template provides a...
Definition: IsBuiltin.h:95
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type...
Definition: Upper.h:81
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
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:438
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:8908
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
Header file for the implementation of the base template of the HeritianMatrix.
Header file for all forward declarations for expression class templates.
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:360
Header file for the EnableIf class template.
Header file for utility functions for dense matrices.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:611
Header file for the implementation of the Column view.
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
#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
bool isHermitian(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is Hermitian.
Definition: DenseMatrix.h:617
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:281
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.
Constraint on the data type.
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 size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
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:718
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
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:74
constexpr bool IsComputation_v
Auxiliary variable template for the IsComputation type trait.The IsComputation_v variable template pr...
Definition: IsComputation.h:90
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not resizable, i.e. does not have a 'res...
Definition: Resizable.h:61
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3082
#define BLAZE_CONSTRAINT_MUST_NOT_BE_EXPRESSION_TYPE(T)
Constraint on the data type.In case the given data type T is an expression (i.e. a type derived from ...
Definition: Expression.h:81
Header file for the HermitianProxy class.
auto operator*=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:290
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
Header file for the IsComplex type trait.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1326
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
Header file for the IsHermitian type trait.
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
System settings for the inline keywords.
Header file for the Size type trait.
InversionFlag
Inversion flag.The InversionFlag type enumeration represents the different types of matrix inversion ...
Definition: InversionFlag.h:101
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the implementation of the Row view.
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.The Size_v variable template provides a convenien...
Definition: Size.h:176
Header file for the TrueType type/value trait base class.
Header file for the clear shim.
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:825