35 #ifndef _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_SPARSE_H_ 36 #define _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_SPARSE_H_ 105 template<
typename MT
107 class HermitianMatrix<MT,SO,false>
108 :
public SparseMatrix< HermitianMatrix<MT,SO,false>, SO >
112 using OT = OppositeType_<MT>;
113 using TT = TransposeType_<MT>;
114 using ET = ElementType_<MT>;
119 using This = HermitianMatrix<MT,SO,false>;
120 using BaseType = SparseMatrix<This,SO>;
135 template<
typename NewType >
138 using Other = HermitianMatrix< typename MT::template Rebind<NewType>::Other >;
145 template<
size_t NewM
149 using Other = HermitianMatrix< typename MT::template Resize<NewM,NewN>::Other >;
160 using IteratorType = Iterator_<MT>;
162 using IteratorCategory = std::forward_iterator_tag;
163 using ValueType = HermitianElement<MT>;
164 using PointerType = ValueType;
165 using ReferenceType = ValueType;
166 using DifferenceType = ptrdiff_t;
169 using iterator_category = IteratorCategory;
170 using value_type = ValueType;
171 using pointer = PointerType;
172 using reference = ReferenceType;
173 using difference_type = DifferenceType;
193 inline Iterator( IteratorType pos, MT& matrix,
size_t index )
216 inline const Iterator operator++(
int ) {
229 return ReferenceType( pos_, matrix_, index_ );
238 inline PointerType operator->()
const {
239 return PointerType( pos_, matrix_, index_ );
260 return pos_ == rhs.pos_;
271 return !( *
this == rhs );
282 return pos_ - rhs.pos_;
291 inline IteratorType base()
const {
307 enum :
bool { smpAssignable =
false };
313 explicit inline HermitianMatrix();
314 explicit inline HermitianMatrix(
size_t n );
315 explicit inline HermitianMatrix(
size_t n,
size_t nonzeros );
316 explicit inline HermitianMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
318 inline HermitianMatrix(
const HermitianMatrix& m );
319 inline HermitianMatrix( HermitianMatrix&& m ) noexcept;
321 template<
typename MT2,
bool SO2 >
322 inline HermitianMatrix(
const Matrix<MT2,SO2>& m );
333 inline Reference operator()(
size_t i,
size_t j );
335 inline Reference at(
size_t i,
size_t j );
349 inline HermitianMatrix& operator=(
const HermitianMatrix& rhs );
350 inline HermitianMatrix& operator=( HermitianMatrix&& rhs ) noexcept;
352 template<
typename MT2,
bool SO2 >
353 inline DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator=(
const Matrix<MT2,SO2>& rhs );
355 template<
typename MT2,
bool SO2 >
356 inline EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator=(
const Matrix<MT2,SO2>& rhs );
358 template<
typename MT2 >
359 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix& >
360 operator=(
const Matrix<MT2,!SO>& rhs );
362 template<
typename MT2,
bool SO2 >
363 inline DisableIf_< IsComputation<MT2>, HermitianMatrix& >
operator+=(
const Matrix<MT2,SO2>& rhs );
365 template<
typename MT2,
bool SO2 >
366 inline EnableIf_< IsComputation<MT2>, HermitianMatrix& >
operator+=(
const Matrix<MT2,SO2>& rhs );
368 template<
typename MT2 >
369 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix& >
372 template<
typename MT2,
bool SO2 >
373 inline DisableIf_< IsComputation<MT2>, HermitianMatrix& >
operator-=(
const Matrix<MT2,SO2>& rhs );
375 template<
typename MT2,
bool SO2 >
376 inline EnableIf_< IsComputation<MT2>, HermitianMatrix& >
operator-=(
const Matrix<MT2,SO2>& rhs );
378 template<
typename MT2 >
379 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix& >
382 template<
typename MT2,
bool SO2 >
383 inline DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator%=(
const Matrix<MT2,SO2>& rhs );
385 template<
typename MT2,
bool SO2 >
386 inline EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator%=(
const Matrix<MT2,SO2>& rhs );
388 template<
typename MT2 >
389 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix& >
390 operator%=(
const Matrix<MT2,!SO>& rhs );
392 template<
typename MT2,
bool SO2 >
393 inline HermitianMatrix&
operator*=(
const Matrix<MT2,SO2>& rhs );
395 template<
typename Other >
396 inline EnableIf_< IsNumeric<Other>, HermitianMatrix >&
operator*=( Other rhs );
398 template<
typename Other >
399 inline EnableIf_< IsNumeric<Other>, HermitianMatrix >&
operator/=( Other rhs );
406 inline size_t rows() const noexcept;
407 inline
size_t columns() const noexcept;
408 inline
size_t capacity() const noexcept;
409 inline
size_t capacity(
size_t i ) const noexcept;
411 inline
size_t nonZeros(
size_t i ) const;
413 inline
void reset(
size_t i );
415 inline
void resize (
size_t n,
bool preserve=true );
416 inline
void reserve(
size_t nonzeros );
417 inline
void reserve(
size_t i,
size_t nonzeros );
419 inline
void trim(
size_t i );
421 inline
void swap( HermitianMatrix& m ) noexcept;
430 inline
void append (
size_t i,
size_t j, const
ElementType& value,
bool check=false );
431 inline
void finalize(
size_t i );
438 inline
void erase(
size_t i,
size_t j );
442 template< typename Pred >
443 inline
void erase( Pred predicate );
445 template< typename Pred >
446 inline
void erase(
size_t i,
Iterator first,
Iterator last, Pred predicate );
453 inline
Iterator find (
size_t i,
size_t j );
455 inline
Iterator lowerBound(
size_t i,
size_t j );
457 inline
Iterator upperBound(
size_t i,
size_t j );
468 template< typename Other > inline HermitianMatrix& scale( const Other& scalar );
469 template< typename Other > inline HermitianMatrix& scaleDiagonal( const Other& scale );
476 inline
bool isIntact() const noexcept;
483 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
484 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
486 inline
bool canSMPAssign() const noexcept;
494 template< typename MT2,
bool SO2, typename T >
495 inline const MT2& construct( const Matrix<MT2,SO2>& m, T );
497 template< typename MT2 >
510 template<
bool RF, typename MT2,
bool SO2,
bool DF2 >
511 friend
bool isDefault( const HermitianMatrix<MT2,SO2,DF2>& m );
547 template< typename MT
549 inline HermitianMatrix<MT,SO,false>::HermitianMatrix()
566 template<
typename MT
568 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n )
588 template<
typename MT
590 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n,
size_t nonzeros )
591 : matrix_( n, n, nonzeros )
612 template<
typename MT
614 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
615 : matrix_( n, n, nonzeros )
631 template<
typename MT
633 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
const HermitianMatrix& m )
634 : matrix_( m.matrix_ )
649 template<
typename MT
651 inline HermitianMatrix<MT,SO,false>::HermitianMatrix( HermitianMatrix&& m ) noexcept
652 : matrix_( std::move( m.matrix_ ) )
671 template<
typename MT
673 template<
typename MT2
675 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
const Matrix<MT2,SO2>& m )
676 : matrix_( construct( m, typename IsBuiltin<
ElementType_<MT2> >::Type() ) )
678 if( !IsHermitian<MT2>::value && !
isHermitian( matrix_ ) ) {
710 template<
typename MT
713 HermitianMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
740 template<
typename MT
743 HermitianMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
const 771 template<
typename MT
774 HermitianMatrix<MT,SO,false>::at(
size_t i,
size_t j )
805 template<
typename MT
808 HermitianMatrix<MT,SO,false>::at(
size_t i,
size_t j )
const 834 template<
typename MT
839 return Iterator( matrix_.begin(i), matrix_, i );
857 template<
typename MT
862 return matrix_.begin(i);
880 template<
typename MT
885 return matrix_.cbegin(i);
903 template<
typename MT
908 return Iterator( matrix_.end(i), matrix_, i );
926 template<
typename MT
931 return matrix_.end(i);
949 template<
typename MT
954 return matrix_.cend(i);
978 template<
typename MT
980 inline HermitianMatrix<MT,SO,false>&
981 HermitianMatrix<MT,SO,false>::operator=(
const HermitianMatrix& rhs )
983 matrix_ = rhs.matrix_;
1001 template<
typename MT
1003 inline HermitianMatrix<MT,SO,false>&
1004 HermitianMatrix<MT,SO,false>::operator=( HermitianMatrix&& rhs ) noexcept
1006 matrix_ = std::move( rhs.matrix_ );
1030 template<
typename MT
1032 template<
typename MT2
1034 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1035 HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1037 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1065 template<
typename MT
1067 template<
typename MT2
1069 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1070 HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1072 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1076 if( IsHermitian<MT2>::value ) {
1086 matrix_ = std::move( tmp );
1111 template<
typename MT
1113 template<
typename MT2 >
1114 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,false>& >
1115 HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,!SO>& rhs )
1117 return this->operator=(
trans( ~rhs ) );
1136 template<
typename MT
1138 template<
typename MT2
1140 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1143 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1171 template<
typename MT
1173 template<
typename MT2
1175 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1178 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1182 if( IsHermitian<MT2>::value ) {
1186 const ResultType_<MT2> tmp( ~rhs );
1218 template<
typename MT
1220 template<
typename MT2 >
1221 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,false>& >
1243 template<
typename MT
1245 template<
typename MT2
1247 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1250 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1278 template<
typename MT
1280 template<
typename MT2
1282 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1285 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1289 if( IsHermitian<MT2>::value ) {
1293 const ResultType_<MT2> tmp( ~rhs );
1325 template<
typename MT
1327 template<
typename MT2 >
1328 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,false>& >
1351 template<
typename MT
1353 template<
typename MT2
1355 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1356 HermitianMatrix<MT,SO,false>::operator%=(
const Matrix<MT2,SO2>& rhs )
1358 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1387 template<
typename MT
1389 template<
typename MT2
1391 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1392 HermitianMatrix<MT,SO,false>::operator%=(
const Matrix<MT2,SO2>& rhs )
1394 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1398 if( IsHermitian<MT2>::value ) {
1402 const ResultType_<MT2> tmp( ~rhs );
1434 template<
typename MT
1436 template<
typename MT2 >
1437 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,false>& >
1438 HermitianMatrix<MT,SO,false>::operator%=(
const Matrix<MT2,!SO>& rhs )
1440 return this->operator%=(
trans( ~rhs ) );
1458 template<
typename MT
1460 template<
typename MT2
1462 inline HermitianMatrix<MT,SO,false>&
1465 if( matrix_.rows() != (~rhs).
columns() ) {
1469 MT tmp( matrix_ * ~rhs );
1475 matrix_ = std::move( tmp );
1494 template<
typename MT
1496 template<
typename Other >
1497 inline EnableIf_< IsNumeric<Other>, HermitianMatrix<MT,SO,false> >&
1514 template<
typename MT
1516 template<
typename Other >
1517 inline EnableIf_< IsNumeric<Other>, HermitianMatrix<MT,SO,false> >&
1543 template<
typename MT
1547 return matrix_.rows();
1559 template<
typename MT
1563 return matrix_.columns();
1575 template<
typename MT
1579 return matrix_.capacity();
1596 template<
typename MT
1600 return matrix_.capacity(i);
1612 template<
typename MT
1616 return matrix_.nonZeros();
1634 template<
typename MT
1638 return matrix_.nonZeros(i);
1650 template<
typename MT
1696 template<
typename MT
1700 for( Iterator_<MT> it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1702 const size_t j( it->index() );
1708 const Iterator_<MT> pos( matrix_.find( i, j ) );
1710 matrix_.erase( j, pos );
1713 const Iterator_<MT> pos( matrix_.find( j, i ) );
1715 matrix_.erase( j, pos );
1733 template<
typename MT
1760 template<
typename MT
1770 matrix_.resize( n, n,
true );
1787 template<
typename MT
1789 inline void HermitianMatrix<MT,SO,false>::reserve(
size_t nonzeros )
1791 matrix_.reserve( nonzeros );
1811 template<
typename MT
1813 inline void HermitianMatrix<MT,SO,false>::reserve(
size_t i,
size_t nonzeros )
1815 matrix_.reserve( i, nonzeros );
1832 template<
typename MT
1834 inline void HermitianMatrix<MT,SO,false>::trim()
1854 template<
typename MT
1856 inline void HermitianMatrix<MT,SO,false>::trim(
size_t i )
1874 template<
typename MT
1878 matrix_.shrinkToFit();
1891 template<
typename MT
1897 swap( matrix_, m.matrix_ );
1926 template<
typename MT
1938 matrix_.set( j, i,
conj( value ) );
1939 return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
1961 template<
typename MT
1964 HermitianMatrix<MT,SO,false>::insert(
size_t i,
size_t j,
const ElementType& value )
1973 matrix_.insert( j, i,
conj( value ) );
1974 return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
2039 template<
typename MT
2041 inline void HermitianMatrix<MT,SO,false>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
2049 matrix_.append( i, j, value, check );
2050 if( !
isDiagonal && ( !check || !isDefault<strict>( value ) ) )
2051 matrix_.insert( j, i,
conj( value ) );
2071 template<
typename MT
2073 inline void HermitianMatrix<MT,SO,false>::finalize(
size_t i )
2099 template<
typename MT
2101 inline void HermitianMatrix<MT,SO,false>::erase(
size_t i,
size_t j )
2103 matrix_.erase( i, j );
2105 matrix_.erase( j, i );
2123 template<
typename MT
2126 HermitianMatrix<MT,SO,false>::erase(
size_t i,
Iterator pos )
2128 const Iterator_<MT> base( pos.base() );
2130 if( base == matrix_.end( i ) )
2133 const size_t j( base->index() );
2137 return Iterator( matrix_.erase( i, base ), matrix_, i );
2142 matrix_.erase( j, matrix_.find( i, j ) );
2143 return Iterator( matrix_.erase( i, base ), matrix_, i );
2147 matrix_.erase( j, matrix_.find( j, i ) );
2148 return Iterator( matrix_.erase( i, base ), matrix_, i );
2169 template<
typename MT
2172 HermitianMatrix<MT,SO,false>::erase(
size_t i,
Iterator first,
Iterator last )
2174 for( Iterator_<MT> it=first.base(); it!=last.base(); ++it )
2176 const size_t j( it->index() );
2183 matrix_.erase( i, j );
2187 matrix_.erase( j, i );
2191 return Iterator( matrix_.erase( i, first.base(), last.base() ), matrix_, i );
2219 template<
typename MT
2221 template<
typename Pred >
2222 inline void HermitianMatrix<MT,SO,false>::erase( Pred predicate )
2224 matrix_.erase( [predicate=predicate](
const ElementType& value ) {
2225 return predicate( value ) || predicate(
conj( value ) );
2262 template<
typename MT
2264 template<
typename Pred >
2266 HermitianMatrix<MT,SO,false>::erase(
size_t i,
Iterator first,
Iterator last, Pred predicate )
2268 for(
Iterator it=first; it!=last; ++it ) {
2269 const size_t j( it->index() );
2270 if( i != j && predicate( it->value() ) ) {
2272 matrix_.erase( i, j );
2274 matrix_.erase( j, i );
2278 matrix_.erase( i, first.base(), last.base(), predicate );
2310 template<
typename MT
2313 HermitianMatrix<MT,SO,false>::find(
size_t i,
size_t j )
2315 return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
2337 template<
typename MT
2340 HermitianMatrix<MT,SO,false>::find(
size_t i,
size_t j )
const 2342 return matrix_.find( i, j );
2364 template<
typename MT
2367 HermitianMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
2369 return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2391 template<
typename MT
2394 HermitianMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
const 2396 return matrix_.lowerBound( i, j );
2418 template<
typename MT
2421 HermitianMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
2423 return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2445 template<
typename MT
2448 HermitianMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
const 2450 return matrix_.upperBound( i, j );
2470 template<
typename MT
2474 if( IsComplex<ElementType>::value )
2475 matrix_.transpose();
2488 template<
typename MT
2516 template<
typename MT
2518 template<
typename Other >
2519 inline HermitianMatrix<MT,SO,false>&
2520 HermitianMatrix<MT,SO,false>::scale(
const Other& scalar )
2522 matrix_.scale( scalar );
2539 template<
typename MT
2541 template<
typename Other >
2542 inline HermitianMatrix<MT,SO,false>&
2543 HermitianMatrix<MT,SO,false>::scaleDiagonal(
const Other& scalar )
2545 matrix_.scaleDiagonal( scalar );
2570 template<
typename MT
2601 template<
typename MT
2603 template<
typename Other >
2604 inline bool HermitianMatrix<MT,SO,false>::canAlias(
const Other* alias )
const noexcept
2606 return matrix_.canAlias( alias );
2623 template<
typename MT
2625 template<
typename Other >
2626 inline bool HermitianMatrix<MT,SO,false>::isAliased(
const Other* alias )
const noexcept
2628 return matrix_.isAliased( alias );
2645 template<
typename MT
2647 inline bool HermitianMatrix<MT,SO,false>::canSMPAssign() const noexcept
2649 return matrix_.canSMPAssign();
2665 template<
typename MT
2667 template<
typename MT2
2670 inline const MT2& HermitianMatrix<MT,SO,false>::construct(
const Matrix<MT2,SO2>& m, T )
2680 template<
typename MT
2682 template<
typename MT2 >
2683 inline TransExprTrait_<MT2>
2684 HermitianMatrix<MT,SO,false>::construct(
const Matrix<MT2,!SO>& m, TrueType )
bool isReal(const DiagonalProxy< MT > &proxy)
Returns whether the matrix element represents a real number.
Definition: DiagonalProxy.h:622
#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.
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.
#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 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.
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
BLAZE_ALWAYS_INLINE void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:609
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
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
bool isDiagonal(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is diagonal.
Definition: DenseMatrix.h:1584
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
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:731
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3086
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1393
Constraint on the data type.
BLAZE_ALWAYS_INLINE MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:308
BLAZE_ALWAYS_INLINE MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:242
Constraint on the data type.
Constraint on the data type.
Header file for the SparseMatrix base class.
Header file for utility functions for sparse matrices.
Header file for the IsSquare type trait.
Constraint on the data type.
typename TransExprTrait< T >::Type TransExprTrait_
Auxiliary alias declaration for the TransExprTrait class template.The TransExprTrait_ alias declarati...
Definition: TransExprTrait.h:112
Header file for the DisableIf class template.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3084
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5924
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 Columns type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:250
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
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
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type...
Definition: Upper.h:81
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:548
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:264
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8893
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
Header file for the implementation of the base template of the HeritianMatrix.
Header file for all forward declarations for expression class templates.
Header file for the HermitianElement class.
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:580
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:76
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
bool isHermitian(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is Hermitian.
Definition: DenseMatrix.h:778
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:270
Header file for the TransExprTrait class template.
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:324
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3082
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:790
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not resizable, i.e. does not have a 'res...
Definition: Resizable.h:61
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3083
#define BLAZE_CONSTRAINT_MUST_NOT_BE_EXPRESSION_TYPE(T)
Constraint on the data type.In case the given data type T is an expression (i.e. a type derived from ...
Definition: Expression.h:81
Header file for the HermitianProxy class.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:252
Header file for the IsComplex type trait.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:600
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1321
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
Header file for the IsHermitian type trait.
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:742
Header file for the isReal shim.
#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
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:61
Header file for the TrueType type/value trait base class.
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:635