35 #ifndef _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_DENSENUMERIC_H_ 36 #define _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_DENSENUMERIC_H_ 107 template<
typename MT
109 class SymmetricMatrix<MT,SO,true,true>
110 :
public DenseMatrix< SymmetricMatrix<MT,SO,true,true>, SO >
114 using OT = OppositeType_<MT>;
115 using TT = TransposeType_<MT>;
116 using ET = ElementType_<MT>;
121 using This = SymmetricMatrix<MT,SO,true,true>;
122 using BaseType = DenseMatrix<This,SO>;
127 using SIMDType = SIMDType_<MT>;
132 using Pointer = Pointer_<MT>;
133 using ConstPointer = ConstPointer_<MT>;
140 template<
typename NewType >
143 using Other = SymmetricMatrix< typename MT::template Rebind<NewType>::Other >;
150 template<
size_t NewM
154 using Other = SymmetricMatrix< typename MT::template Resize<NewM,NewN>::Other >;
165 using IteratorCategory = std::random_access_iterator_tag;
166 using ValueType = ElementType_<MT>;
167 using PointerType = NumericProxy<MT>;
168 using ReferenceType = NumericProxy<MT>;
169 using DifferenceType = ptrdiff_t;
172 using iterator_category = IteratorCategory;
173 using value_type = ValueType;
174 using pointer = PointerType;
175 using reference = ReferenceType;
176 using difference_type = DifferenceType;
210 ( SO )?( row_ += inc ):( column_ += inc );
222 ( SO )?( row_ -= dec ):( column_ -= dec );
232 inline Iterator& operator++() noexcept {
233 ( SO )?( ++row_ ):( ++column_ );
243 inline const Iterator operator++(
int ) noexcept {
255 inline Iterator& operator--() noexcept {
256 ( SO )?( --row_ ):( --column_ );
266 inline const Iterator operator--(
int ) noexcept {
279 return ReferenceType( *matrix_, row_, column_ );
288 inline PointerType operator->()
const {
289 return PointerType( *matrix_, row_, column_ );
303 inline SIMDType load()
const {
304 return (*matrix_).load(row_,column_);
318 inline SIMDType
loada()
const {
319 return (*matrix_).loada(row_,column_);
333 inline SIMDType
loadu()
const {
334 return (*matrix_).loadu(row_,column_);
349 inline void store(
const SIMDType& value )
const {
350 (*matrix_).store( row_, column_, value );
366 inline void storea(
const SIMDType& value )
const {
367 (*matrix_).storea( row_, column_, value );
383 inline void storeu(
const SIMDType& value )
const {
384 (*matrix_).storeu( row_, column_, value );
400 inline void stream(
const SIMDType& value )
const {
401 (*matrix_).stream( row_, column_, value );
413 return matrix_->begin( column_ ) + row_;
415 return matrix_->begin( row_ ) + column_;
427 return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
463 return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
499 return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
535 return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
571 return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
607 return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
642 return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
655 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
657 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
670 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
672 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
685 return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
687 return Iterator( *it.matrix_, it.row_, it.column_ - dec );
699 const size_t kend(
min( row_+SIMDSIZE, (*matrix_).rows() ) );
700 for(
size_t k=row_; k<kend; ++k )
701 (*matrix_)(column_,k) = (*matrix_)(k,column_);
704 const size_t kend(
min( column_+SIMDSIZE, (*matrix_).columns() ) );
705 for(
size_t k=column_; k<kend; ++k )
706 (*matrix_)(k,row_) = (*matrix_)(row_,k);
721 enum :
bool { simdEnabled = MT::simdEnabled };
724 enum :
bool { smpAssignable = MT::smpAssignable };
730 explicit inline SymmetricMatrix();
731 explicit inline SymmetricMatrix(
size_t n );
732 explicit inline SymmetricMatrix( initializer_list< initializer_list<ElementType> > list );
734 template<
typename Other >
735 explicit inline SymmetricMatrix(
size_t n,
const Other* array );
737 template<
typename Other,
size_t N >
738 explicit inline SymmetricMatrix(
const Other (&array)[N][N] );
740 explicit inline SymmetricMatrix(
ElementType* ptr,
size_t n );
741 explicit inline SymmetricMatrix(
ElementType* ptr,
size_t n,
size_t nn );
743 inline SymmetricMatrix(
const SymmetricMatrix& m );
744 inline SymmetricMatrix( SymmetricMatrix&& m ) noexcept;
746 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,SO>& m );
747 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,!SO>& m );
758 inline Reference operator()(
size_t i,
size_t j );
760 inline Reference at(
size_t i,
size_t j );
762 inline ConstPointer data () const noexcept;
763 inline ConstPointer data (
size_t i ) const noexcept;
776 inline SymmetricMatrix& operator=( initializer_list< initializer_list<
ElementType> > list );
778 template< typename Other,
size_t N >
779 inline SymmetricMatrix& operator=( const Other (&array)[N][N] );
781 inline SymmetricMatrix& operator=( const SymmetricMatrix& rhs );
782 inline SymmetricMatrix& operator=( SymmetricMatrix&& rhs ) noexcept;
784 template< typename MT2 >
785 inline
DisableIf_< IsComputation<MT2>, SymmetricMatrix& > operator=( const Matrix<MT2,SO>& rhs );
787 template< typename MT2 >
788 inline
EnableIf_< IsComputation<MT2>, SymmetricMatrix& > operator=( const Matrix<MT2,SO>& rhs );
790 template< typename MT2 >
791 inline SymmetricMatrix& operator=( const Matrix<MT2,!SO>& rhs );
793 template< typename MT2 >
794 inline
DisableIf_< IsComputation<MT2>, SymmetricMatrix& > operator+=( const Matrix<MT2,SO>& rhs );
796 template< typename MT2 >
797 inline
EnableIf_< IsComputation<MT2>, SymmetricMatrix& > operator+=( const Matrix<MT2,SO>& rhs );
799 template< typename MT2 >
800 inline SymmetricMatrix& operator+=( const Matrix<MT2,!SO>& rhs );
802 template< typename MT2 >
803 inline
DisableIf_< IsComputation<MT2>, SymmetricMatrix& > operator-=( const Matrix<MT2,SO>& rhs );
805 template< typename MT2 >
806 inline
EnableIf_< IsComputation<MT2>, SymmetricMatrix& > operator-=( const Matrix<MT2,SO>& rhs );
808 template< typename MT2 >
809 inline SymmetricMatrix& operator-=( const Matrix<MT2,!SO>& rhs );
811 template< typename MT2 >
812 inline
DisableIf_< IsComputation<MT2>, SymmetricMatrix& > operator%=( const Matrix<MT2,SO>& rhs );
814 template< typename MT2 >
815 inline
EnableIf_< IsComputation<MT2>, SymmetricMatrix& > operator%=( const Matrix<MT2,SO>& rhs );
817 template< typename MT2 >
818 inline SymmetricMatrix& operator%=( const Matrix<MT2,!SO>& rhs );
820 template< typename MT2,
bool SO2 >
821 inline SymmetricMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
823 template< typename Other >
824 inline
EnableIf_< IsNumeric<Other>, SymmetricMatrix >& operator*=( Other rhs );
826 template< typename Other >
827 inline
EnableIf_< IsNumeric<Other>, SymmetricMatrix >& operator/=( Other rhs );
834 inline
size_t rows() const noexcept;
835 inline
size_t columns() const noexcept;
836 inline
size_t spacing() const noexcept;
837 inline
size_t capacity() const noexcept;
838 inline
size_t capacity(
size_t i ) const noexcept;
840 inline
size_t nonZeros(
size_t i ) const;
842 inline
void reset(
size_t i );
844 void resize (
size_t n,
bool preserve=true );
845 inline
void extend (
size_t n,
bool preserve=true );
846 inline
void reserve(
size_t elements );
848 inline
void swap( SymmetricMatrix& m ) noexcept;
858 template< typename Other > inline SymmetricMatrix& scale( const Other& scalar );
865 inline
bool isIntact() const noexcept;
872 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
873 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
875 inline
bool isAligned () const noexcept;
876 inline
bool canSMPAssign() const noexcept;
882 inline
void store (
size_t i,
size_t j, const SIMDType& value ) noexcept;
883 inline
void storea(
size_t i,
size_t j, const SIMDType& value ) noexcept;
884 inline
void storeu(
size_t i,
size_t j, const SIMDType& value ) noexcept;
885 inline
void stream(
size_t i,
size_t j, const SIMDType& value ) noexcept;
903 template<
bool RF,
typename MT2,
bool SO2,
bool DF2,
bool NF2 >
904 friend bool isDefault(
const SymmetricMatrix<MT2,SO2,DF2,NF2>& m );
906 template< InversionFlag IF,
typename MT2,
bool SO2 >
907 friend void invert( SymmetricMatrix<MT2,SO2,true,true>& m );
943 template<
typename MT
945 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix()
961 template<
typename MT
963 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix(
size_t n )
998 template<
typename MT
1000 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix( initializer_list< initializer_list<ElementType> > list )
1039 template<
typename MT
1041 template<
typename Other >
1042 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix(
size_t n,
const Other* array )
1043 : matrix_( n, n, array )
1078 template<
typename MT
1080 template<
typename Other
1082 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix(
const Other (&array)[N][N] )
1127 template<
typename MT
1129 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix(
ElementType* ptr,
size_t n )
1130 : matrix_( ptr, n, n )
1176 template<
typename MT
1178 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix(
ElementType* ptr,
size_t n,
size_t nn )
1179 : matrix_( ptr, n, n, nn )
1197 template<
typename MT
1199 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix(
const SymmetricMatrix& m )
1200 : matrix_( m.matrix_ )
1215 template<
typename MT
1217 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix( SymmetricMatrix&& m ) noexcept
1218 : matrix_( std::move( m.matrix_ ) )
1237 template<
typename MT
1239 template<
typename MT2 >
1240 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix(
const Matrix<MT2,SO>& m )
1243 if( !IsSymmetric<MT2>::value && !
isSymmetric( matrix_ ) ) {
1264 template<
typename MT
1266 template<
typename MT2 >
1267 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix(
const Matrix<MT2,!SO>& m )
1268 : matrix_(
trans( ~m ) )
1270 if( !IsSymmetric<MT2>::value && !
isSymmetric( matrix_ ) ) {
1304 template<
typename MT
1307 SymmetricMatrix<MT,SO,true,true>::operator()(
size_t i,
size_t j )
1333 template<
typename MT
1336 SymmetricMatrix<MT,SO,true,true>::operator()(
size_t i,
size_t j )
const 1341 return matrix_(i,j);
1363 template<
typename MT
1366 SymmetricMatrix<MT,SO,true,true>::at(
size_t i,
size_t j )
1374 return (*
this)(i,j);
1396 template<
typename MT
1399 SymmetricMatrix<MT,SO,true,true>::at(
size_t i,
size_t j )
const 1407 return (*
this)(i,j);
1427 template<
typename MT
1429 inline typename SymmetricMatrix<MT,SO,true,true>::ConstPointer
1430 SymmetricMatrix<MT,SO,true,true>::data() const noexcept
1432 return matrix_.data();
1449 template<
typename MT
1451 inline typename SymmetricMatrix<MT,SO,true,true>::ConstPointer
1452 SymmetricMatrix<MT,SO,true,true>::data(
size_t i )
const noexcept
1454 return matrix_.data(i);
1472 template<
typename MT
1478 return Iterator( matrix_, 0UL, i );
1480 return Iterator( matrix_, i, 0UL );
1498 template<
typename MT
1503 return matrix_.begin(i);
1521 template<
typename MT
1526 return matrix_.cbegin(i);
1544 template<
typename MT
1570 template<
typename MT
1575 return matrix_.end(i);
1593 template<
typename MT
1598 return matrix_.cend(i);
1636 template<
typename MT
1638 inline SymmetricMatrix<MT,SO,true,true>&
1639 SymmetricMatrix<MT,SO,true,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1647 matrix_ = std::move( tmp );
1682 template<
typename MT
1684 template<
typename Other
1686 inline SymmetricMatrix<MT,SO,true,true>&
1687 SymmetricMatrix<MT,SO,true,true>::operator=(
const Other (&array)[N][N] )
1695 matrix_ = std::move( tmp );
1716 template<
typename MT
1718 inline SymmetricMatrix<MT,SO,true,true>&
1719 SymmetricMatrix<MT,SO,true,true>::operator=(
const SymmetricMatrix& rhs )
1721 matrix_ = rhs.matrix_;
1739 template<
typename MT
1741 inline SymmetricMatrix<MT,SO,true,true>&
1742 SymmetricMatrix<MT,SO,true,true>::operator=( SymmetricMatrix&& rhs ) noexcept
1744 matrix_ = std::move( rhs.matrix_ );
1768 template<
typename MT
1770 template<
typename MT2 >
1771 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
1772 SymmetricMatrix<MT,SO,true,true>::operator=(
const Matrix<MT2,SO>& rhs )
1774 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1802 template<
typename MT
1804 template<
typename MT2 >
1805 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
1806 SymmetricMatrix<MT,SO,true,true>::operator=(
const Matrix<MT2,SO>& rhs )
1808 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1812 if( IsSymmetric<MT2>::value ) {
1822 matrix_ = std::move( tmp );
1847 template<
typename MT
1849 template<
typename MT2 >
1850 inline SymmetricMatrix<MT,SO,true,true>&
1851 SymmetricMatrix<MT,SO,true,true>::operator=(
const Matrix<MT2,!SO>& rhs )
1853 return this->operator=(
trans( ~rhs ) );
1872 template<
typename MT
1874 template<
typename MT2 >
1875 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
1878 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1906 template<
typename MT
1908 template<
typename MT2 >
1909 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
1912 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1916 if( IsSymmetric<MT2>::value ) {
1920 const ResultType_<MT2> tmp( ~rhs );
1952 template<
typename MT
1954 template<
typename MT2 >
1955 inline SymmetricMatrix<MT,SO,true,true>&
1977 template<
typename MT
1979 template<
typename MT2 >
1980 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
1983 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
2011 template<
typename MT
2013 template<
typename MT2 >
2014 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
2017 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
2021 if( IsSymmetric<MT2>::value ) {
2025 const ResultType_<MT2> tmp( ~rhs );
2057 template<
typename MT
2059 template<
typename MT2 >
2060 inline SymmetricMatrix<MT,SO,true,true>&
2083 template<
typename MT
2085 template<
typename MT2 >
2086 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
2087 SymmetricMatrix<MT,SO,true,true>::operator%=(
const Matrix<MT2,SO>& rhs )
2089 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
2118 template<
typename MT
2120 template<
typename MT2 >
2121 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
2122 SymmetricMatrix<MT,SO,true,true>::operator%=(
const Matrix<MT2,SO>& rhs )
2124 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
2128 if( IsSymmetric<MT2>::value ) {
2132 const ResultType_<MT2> tmp( ~rhs );
2164 template<
typename MT
2166 template<
typename MT2 >
2167 inline SymmetricMatrix<MT,SO,true,true>&
2168 SymmetricMatrix<MT,SO,true,true>::operator%=(
const Matrix<MT2,!SO>& rhs )
2170 return this->operator%=(
trans( ~rhs ) );
2188 template<
typename MT
2190 template<
typename MT2
2192 inline SymmetricMatrix<MT,SO,true,true>&
2195 if( matrix_.rows() != (~rhs).
columns() ) {
2199 MT tmp( matrix_ * ~rhs );
2205 matrix_ = std::move( tmp );
2224 template<
typename MT
2226 template<
typename Other >
2227 inline EnableIf_< IsNumeric<Other>, SymmetricMatrix<MT,SO,true,true> >&
2244 template<
typename MT
2246 template<
typename Other >
2247 inline EnableIf_< IsNumeric<Other>, SymmetricMatrix<MT,SO,true,true> >&
2273 template<
typename MT
2277 return matrix_.rows();
2289 template<
typename MT
2293 return matrix_.columns();
2311 template<
typename MT
2315 return matrix_.spacing();
2327 template<
typename MT
2331 return matrix_.capacity();
2348 template<
typename MT
2352 return matrix_.capacity(i);
2364 template<
typename MT
2368 return matrix_.nonZeros();
2386 template<
typename MT
2390 return matrix_.nonZeros(i);
2402 template<
typename MT
2448 template<
typename MT
2452 row ( matrix_, i ).reset();
2453 column( matrix_, i ).reset();
2471 template<
typename MT
2518 template<
typename MT
2528 const size_t oldsize( matrix_.rows() );
2530 matrix_.resize( n, n,
true );
2533 const size_t increment( n - oldsize );
2534 submatrix( matrix_, 0UL, oldsize, oldsize, increment ).reset();
2535 submatrix( matrix_, oldsize, 0UL, increment, n ).reset();
2555 template<
typename MT
2557 inline void SymmetricMatrix<MT,SO,true,true>::extend(
size_t n,
bool preserve )
2578 template<
typename MT
2580 inline void SymmetricMatrix<MT,SO,true,true>::reserve(
size_t elements )
2582 matrix_.reserve( elements );
2598 template<
typename MT
2602 matrix_.shrinkToFit();
2615 template<
typename MT
2621 swap( matrix_, m.matrix_ );
2641 template<
typename MT
2657 template<
typename MT
2661 if( !IsBuiltin<ElementType>::value )
2688 template<
typename MT
2690 template<
typename Other >
2691 inline SymmetricMatrix<MT,SO,true,true>&
2692 SymmetricMatrix<MT,SO,true,true>::scale(
const Other& scalar )
2694 matrix_.scale( scalar );
2719 template<
typename MT
2750 template<
typename MT
2752 template<
typename Other >
2753 inline bool SymmetricMatrix<MT,SO,true,true>::canAlias(
const Other* alias )
const noexcept
2755 return matrix_.canAlias( alias );
2772 template<
typename MT
2774 template<
typename Other >
2775 inline bool SymmetricMatrix<MT,SO,true,true>::isAliased(
const Other* alias )
const noexcept
2777 return matrix_.isAliased( alias );
2793 template<
typename MT
2795 inline bool SymmetricMatrix<MT,SO,true,true>::isAligned() const noexcept
2797 return matrix_.isAligned();
2814 template<
typename MT
2816 inline bool SymmetricMatrix<MT,SO,true,true>::canSMPAssign() const noexcept
2818 return matrix_.canSMPAssign();
2840 template<
typename MT
2843 SymmetricMatrix<MT,SO,true,true>::load(
size_t i,
size_t j )
const noexcept
2845 return matrix_.load( i, j );
2867 template<
typename MT
2872 return matrix_.loada( i, j );
2894 template<
typename MT
2899 return matrix_.loadu( i, j );
2922 template<
typename MT
2925 SymmetricMatrix<MT,SO,true,true>::store(
size_t i,
size_t j,
const SIMDType& value ) noexcept
2927 matrix_.store( i, j, value );
2930 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
2931 for(
size_t k=i; k<kend; ++k )
2932 matrix_(j,k) = matrix_(k,j);
2935 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
2936 for(
size_t k=j; k<kend; ++k )
2937 matrix_(k,i) = matrix_(i,k);
2961 template<
typename MT
2966 matrix_.storea( i, j, value );
2969 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
2970 for(
size_t k=i; k<kend; ++k )
2971 matrix_(j,k) = matrix_(k,j);
2974 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
2975 for(
size_t k=j; k<kend; ++k )
2976 matrix_(k,i) = matrix_(i,k);
3000 template<
typename MT
3005 matrix_.storeu( i, j, value );
3008 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
3009 for(
size_t k=i; k<kend; ++k )
3010 matrix_(j,k) = matrix_(k,j);
3013 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
3014 for(
size_t k=j; k<kend; ++k )
3015 matrix_(k,i) = matrix_(i,k);
3039 template<
typename MT
3044 matrix_.stream( i, j, value );
3047 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
3048 for(
size_t k=i; k<kend; ++k )
3049 matrix_(j,k) = matrix_(k,j);
3052 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
3053 for(
size_t k=j; k<kend; ++k )
3054 matrix_(k,i) = matrix_(i,k);
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
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
Header file for the NumericProxy class.
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
Header file for the implementation of the base template of the SymmetricMatrix.
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
Header file for the DisableIf class template.
Header file for the IsSymmetric type trait.
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
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 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
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:270
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE void conjugate(T &a) noexcept(IsNumeric< T >::value)
In-place conjugation of the given value/object.
Definition: Conjugate.h:120
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
bool isSymmetric(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is symmetric.
Definition: DenseMatrix.h:700
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
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:252
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
#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
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.
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:635