35 #ifndef _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_DENSENUMERIC_H_ 36 #define _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_DENSENUMERIC_H_ 109 template<
typename MT
111 class SymmetricMatrix<MT,SO,true,true>
112 :
public DenseMatrix< SymmetricMatrix<MT,SO,true,true>, SO >
116 using OT = OppositeType_<MT>;
117 using TT = TransposeType_<MT>;
118 using ET = ElementType_<MT>;
123 using This = SymmetricMatrix<MT,SO,true,true>;
124 using BaseType = DenseMatrix<This,SO>;
129 using SIMDType = SIMDType_<MT>;
134 using Pointer = Pointer_<MT>;
135 using ConstPointer = ConstPointer_<MT>;
142 template<
typename NewType >
145 using Other = SymmetricMatrix< typename MT::template Rebind<NewType>::Other >;
152 template<
size_t NewM
156 using Other = SymmetricMatrix< typename MT::template Resize<NewM,NewN>::Other >;
167 using IteratorCategory = std::random_access_iterator_tag;
168 using ValueType = ElementType_<MT>;
169 using PointerType = NumericProxy<MT>;
170 using ReferenceType = NumericProxy<MT>;
171 using DifferenceType = ptrdiff_t;
174 using iterator_category = IteratorCategory;
175 using value_type = ValueType;
176 using pointer = PointerType;
177 using reference = ReferenceType;
178 using difference_type = DifferenceType;
212 ( SO )?( row_ += inc ):( column_ += inc );
224 ( SO )?( row_ -= dec ):( column_ -= dec );
234 inline Iterator& operator++() noexcept {
235 ( SO )?( ++row_ ):( ++column_ );
245 inline const Iterator operator++(
int ) noexcept {
257 inline Iterator& operator--() noexcept {
258 ( SO )?( --row_ ):( --column_ );
268 inline const Iterator operator--(
int ) noexcept {
281 return ReferenceType( *matrix_, row_, column_ );
290 inline PointerType operator->()
const {
291 return PointerType( *matrix_, row_, column_ );
305 inline SIMDType load()
const {
306 return (*matrix_).load(row_,column_);
320 inline SIMDType
loada()
const {
321 return (*matrix_).loada(row_,column_);
335 inline SIMDType
loadu()
const {
336 return (*matrix_).loadu(row_,column_);
351 inline void store(
const SIMDType& value )
const {
352 (*matrix_).store( row_, column_, value );
368 inline void storea(
const SIMDType& value )
const {
369 (*matrix_).storea( row_, column_, value );
385 inline void storeu(
const SIMDType& value )
const {
386 (*matrix_).storeu( row_, column_, value );
402 inline void stream(
const SIMDType& value )
const {
403 (*matrix_).stream( row_, column_, value );
415 return matrix_->begin( column_ ) + row_;
417 return matrix_->begin( row_ ) + column_;
429 return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
465 return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
501 return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
537 return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
573 return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
609 return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
644 return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
657 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
659 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
672 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
674 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
687 return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
689 return Iterator( *it.matrix_, it.row_, it.column_ - dec );
701 const size_t kend(
min( row_+SIMDSIZE, (*matrix_).rows() ) );
702 for(
size_t k=row_; k<kend; ++k )
703 (*matrix_)(column_,k) = (*matrix_)(k,column_);
706 const size_t kend(
min( column_+SIMDSIZE, (*matrix_).columns() ) );
707 for(
size_t k=column_; k<kend; ++k )
708 (*matrix_)(k,row_) = (*matrix_)(row_,k);
723 enum :
bool { simdEnabled = MT::simdEnabled };
726 enum :
bool { smpAssignable = MT::smpAssignable };
732 explicit inline SymmetricMatrix();
733 explicit inline SymmetricMatrix(
size_t n );
734 explicit inline SymmetricMatrix( initializer_list< initializer_list<ElementType> > list );
736 template<
typename Other >
737 explicit inline SymmetricMatrix(
size_t n,
const Other* array );
739 template<
typename Other,
size_t N >
740 explicit inline SymmetricMatrix(
const Other (&array)[N][N] );
742 explicit inline SymmetricMatrix(
ElementType* ptr,
size_t n );
743 explicit inline SymmetricMatrix(
ElementType* ptr,
size_t n,
size_t nn );
745 inline SymmetricMatrix(
const SymmetricMatrix& m );
746 inline SymmetricMatrix( SymmetricMatrix&& m ) noexcept;
748 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,SO>& m );
749 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,!SO>& m );
760 inline Reference operator()(
size_t i,
size_t j );
762 inline Reference at(
size_t i,
size_t j );
764 inline ConstPointer
data () const noexcept;
765 inline ConstPointer
data (
size_t i ) const noexcept;
778 inline SymmetricMatrix& operator=( initializer_list< initializer_list<
ElementType> > list );
780 template< typename Other,
size_t N >
781 inline SymmetricMatrix& operator=( const Other (&array)[N][N] );
783 inline SymmetricMatrix& operator=( const SymmetricMatrix& rhs );
784 inline SymmetricMatrix& operator=( SymmetricMatrix&& rhs ) noexcept;
786 template< typename MT2 >
787 inline
DisableIf_< IsComputation<MT2>, SymmetricMatrix& > operator=( const Matrix<MT2,SO>& rhs );
789 template< typename MT2 >
790 inline
EnableIf_< IsComputation<MT2>, SymmetricMatrix& > operator=( const Matrix<MT2,SO>& rhs );
792 template< typename MT2 >
793 inline SymmetricMatrix& operator=( const Matrix<MT2,!SO>& rhs );
795 template< typename MT2 >
796 inline
DisableIf_< IsComputation<MT2>, SymmetricMatrix& > operator+=( const Matrix<MT2,SO>& rhs );
798 template< typename MT2 >
799 inline
EnableIf_< IsComputation<MT2>, SymmetricMatrix& > operator+=( const Matrix<MT2,SO>& rhs );
801 template< typename MT2 >
802 inline SymmetricMatrix& operator+=( const Matrix<MT2,!SO>& rhs );
804 template< typename MT2 >
805 inline
DisableIf_< IsComputation<MT2>, SymmetricMatrix& > operator-=( const Matrix<MT2,SO>& rhs );
807 template< typename MT2 >
808 inline
EnableIf_< IsComputation<MT2>, SymmetricMatrix& > operator-=( const Matrix<MT2,SO>& rhs );
810 template< typename MT2 >
811 inline SymmetricMatrix& operator-=( const Matrix<MT2,!SO>& rhs );
813 template< typename MT2 >
814 inline
DisableIf_< IsComputation<MT2>, SymmetricMatrix& > operator%=( const Matrix<MT2,SO>& rhs );
816 template< typename MT2 >
817 inline
EnableIf_< IsComputation<MT2>, SymmetricMatrix& > operator%=( const Matrix<MT2,SO>& rhs );
819 template< typename MT2 >
820 inline SymmetricMatrix& operator%=( const Matrix<MT2,!SO>& rhs );
822 template< typename ST >
823 inline
EnableIf_< IsNumeric<ST>, SymmetricMatrix >& operator*=( ST rhs );
825 template< typename ST >
826 inline
EnableIf_< IsNumeric<ST>, SymmetricMatrix >& operator/=( ST rhs );
833 inline
size_t rows() const noexcept;
834 inline
size_t columns() const noexcept;
835 inline
size_t spacing() const noexcept;
836 inline
size_t capacity() const noexcept;
837 inline
size_t capacity(
size_t i ) const noexcept;
839 inline
size_t nonZeros(
size_t i ) const;
841 inline
void reset(
size_t i );
843 void resize (
size_t n,
bool preserve=true );
844 inline
void extend (
size_t n,
bool preserve=true );
845 inline
void reserve(
size_t elements );
847 inline
void swap( SymmetricMatrix& m ) noexcept;
857 template< typename Other > inline SymmetricMatrix& scale( const Other& scalar );
864 inline
bool isIntact() const noexcept;
871 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
872 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
874 inline
bool isAligned () const noexcept;
875 inline
bool canSMPAssign() const noexcept;
881 inline
void store (
size_t i,
size_t j, const SIMDType& value ) noexcept;
882 inline
void storea(
size_t i,
size_t j, const SIMDType& value ) noexcept;
883 inline
void storeu(
size_t i,
size_t j, const SIMDType& value ) noexcept;
884 inline
void stream(
size_t i,
size_t j, const SIMDType& value ) noexcept;
902 template<
bool RF,
typename MT2,
bool SO2,
bool DF2,
bool NF2 >
903 friend bool isDefault(
const SymmetricMatrix<MT2,SO2,DF2,NF2>& m );
905 template< InversionFlag IF,
typename MT2,
bool SO2 >
906 friend void invert( SymmetricMatrix<MT2,SO2,true,true>& m );
942 template<
typename MT
944 inline SymmetricMatrix<MT,SO,true,true>::SymmetricMatrix()
960 template<
typename MT
962 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
1432 return matrix_.data();
1449 template<
typename MT
1451 inline typename SymmetricMatrix<MT,SO,true,true>::ConstPointer
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);
1637 template<
typename MT
1639 inline SymmetricMatrix<MT,SO,true,true>&
1640 SymmetricMatrix<MT,SO,true,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1642 const InitializerMatrix<ElementType> tmp( list, list.size() );
1683 template<
typename MT
1685 template<
typename Other
1687 inline SymmetricMatrix<MT,SO,true,true>&
1688 SymmetricMatrix<MT,SO,true,true>::operator=(
const Other (&array)[N][N] )
1696 matrix_ = std::move( tmp );
1717 template<
typename MT
1719 inline SymmetricMatrix<MT,SO,true,true>&
1720 SymmetricMatrix<MT,SO,true,true>::operator=(
const SymmetricMatrix& rhs )
1722 matrix_ = rhs.matrix_;
1740 template<
typename MT
1742 inline SymmetricMatrix<MT,SO,true,true>&
1743 SymmetricMatrix<MT,SO,true,true>::operator=( SymmetricMatrix&& rhs ) noexcept
1745 matrix_ = std::move( rhs.matrix_ );
1769 template<
typename MT
1771 template<
typename MT2 >
1772 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
1773 SymmetricMatrix<MT,SO,true,true>::operator=(
const Matrix<MT2,SO>& rhs )
1775 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1803 template<
typename MT
1805 template<
typename MT2 >
1806 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
1807 SymmetricMatrix<MT,SO,true,true>::operator=(
const Matrix<MT2,SO>& rhs )
1809 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1813 if( IsSymmetric<MT2>::value ) {
1823 matrix_ = std::move( tmp );
1848 template<
typename MT
1850 template<
typename MT2 >
1851 inline SymmetricMatrix<MT,SO,true,true>&
1852 SymmetricMatrix<MT,SO,true,true>::operator=(
const Matrix<MT2,!SO>& rhs )
1854 return this->operator=(
trans( ~rhs ) );
1873 template<
typename MT
1875 template<
typename MT2 >
1876 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
1879 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1907 template<
typename MT
1909 template<
typename MT2 >
1910 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
1913 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1917 if( IsSymmetric<MT2>::value ) {
1921 const ResultType_<MT2> tmp( ~rhs );
1953 template<
typename MT
1955 template<
typename MT2 >
1956 inline SymmetricMatrix<MT,SO,true,true>&
1978 template<
typename MT
1980 template<
typename MT2 >
1981 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
1984 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
2012 template<
typename MT
2014 template<
typename MT2 >
2015 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
2018 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
2022 if( IsSymmetric<MT2>::value ) {
2026 const ResultType_<MT2> tmp( ~rhs );
2058 template<
typename MT
2060 template<
typename MT2 >
2061 inline SymmetricMatrix<MT,SO,true,true>&
2084 template<
typename MT
2086 template<
typename MT2 >
2087 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
2088 SymmetricMatrix<MT,SO,true,true>::operator%=(
const Matrix<MT2,SO>& rhs )
2090 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
2119 template<
typename MT
2121 template<
typename MT2 >
2122 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,true,true>& >
2123 SymmetricMatrix<MT,SO,true,true>::operator%=(
const Matrix<MT2,SO>& rhs )
2125 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
2129 if( IsSymmetric<MT2>::value ) {
2133 const ResultType_<MT2> tmp( ~rhs );
2165 template<
typename MT
2167 template<
typename MT2 >
2168 inline SymmetricMatrix<MT,SO,true,true>&
2169 SymmetricMatrix<MT,SO,true,true>::operator%=(
const Matrix<MT2,!SO>& rhs )
2171 return this->operator%=(
trans( ~rhs ) );
2185 template<
typename MT
2187 template<
typename ST >
2188 inline EnableIf_< IsNumeric<ST>, SymmetricMatrix<MT,SO,true,true> >&
2205 template<
typename MT
2207 template<
typename ST >
2208 inline EnableIf_< IsNumeric<ST>, SymmetricMatrix<MT,SO,true,true> >&
2234 template<
typename MT
2238 return matrix_.rows();
2250 template<
typename MT
2254 return matrix_.columns();
2272 template<
typename MT
2276 return matrix_.spacing();
2288 template<
typename MT
2292 return matrix_.capacity();
2309 template<
typename MT
2313 return matrix_.capacity(i);
2325 template<
typename MT
2329 return matrix_.nonZeros();
2347 template<
typename MT
2351 return matrix_.nonZeros(i);
2363 template<
typename MT
2409 template<
typename MT
2432 template<
typename MT
2479 template<
typename MT
2489 const size_t oldsize( matrix_.rows() );
2491 matrix_.resize( n, n,
true );
2494 const size_t increment( n - oldsize );
2495 submatrix( matrix_, 0UL, oldsize, oldsize, increment ).reset();
2496 submatrix( matrix_, oldsize, 0UL, increment, n ).reset();
2516 template<
typename MT
2518 inline void SymmetricMatrix<MT,SO,true,true>::extend(
size_t n,
bool preserve )
2539 template<
typename MT
2541 inline void SymmetricMatrix<MT,SO,true,true>::reserve(
size_t elements )
2543 matrix_.reserve( elements );
2559 template<
typename MT
2563 matrix_.shrinkToFit();
2576 template<
typename MT
2582 swap( matrix_, m.matrix_ );
2602 template<
typename MT
2618 template<
typename MT
2622 if( !IsBuiltin<ElementType>::value )
2649 template<
typename MT
2651 template<
typename Other >
2652 inline SymmetricMatrix<MT,SO,true,true>&
2653 SymmetricMatrix<MT,SO,true,true>::scale(
const Other& scalar )
2655 matrix_.scale( scalar );
2680 template<
typename MT
2711 template<
typename MT
2713 template<
typename Other >
2714 inline bool SymmetricMatrix<MT,SO,true,true>::canAlias(
const Other* alias )
const noexcept
2716 return matrix_.canAlias( alias );
2733 template<
typename MT
2735 template<
typename Other >
2736 inline bool SymmetricMatrix<MT,SO,true,true>::isAliased(
const Other* alias )
const noexcept
2738 return matrix_.isAliased( alias );
2754 template<
typename MT
2756 inline bool SymmetricMatrix<MT,SO,true,true>::isAligned() const noexcept
2758 return matrix_.isAligned();
2775 template<
typename MT
2777 inline bool SymmetricMatrix<MT,SO,true,true>::canSMPAssign() const noexcept
2779 return matrix_.canSMPAssign();
2801 template<
typename MT
2804 SymmetricMatrix<MT,SO,true,true>::load(
size_t i,
size_t j )
const noexcept
2806 return matrix_.load( i, j );
2828 template<
typename MT
2833 return matrix_.loada( i, j );
2855 template<
typename MT
2860 return matrix_.loadu( i, j );
2883 template<
typename MT
2886 SymmetricMatrix<MT,SO,true,true>::store(
size_t i,
size_t j,
const SIMDType& value ) noexcept
2888 matrix_.store( i, j, value );
2891 const size_t kend(
min( i+SIMDSIZE,
rows() ) );
2892 for(
size_t k=i; k<kend; ++k )
2893 matrix_(j,k) = matrix_(k,j);
2896 const size_t kend(
min( j+SIMDSIZE,
columns() ) );
2897 for(
size_t k=j; k<kend; ++k )
2898 matrix_(k,i) = matrix_(i,k);
2922 template<
typename MT
2927 matrix_.storea( 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_.storeu( 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_.stream( 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);
Header file for the implementation of the Submatrix view.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:79
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:131
Headerfile for the generic min algorithm.
Header file for the blaze::checked and blaze::unchecked instances.
Constraint on the data type.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3077
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the UNUSED_PARAMETER function template.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:522
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:79
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:63
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
constexpr bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:329
Constraint on the data type.
Header file for the dense matrix inversion flags.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3076
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:364
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3074
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:701
BLAZE_ALWAYS_INLINE void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:775
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5829
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3078
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1903
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:827
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3083
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:560
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:733
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3084
Header file for the extended initializer_list functionality.
Constraint on the data type.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
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:474
BLAZE_ALWAYS_INLINE MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:408
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:252
Header file for the IsSquare type trait.
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:670
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:772
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:3082
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5908
Header file for the If class template.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5891
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3079
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:367
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:443
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
Header file for the isZero shim.
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:250
Header file for all SIMD functionality.
Constraint on the data type.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:506
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:80
Constraints on the storage order of matrix types.
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:134
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type...
Definition: Upper.h:81
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:714
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:430
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8893
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
Header file for all forward declarations for expression class templates.
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:360
Header file for the EnableIf class template.
Header file for utility functions for dense matrices.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
Header file for the implementation of the Column view.
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:75
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:131
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:272
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:841
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:76
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:490
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
BLAZE_ALWAYS_INLINE MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:169
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
EnableIf_< IsNumeric< ST >, MT &> operator/=(DenseMatrix< MT, SO > &mat, ST scalar)
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:655
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not resizable, i.e. does not have a 'res...
Definition: Resizable.h:61
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3081
#define BLAZE_CONSTRAINT_MUST_NOT_BE_EXPRESSION_TYPE(T)
Constraint on the data type.In case the given data type T is an expression (i.e. a type derived from ...
Definition: Expression.h:81
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
EnableIf_< IsNumeric< ST >, MT &> operator*=(DenseMatrix< MT, SO > &mat, ST scalar)
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:593
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:908
System settings for the inline keywords.
Header file for the Size type trait.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the implementation of the Row view.
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:801