35#ifndef _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_SPARSE_H_
36#define _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_SPARSE_H_
108class 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>;
122 using ResultType = This;
123 using OppositeType = HermitianMatrix<OT,!SO,false>;
124 using TransposeType = HermitianMatrix<TT,!SO,false>;
125 using ElementType = ET;
126 using TagType = TagType_t<MT>;
127 using ReturnType = ReturnType_t<MT>;
128 using CompositeType =
const This&;
129 using Reference = HermitianProxy<MT>;
130 using ConstReference = ConstReference_t<MT>;
131 using ConstIterator = ConstIterator_t<MT>;
137 template<
typename NewType >
140 using Other = HermitianMatrix< typename MT::template Rebind<NewType>::Other >;
147 template<
size_t NewM
151 using Other = HermitianMatrix< typename MT::template Resize<NewM,NewN>::Other >;
162 using IteratorType = Iterator_t<MT>;
164 using IteratorCategory = std::forward_iterator_tag;
165 using ValueType = HermitianElement<MT>;
166 using PointerType = ValueType;
167 using ReferenceType = ValueType;
171 using iterator_category = IteratorCategory;
172 using value_type = ValueType;
173 using pointer = PointerType;
174 using reference = ReferenceType;
175 using difference_type = DifferenceType;
195 inline Iterator( IteratorType pos, MT& matrix,
size_t index )
207 inline Iterator& operator++() {
218 inline const Iterator operator++(
int ) {
219 const Iterator tmp( *
this );
231 return ReferenceType( pos_, matrix_, index_ );
240 inline PointerType operator->()
const {
241 return PointerType( pos_, matrix_, index_ );
250 inline operator ConstIterator()
const {
261 inline bool operator==(
const Iterator& rhs )
const {
262 return pos_ == rhs.pos_;
272 inline bool operator!=(
const Iterator& rhs )
const {
273 return !( *
this == rhs );
283 inline DifferenceType
operator-(
const Iterator& rhs )
const {
284 return pos_ - rhs.pos_;
293 inline IteratorType base()
const {
309 static constexpr bool smpAssignable =
false;
315 inline HermitianMatrix();
316 explicit inline HermitianMatrix(
size_t n );
317 inline HermitianMatrix(
size_t n,
size_t nonzeros );
318 inline HermitianMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
321 inline HermitianMatrix(
const HermitianMatrix& m );
322 inline HermitianMatrix( HermitianMatrix&& m )
noexcept;
324 template<
typename MT2,
bool SO2 >
325 inline HermitianMatrix(
const Matrix<MT2,SO2>& m );
332 ~HermitianMatrix() =
default;
339 inline Reference operator()(
size_t i,
size_t j );
340 inline ConstReference operator()(
size_t i,
size_t j )
const;
341 inline Reference at(
size_t i,
size_t j );
342 inline ConstReference at(
size_t i,
size_t j )
const;
343 inline Iterator
begin (
size_t i );
344 inline ConstIterator
begin (
size_t i )
const;
345 inline ConstIterator
cbegin(
size_t i )
const;
346 inline Iterator
end (
size_t i );
347 inline ConstIterator
end (
size_t i )
const;
348 inline ConstIterator
cend (
size_t i )
const;
357 inline HermitianMatrix& operator=(
const HermitianMatrix& rhs );
358 inline HermitianMatrix& operator=( HermitianMatrix&& rhs )
noexcept;
360 template<
typename MT2,
bool SO2 >
361 inline auto operator=(
const Matrix<MT2,SO2>& rhs )
362 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
364 template<
typename MT2,
bool SO2 >
365 inline auto operator=(
const Matrix<MT2,SO2>& rhs )
366 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
368 template<
typename MT2 >
369 inline auto operator=(
const Matrix<MT2,!SO>& rhs )
370 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >;
372 template<
typename MT2,
bool SO2 >
373 inline auto operator+=(
const Matrix<MT2,SO2>& rhs )
374 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
376 template<
typename MT2,
bool SO2 >
377 inline auto operator+=(
const Matrix<MT2,SO2>& rhs )
378 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
380 template<
typename MT2 >
381 inline auto operator+=(
const Matrix<MT2,!SO>& rhs )
382 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >;
384 template<
typename MT2,
bool SO2 >
385 inline auto operator-=(
const Matrix<MT2,SO2>& rhs )
386 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
388 template<
typename MT2,
bool SO2 >
389 inline auto operator-=(
const Matrix<MT2,SO2>& rhs )
390 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
392 template<
typename MT2 >
393 inline auto operator-=(
const Matrix<MT2,!SO>& rhs )
394 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >;
396 template<
typename MT2,
bool SO2 >
397 inline auto operator%=(
const Matrix<MT2,SO2>& rhs )
398 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
400 template<
typename MT2,
bool SO2 >
401 inline auto operator%=(
const Matrix<MT2,SO2>& rhs )
402 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
404 template<
typename MT2 >
405 inline auto operator%=(
const Matrix<MT2,!SO>& rhs )
406 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >;
408 template<
typename ST >
409 inline auto operator*=( ST rhs ) -> EnableIf_t< IsScalar_v<ST>, HermitianMatrix& >;
411 template<
typename ST >
412 inline auto operator/=( ST rhs ) -> EnableIf_t< IsScalar_v<ST>, HermitianMatrix& >;
419 inline size_t rows() const noexcept;
420 inline
size_t columns() const noexcept;
421 inline
size_t capacity() const noexcept;
422 inline
size_t capacity(
size_t i ) const noexcept;
424 inline
size_t nonZeros(
size_t i ) const;
426 inline
void reset(
size_t i );
428 inline
void resize (
size_t n,
bool preserve=true );
429 inline
void reserve(
size_t nonzeros );
430 inline
void reserve(
size_t i,
size_t nonzeros );
432 inline
void trim(
size_t i );
434 inline
void swap( HermitianMatrix& m ) noexcept;
441 inline Iterator
set (
size_t i,
size_t j, const ElementType& value );
442 inline Iterator insert (
size_t i,
size_t j, const ElementType& value );
443 inline
void append (
size_t i,
size_t j, const ElementType& value,
bool check=false );
444 inline
void finalize(
size_t i );
451 inline
void erase(
size_t i,
size_t j );
452 inline Iterator erase(
size_t i, Iterator pos );
453 inline Iterator erase(
size_t i, Iterator first, Iterator last );
455 template< typename Pred >
456 inline
void erase( Pred predicate );
458 template< typename Pred >
459 inline
void erase(
size_t i, Iterator first, Iterator last, Pred predicate );
466 inline Iterator
find (
size_t i,
size_t j );
467 inline ConstIterator
find (
size_t i,
size_t j ) const;
468 inline Iterator
lowerBound(
size_t i,
size_t j );
469 inline ConstIterator
lowerBound(
size_t i,
size_t j ) const;
470 inline Iterator
upperBound(
size_t i,
size_t j );
471 inline ConstIterator
upperBound(
size_t i,
size_t j ) const;
481 template< typename Other > inline HermitianMatrix& scale( const Other& scalar );
488 inline
bool isIntact() const noexcept;
495 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
496 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
498 inline
bool canSMPAssign() const noexcept;
506 template< typename MT2,
bool SO2, typename T >
507 inline decltype(auto) construct( const Matrix<MT2,SO2>& m, T );
509 template< typename MT2 >
510 inline decltype(auto) construct( const Matrix<MT2,!SO>& m,
TrueType );
558inline HermitianMatrix<MT,SO,false>::HermitianMatrix()
577inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n )
599inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n,
size_t nonzeros )
600 : matrix_( n, n, nonzeros )
623inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
624 : matrix_( n, n, nonzeros )
684inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
const HermitianMatrix& m )
685 : matrix_( m.matrix_ )
702inline HermitianMatrix<MT,SO,false>::HermitianMatrix( HermitianMatrix&& m ) noexcept
703 : matrix_( std::move( m.matrix_ ) )
724template<
typename MT2
726inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
const Matrix<MT2,SO2>& m )
727 : matrix_( construct( m, typename IsBuiltin<
ElementType_t<MT2> >::Type() ) )
729 if( !IsHermitian_v<MT2> && !
isHermitian( matrix_ ) ) {
763inline typename HermitianMatrix<MT,SO,false>::Reference
764 HermitianMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
769 return Reference( matrix_, i, j );
793inline typename HermitianMatrix<MT,SO,false>::ConstReference
794 HermitianMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
const
824inline typename HermitianMatrix<MT,SO,false>::Reference
825 HermitianMatrix<MT,SO,false>::at(
size_t i,
size_t j )
858inline typename HermitianMatrix<MT,SO,false>::ConstReference
859 HermitianMatrix<MT,SO,false>::at(
size_t i,
size_t j )
const
887inline typename HermitianMatrix<MT,SO,false>::Iterator
890 return Iterator( matrix_.begin(i), matrix_, i );
910inline typename HermitianMatrix<MT,SO,false>::ConstIterator
913 return matrix_.begin(i);
933inline typename HermitianMatrix<MT,SO,false>::ConstIterator
936 return matrix_.cbegin(i);
956inline typename HermitianMatrix<MT,SO,false>::Iterator
959 return Iterator( matrix_.end(i), matrix_, i );
979inline typename HermitianMatrix<MT,SO,false>::ConstIterator
982 return matrix_.end(i);
1000template<
typename MT
1002inline typename HermitianMatrix<MT,SO,false>::ConstIterator
1005 return matrix_.cend(i);
1046template<
typename MT
1048inline HermitianMatrix<MT,SO,false>&
1051 const InitializerMatrix<ElementType> tmp( list, list.size() );
1078template<
typename MT
1080inline HermitianMatrix<MT,SO,false>&
1081 HermitianMatrix<MT,SO,false>::operator=(
const HermitianMatrix& rhs )
1083 matrix_ = rhs.matrix_;
1101template<
typename MT
1103inline HermitianMatrix<MT,SO,false>&
1104 HermitianMatrix<MT,SO,false>::operator=( HermitianMatrix&& rhs )
noexcept
1106 matrix_ = std::move( rhs.matrix_ );
1130template<
typename MT
1132template<
typename MT2
1134inline auto HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1135 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1137 if( !IsHermitian_v<MT2> && !
isHermitian( *rhs ) ) {
1165template<
typename MT
1167template<
typename MT2
1169inline auto HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1170 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1172 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1176 if( IsHermitian_v<MT2> ) {
1186 matrix_ = std::move( tmp );
1211template<
typename MT
1213template<
typename MT2 >
1214inline auto HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,!SO>& rhs )
1215 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
1217 return this->operator=(
trans( *rhs ) );
1236template<
typename MT
1238template<
typename MT2
1241 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1243 if( !IsHermitian_v<MT2> && !
isHermitian( *rhs ) ) {
1271template<
typename MT
1273template<
typename MT2
1276 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1278 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1282 if( IsHermitian_v<MT2> ) {
1286 const ResultType_t<MT2> tmp( *rhs );
1318template<
typename MT
1320template<
typename MT2 >
1322 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
1343template<
typename MT
1345template<
typename MT2
1348 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1350 if( !IsHermitian_v<MT2> && !
isHermitian( *rhs ) ) {
1378template<
typename MT
1380template<
typename MT2
1383 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1385 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1389 if( IsHermitian_v<MT2> ) {
1393 const ResultType_t<MT2> tmp( *rhs );
1425template<
typename MT
1427template<
typename MT2 >
1429 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
1451template<
typename MT
1453template<
typename MT2
1455inline auto HermitianMatrix<MT,SO,false>::operator%=(
const Matrix<MT2,SO2>& rhs )
1456 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1458 if( !IsHermitian_v<MT2> && !
isHermitian( *rhs ) ) {
1487template<
typename MT
1489template<
typename MT2
1491inline auto HermitianMatrix<MT,SO,false>::operator%=(
const Matrix<MT2,SO2>& rhs )
1492 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1494 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1498 if( IsHermitian_v<MT2> ) {
1502 const ResultType_t<MT2> tmp( *rhs );
1534template<
typename MT
1536template<
typename MT2 >
1537inline auto HermitianMatrix<MT,SO,false>::operator%=(
const Matrix<MT2,!SO>& rhs )
1538 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
1540 return this->operator%=(
trans( *rhs ) );
1554template<
typename MT
1556template<
typename ST >
1558 -> EnableIf_t< IsScalar_v<ST>, HermitianMatrix& >
1574template<
typename MT
1576template<
typename ST >
1578 -> EnableIf_t< IsScalar_v<ST>, HermitianMatrix& >
1603template<
typename MT
1607 return matrix_.rows();
1619template<
typename MT
1623 return matrix_.columns();
1635template<
typename MT
1639 return matrix_.capacity();
1656template<
typename MT
1660 return matrix_.capacity(i);
1672template<
typename MT
1676 return matrix_.nonZeros();
1694template<
typename MT
1698 return matrix_.nonZeros(i);
1710template<
typename MT
1756template<
typename MT
1762 for(
auto it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1764 const size_t j( it->index() );
1770 const Iterator_t<MT> pos( matrix_.find( i, j ) );
1772 erase( matrix_, j, pos );
1775 const Iterator_t<MT> pos( matrix_.find( j, i ) );
1777 erase( matrix_, j, pos );
1795template<
typename MT
1823template<
typename MT
1833 matrix_.resize( n, n,
true );
1850template<
typename MT
1852inline void HermitianMatrix<MT,SO,false>::reserve(
size_t nonzeros )
1854 matrix_.reserve( nonzeros );
1874template<
typename MT
1876inline void HermitianMatrix<MT,SO,false>::reserve(
size_t i,
size_t nonzeros )
1878 matrix_.reserve( i, nonzeros );
1895template<
typename MT
1897inline void HermitianMatrix<MT,SO,false>::trim()
1917template<
typename MT
1919inline void HermitianMatrix<MT,SO,false>::trim(
size_t i )
1937template<
typename MT
1941 matrix_.shrinkToFit();
1954template<
typename MT
1960 swap( matrix_, m.matrix_ );
1989template<
typename MT
1991inline typename HermitianMatrix<MT,SO,false>::Iterator
2001 matrix_.set( j, i,
conj( value ) );
2002 return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
2024template<
typename MT
2026inline typename HermitianMatrix<MT,SO,false>::Iterator
2027 HermitianMatrix<MT,SO,false>::insert(
size_t i,
size_t j,
const ElementType& value )
2036 matrix_.insert( j, i,
conj( value ) );
2037 return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
2102template<
typename MT
2104inline void HermitianMatrix<MT,SO,false>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
2112 matrix_.append( i, j, value, check );
2113 if( !
isDiagonal && ( !check || !isDefault<strict>( value ) ) )
2114 matrix_.insert( j, i,
conj( value ) );
2134template<
typename MT
2136inline void HermitianMatrix<MT,SO,false>::finalize(
size_t i )
2162template<
typename MT
2164inline void HermitianMatrix<MT,SO,false>::erase(
size_t i,
size_t j )
2168 erase( matrix_, i, j );
2170 erase( matrix_, j, i );
2188template<
typename MT
2190inline typename HermitianMatrix<MT,SO,false>::Iterator
2191 HermitianMatrix<MT,SO,false>::erase(
size_t i, Iterator pos )
2195 const Iterator_t<MT> base( pos.base() );
2197 if( base == matrix_.end( i ) )
2200 const size_t j( base->index() );
2204 return Iterator( erase( matrix_, i, base ), matrix_, i );
2209 erase( matrix_, j, matrix_.find( i, j ) );
2210 return Iterator( erase( matrix_, i, base ), matrix_, i );
2214 erase( matrix_, j, matrix_.find( j, i ) );
2215 return Iterator( erase( matrix_, i, base ), matrix_, i );
2236template<
typename MT
2238inline typename HermitianMatrix<MT,SO,false>::Iterator
2239 HermitianMatrix<MT,SO,false>::erase(
size_t i, Iterator first, Iterator last )
2243 for(
auto it=first.base(); it!=last.base(); ++it )
2245 const size_t j( it->index() );
2252 erase( matrix_, i, j );
2256 erase( matrix_, j, i );
2260 return Iterator( erase( matrix_, i, first.base(), last.base() ), matrix_, i );
2288template<
typename MT
2290template<
typename Pred >
2291inline void HermitianMatrix<MT,SO,false>::erase( Pred predicate )
2295 erase( matrix_, [predicate=predicate](
const ElementType& value ) {
2296 return predicate( value ) || predicate(
conj( value ) );
2333template<
typename MT
2335template<
typename Pred >
2337 HermitianMatrix<MT,SO,false>::erase(
size_t i, Iterator first, Iterator last, Pred predicate )
2341 for(
auto it=first; it!=last; ++it ) {
2342 const size_t j( it->index() );
2343 if( i != j && predicate( it->value() ) ) {
2345 erase( matrix_, i, j );
2347 erase( matrix_, j, i );
2351 erase( matrix_, i, first.base(), last.base(), predicate );
2383template<
typename MT
2385inline typename HermitianMatrix<MT,SO,false>::Iterator
2388 return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
2410template<
typename MT
2412inline typename HermitianMatrix<MT,SO,false>::ConstIterator
2415 return matrix_.find( i, j );
2437template<
typename MT
2439inline typename HermitianMatrix<MT,SO,false>::Iterator
2442 return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2464template<
typename MT
2466inline typename HermitianMatrix<MT,SO,false>::ConstIterator
2469 return matrix_.lowerBound( i, j );
2491template<
typename MT
2493inline typename HermitianMatrix<MT,SO,false>::Iterator
2496 return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2518template<
typename MT
2520inline typename HermitianMatrix<MT,SO,false>::ConstIterator
2523 return matrix_.upperBound( i, j );
2543template<
typename MT
2547 if( IsComplex_v<ElementType> )
2548 matrix_.transpose();
2561template<
typename MT
2589template<
typename MT
2591template<
typename Other >
2592inline HermitianMatrix<MT,SO,false>&
2593 HermitianMatrix<MT,SO,false>::scale(
const Other& scalar )
2595 matrix_.scale( scalar );
2620template<
typename MT
2651template<
typename MT
2653template<
typename Other >
2654inline bool HermitianMatrix<MT,SO,false>::canAlias(
const Other* alias )
const noexcept
2656 return matrix_.canAlias( alias );
2673template<
typename MT
2675template<
typename Other >
2676inline bool HermitianMatrix<MT,SO,false>::isAliased(
const Other* alias )
const noexcept
2678 return matrix_.isAliased( alias );
2695template<
typename MT
2697inline bool HermitianMatrix<MT,SO,false>::canSMPAssign() const noexcept
2699 return matrix_.canSMPAssign();
2715template<
typename MT
2717template<
typename MT2
2720inline decltype(
auto) HermitianMatrix<MT,SO,false>::construct(
const Matrix<MT2,SO2>& m, T )
2730template<
typename MT
2732template<
typename MT2 >
2733inline decltype(
auto) HermitianMatrix<MT,SO,false>::construct(
const Matrix<MT2,!SO>& m,
TrueType )
Header file for auxiliary alias declarations.
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition: Aliases.h:190
Header file for run time assertion macros.
Header file for the conjugate shim.
Constraint on the data type.
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:751
Header file for the EnableIf class template.
Header file for the HermitianElement class.
Header file for the HermitianProxy class.
Constraint on the data type.
Header file for the IntegralConstant class template.
Header file for the IsBuiltin type trait.
Header file for the IsComplex type trait.
Header file for the IsComputation type trait class.
Header file for the isDefault shim.
Header file for the IsHermitian type trait.
Header file for the isReal shim.
Header file for the IsScalar type trait.
Header file for the IsSquare type trait.
Constraint on the data type.
Header file for the MAYBE_UNUSED function template.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of the base template of the HeritianMatrix.
Initializer list type of the Blaze library.
Pointer difference type of the Blaze library.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
Header file for the SparseMatrix base class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.
Definition: Volatile.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.
Definition: Pointer.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.
Definition: Const.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.
Definition: Reference.h:79
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( ).
Definition: DenseMatrix.h:574
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1464
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:386
bool isHermitian(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is Hermitian.
Definition: DenseMatrix.h:1534
auto operator*=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:510
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:9640
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:448
bool isDiagonal(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is diagonal.
Definition: DenseMatrix.h:2456
bool isZero(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a zero matrix.
Definition: DenseMatrix.h:1819
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:207
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:225
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VIEW_TYPE(T)
Constraint on the data type.
Definition: View.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Hermitian.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Upper.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: SparseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(T)
Constraint on the data type.
Definition: Resizable.h:61
#define BLAZE_CONSTRAINT_MUST_BE_SCALAR_TYPE(T)
Constraint on the data type.
Definition: Scalar.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSFORMATION_TYPE(T)
Constraint on the data type.
Definition: Transformation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.
Definition: StorageOrder.h:63
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.
Definition: Size.h:176
bool isReal(const Proxy< PT, RT > &proxy)
Returns whether the element represents a real number.
Definition: Proxy.h:2297
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
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
constexpr void clear(Matrix< MT, SO > &matrix)
Clearing the given matrix.
Definition: Matrix.h:960
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:628
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:644
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:730
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:562
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:692
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition: Matrix.h:806
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:660
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:1108
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:584
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:1221
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:518
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:1195
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:1169
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:1383
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition: Assert.h:117
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
MT::Iterator upperBound(SparseMatrix< MT, SO > &sm, size_t i, size_t j)
Returns an iterator to the first index greater than the given index.
Definition: SparseMatrix.h:244
MT::Iterator lowerBound(SparseMatrix< MT, SO > &sm, size_t i, size_t j)
Returns an iterator to the first index not less than the given index.
Definition: SparseMatrix.h:194
MT::Iterator find(SparseMatrix< MT, SO > &sm, size_t i, size_t j)
Searches for a specific matrix element.
Definition: SparseMatrix.h:144
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition: StaticAssert.h:112
BoolConstant< true > TrueType
Type traits base class.
Definition: IntegralConstant.h:132
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition: Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
Header file for the exception macros of the math module.
Header file for the extended initializer_list functionality.
Constraints on the storage order of matrix types.
Header file for all forward declarations for expression class templates.
Header file for the Size type trait.
Header file for the isZero shim.
Header file for utility functions for sparse matrices.
Header file for basic type definitions.