35 #ifndef _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_DENSE_H_ 36 #define _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_DENSE_H_ 110 template<
typename MT
112 class HermitianMatrix<MT,SO,true>
113 :
public DenseMatrix< HermitianMatrix<MT,SO,true>, SO >
117 using OT = OppositeType_<MT>;
118 using TT = TransposeType_<MT>;
119 using ET = ElementType_<MT>;
124 using This = HermitianMatrix<MT,SO,true>;
125 using BaseType = DenseMatrix<This,SO>;
130 using SIMDType = SIMDType_<MT>;
135 using Pointer = Pointer_<MT>;
136 using ConstPointer = ConstPointer_<MT>;
143 template<
typename NewType >
146 using Other = HermitianMatrix< typename MT::template Rebind<NewType>::Other >;
153 template<
size_t NewM
157 using Other = HermitianMatrix< typename MT::template Resize<NewM,NewN>::Other >;
168 using IteratorCategory = std::random_access_iterator_tag;
169 using ValueType = ElementType_<MT>;
170 using PointerType = HermitianProxy<MT>;
171 using ReferenceType = HermitianProxy<MT>;
172 using DifferenceType = ptrdiff_t;
175 using iterator_category = IteratorCategory;
176 using value_type = ValueType;
177 using pointer = PointerType;
178 using reference = ReferenceType;
179 using difference_type = DifferenceType;
213 ( SO )?( row_ += inc ):( column_ += inc );
225 ( SO )?( row_ -= dec ):( column_ -= dec );
235 inline Iterator& operator++() noexcept {
236 ( SO )?( ++row_ ):( ++column_ );
246 inline const Iterator operator++(
int ) noexcept {
258 inline Iterator& operator--() noexcept {
259 ( SO )?( --row_ ):( --column_ );
269 inline const Iterator operator--(
int ) noexcept {
282 return ReferenceType( *matrix_, row_, column_ );
291 inline PointerType operator->()
const {
292 return PointerType( *matrix_, row_, column_ );
306 inline SIMDType load()
const {
307 return (*matrix_).load(row_,column_);
321 inline SIMDType
loada()
const {
322 return (*matrix_).loada(row_,column_);
336 inline SIMDType
loadu()
const {
337 return (*matrix_).loadu(row_,column_);
352 inline void store(
const SIMDType& value )
const {
353 (*matrix_).store( row_, column_, value );
369 inline void storea(
const SIMDType& value )
const {
370 (*matrix_).storea( row_, column_, value );
386 inline void storeu(
const SIMDType& value )
const {
387 (*matrix_).storeu( row_, column_, value );
403 inline void stream(
const SIMDType& value )
const {
404 (*matrix_).stream( row_, column_, value );
416 return matrix_->begin( column_ ) + row_;
418 return matrix_->begin( row_ ) + column_;
430 return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
466 return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
502 return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
538 return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
574 return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
610 return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
645 return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
658 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
660 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
673 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
675 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
688 return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
690 return Iterator( *it.matrix_, it.row_, it.column_ - dec );
702 const size_t kend(
min( row_+SIMDSIZE, (*matrix_).rows() ) );
703 for(
size_t k=row_; k<kend; ++k )
704 (*matrix_)(column_,k) =
conj( (*matrix_)(k,column_) );
707 const size_t kend(
min( column_+SIMDSIZE, (*matrix_).columns() ) );
708 for(
size_t k=column_; k<kend; ++k )
709 (*matrix_)(k,row_) =
conj( (*matrix_)(row_,k) );
724 enum :
bool { simdEnabled = MT::simdEnabled };
727 enum :
bool { smpAssignable = MT::smpAssignable };
733 explicit inline HermitianMatrix();
734 explicit inline HermitianMatrix(
size_t n );
735 explicit inline HermitianMatrix( initializer_list< initializer_list<ElementType> > list );
737 template<
typename Other >
738 explicit inline HermitianMatrix(
size_t n,
const Other* array );
740 template<
typename Other,
size_t N >
741 explicit inline HermitianMatrix(
const Other (&array)[N][N] );
743 explicit inline HermitianMatrix(
ElementType* ptr,
size_t n );
744 explicit inline HermitianMatrix(
ElementType* ptr,
size_t n,
size_t nn );
746 inline HermitianMatrix(
const HermitianMatrix& m );
747 inline HermitianMatrix( HermitianMatrix&& m ) noexcept;
749 template<
typename MT2,
bool SO2 >
750 inline HermitianMatrix(
const Matrix<MT2,SO2>& m );
761 inline Reference operator()(
size_t i,
size_t j );
763 inline Reference at(
size_t i,
size_t j );
765 inline ConstPointer data () const noexcept;
766 inline ConstPointer data (
size_t i ) const noexcept;
779 inline HermitianMatrix& operator=( initializer_list< initializer_list<
ElementType> > list );
781 template< typename Other,
size_t N >
782 inline HermitianMatrix& operator=( const Other (&array)[N][N] );
784 inline HermitianMatrix& operator=( const HermitianMatrix& rhs );
785 inline HermitianMatrix& operator=( HermitianMatrix&& rhs ) noexcept;
787 template< typename MT2,
bool SO2 >
788 inline
DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
790 template< typename MT2,
bool SO2 >
791 inline
EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
793 template< typename MT2 >
795 operator=( const Matrix<MT2,!SO>& rhs );
797 template< typename MT2,
bool SO2 >
798 inline
DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
800 template< typename MT2,
bool SO2 >
801 inline
EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
803 template< typename MT2 >
805 operator+=( const Matrix<MT2,!SO>& rhs );
807 template< typename MT2,
bool SO2 >
808 inline
DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
810 template< typename MT2,
bool SO2 >
811 inline
EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
813 template< typename MT2 >
815 operator-=( const Matrix<MT2,!SO>& rhs );
817 template< typename MT2,
bool SO2 >
818 inline
DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator%=( const Matrix<MT2,SO2>& rhs );
820 template< typename MT2,
bool SO2 >
821 inline
EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator%=( const Matrix<MT2,SO2>& rhs );
823 template< typename MT2 >
825 operator%=( const Matrix<MT2,!SO>& rhs );
827 template< typename MT2,
bool SO2 >
828 inline HermitianMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
830 template< typename Other >
831 inline
EnableIf_< IsNumeric<Other>, HermitianMatrix >& operator*=( Other rhs );
833 template< typename Other >
834 inline
EnableIf_< IsNumeric<Other>, HermitianMatrix >& operator/=( Other rhs );
841 inline
size_t rows() const noexcept;
842 inline
size_t columns() const noexcept;
843 inline
size_t spacing() const noexcept;
844 inline
size_t capacity() const noexcept;
845 inline
size_t capacity(
size_t i ) const noexcept;
847 inline
size_t nonZeros(
size_t i ) const;
849 inline
void reset(
size_t i );
851 void resize (
size_t n,
bool preserve=true );
852 inline
void extend (
size_t n,
bool preserve=true );
853 inline
void reserve(
size_t elements );
855 inline
void swap( HermitianMatrix& m ) noexcept;
865 template< typename Other > inline HermitianMatrix& scale( const Other& scalar );
872 inline
bool isIntact() const noexcept;
879 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
880 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
882 inline
bool isAligned () const noexcept;
883 inline
bool canSMPAssign() const noexcept;
889 inline
void store (
size_t i,
size_t j, const SIMDType& value ) noexcept;
890 inline
void storea(
size_t i,
size_t j, const SIMDType& value ) noexcept;
891 inline
void storeu(
size_t i,
size_t j, const SIMDType& value ) noexcept;
892 inline
void stream(
size_t i,
size_t j, const SIMDType& value ) noexcept;
900 template< typename MT2,
bool SO2, typename T >
901 inline const MT2& construct( const Matrix<MT2,SO2>& m, T );
903 template< typename MT2 >
921 template<
bool RF,
typename MT2,
bool SO2,
bool DF2 >
922 friend bool isDefault(
const HermitianMatrix<MT2,SO2,DF2>& m );
925 template< InversionFlag IF,
typename MT2,
bool SO2 >
926 friend void invert( HermitianMatrix<MT2,SO2,true>& m );
962 template<
typename MT
964 inline HermitianMatrix<MT,SO,true>::HermitianMatrix()
980 template<
typename MT
982 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
1438 HermitianMatrix<MT,SO,true>::data() const noexcept
1440 return matrix_.data();
1457 template<
typename MT
1459 inline typename HermitianMatrix<MT,SO,true>::ConstPointer
1460 HermitianMatrix<MT,SO,true>::data(
size_t i )
const noexcept
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);
1646 template<
typename MT
1648 inline HermitianMatrix<MT,SO,true>&
1649 HermitianMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1657 matrix_ = std::move( tmp );
1694 template<
typename MT
1696 template<
typename Other
1698 inline HermitianMatrix<MT,SO,true>&
1699 HermitianMatrix<MT,SO,true>::operator=(
const Other (&array)[N][N] )
1707 matrix_ = std::move( tmp );
1728 template<
typename MT
1730 inline HermitianMatrix<MT,SO,true>&
1731 HermitianMatrix<MT,SO,true>::operator=(
const HermitianMatrix& rhs )
1733 matrix_ = rhs.matrix_;
1751 template<
typename MT
1753 inline HermitianMatrix<MT,SO,true>&
1754 HermitianMatrix<MT,SO,true>::operator=( HermitianMatrix&& rhs ) noexcept
1756 matrix_ = std::move( rhs.matrix_ );
1780 template<
typename MT
1782 template<
typename MT2
1784 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
1785 HermitianMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1787 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1815 template<
typename MT
1817 template<
typename MT2
1819 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
1820 HermitianMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1822 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1826 if( IsHermitian<MT2>::value ) {
1836 matrix_ = std::move( tmp );
1861 template<
typename MT
1863 template<
typename MT2 >
1864 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,true>& >
1865 HermitianMatrix<MT,SO,true>::operator=(
const Matrix<MT2,!SO>& rhs )
1867 return this->operator=(
trans( ~rhs ) );
1886 template<
typename MT
1888 template<
typename MT2
1890 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
1893 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1921 template<
typename MT
1923 template<
typename MT2
1925 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
1928 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1932 if( IsHermitian<MT2>::value ) {
1936 const ResultType_<MT2> tmp( ~rhs );
1968 template<
typename MT
1970 template<
typename MT2 >
1971 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,true>& >
1993 template<
typename MT
1995 template<
typename MT2
1997 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
2000 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
2028 template<
typename MT
2030 template<
typename MT2
2032 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
2035 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
2039 if( IsHermitian<MT2>::value ) {
2043 const ResultType_<MT2> tmp( ~rhs );
2075 template<
typename MT
2077 template<
typename MT2 >
2078 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,true>& >
2101 template<
typename MT
2103 template<
typename MT2
2105 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
2106 HermitianMatrix<MT,SO,true>::operator%=(
const Matrix<MT2,SO2>& rhs )
2108 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
2137 template<
typename MT
2139 template<
typename MT2
2141 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >
2142 HermitianMatrix<MT,SO,true>::operator%=(
const Matrix<MT2,SO2>& rhs )
2144 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
2148 if( IsHermitian<MT2>::value ) {
2152 const ResultType_<MT2> tmp( ~rhs );
2184 template<
typename MT
2186 template<
typename MT2 >
2187 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,true>& >
2188 HermitianMatrix<MT,SO,true>::operator%=(
const Matrix<MT2,!SO>& rhs )
2190 return this->operator%=(
trans( ~rhs ) );
2208 template<
typename MT
2210 template<
typename MT2
2212 inline HermitianMatrix<MT,SO,true>&
2215 if( matrix_.rows() != (~rhs).
columns() ) {
2219 MT tmp( matrix_ * ~rhs );
2225 matrix_ = std::move( tmp );
2244 template<
typename MT
2246 template<
typename Other >
2247 inline EnableIf_< IsNumeric<Other>, HermitianMatrix<MT,SO,true> >&
2264 template<
typename MT
2266 template<
typename Other >
2267 inline EnableIf_< IsNumeric<Other>, HermitianMatrix<MT,SO,true> >&
2293 template<
typename MT
2297 return matrix_.rows();
2309 template<
typename MT
2313 return matrix_.columns();
2331 template<
typename MT
2335 return matrix_.spacing();
2347 template<
typename MT
2351 return matrix_.capacity();
2368 template<
typename MT
2372 return matrix_.capacity(i);
2384 template<
typename MT
2388 return matrix_.nonZeros();
2406 template<
typename MT
2410 return matrix_.nonZeros(i);
2422 template<
typename MT
2468 template<
typename MT
2472 row ( matrix_, i ).reset();
2473 column( matrix_, i ).reset();
2491 template<
typename MT
2538 template<
typename MT
2548 const size_t oldsize( matrix_.rows() );
2550 matrix_.resize( n, n,
true );
2553 const size_t increment( n - oldsize );
2554 submatrix( matrix_, 0UL, oldsize, oldsize, increment ).reset();
2555 submatrix( matrix_, oldsize, 0UL, increment, n ).reset();
2575 template<
typename MT
2577 inline void HermitianMatrix<MT,SO,true>::extend(
size_t n,
bool preserve )
2598 template<
typename MT
2600 inline void HermitianMatrix<MT,SO,true>::reserve(
size_t elements )
2602 matrix_.reserve( elements );
2618 template<
typename MT
2622 matrix_.shrinkToFit();
2635 template<
typename MT
2641 swap( matrix_, m.matrix_ );
2661 template<
typename MT
2665 if( IsComplex<ElementType>::value )
2666 matrix_.transpose();
2679 template<
typename MT
2707 template<
typename MT
2709 template<
typename Other >
2710 inline HermitianMatrix<MT,SO,true>&
2711 HermitianMatrix<MT,SO,true>::scale(
const Other& scalar )
2713 matrix_.scale( scalar );
2738 template<
typename MT
2769 template<
typename MT
2771 template<
typename Other >
2772 inline bool HermitianMatrix<MT,SO,true>::canAlias(
const Other* alias )
const noexcept
2774 return matrix_.canAlias( alias );
2791 template<
typename MT
2793 template<
typename Other >
2794 inline bool HermitianMatrix<MT,SO,true>::isAliased(
const Other* alias )
const noexcept
2796 return matrix_.isAliased( alias );
2812 template<
typename MT
2814 inline bool HermitianMatrix<MT,SO,true>::isAligned() const noexcept
2816 return matrix_.isAligned();
2833 template<
typename MT
2835 inline bool HermitianMatrix<MT,SO,true>::canSMPAssign() const noexcept
2837 return matrix_.canSMPAssign();
2859 template<
typename MT
2862 HermitianMatrix<MT,SO,true>::load(
size_t i,
size_t j )
const noexcept
2864 return matrix_.load( i, j );
2886 template<
typename MT
2891 return matrix_.loada( i, j );
2913 template<
typename MT
2918 return matrix_.loadu( i, j );
2941 template<
typename MT
2944 HermitianMatrix<MT,SO,true>::store(
size_t i,
size_t j,
const SIMDType& value ) noexcept
2946 matrix_.store( 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_.storea( 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_.storeu( 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) );
3058 template<
typename MT
3063 matrix_.stream( i, j, value );
3066 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
3067 for(
size_t k=i; k<kend; ++k )
3068 matrix_(j,k) =
conj( matrix_(k,j) );
3071 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
3072 for(
size_t k=j; k<kend; ++k )
3073 matrix_(k,i) =
conj( matrix_(i,k) );
3090 template<
typename MT
3092 template<
typename MT2
3095 inline const MT2& HermitianMatrix<MT,SO,true>::construct(
const Matrix<MT2,SO2>& m, T )
3105 template<
typename MT
3107 template<
typename MT2 >
3108 inline TransExprTrait_<MT2>
3109 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.
Headerfile for the generic min algorithm.
Constraint on the data type.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3079
#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 Rows type trait.
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:356
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
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1411
Constraint on the data type.
Header file for the dense matrix inversion flags.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3078
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:198
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:560
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:699
BLAZE_ALWAYS_INLINE void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:609
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:5845
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3080
Submatrix< MT, AF > submatrix(Matrix< MT, SO > &matrix, size_t row, size_t column, size_t m, size_t n)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:352
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1762
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:661
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3085
#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:394
Column< MT > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:124
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:731
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:3086
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1393
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:308
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:242
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:110
Header file for the std::initializer_list aliases.
Header file for the IsSquare type trait.
Row< MT > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:124
Constraint on the data type.
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:3084
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#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:5924
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:5907
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3077
#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:3081
#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.
Header file for the Columns type trait.
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:3087
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:340
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.
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:548
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:264
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.
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:580
Header file for all restructuring column functions.
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.
#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:778
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:270
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:324
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3082
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:790
#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:3083
#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:252
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:600
#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
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:742
System settings for the inline keywords.
#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:635