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 typedef OppositeType_<MT> OT;
115 typedef TransposeType_<MT> TT;
116 typedef ElementType_<MT> ET;
121 typedef SymmetricMatrix<MT,SO,true,true>
This;
122 typedef DenseMatrix<This,SO>
BaseType;
127 typedef SIMDType_<MT> SIMDType;
132 typedef Pointer_<MT> Pointer;
133 typedef ConstPointer_<MT> ConstPointer;
140 template<
typename ET >
143 typedef SymmetricMatrix< typename MT::template Rebind<ET>::Other > Other;
154 typedef std::random_access_iterator_tag IteratorCategory;
155 typedef ElementType_<MT> ValueType;
156 typedef NumericProxy<MT> PointerType;
157 typedef NumericProxy<MT> ReferenceType;
158 typedef ptrdiff_t DifferenceType;
161 typedef IteratorCategory iterator_category;
162 typedef ValueType value_type;
163 typedef PointerType pointer;
164 typedef ReferenceType reference;
165 typedef DifferenceType difference_type;
199 ( SO )?( row_ += inc ):( column_ += inc );
211 ( SO )?( row_ -= dec ):( column_ -= dec );
221 inline Iterator& operator++() noexcept {
222 ( SO )?( ++row_ ):( ++column_ );
232 inline const Iterator operator++(
int ) noexcept {
244 inline Iterator& operator--() noexcept {
245 ( SO )?( --row_ ):( --column_ );
255 inline const Iterator operator--(
int ) noexcept {
268 return ReferenceType( *matrix_, row_, column_ );
277 inline PointerType operator->()
const {
278 return PointerType( *matrix_, row_, column_ );
292 inline SIMDType load()
const {
293 return (*matrix_).load(row_,column_);
307 inline SIMDType
loada()
const {
308 return (*matrix_).loada(row_,column_);
322 inline SIMDType
loadu()
const {
323 return (*matrix_).loadu(row_,column_);
338 inline void store(
const SIMDType& value )
const {
339 (*matrix_).store( row_, column_, value );
355 inline void storea(
const SIMDType& value )
const {
356 (*matrix_).storea( row_, column_, value );
372 inline void storeu(
const SIMDType& value )
const {
373 (*matrix_).storeu( row_, column_, value );
389 inline void stream(
const SIMDType& value )
const {
390 (*matrix_).stream( row_, column_, value );
402 return matrix_->begin( column_ ) + row_;
404 return matrix_->begin( row_ ) + column_;
416 return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
452 return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
488 return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
524 return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
560 return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
596 return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
631 return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
644 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
646 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
659 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
661 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
674 return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
676 return Iterator( *it.matrix_, it.row_, it.column_ - dec );
688 const size_t kend(
min( row_+SIMDSIZE, (*matrix_).rows() ) );
689 for(
size_t k=row_; k<kend; ++k )
690 (*matrix_)(column_,k) = (*matrix_)(k,column_);
693 const size_t kend(
min( column_+SIMDSIZE, (*matrix_).columns() ) );
694 for(
size_t k=column_; k<kend; ++k )
695 (*matrix_)(k,row_) = (*matrix_)(row_,k);
710 enum :
bool { simdEnabled = MT::simdEnabled };
713 enum :
bool { smpAssignable = MT::smpAssignable };
719 explicit inline SymmetricMatrix();
720 explicit inline SymmetricMatrix(
size_t n );
721 explicit inline SymmetricMatrix( initializer_list< initializer_list<ElementType> > list );
723 template<
typename Other >
724 explicit inline SymmetricMatrix(
size_t n,
const Other* array );
726 template<
typename Other,
size_t N >
727 explicit inline SymmetricMatrix(
const Other (&array)[N][N] );
729 explicit inline SymmetricMatrix( ElementType* ptr,
size_t n );
730 explicit inline SymmetricMatrix( ElementType* ptr,
size_t n,
size_t nn );
732 template<
typename Deleter >
733 explicit inline SymmetricMatrix( ElementType* ptr,
size_t n, Deleter d );
735 template<
typename Deleter >
736 explicit inline SymmetricMatrix( ElementType* ptr,
size_t n,
size_t nn, Deleter d );
738 inline SymmetricMatrix(
const SymmetricMatrix& m );
739 inline SymmetricMatrix( SymmetricMatrix&& m ) noexcept;
741 template< typename MT2 > inline SymmetricMatrix( const Matrix<MT2,SO>& m );
742 template< typename MT2 > inline SymmetricMatrix( const Matrix<MT2,!SO>& m );
753 inline Reference operator()(
size_t i,
size_t j );
754 inline ConstReference operator()(
size_t i,
size_t j ) const;
755 inline Reference at(
size_t i,
size_t j );
756 inline ConstReference at(
size_t i,
size_t j ) const;
757 inline ConstPointer data () const noexcept;
758 inline ConstPointer data (
size_t i ) const noexcept;
760 inline ConstIterator
begin (
size_t i ) const;
761 inline ConstIterator
cbegin(
size_t i ) const;
763 inline ConstIterator
end (
size_t i ) const;
764 inline ConstIterator
cend (
size_t i ) const;
771 inline SymmetricMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
773 template< typename Other,
size_t N >
774 inline SymmetricMatrix& operator=( const Other (&array)[N][N] );
776 inline SymmetricMatrix& operator=( const SymmetricMatrix& rhs );
777 inline SymmetricMatrix& operator=( SymmetricMatrix&& rhs ) noexcept;
779 template< typename MT2 >
780 inline
DisableIf_< IsComputation<MT2>, SymmetricMatrix& > operator=( const Matrix<MT2,SO>& rhs );
782 template< typename MT2 >
783 inline
EnableIf_< IsComputation<MT2>, SymmetricMatrix& > operator=( const Matrix<MT2,SO>& rhs );
785 template< typename MT2 >
786 inline SymmetricMatrix& operator=( const Matrix<MT2,!SO>& rhs );
788 template< typename MT2 >
789 inline
DisableIf_< IsComputation<MT2>, SymmetricMatrix& > operator+=( const Matrix<MT2,SO>& rhs );
791 template< typename MT2 >
792 inline
EnableIf_< IsComputation<MT2>, SymmetricMatrix& > operator+=( const Matrix<MT2,SO>& rhs );
794 template< typename MT2 >
795 inline SymmetricMatrix& operator+=( const Matrix<MT2,!SO>& rhs );
797 template< typename MT2 >
798 inline
DisableIf_< IsComputation<MT2>, SymmetricMatrix& > operator-=( const Matrix<MT2,SO>& rhs );
800 template< typename MT2 >
801 inline
EnableIf_< IsComputation<MT2>, SymmetricMatrix& > operator-=( const Matrix<MT2,SO>& rhs );
803 template< typename MT2 >
804 inline SymmetricMatrix& operator-=( const Matrix<MT2,!SO>& rhs );
806 template< typename MT2,
bool SO2 >
807 inline SymmetricMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
809 template< typename Other >
810 inline
EnableIf_< IsNumeric<Other>, SymmetricMatrix >& operator*=( Other rhs );
812 template< typename Other >
813 inline
EnableIf_< IsNumeric<Other>, SymmetricMatrix >& operator/=( Other rhs );
820 inline
size_t rows() const noexcept;
821 inline
size_t columns() const noexcept;
822 inline
size_t spacing() const noexcept;
823 inline
size_t capacity() const noexcept;
824 inline
size_t capacity(
size_t i ) const noexcept;
826 inline
size_t nonZeros(
size_t i ) const;
828 inline
void reset(
size_t i );
830 void resize (
size_t n,
bool preserve=true );
831 inline
void extend (
size_t n,
bool preserve=true );
832 inline
void reserve(
size_t elements );
835 template< typename Other > inline SymmetricMatrix& scale( const Other& scalar );
836 inline
void swap( SymmetricMatrix& m ) noexcept;
843 inline
bool isIntact() const noexcept;
850 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
851 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
853 inline
bool isAligned () const noexcept;
854 inline
bool canSMPAssign() const noexcept;
860 inline
void store (
size_t i,
size_t j, const SIMDType& value ) noexcept;
861 inline
void storea(
size_t i,
size_t j, const SIMDType& value ) noexcept;
862 inline
void storeu(
size_t i,
size_t j, const SIMDType& value ) noexcept;
863 inline
void stream(
size_t i,
size_t j, const SIMDType& value ) noexcept;
881 template<
typename MT2,
bool SO2,
bool DF2,
bool NF2 >
882 friend bool isDefault(
const SymmetricMatrix<MT2,SO2,DF2,NF2>& m );
884 template< InversionFlag IF,
typename MT2,
bool SO2 >
885 friend void invert( SymmetricMatrix<MT2,SO2,true,true>& m );
921 template<
typename MT
923 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix()
939 template<
typename MT
941 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix(
size_t n )
942 : matrix_( n, n, ElementType() )
976 template<
typename MT
978 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix( initializer_list< initializer_list<ElementType> > list )
1017 template<
typename MT
1019 template<
typename Other >
1020 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix(
size_t n,
const Other* array )
1021 : matrix_( n, n, array )
1056 template<
typename MT
1058 template<
typename Other
1060 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix(
const Other (&array)[N][N] )
1094 template<
typename MT
1096 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix( ElementType* ptr,
size_t n )
1097 : matrix_( ptr, n, n )
1132 template<
typename MT
1134 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix( ElementType* ptr,
size_t n,
size_t nn )
1135 : matrix_( ptr, n, n, nn )
1168 template<
typename MT
1170 template<
typename Deleter >
1171 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix( ElementType* ptr,
size_t n, Deleter d )
1172 : matrix_( ptr, n, n, d )
1206 template<
typename MT
1208 template<
typename Deleter >
1209 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix( ElementType* ptr,
size_t n,
size_t nn, Deleter d )
1210 : matrix_( ptr, n, n, nn, d )
1228 template<
typename MT
1230 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix(
const SymmetricMatrix& m )
1231 : matrix_( m.matrix_ )
1246 template<
typename MT
1248 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix( SymmetricMatrix&& m ) noexcept
1249 : matrix_(
std::move( m.matrix_ ) )
1268 template<
typename MT
1270 template<
typename MT2 >
1271 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix(
const Matrix<MT2,SO>& m )
1274 if( !IsSymmetric<MT2>::value && !
isSymmetric( matrix_ ) ) {
1295 template<
typename MT
1297 template<
typename MT2 >
1298 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix(
const Matrix<MT2,!SO>& m )
1299 : matrix_(
trans( ~m ) )
1301 if( !IsSymmetric<MT2>::value && !
isSymmetric( matrix_ ) ) {
1335 template<
typename MT
1338 SymmetricMatrix<MT,SO,true,true>::operator()(
size_t i,
size_t j )
1364 template<
typename MT
1367 SymmetricMatrix<MT,SO,true,true>::operator()(
size_t i,
size_t j )
const
1372 return matrix_(i,j);
1394 template<
typename MT
1397 SymmetricMatrix<MT,SO,true,true>::at(
size_t i,
size_t j )
1405 return (*
this)(i,j);
1427 template<
typename MT
1430 SymmetricMatrix<MT,SO,true,true>::at(
size_t i,
size_t j )
const
1438 return (*
this)(i,j);
1458 template<
typename MT
1460 inline typename SymmetricMatrix<MT,SO,true,true>::ConstPointer
1461 SymmetricMatrix<MT,SO,true,true>::data() const noexcept
1463 return matrix_.data();
1480 template<
typename MT
1482 inline typename SymmetricMatrix<MT,SO,true,true>::ConstPointer
1483 SymmetricMatrix<MT,SO,true,true>::data(
size_t i )
const noexcept
1485 return matrix_.data(i);
1503 template<
typename MT
1509 return Iterator( matrix_, 0UL, i );
1511 return Iterator( matrix_, i, 0UL );
1529 template<
typename MT
1534 return matrix_.begin(i);
1552 template<
typename MT
1557 return matrix_.cbegin(i);
1575 template<
typename MT
1601 template<
typename MT
1606 return matrix_.end(i);
1624 template<
typename MT
1629 return matrix_.cend(i);
1667 template<
typename MT
1669 inline SymmetricMatrix<MT,SO,true,true>&
1670 SymmetricMatrix<MT,SO,true,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1678 matrix_ = std::move( tmp );
1713 template<
typename MT
1715 template<
typename Other
1717 inline SymmetricMatrix<MT,SO,true,true>&
1718 SymmetricMatrix<MT,SO,true,true>::operator=(
const Other (&array)[N][N] )
1726 matrix_ = std::move( tmp );
1747 template<
typename MT
1749 inline SymmetricMatrix<MT,SO,true,true>&
1750 SymmetricMatrix<MT,SO,true,true>::operator=(
const SymmetricMatrix& rhs )
1752 matrix_ = rhs.matrix_;
1770 template<
typename MT
1772 inline SymmetricMatrix<MT,SO,true,true>&
1773 SymmetricMatrix<MT,SO,true,true>::operator=( SymmetricMatrix&& rhs ) noexcept
1775 matrix_ = std::move( rhs.matrix_ );
1799 template<
typename MT
1801 template<
typename MT2 >
1802 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
1803 SymmetricMatrix<MT,SO,true,true>::operator=(
const Matrix<MT2,SO>& rhs )
1805 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1833 template<
typename MT
1835 template<
typename MT2 >
1836 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
1837 SymmetricMatrix<MT,SO,true,true>::operator=(
const Matrix<MT2,SO>& rhs )
1839 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1843 if( IsSymmetric<MT2>::value ) {
1853 matrix_ = std::move( tmp );
1878 template<
typename MT
1880 template<
typename MT2 >
1881 inline SymmetricMatrix<MT,SO,true,true>&
1882 SymmetricMatrix<MT,SO,true,true>::operator=(
const Matrix<MT2,!SO>& rhs )
1884 return this->operator=(
trans( ~rhs ) );
1903 template<
typename MT
1905 template<
typename MT2 >
1906 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
1909 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1937 template<
typename MT
1939 template<
typename MT2 >
1940 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
1943 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1947 if( IsSymmetric<MT2>::value ) {
1951 const ResultType_<MT2> tmp( ~rhs );
1983 template<
typename MT
1985 template<
typename MT2 >
1986 inline SymmetricMatrix<MT,SO,true,true>&
2008 template<
typename MT
2010 template<
typename MT2 >
2011 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
2014 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
2042 template<
typename MT
2044 template<
typename MT2 >
2045 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
2048 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
2052 if( IsSymmetric<MT2>::value ) {
2056 const ResultType_<MT2> tmp( ~rhs );
2088 template<
typename MT
2090 template<
typename MT2 >
2091 inline SymmetricMatrix<MT,SO,true,true>&
2112 template<
typename MT
2114 template<
typename MT2
2116 inline SymmetricMatrix<MT,SO,true,true>&
2119 if( matrix_.rows() != (~rhs).
columns() ) {
2123 MT tmp( matrix_ * ~rhs );
2129 matrix_ = std::move( tmp );
2148 template<
typename MT
2150 template<
typename Other >
2151 inline EnableIf_< IsNumeric<Other>, SymmetricMatrix<MT,SO,true,true> >&
2168 template<
typename MT
2170 template<
typename Other >
2171 inline EnableIf_< IsNumeric<Other>, SymmetricMatrix<MT,SO,true,true> >&
2197 template<
typename MT
2201 return matrix_.rows();
2213 template<
typename MT
2217 return matrix_.columns();
2235 template<
typename MT
2239 return matrix_.spacing();
2251 template<
typename MT
2255 return matrix_.capacity();
2272 template<
typename MT
2276 return matrix_.capacity(i);
2288 template<
typename MT
2292 return matrix_.nonZeros();
2310 template<
typename MT
2314 return matrix_.nonZeros(i);
2326 template<
typename MT
2372 template<
typename MT
2376 row ( matrix_, i ).reset();
2377 column( matrix_, i ).reset();
2395 template<
typename MT
2442 template<
typename MT
2452 const size_t oldsize( matrix_.rows() );
2454 matrix_.resize( n, n,
true );
2457 const size_t increment( n - oldsize );
2458 submatrix( matrix_, 0UL, oldsize, oldsize, increment ).reset();
2459 submatrix( matrix_, oldsize, 0UL, increment, n ).reset();
2479 template<
typename MT
2481 inline void SymmetricMatrix<MT,SO,true,true>::extend(
size_t n,
bool preserve )
2502 template<
typename MT
2504 inline void SymmetricMatrix<MT,SO,true,true>::reserve(
size_t elements )
2506 matrix_.reserve( elements );
2518 template<
typename MT
2534 template<
typename MT
2538 if( !IsBuiltin<ElementType>::value )
2554 template<
typename MT
2556 template<
typename Other >
2557 inline SymmetricMatrix<MT,SO,true,true>&
2558 SymmetricMatrix<MT,SO,true,true>::scale(
const Other& scalar )
2560 matrix_.scale( scalar );
2574 template<
typename MT
2580 swap( matrix_, m.matrix_ );
2604 template<
typename MT
2635 template<
typename MT
2637 template<
typename Other >
2638 inline bool SymmetricMatrix<MT,SO,true,true>::canAlias(
const Other* alias )
const noexcept
2640 return matrix_.canAlias( alias );
2657 template<
typename MT
2659 template<
typename Other >
2660 inline bool SymmetricMatrix<MT,SO,true,true>::isAliased(
const Other* alias )
const noexcept
2662 return matrix_.isAliased( alias );
2678 template<
typename MT
2680 inline bool SymmetricMatrix<MT,SO,true,true>::isAligned() const noexcept
2682 return matrix_.isAligned();
2699 template<
typename MT
2701 inline bool SymmetricMatrix<MT,SO,true,true>::canSMPAssign() const noexcept
2703 return matrix_.canSMPAssign();
2725 template<
typename MT
2728 SymmetricMatrix<MT,SO,true,true>::load(
size_t i,
size_t j )
const noexcept
2730 return matrix_.load( i, j );
2752 template<
typename MT
2757 return matrix_.loada( i, j );
2779 template<
typename MT
2784 return matrix_.loadu( i, j );
2807 template<
typename MT
2810 SymmetricMatrix<MT,SO,true,true>::store(
size_t i,
size_t j,
const SIMDType& value ) noexcept
2812 matrix_.store( i, j, value );
2815 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
2816 for(
size_t k=i; k<kend; ++k )
2817 matrix_(j,k) = matrix_(k,j);
2820 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
2821 for(
size_t k=j; k<kend; ++k )
2822 matrix_(k,i) = matrix_(i,k);
2846 template<
typename MT
2851 matrix_.storea( i, j, value );
2854 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
2855 for(
size_t k=i; k<kend; ++k )
2856 matrix_(j,k) = matrix_(k,j);
2859 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
2860 for(
size_t k=j; k<kend; ++k )
2861 matrix_(k,i) = matrix_(i,k);
2885 template<
typename MT
2890 matrix_.storeu( i, j, value );
2893 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
2894 for(
size_t k=i; k<kend; ++k )
2895 matrix_(j,k) = matrix_(k,j);
2898 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
2899 for(
size_t k=j; k<kend; ++k )
2900 matrix_(k,i) = matrix_(i,k);
2924 template<
typename MT
2929 matrix_.stream( i, j, value );
2932 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
2933 for(
size_t k=i; k<kend; ++k )
2934 matrix_(j,k) = matrix_(k,j);
2937 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
2938 for(
size_t k=j; k<kend; ++k )
2939 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.
Constraint on the data type.
Header file for mathematical functions.
#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.
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7800
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:346
Header file for basic type definitions.
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:404
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:258
#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
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:1339
Constraint on the data type.
Header file for the dense matrix inversion flags.
bool isSymmetric(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is symmetric.
Definition: DenseMatrix.h:689
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:188
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
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
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2643
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5077
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1669
bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:366
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:590
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2636
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:442
#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:384
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
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:1321
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.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2639
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, ColumnExprTrait_< MT > > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:126
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:298
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:232
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Header file for the implementation of the base template of the SymmetricMatrix.
Constraint on the data type.
Constraint on the data type.
constexpr bool spacing
Adding an additional spacing line between two log messages.This setting gives the opportunity to add ...
Definition: Logging.h:70
Header file for the std::initializer_list aliases.
Header file for the IsSquare type trait.
Constraint on the data type.
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:741
Header file for the DisableIf class template.
Header file for the IsSymmetric type trait.
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:5148
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:5131
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
#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
#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.
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:330
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
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2640
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:538
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:254
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2641
Header file for all forward declarations for expression class templates.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2645
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:553
Header file for all restructuring column functions.
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, RowExprTrait_< MT > > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:126
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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2642
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:1285
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
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2646
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:258
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
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
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:314
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2637
bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:328
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE(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
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:950
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
#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 operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2638
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2644
#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:1303
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
SubmatrixExprTrait_< MT, unaligned > 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:167
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:609
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:564