35 #ifndef _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_DENSE_H_ 36 #define _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_DENSE_H_ 112 template<
typename MT
114 class HermitianMatrix<MT,SO,true>
115 :
public DenseMatrix< HermitianMatrix<MT,SO,true>, SO >
119 using OT = OppositeType_<MT>;
120 using TT = TransposeType_<MT>;
121 using ET = ElementType_<MT>;
126 using This = HermitianMatrix<MT,SO,true>;
127 using BaseType = DenseMatrix<This,SO>;
132 using SIMDType = SIMDType_<MT>;
137 using Pointer = Pointer_<MT>;
138 using ConstPointer = ConstPointer_<MT>;
145 template<
typename NewType >
148 using Other = HermitianMatrix< typename MT::template Rebind<NewType>::Other >;
155 template<
size_t NewM
159 using Other = HermitianMatrix< typename MT::template Resize<NewM,NewN>::Other >;
170 using IteratorCategory = std::random_access_iterator_tag;
171 using ValueType = ElementType_<MT>;
172 using PointerType = HermitianProxy<MT>;
173 using ReferenceType = HermitianProxy<MT>;
174 using DifferenceType = ptrdiff_t;
177 using iterator_category = IteratorCategory;
178 using value_type = ValueType;
179 using pointer = PointerType;
180 using reference = ReferenceType;
181 using difference_type = DifferenceType;
215 ( SO )?( row_ += inc ):( column_ += inc );
227 ( SO )?( row_ -= dec ):( column_ -= dec );
237 inline Iterator& operator++() noexcept {
238 ( SO )?( ++row_ ):( ++column_ );
248 inline const Iterator operator++(
int ) noexcept {
260 inline Iterator& operator--() noexcept {
261 ( SO )?( --row_ ):( --column_ );
271 inline const Iterator operator--(
int ) noexcept {
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_);
354 inline void store(
const SIMDType& value )
const {
355 (*matrix_).store( row_, column_, value );
371 inline void storea(
const SIMDType& value )
const {
372 (*matrix_).storea( row_, column_, value );
388 inline void storeu(
const SIMDType& value )
const {
389 (*matrix_).storeu( row_, column_, value );
405 inline void stream(
const SIMDType& value )
const {
406 (*matrix_).stream( row_, column_, value );
418 return matrix_->begin( column_ ) + row_;
420 return matrix_->begin( row_ ) + column_;
432 return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
468 return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
504 return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
540 return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
576 return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
612 return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
647 return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
660 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
662 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
675 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
677 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
690 return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
692 return Iterator( *it.matrix_, it.row_, it.column_ - dec );
704 const size_t kend(
min( row_+SIMDSIZE, (*matrix_).rows() ) );
705 for(
size_t k=row_; k<kend; ++k )
706 (*matrix_)(column_,k) =
conj( (*matrix_)(k,column_) );
709 const size_t kend(
min( column_+SIMDSIZE, (*matrix_).columns() ) );
710 for(
size_t k=column_; k<kend; ++k )
711 (*matrix_)(k,row_) =
conj( (*matrix_)(row_,k) );
726 enum :
bool { simdEnabled = MT::simdEnabled };
729 enum :
bool { smpAssignable = MT::smpAssignable };
735 explicit inline HermitianMatrix();
736 explicit inline HermitianMatrix(
size_t n );
737 explicit inline HermitianMatrix( initializer_list< initializer_list<ElementType> > list );
739 template<
typename Other >
740 explicit inline HermitianMatrix(
size_t n,
const Other* array );
742 template<
typename Other,
size_t N >
743 explicit inline HermitianMatrix(
const Other (&array)[N][N] );
745 explicit inline HermitianMatrix(
ElementType* ptr,
size_t n );
746 explicit inline HermitianMatrix(
ElementType* ptr,
size_t n,
size_t nn );
748 inline HermitianMatrix(
const HermitianMatrix& m );
749 inline HermitianMatrix( HermitianMatrix&& m ) noexcept;
751 template<
typename MT2,
bool SO2 >
752 inline HermitianMatrix(
const Matrix<MT2,SO2>& m );
763 inline Reference operator()(
size_t i,
size_t j );
765 inline Reference at(
size_t i,
size_t j );
767 inline ConstPointer
data () const noexcept;
768 inline ConstPointer
data (
size_t i ) const noexcept;
781 inline HermitianMatrix& operator=( initializer_list< initializer_list<
ElementType> > list );
783 template< typename Other,
size_t N >
784 inline HermitianMatrix& operator=( const Other (&array)[N][N] );
786 inline HermitianMatrix& operator=( const HermitianMatrix& rhs );
787 inline HermitianMatrix& operator=( HermitianMatrix&& rhs ) noexcept;
789 template< typename MT2,
bool SO2 >
790 inline
DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
792 template< typename MT2,
bool SO2 >
793 inline
EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
795 template< typename MT2 >
797 operator=( const Matrix<MT2,!SO>& rhs );
799 template< typename MT2,
bool SO2 >
800 inline
DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
802 template< typename MT2,
bool SO2 >
803 inline
EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
805 template< typename MT2 >
807 operator+=( const Matrix<MT2,!SO>& rhs );
809 template< typename MT2,
bool SO2 >
810 inline
DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
812 template< typename MT2,
bool SO2 >
813 inline
EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
815 template< typename MT2 >
817 operator-=( const Matrix<MT2,!SO>& rhs );
819 template< typename MT2,
bool SO2 >
820 inline
DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator%=( const Matrix<MT2,SO2>& rhs );
822 template< typename MT2,
bool SO2 >
823 inline
EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator%=( const Matrix<MT2,SO2>& rhs );
825 template< typename MT2 >
827 operator%=( const Matrix<MT2,!SO>& rhs );
829 template< typename ST >
830 inline
EnableIf_< IsNumeric<ST>, HermitianMatrix >& operator*=( ST rhs );
832 template< typename ST >
833 inline
EnableIf_< IsNumeric<ST>, HermitianMatrix >& operator/=( ST rhs );
840 inline
size_t rows() const noexcept;
841 inline
size_t columns() const noexcept;
842 inline
size_t spacing() const noexcept;
843 inline
size_t capacity() const noexcept;
844 inline
size_t capacity(
size_t i ) const noexcept;
846 inline
size_t nonZeros(
size_t i ) const;
848 inline
void reset(
size_t i );
850 void resize (
size_t n,
bool preserve=true );
851 inline
void extend (
size_t n,
bool preserve=true );
852 inline
void reserve(
size_t elements );
854 inline
void swap( HermitianMatrix& m ) noexcept;
864 template< typename Other > inline HermitianMatrix& scale( const Other& scalar );
871 inline
bool isIntact() const noexcept;
878 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
879 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
881 inline
bool isAligned () const noexcept;
882 inline
bool canSMPAssign() const noexcept;
888 inline
void store (
size_t i,
size_t j, const SIMDType& value ) noexcept;
889 inline
void storea(
size_t i,
size_t j, const SIMDType& value ) noexcept;
890 inline
void storeu(
size_t i,
size_t j, const SIMDType& value ) noexcept;
891 inline
void stream(
size_t i,
size_t j, const SIMDType& value ) noexcept;
899 template< typename MT2,
bool SO2, typename T >
900 inline const MT2& construct( const Matrix<MT2,SO2>& m, T );
902 template< typename MT2 >
920 template<
bool RF,
typename MT2,
bool SO2,
bool DF2 >
921 friend bool isDefault(
const HermitianMatrix<MT2,SO2,DF2>& m );
924 template< InversionFlag IF,
typename MT2,
bool SO2 >
925 friend void invert( HermitianMatrix<MT2,SO2,true>& m );
961 template<
typename MT
963 inline HermitianMatrix<MT,SO,true>::HermitianMatrix()
979 template<
typename MT
981 inline HermitianMatrix<MT,SO,true>::HermitianMatrix(
size_t n )
1020 template<
typename MT
1022 inline HermitianMatrix<MT,SO,true>::HermitianMatrix( initializer_list< initializer_list<ElementType> > list )
1064 template<
typename MT
1066 template<
typename Other >
1067 inline HermitianMatrix<MT,SO,true>::HermitianMatrix(
size_t n,
const Other* array )
1068 : matrix_( n, n, array )
1105 template<
typename MT
1107 template<
typename Other
1109 inline HermitianMatrix<MT,SO,true>::HermitianMatrix(
const Other (&array)[N][N] )
1156 template<
typename MT
1158 inline HermitianMatrix<MT,SO,true>::HermitianMatrix(
ElementType* ptr,
size_t n )
1159 : matrix_( ptr, n, n )
1207 template<
typename MT
1209 inline HermitianMatrix<MT,SO,true>::HermitianMatrix(
ElementType* ptr,
size_t n,
size_t nn )
1210 : matrix_( ptr, n, n, nn )
1228 template<
typename MT
1230 inline HermitianMatrix<MT,SO,true>::HermitianMatrix(
const HermitianMatrix& m )
1231 : matrix_( m.matrix_ )
1246 template<
typename MT
1248 inline HermitianMatrix<MT,SO,true>::HermitianMatrix( HermitianMatrix&& m ) noexcept
1249 : matrix_( std::move( m.matrix_ ) )
1268 template<
typename MT
1270 template<
typename MT2
1272 inline HermitianMatrix<MT,SO,true>::HermitianMatrix(
const Matrix<MT2,SO2>& m )
1273 : matrix_( construct( m, typename IsBuiltin<
ElementType_<MT2> >::Type() ) )
1275 if( !IsHermitian<MT2>::value && !
isHermitian( matrix_ ) ) {
1309 template<
typename MT
1312 HermitianMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
1339 template<
typename MT
1342 HermitianMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
const 1347 return matrix_(i,j);
1370 template<
typename MT
1373 HermitianMatrix<MT,SO,true>::at(
size_t i,
size_t j )
1381 return (*
this)(i,j);
1404 template<
typename MT
1407 HermitianMatrix<MT,SO,true>::at(
size_t i,
size_t j )
const 1415 return (*
this)(i,j);
1435 template<
typename MT
1437 inline typename HermitianMatrix<MT,SO,true>::ConstPointer
1440 return matrix_.data();
1457 template<
typename MT
1459 inline typename HermitianMatrix<MT,SO,true>::ConstPointer
1462 return matrix_.data(i);
1480 template<
typename MT
1486 return Iterator( matrix_, 0UL, i );
1488 return Iterator( matrix_, i, 0UL );
1506 template<
typename MT
1511 return matrix_.begin(i);
1529 template<
typename MT
1534 return matrix_.cbegin(i);
1552 template<
typename MT
1578 template<
typename MT
1583 return matrix_.end(i);
1601 template<
typename MT
1606 return matrix_.cend(i);
1647 template<
typename MT
1649 inline HermitianMatrix<MT,SO,true>&
1650 HermitianMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1652 const InitializerMatrix<ElementType> tmp( list, list.size() );
1695 template<
typename MT
1697 template<
typename Other
1699 inline HermitianMatrix<MT,SO,true>&
1700 HermitianMatrix<MT,SO,true>::operator=(
const Other (&array)[N][N] )
1708 matrix_ = std::move( tmp );
1729 template<
typename MT
1731 inline HermitianMatrix<MT,SO,true>&
1732 HermitianMatrix<MT,SO,true>::operator=(
const HermitianMatrix& rhs )
1734 matrix_ = rhs.matrix_;
1752 template<
typename MT
1754 inline HermitianMatrix<MT,SO,true>&
1755 HermitianMatrix<MT,SO,true>::operator=( HermitianMatrix&& rhs ) noexcept
1757 matrix_ = std::move( rhs.matrix_ );
1781 template<
typename MT
1783 template<
typename MT2
1785 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
1786 HermitianMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1788 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1816 template<
typename MT
1818 template<
typename MT2
1820 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
1821 HermitianMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1823 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1827 if( IsHermitian<MT2>::value ) {
1837 matrix_ = std::move( tmp );
1862 template<
typename MT
1864 template<
typename MT2 >
1865 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,true>& >
1866 HermitianMatrix<MT,SO,true>::operator=(
const Matrix<MT2,!SO>& rhs )
1868 return this->operator=(
trans( ~rhs ) );
1887 template<
typename MT
1889 template<
typename MT2
1891 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
1894 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1922 template<
typename MT
1924 template<
typename MT2
1926 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
1929 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1933 if( IsHermitian<MT2>::value ) {
1937 const ResultType_<MT2> tmp( ~rhs );
1969 template<
typename MT
1971 template<
typename MT2 >
1972 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,true>& >
1994 template<
typename MT
1996 template<
typename MT2
1998 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
2001 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
2029 template<
typename MT
2031 template<
typename MT2
2033 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
2036 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
2040 if( IsHermitian<MT2>::value ) {
2044 const ResultType_<MT2> tmp( ~rhs );
2076 template<
typename MT
2078 template<
typename MT2 >
2079 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,true>& >
2102 template<
typename MT
2104 template<
typename MT2
2106 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
2107 HermitianMatrix<MT,SO,true>::operator%=(
const Matrix<MT2,SO2>& rhs )
2109 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
2138 template<
typename MT
2140 template<
typename MT2
2142 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
2143 HermitianMatrix<MT,SO,true>::operator%=(
const Matrix<MT2,SO2>& rhs )
2145 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
2149 if( IsHermitian<MT2>::value ) {
2153 const ResultType_<MT2> tmp( ~rhs );
2185 template<
typename MT
2187 template<
typename MT2 >
2188 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,true>& >
2189 HermitianMatrix<MT,SO,true>::operator%=(
const Matrix<MT2,!SO>& rhs )
2191 return this->operator%=(
trans( ~rhs ) );
2205 template<
typename MT
2207 template<
typename ST >
2208 inline EnableIf_< IsNumeric<ST>, HermitianMatrix<MT,SO,true> >&
2225 template<
typename MT
2227 template<
typename ST >
2228 inline EnableIf_< IsNumeric<ST>, HermitianMatrix<MT,SO,true> >&
2254 template<
typename MT
2258 return matrix_.rows();
2270 template<
typename MT
2274 return matrix_.columns();
2292 template<
typename MT
2296 return matrix_.spacing();
2308 template<
typename MT
2312 return matrix_.capacity();
2329 template<
typename MT
2333 return matrix_.capacity(i);
2345 template<
typename MT
2349 return matrix_.nonZeros();
2367 template<
typename MT
2371 return matrix_.nonZeros(i);
2383 template<
typename MT
2429 template<
typename MT
2452 template<
typename MT
2499 template<
typename MT
2509 const size_t oldsize( matrix_.rows() );
2511 matrix_.resize( n, n,
true );
2514 const size_t increment( n - oldsize );
2515 submatrix( matrix_, 0UL, oldsize, oldsize, increment ).reset();
2516 submatrix( matrix_, oldsize, 0UL, increment, n ).reset();
2536 template<
typename MT
2538 inline void HermitianMatrix<MT,SO,true>::extend(
size_t n,
bool preserve )
2559 template<
typename MT
2561 inline void HermitianMatrix<MT,SO,true>::reserve(
size_t elements )
2563 matrix_.reserve( elements );
2579 template<
typename MT
2583 matrix_.shrinkToFit();
2596 template<
typename MT
2602 swap( matrix_, m.matrix_ );
2622 template<
typename MT
2626 if( IsComplex<ElementType>::value )
2627 matrix_.transpose();
2640 template<
typename MT
2668 template<
typename MT
2670 template<
typename Other >
2671 inline HermitianMatrix<MT,SO,true>&
2672 HermitianMatrix<MT,SO,true>::scale(
const Other& scalar )
2674 matrix_.scale( scalar );
2699 template<
typename MT
2730 template<
typename MT
2732 template<
typename Other >
2733 inline bool HermitianMatrix<MT,SO,true>::canAlias(
const Other* alias )
const noexcept
2735 return matrix_.canAlias( alias );
2752 template<
typename MT
2754 template<
typename Other >
2755 inline bool HermitianMatrix<MT,SO,true>::isAliased(
const Other* alias )
const noexcept
2757 return matrix_.isAliased( alias );
2773 template<
typename MT
2775 inline bool HermitianMatrix<MT,SO,true>::isAligned() const noexcept
2777 return matrix_.isAligned();
2794 template<
typename MT
2796 inline bool HermitianMatrix<MT,SO,true>::canSMPAssign() const noexcept
2798 return matrix_.canSMPAssign();
2820 template<
typename MT
2823 HermitianMatrix<MT,SO,true>::load(
size_t i,
size_t j )
const noexcept
2825 return matrix_.load( i, j );
2847 template<
typename MT
2852 return matrix_.loada( i, j );
2874 template<
typename MT
2879 return matrix_.loadu( i, j );
2902 template<
typename MT
2905 HermitianMatrix<MT,SO,true>::store(
size_t i,
size_t j,
const SIMDType& value ) noexcept
2907 matrix_.store( i, j, value );
2910 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
2911 for(
size_t k=i; k<kend; ++k )
2912 matrix_(j,k) =
conj( matrix_(k,j) );
2915 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
2916 for(
size_t k=j; k<kend; ++k )
2917 matrix_(k,i) =
conj( matrix_(i,k) );
2941 template<
typename MT
2946 matrix_.storea( i, j, value );
2949 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
2950 for(
size_t k=i; k<kend; ++k )
2951 matrix_(j,k) =
conj( matrix_(k,j) );
2954 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
2955 for(
size_t k=j; k<kend; ++k )
2956 matrix_(k,i) =
conj( matrix_(i,k) );
2980 template<
typename MT
2985 matrix_.storeu( i, j, value );
2988 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
2989 for(
size_t k=i; k<kend; ++k )
2990 matrix_(j,k) =
conj( matrix_(k,j) );
2993 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
2994 for(
size_t k=j; k<kend; ++k )
2995 matrix_(k,i) =
conj( matrix_(i,k) );
3019 template<
typename MT
3024 matrix_.stream( i, j, value );
3027 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
3028 for(
size_t k=i; k<kend; ++k )
3029 matrix_(j,k) =
conj( matrix_(k,j) );
3032 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
3033 for(
size_t k=j; k<kend; ++k )
3034 matrix_(k,i) =
conj( matrix_(i,k) );
3051 template<
typename MT
3053 template<
typename MT2
3056 inline const MT2& HermitianMatrix<MT,SO,true>::construct(
const Matrix<MT2,SO2>& m, T )
3066 template<
typename MT
3068 template<
typename MT2 >
3069 inline TransExprTrait_<MT2>
3070 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:131
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:3077
#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.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:522
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:79
#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
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
#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:329
Constraint on the data type.
Header file for the dense matrix inversion flags.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3076
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:364
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3074
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
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:701
BLAZE_ALWAYS_INLINE void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:775
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5829
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3078
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1903
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:827
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3083
#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
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 DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:733
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:3084
Header file for the extended initializer_list functionality.
Constraint on the data type.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
BLAZE_ALWAYS_INLINE 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:474
BLAZE_ALWAYS_INLINE 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:408
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE 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:670
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:772
typename TransExprTrait< T >::Type TransExprTrait_
Auxiliary alias declaration for the TransExprTrait class template.The TransExprTrait_ alias declarati...
Definition: TransExprTrait.h:112
Header file for the DisableIf class template.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3082
Header file for the clear shim.
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:5908
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:5891
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
#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:3079
#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:367
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:443
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
Header file for the isZero shim.
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:250
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for all SIMD functionality.
Constraint on the data type.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:506
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:80
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:134
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
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:714
BLAZE_ALWAYS_INLINE 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:430
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:8893
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
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:608
Header file for the implementation of the Column view.
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< 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:75
#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:131
#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:919
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:272
Header file for the TransExprTrait class template.
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:405
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:76
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:490
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
BLAZE_ALWAYS_INLINE MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:169
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
EnableIf_< IsNumeric< ST >, MT &> operator/=(DenseMatrix< MT, SO > &mat, ST scalar)
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:655
#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:3081
#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.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
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:628
#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
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1321
#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
EnableIf_< IsNumeric< ST >, MT &> operator*=(DenseMatrix< MT, SO > &mat, ST scalar)
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:593
Header file for the IsHermitian type trait.
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:908
System settings for the inline keywords.
Header file for the Size type trait.
#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.
Header file for the TrueType type/value trait base class.
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:801