35 #ifndef _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_SPARSE_H_ 36 #define _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_SPARSE_H_ 106 template<
typename MT
108 class HermitianMatrix<MT,SO,false>
109 :
public SparseMatrix< HermitianMatrix<MT,SO,false>, SO >
113 using OT = OppositeType_t<MT>;
114 using TT = TransposeType_t<MT>;
115 using ET = ElementType_t<MT>;
120 using This = HermitianMatrix<MT,SO,false>;
121 using BaseType = SparseMatrix<This,SO>;
136 template<
typename NewType >
139 using Other = HermitianMatrix< typename MT::template Rebind<NewType>::Other >;
146 template<
size_t NewM
150 using Other = HermitianMatrix< typename MT::template Resize<NewM,NewN>::Other >;
161 using IteratorType = Iterator_t<MT>;
163 using IteratorCategory = std::forward_iterator_tag;
164 using ValueType = HermitianElement<MT>;
165 using PointerType = ValueType;
166 using ReferenceType = ValueType;
167 using DifferenceType = ptrdiff_t;
170 using iterator_category = IteratorCategory;
171 using value_type = ValueType;
172 using pointer = PointerType;
173 using reference = ReferenceType;
174 using difference_type = DifferenceType;
194 inline Iterator( IteratorType pos, MT& matrix,
size_t index )
217 inline const Iterator operator++(
int ) {
230 return ReferenceType( pos_, matrix_, index_ );
239 inline PointerType operator->()
const {
240 return PointerType( pos_, matrix_, index_ );
261 return pos_ == rhs.pos_;
272 return !( *
this == rhs );
283 return pos_ - rhs.pos_;
292 inline IteratorType base()
const {
314 explicit inline HermitianMatrix();
315 explicit inline HermitianMatrix(
size_t n );
316 explicit inline HermitianMatrix(
size_t n,
size_t nonzeros );
317 explicit inline HermitianMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
318 explicit inline HermitianMatrix( initializer_list< initializer_list<ElementType> > list );
320 inline HermitianMatrix(
const HermitianMatrix& m );
321 inline HermitianMatrix( HermitianMatrix&& m ) noexcept;
323 template<
typename MT2,
bool SO2 >
324 inline HermitianMatrix(
const Matrix<MT2,SO2>& m );
331 ~HermitianMatrix() =
default;
338 inline Reference operator()(
size_t i,
size_t j );
340 inline Reference at(
size_t i,
size_t j );
354 inline HermitianMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
356 inline HermitianMatrix& operator=(
const HermitianMatrix& rhs );
357 inline HermitianMatrix& operator=( HermitianMatrix&& rhs ) noexcept;
359 template<
typename MT2,
bool SO2 >
360 inline auto operator=(
const Matrix<MT2,SO2>& rhs )
361 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
363 template<
typename MT2,
bool SO2 >
364 inline auto operator=(
const Matrix<MT2,SO2>& rhs )
365 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
367 template<
typename MT2 >
368 inline auto operator=(
const Matrix<MT2,!SO>& rhs )
369 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >;
371 template<
typename MT2,
bool SO2 >
372 inline auto operator+=(
const Matrix<MT2,SO2>& rhs )
373 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
375 template<
typename MT2,
bool SO2 >
376 inline auto operator+=(
const Matrix<MT2,SO2>& rhs )
377 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
379 template<
typename MT2 >
380 inline auto operator+=(
const Matrix<MT2,!SO>& rhs )
381 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >;
383 template<
typename MT2,
bool SO2 >
384 inline auto operator-=(
const Matrix<MT2,SO2>& rhs )
385 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
387 template<
typename MT2,
bool SO2 >
388 inline auto operator-=(
const Matrix<MT2,SO2>& rhs )
389 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
391 template<
typename MT2 >
392 inline auto operator-=(
const Matrix<MT2,!SO>& rhs )
393 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >;
395 template<
typename MT2,
bool SO2 >
396 inline auto operator%=(
const Matrix<MT2,SO2>& rhs )
397 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
399 template<
typename MT2,
bool SO2 >
400 inline auto operator%=(
const Matrix<MT2,SO2>& rhs )
401 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
403 template<
typename MT2 >
404 inline auto operator%=(
const Matrix<MT2,!SO>& rhs )
405 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >;
407 template<
typename ST >
408 inline auto operator*=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, HermitianMatrix& >;
410 template<
typename ST >
411 inline auto operator/=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, HermitianMatrix& >;
418 inline size_t rows() const noexcept;
419 inline
size_t columns() const noexcept;
420 inline
size_t capacity() const noexcept;
421 inline
size_t capacity(
size_t i ) const noexcept;
423 inline
size_t nonZeros(
size_t i ) const;
425 inline
void reset(
size_t i );
427 inline
void resize (
size_t n,
bool preserve=true );
428 inline
void reserve(
size_t nonzeros );
429 inline
void reserve(
size_t i,
size_t nonzeros );
431 inline
void trim(
size_t i );
433 inline
void swap( HermitianMatrix& m ) noexcept;
442 inline
void append (
size_t i,
size_t j, const
ElementType& value,
bool check=false );
443 inline
void finalize(
size_t i );
450 inline
void erase(
size_t i,
size_t j );
454 template< typename Pred >
455 inline
void erase( Pred predicate );
457 template< typename Pred >
458 inline
void erase(
size_t i,
Iterator first,
Iterator last, Pred predicate );
465 inline
Iterator find (
size_t i,
size_t j );
467 inline
Iterator lowerBound(
size_t i,
size_t j );
469 inline
Iterator upperBound(
size_t i,
size_t j );
480 template< typename Other > inline HermitianMatrix& scale( const Other& scalar );
487 inline
bool isIntact() const noexcept;
494 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
495 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
497 inline
bool canSMPAssign() const noexcept;
505 template< typename MT2,
bool SO2, typename T >
506 inline decltype(auto) construct( const Matrix<MT2,SO2>& m, T );
508 template< typename MT2 >
509 inline decltype(auto) construct( const Matrix<MT2,!SO>& m,
TrueType );
521 template<
bool RF, typename MT2,
bool SO2,
bool DF2 >
522 friend
bool isDefault( const HermitianMatrix<MT2,SO2,DF2>& m );
558 template< typename MT
560 inline HermitianMatrix<MT,SO,false>::HermitianMatrix()
577 template<
typename MT
579 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n )
599 template<
typename MT
601 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n,
size_t nonzeros )
602 : matrix_( n, n, nonzeros )
623 template<
typename MT
625 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
626 : matrix_( n, n, nonzeros )
663 template<
typename MT
665 inline HermitianMatrix<MT,SO,false>::HermitianMatrix( initializer_list< initializer_list<ElementType> > list )
684 template<
typename MT
686 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
const HermitianMatrix& m )
687 : matrix_( m.matrix_ )
702 template<
typename MT
704 inline HermitianMatrix<MT,SO,false>::HermitianMatrix( HermitianMatrix&& m ) noexcept
705 : matrix_( std::move( m.matrix_ ) )
724 template<
typename MT
726 template<
typename MT2
728 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
const Matrix<MT2,SO2>& m )
729 : matrix_( construct( m, typename IsBuiltin<
ElementType_t<MT2> >::Type() ) )
731 if( !IsHermitian_v<MT2> && !
isHermitian( matrix_ ) ) {
763 template<
typename MT
766 HermitianMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
793 template<
typename MT
796 HermitianMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
const 824 template<
typename MT
827 HermitianMatrix<MT,SO,false>::at(
size_t i,
size_t j )
858 template<
typename MT
861 HermitianMatrix<MT,SO,false>::at(
size_t i,
size_t j )
const 887 template<
typename MT
892 return Iterator( matrix_.begin(i), matrix_, i );
910 template<
typename MT
915 return matrix_.begin(i);
933 template<
typename MT
938 return matrix_.cbegin(i);
956 template<
typename MT
961 return Iterator( matrix_.end(i), matrix_, i );
979 template<
typename MT
984 return matrix_.end(i);
1002 template<
typename MT
1007 return matrix_.cend(i);
1048 template<
typename MT
1050 inline HermitianMatrix<MT,SO,false>&
1051 HermitianMatrix<MT,SO,false>::operator=( initializer_list< initializer_list<ElementType> > list )
1053 const InitializerMatrix<ElementType> tmp( list, list.size() );
1080 template<
typename MT
1082 inline HermitianMatrix<MT,SO,false>&
1083 HermitianMatrix<MT,SO,false>::operator=(
const HermitianMatrix& rhs )
1085 matrix_ = rhs.matrix_;
1103 template<
typename MT
1105 inline HermitianMatrix<MT,SO,false>&
1106 HermitianMatrix<MT,SO,false>::operator=( HermitianMatrix&& rhs ) noexcept
1108 matrix_ = std::move( rhs.matrix_ );
1132 template<
typename MT
1134 template<
typename MT2
1136 inline auto HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1137 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1139 if( !IsHermitian_v<MT2> && !
isHermitian( ~rhs ) ) {
1167 template<
typename MT
1169 template<
typename MT2
1171 inline auto HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1172 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1174 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1178 if( IsHermitian_v<MT2> ) {
1188 matrix_ = std::move( tmp );
1213 template<
typename MT
1215 template<
typename MT2 >
1216 inline auto HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,!SO>& rhs )
1217 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
1219 return this->operator=(
trans( ~rhs ) );
1238 template<
typename MT
1240 template<
typename MT2
1243 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1245 if( !IsHermitian_v<MT2> && !
isHermitian( ~rhs ) ) {
1273 template<
typename MT
1275 template<
typename MT2
1278 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1280 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1284 if( IsHermitian_v<MT2> ) {
1288 const ResultType_t<MT2> tmp( ~rhs );
1320 template<
typename MT
1322 template<
typename MT2 >
1324 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
1345 template<
typename MT
1347 template<
typename MT2
1350 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1352 if( !IsHermitian_v<MT2> && !
isHermitian( ~rhs ) ) {
1380 template<
typename MT
1382 template<
typename MT2
1385 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1387 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1391 if( IsHermitian_v<MT2> ) {
1395 const ResultType_t<MT2> tmp( ~rhs );
1427 template<
typename MT
1429 template<
typename MT2 >
1431 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
1453 template<
typename MT
1455 template<
typename MT2
1457 inline auto HermitianMatrix<MT,SO,false>::operator%=(
const Matrix<MT2,SO2>& rhs )
1458 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1460 if( !IsHermitian_v<MT2> && !
isHermitian( ~rhs ) ) {
1489 template<
typename MT
1491 template<
typename MT2
1493 inline auto HermitianMatrix<MT,SO,false>::operator%=(
const Matrix<MT2,SO2>& rhs )
1494 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1496 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1500 if( IsHermitian_v<MT2> ) {
1504 const ResultType_t<MT2> tmp( ~rhs );
1536 template<
typename MT
1538 template<
typename MT2 >
1539 inline auto HermitianMatrix<MT,SO,false>::operator%=(
const Matrix<MT2,!SO>& rhs )
1540 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
1542 return this->operator%=(
trans( ~rhs ) );
1556 template<
typename MT
1558 template<
typename ST >
1560 -> EnableIf_t< IsNumeric_v<ST>, HermitianMatrix& >
1576 template<
typename MT
1578 template<
typename ST >
1580 -> EnableIf_t< IsNumeric_v<ST>, HermitianMatrix& >
1605 template<
typename MT
1609 return matrix_.rows();
1621 template<
typename MT
1625 return matrix_.columns();
1637 template<
typename MT
1641 return matrix_.capacity();
1658 template<
typename MT
1662 return matrix_.capacity(i);
1674 template<
typename MT
1678 return matrix_.nonZeros();
1696 template<
typename MT
1700 return matrix_.nonZeros(i);
1712 template<
typename MT
1758 template<
typename MT
1764 for(
auto it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1766 const size_t j( it->index() );
1772 const Iterator_t<MT> pos( matrix_.find( i, j ) );
1774 erase( matrix_, j, pos );
1777 const Iterator_t<MT> pos( matrix_.find( j, i ) );
1779 erase( matrix_, j, pos );
1797 template<
typename MT
1824 template<
typename MT
1834 matrix_.resize( n, n,
true );
1851 template<
typename MT
1853 inline void HermitianMatrix<MT,SO,false>::reserve(
size_t nonzeros )
1855 matrix_.reserve( nonzeros );
1875 template<
typename MT
1877 inline void HermitianMatrix<MT,SO,false>::reserve(
size_t i,
size_t nonzeros )
1879 matrix_.reserve( i, nonzeros );
1896 template<
typename MT
1898 inline void HermitianMatrix<MT,SO,false>::trim()
1918 template<
typename MT
1920 inline void HermitianMatrix<MT,SO,false>::trim(
size_t i )
1938 template<
typename MT
1942 matrix_.shrinkToFit();
1955 template<
typename MT
1961 swap( matrix_, m.matrix_ );
1990 template<
typename MT
2002 matrix_.set( j, i,
conj( value ) );
2003 return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
2025 template<
typename MT
2028 HermitianMatrix<MT,SO,false>::insert(
size_t i,
size_t j,
const ElementType& value )
2037 matrix_.insert( j, i,
conj( value ) );
2038 return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
2103 template<
typename MT
2105 inline void HermitianMatrix<MT,SO,false>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
2113 matrix_.append( i, j, value, check );
2114 if( !
isDiagonal && ( !check || !isDefault<strict>( value ) ) )
2115 matrix_.insert( j, i,
conj( value ) );
2135 template<
typename MT
2137 inline void HermitianMatrix<MT,SO,false>::finalize(
size_t i )
2163 template<
typename MT
2165 inline void HermitianMatrix<MT,SO,false>::erase(
size_t i,
size_t j )
2169 erase( matrix_, i, j );
2171 erase( matrix_, j, i );
2189 template<
typename MT
2192 HermitianMatrix<MT,SO,false>::erase(
size_t i,
Iterator pos )
2196 const Iterator_t<MT> base( pos.base() );
2198 if( base == matrix_.end( i ) )
2201 const size_t j( base->index() );
2205 return Iterator( erase( matrix_, i, base ), matrix_, i );
2210 erase( matrix_, j, matrix_.find( i, j ) );
2211 return Iterator( erase( matrix_, i, base ), matrix_, i );
2215 erase( matrix_, j, matrix_.find( j, i ) );
2216 return Iterator( erase( matrix_, i, base ), matrix_, i );
2237 template<
typename MT
2240 HermitianMatrix<MT,SO,false>::erase(
size_t i,
Iterator first,
Iterator last )
2244 for(
auto it=first.base(); it!=last.base(); ++it )
2246 const size_t j( it->index() );
2253 erase( matrix_, i, j );
2257 erase( matrix_, j, i );
2261 return Iterator( erase( matrix_, i, first.base(), last.base() ), matrix_, i );
2289 template<
typename MT
2291 template<
typename Pred >
2292 inline void HermitianMatrix<MT,SO,false>::erase( Pred predicate )
2296 erase( matrix_, [predicate=predicate](
const ElementType& value ) {
2297 return predicate( value ) || predicate(
conj( value ) );
2334 template<
typename MT
2336 template<
typename Pred >
2338 HermitianMatrix<MT,SO,false>::erase(
size_t i,
Iterator first,
Iterator last, Pred predicate )
2342 for(
auto it=first; it!=last; ++it ) {
2343 const size_t j( it->index() );
2344 if( i != j && predicate( it->value() ) ) {
2346 erase( matrix_, i, j );
2348 erase( matrix_, j, i );
2352 erase( matrix_, i, first.base(), last.base(), predicate );
2384 template<
typename MT
2387 HermitianMatrix<MT,SO,false>::find(
size_t i,
size_t j )
2389 return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
2411 template<
typename MT
2414 HermitianMatrix<MT,SO,false>::find(
size_t i,
size_t j )
const 2416 return matrix_.find( i, j );
2438 template<
typename MT
2441 HermitianMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
2443 return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2465 template<
typename MT
2468 HermitianMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
const 2470 return matrix_.lowerBound( i, j );
2492 template<
typename MT
2495 HermitianMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
2497 return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2519 template<
typename MT
2522 HermitianMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
const 2524 return matrix_.upperBound( i, j );
2544 template<
typename MT
2548 if( IsComplex_v<ElementType> )
2549 matrix_.transpose();
2562 template<
typename MT
2590 template<
typename MT
2592 template<
typename Other >
2593 inline HermitianMatrix<MT,SO,false>&
2594 HermitianMatrix<MT,SO,false>::scale(
const Other& scalar )
2596 matrix_.scale( scalar );
2621 template<
typename MT
2652 template<
typename MT
2654 template<
typename Other >
2655 inline bool HermitianMatrix<MT,SO,false>::canAlias(
const Other* alias )
const noexcept
2657 return matrix_.canAlias( alias );
2674 template<
typename MT
2676 template<
typename Other >
2677 inline bool HermitianMatrix<MT,SO,false>::isAliased(
const Other* alias )
const noexcept
2679 return matrix_.isAliased( alias );
2696 template<
typename MT
2698 inline bool HermitianMatrix<MT,SO,false>::canSMPAssign() const noexcept
2700 return matrix_.canSMPAssign();
2716 template<
typename MT
2718 template<
typename MT2
2721 inline decltype(
auto) HermitianMatrix<MT,SO,false>::construct( const Matrix<MT2,SO2>& m, T )
2731 template<
typename MT
2733 template<
typename MT2 >
2734 inline decltype(
auto) 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:653
#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:3078
#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
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:354
Header file for the UNUSED_PARAMETER function template.
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
Header file for basic type definitions.
constexpr 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:750
#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
Header file for the isZero shim.
Constraint on the data type.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3077
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:799
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5828
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3079
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:851
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
#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:1539
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
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:3085
Header file for the extended initializer_list functionality.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Constraint on the data type.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
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:482
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:416
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
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.
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:673
Header file for the implementation of a matrix representation of an initializer list.
Header file for the DisableIf class template.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3083
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5907
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5890
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
#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:3080
#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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:253
Constraint on the data type.
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
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
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:438
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:8908
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
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:611
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
#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:617
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:281
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:75
Constraint on the data type.
Constraint on the data type.
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
#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:3082
#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.
auto operator*=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:290
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
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:631
#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
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1326
#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.
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
Header file for the Size type trait.
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
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.The Size_v variable template provides a convenien...
Definition: Size.h:176
Header file for the TrueType type/value trait base class.
Header file for the clear shim.
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:825