35 #ifndef _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_SPARSE_H_ 36 #define _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_SPARSE_H_ 108 template<
typename MT
110 class HermitianMatrix<MT,SO,false>
111 :
public SparseMatrix< HermitianMatrix<MT,SO,false>, SO >
115 using OT = OppositeType_t<MT>;
116 using TT = TransposeType_t<MT>;
117 using ET = ElementType_t<MT>;
122 using This = HermitianMatrix<MT,SO,false>;
123 using BaseType = SparseMatrix<This,SO>;
124 using ResultType = This;
125 using OppositeType = HermitianMatrix<OT,!SO,false>;
126 using TransposeType = HermitianMatrix<TT,!SO,false>;
127 using ElementType = ET;
128 using ReturnType = ReturnType_t<MT>;
129 using CompositeType =
const This&;
130 using Reference = HermitianProxy<MT>;
131 using ConstReference = ConstReference_t<MT>;
132 using ConstIterator = ConstIterator_t<MT>;
138 template<
typename NewType >
141 using Other = HermitianMatrix< typename MT::template Rebind<NewType>::Other >;
148 template<
size_t NewM
152 using Other = HermitianMatrix< typename MT::template Resize<NewM,NewN>::Other >;
163 using IteratorType = Iterator_t<MT>;
165 using IteratorCategory = std::forward_iterator_tag;
166 using ValueType = HermitianElement<MT>;
167 using PointerType = ValueType;
168 using ReferenceType = ValueType;
169 using DifferenceType = ptrdiff_t;
172 using iterator_category = IteratorCategory;
173 using value_type = ValueType;
174 using pointer = PointerType;
175 using reference = ReferenceType;
176 using difference_type = DifferenceType;
196 inline Iterator( IteratorType pos, MT& matrix,
size_t index )
208 inline Iterator& operator++() {
219 inline const Iterator operator++(
int ) {
220 const Iterator tmp( *
this );
232 return ReferenceType( pos_, matrix_, index_ );
241 inline PointerType operator->()
const {
242 return PointerType( pos_, matrix_, index_ );
251 inline operator ConstIterator()
const {
262 inline bool operator==(
const Iterator& rhs )
const {
263 return pos_ == rhs.pos_;
273 inline bool operator!=(
const Iterator& rhs )
const {
274 return !( *
this == rhs );
284 inline DifferenceType
operator-(
const Iterator& rhs )
const {
285 return pos_ - rhs.pos_;
294 inline IteratorType base()
const {
310 static constexpr
bool smpAssignable =
false;
316 explicit inline HermitianMatrix();
317 explicit inline HermitianMatrix(
size_t n );
318 explicit inline HermitianMatrix(
size_t n,
size_t nonzeros );
319 explicit inline HermitianMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
320 inline HermitianMatrix( initializer_list< initializer_list<ElementType> > list );
322 inline HermitianMatrix(
const HermitianMatrix& m );
323 inline HermitianMatrix( HermitianMatrix&& m ) noexcept;
325 template<
typename MT2,
bool SO2 >
326 inline HermitianMatrix(
const Matrix<MT2,SO2>& m );
333 ~HermitianMatrix() =
default;
340 inline Reference operator()(
size_t i,
size_t j );
341 inline ConstReference operator()(
size_t i,
size_t j )
const;
342 inline Reference at(
size_t i,
size_t j );
343 inline ConstReference at(
size_t i,
size_t j )
const;
344 inline Iterator
begin (
size_t i );
345 inline ConstIterator
begin (
size_t i )
const;
346 inline ConstIterator
cbegin(
size_t i )
const;
347 inline Iterator
end (
size_t i );
348 inline ConstIterator
end (
size_t i )
const;
349 inline ConstIterator
cend (
size_t i )
const;
356 inline HermitianMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
358 inline HermitianMatrix& operator=(
const HermitianMatrix& rhs );
359 inline HermitianMatrix& operator=( HermitianMatrix&& rhs ) noexcept;
361 template<
typename MT2,
bool SO2 >
362 inline auto operator=(
const Matrix<MT2,SO2>& rhs )
363 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
365 template<
typename MT2,
bool SO2 >
366 inline auto operator=(
const Matrix<MT2,SO2>& rhs )
367 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
369 template<
typename MT2 >
370 inline auto operator=(
const Matrix<MT2,!SO>& rhs )
371 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >;
373 template<
typename MT2,
bool SO2 >
374 inline auto operator+=(
const Matrix<MT2,SO2>& rhs )
375 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
377 template<
typename MT2,
bool SO2 >
378 inline auto operator+=(
const Matrix<MT2,SO2>& rhs )
379 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
381 template<
typename MT2 >
382 inline auto operator+=(
const Matrix<MT2,!SO>& rhs )
383 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >;
385 template<
typename MT2,
bool SO2 >
386 inline auto operator-=(
const Matrix<MT2,SO2>& rhs )
387 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
389 template<
typename MT2,
bool SO2 >
390 inline auto operator-=(
const Matrix<MT2,SO2>& rhs )
391 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
393 template<
typename MT2 >
394 inline auto operator-=(
const Matrix<MT2,!SO>& rhs )
395 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >;
397 template<
typename MT2,
bool SO2 >
398 inline auto operator%=(
const Matrix<MT2,SO2>& rhs )
399 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
401 template<
typename MT2,
bool SO2 >
402 inline auto operator%=(
const Matrix<MT2,SO2>& rhs )
403 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >;
405 template<
typename MT2 >
406 inline auto operator%=(
const Matrix<MT2,!SO>& rhs )
407 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >;
409 template<
typename ST >
410 inline auto operator*=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, HermitianMatrix& >;
412 template<
typename ST >
413 inline auto operator/=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, HermitianMatrix& >;
420 inline size_t rows() const noexcept;
421 inline
size_t columns() const noexcept;
422 inline
size_t capacity() const noexcept;
423 inline
size_t capacity(
size_t i ) const noexcept;
425 inline
size_t nonZeros(
size_t i ) const;
427 inline
void reset(
size_t i );
429 inline
void resize (
size_t n,
bool preserve=true );
430 inline
void reserve(
size_t nonzeros );
431 inline
void reserve(
size_t i,
size_t nonzeros );
433 inline
void trim(
size_t i );
435 inline
void swap( HermitianMatrix& m ) noexcept;
442 inline Iterator
set (
size_t i,
size_t j, const ElementType& value );
443 inline Iterator insert (
size_t i,
size_t j, const ElementType& value );
444 inline
void append (
size_t i,
size_t j, const ElementType& value,
bool check=false );
445 inline
void finalize(
size_t i );
452 inline
void erase(
size_t i,
size_t j );
453 inline Iterator erase(
size_t i, Iterator pos );
454 inline Iterator erase(
size_t i, Iterator first, Iterator last );
456 template< typename Pred >
457 inline
void erase( Pred predicate );
459 template< typename Pred >
460 inline
void erase(
size_t i, Iterator first, Iterator last, Pred predicate );
467 inline Iterator find (
size_t i,
size_t j );
468 inline ConstIterator find (
size_t i,
size_t j ) const;
469 inline Iterator lowerBound(
size_t i,
size_t j );
470 inline ConstIterator lowerBound(
size_t i,
size_t j ) const;
471 inline Iterator upperBound(
size_t i,
size_t j );
472 inline ConstIterator upperBound(
size_t i,
size_t j ) const;
482 template< typename Other > inline HermitianMatrix& scale( const Other& scalar );
489 inline
bool isIntact() const noexcept;
496 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
497 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
499 inline
bool canSMPAssign() const noexcept;
507 template< typename MT2,
bool SO2, typename T >
508 inline decltype(auto) construct( const Matrix<MT2,SO2>& m, T );
510 template< typename MT2 >
511 inline decltype(auto) construct( const Matrix<MT2,!SO>& m,
TrueType );
523 template<
bool RF, typename MT2,
bool SO2,
bool DF2 >
524 friend
bool isDefault( const HermitianMatrix<MT2,SO2,DF2>& m );
562 template< typename MT
564 inline HermitianMatrix<MT,SO,false>::HermitianMatrix()
581 template<
typename MT
583 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n )
603 template<
typename MT
605 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n,
size_t nonzeros )
606 : matrix_( n, n, nonzeros )
627 template<
typename MT
629 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
630 : matrix_( n, n, nonzeros )
667 template<
typename MT
669 inline HermitianMatrix<MT,SO,false>::HermitianMatrix( initializer_list< initializer_list<ElementType> > list )
688 template<
typename MT
690 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
const HermitianMatrix& m )
691 : matrix_( m.matrix_ )
706 template<
typename MT
708 inline HermitianMatrix<MT,SO,false>::HermitianMatrix( HermitianMatrix&& m ) noexcept
709 : matrix_( std::move( m.matrix_ ) )
728 template<
typename MT
730 template<
typename MT2
732 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
const Matrix<MT2,SO2>& m )
733 : matrix_( construct( m, typename IsBuiltin<
ElementType_t<MT2> >::Type() ) )
735 if( !IsHermitian_v<MT2> && !
isHermitian( matrix_ ) ) {
767 template<
typename MT
769 inline typename HermitianMatrix<MT,SO,false>::Reference
770 HermitianMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
775 return Reference( matrix_, i, j );
797 template<
typename MT
799 inline typename HermitianMatrix<MT,SO,false>::ConstReference
800 HermitianMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
const 828 template<
typename MT
830 inline typename HermitianMatrix<MT,SO,false>::Reference
831 HermitianMatrix<MT,SO,false>::at(
size_t i,
size_t j )
862 template<
typename MT
864 inline typename HermitianMatrix<MT,SO,false>::ConstReference
865 HermitianMatrix<MT,SO,false>::at(
size_t i,
size_t j )
const 891 template<
typename MT
893 inline typename HermitianMatrix<MT,SO,false>::Iterator
896 return Iterator( matrix_.begin(i), matrix_, i );
914 template<
typename MT
916 inline typename HermitianMatrix<MT,SO,false>::ConstIterator
919 return matrix_.begin(i);
937 template<
typename MT
939 inline typename HermitianMatrix<MT,SO,false>::ConstIterator
942 return matrix_.cbegin(i);
960 template<
typename MT
962 inline typename HermitianMatrix<MT,SO,false>::Iterator
965 return Iterator( matrix_.end(i), matrix_, i );
983 template<
typename MT
985 inline typename HermitianMatrix<MT,SO,false>::ConstIterator
988 return matrix_.end(i);
1006 template<
typename MT
1008 inline typename HermitianMatrix<MT,SO,false>::ConstIterator
1011 return matrix_.cend(i);
1052 template<
typename MT
1054 inline HermitianMatrix<MT,SO,false>&
1055 HermitianMatrix<MT,SO,false>::operator=( initializer_list< initializer_list<ElementType> > list )
1057 const InitializerMatrix<ElementType> tmp( list, list.size() );
1084 template<
typename MT
1086 inline HermitianMatrix<MT,SO,false>&
1087 HermitianMatrix<MT,SO,false>::operator=(
const HermitianMatrix& rhs )
1089 matrix_ = rhs.matrix_;
1107 template<
typename MT
1109 inline HermitianMatrix<MT,SO,false>&
1110 HermitianMatrix<MT,SO,false>::operator=( HermitianMatrix&& rhs ) noexcept
1112 matrix_ = std::move( rhs.matrix_ );
1136 template<
typename MT
1138 template<
typename MT2
1140 inline auto HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1141 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1143 if( !IsHermitian_v<MT2> && !
isHermitian( ~rhs ) ) {
1171 template<
typename MT
1173 template<
typename MT2
1175 inline auto HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1176 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1178 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1182 if( IsHermitian_v<MT2> ) {
1192 matrix_ = std::move( tmp );
1217 template<
typename MT
1219 template<
typename MT2 >
1220 inline auto HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,!SO>& rhs )
1221 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
1223 return this->operator=(
trans( ~rhs ) );
1242 template<
typename MT
1244 template<
typename MT2
1247 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1249 if( !IsHermitian_v<MT2> && !
isHermitian( ~rhs ) ) {
1277 template<
typename MT
1279 template<
typename MT2
1282 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1284 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1288 if( IsHermitian_v<MT2> ) {
1292 const ResultType_t<MT2> tmp( ~rhs );
1324 template<
typename MT
1326 template<
typename MT2 >
1328 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
1349 template<
typename MT
1351 template<
typename MT2
1354 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1356 if( !IsHermitian_v<MT2> && !
isHermitian( ~rhs ) ) {
1384 template<
typename MT
1386 template<
typename MT2
1389 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1391 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1395 if( IsHermitian_v<MT2> ) {
1399 const ResultType_t<MT2> tmp( ~rhs );
1431 template<
typename MT
1433 template<
typename MT2 >
1435 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
1457 template<
typename MT
1459 template<
typename MT2
1461 inline auto HermitianMatrix<MT,SO,false>::operator%=(
const Matrix<MT2,SO2>& rhs )
1462 -> DisableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1464 if( !IsHermitian_v<MT2> && !
isHermitian( ~rhs ) ) {
1493 template<
typename MT
1495 template<
typename MT2
1497 inline auto HermitianMatrix<MT,SO,false>::operator%=(
const Matrix<MT2,SO2>& rhs )
1498 -> EnableIf_t< IsComputation_v<MT2>, HermitianMatrix& >
1500 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1504 if( IsHermitian_v<MT2> ) {
1508 const ResultType_t<MT2> tmp( ~rhs );
1540 template<
typename MT
1542 template<
typename MT2 >
1543 inline auto HermitianMatrix<MT,SO,false>::operator%=(
const Matrix<MT2,!SO>& rhs )
1544 -> EnableIf_t< IsBuiltin_v< ElementType_t<MT2> >, HermitianMatrix& >
1546 return this->operator%=(
trans( ~rhs ) );
1560 template<
typename MT
1562 template<
typename ST >
1564 -> EnableIf_t< IsNumeric_v<ST>, HermitianMatrix& >
1580 template<
typename MT
1582 template<
typename ST >
1584 -> EnableIf_t< IsNumeric_v<ST>, HermitianMatrix& >
1609 template<
typename MT
1613 return matrix_.rows();
1625 template<
typename MT
1629 return matrix_.columns();
1641 template<
typename MT
1645 return matrix_.capacity();
1662 template<
typename MT
1666 return matrix_.capacity(i);
1678 template<
typename MT
1682 return matrix_.nonZeros();
1700 template<
typename MT
1704 return matrix_.nonZeros(i);
1716 template<
typename MT
1762 template<
typename MT
1768 for(
auto it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1770 const size_t j( it->index() );
1776 const Iterator_t<MT> pos( matrix_.find( i, j ) );
1778 erase( matrix_, j, pos );
1781 const Iterator_t<MT> pos( matrix_.find( j, i ) );
1783 erase( matrix_, j, pos );
1801 template<
typename MT
1828 template<
typename MT
1838 matrix_.resize( n, n,
true );
1855 template<
typename MT
1857 inline void HermitianMatrix<MT,SO,false>::reserve(
size_t nonzeros )
1859 matrix_.reserve( nonzeros );
1879 template<
typename MT
1881 inline void HermitianMatrix<MT,SO,false>::reserve(
size_t i,
size_t nonzeros )
1883 matrix_.reserve( i, nonzeros );
1900 template<
typename MT
1902 inline void HermitianMatrix<MT,SO,false>::trim()
1922 template<
typename MT
1924 inline void HermitianMatrix<MT,SO,false>::trim(
size_t i )
1942 template<
typename MT
1946 matrix_.shrinkToFit();
1959 template<
typename MT
1965 swap( matrix_, m.matrix_ );
1994 template<
typename MT
1996 inline typename HermitianMatrix<MT,SO,false>::Iterator
2006 matrix_.set( j, i,
conj( value ) );
2007 return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
2029 template<
typename MT
2031 inline typename HermitianMatrix<MT,SO,false>::Iterator
2032 HermitianMatrix<MT,SO,false>::insert(
size_t i,
size_t j,
const ElementType& value )
2041 matrix_.insert( j, i,
conj( value ) );
2042 return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
2107 template<
typename MT
2109 inline void HermitianMatrix<MT,SO,false>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
2117 matrix_.append( i, j, value, check );
2118 if( !
isDiagonal && ( !check || !isDefault<strict>( value ) ) )
2119 matrix_.insert( j, i,
conj( value ) );
2139 template<
typename MT
2141 inline void HermitianMatrix<MT,SO,false>::finalize(
size_t i )
2167 template<
typename MT
2169 inline void HermitianMatrix<MT,SO,false>::erase(
size_t i,
size_t j )
2173 erase( matrix_, i, j );
2175 erase( matrix_, j, i );
2193 template<
typename MT
2195 inline typename HermitianMatrix<MT,SO,false>::Iterator
2196 HermitianMatrix<MT,SO,false>::erase(
size_t i, Iterator pos )
2200 const Iterator_t<MT> base( pos.base() );
2202 if( base == matrix_.end( i ) )
2205 const size_t j( base->index() );
2209 return Iterator( erase( matrix_, i, base ), matrix_, i );
2214 erase( matrix_, j, matrix_.find( i, j ) );
2215 return Iterator( erase( matrix_, i, base ), matrix_, i );
2219 erase( matrix_, j, matrix_.find( j, i ) );
2220 return Iterator( erase( matrix_, i, base ), matrix_, i );
2241 template<
typename MT
2243 inline typename HermitianMatrix<MT,SO,false>::Iterator
2244 HermitianMatrix<MT,SO,false>::erase(
size_t i, Iterator first, Iterator last )
2248 for(
auto it=first.base(); it!=last.base(); ++it )
2250 const size_t j( it->index() );
2257 erase( matrix_, i, j );
2261 erase( matrix_, j, i );
2265 return Iterator( erase( matrix_, i, first.base(), last.base() ), matrix_, i );
2293 template<
typename MT
2295 template<
typename Pred >
2296 inline void HermitianMatrix<MT,SO,false>::erase( Pred predicate )
2300 erase( matrix_, [predicate=predicate](
const ElementType& value ) {
2301 return predicate( value ) || predicate(
conj( value ) );
2338 template<
typename MT
2340 template<
typename Pred >
2342 HermitianMatrix<MT,SO,false>::erase(
size_t i, Iterator first, Iterator last, Pred predicate )
2346 for(
auto it=first; it!=last; ++it ) {
2347 const size_t j( it->index() );
2348 if( i != j && predicate( it->value() ) ) {
2350 erase( matrix_, i, j );
2352 erase( matrix_, j, i );
2356 erase( matrix_, i, first.base(), last.base(), predicate );
2388 template<
typename MT
2390 inline typename HermitianMatrix<MT,SO,false>::Iterator
2391 HermitianMatrix<MT,SO,false>::find(
size_t i,
size_t j )
2393 return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
2415 template<
typename MT
2417 inline typename HermitianMatrix<MT,SO,false>::ConstIterator
2418 HermitianMatrix<MT,SO,false>::find(
size_t i,
size_t j )
const 2420 return matrix_.find( i, j );
2442 template<
typename MT
2444 inline typename HermitianMatrix<MT,SO,false>::Iterator
2445 HermitianMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
2447 return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2469 template<
typename MT
2471 inline typename HermitianMatrix<MT,SO,false>::ConstIterator
2472 HermitianMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
const 2474 return matrix_.lowerBound( i, j );
2496 template<
typename MT
2498 inline typename HermitianMatrix<MT,SO,false>::Iterator
2499 HermitianMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
2501 return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2523 template<
typename MT
2525 inline typename HermitianMatrix<MT,SO,false>::ConstIterator
2526 HermitianMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
const 2528 return matrix_.upperBound( i, j );
2548 template<
typename MT
2552 if( IsComplex_v<ElementType> )
2553 matrix_.transpose();
2566 template<
typename MT
2594 template<
typename MT
2596 template<
typename Other >
2597 inline HermitianMatrix<MT,SO,false>&
2598 HermitianMatrix<MT,SO,false>::scale(
const Other& scalar )
2600 matrix_.scale( scalar );
2625 template<
typename MT
2656 template<
typename MT
2658 template<
typename Other >
2659 inline bool HermitianMatrix<MT,SO,false>::canAlias(
const Other* alias )
const noexcept
2661 return matrix_.canAlias( alias );
2678 template<
typename MT
2680 template<
typename Other >
2681 inline bool HermitianMatrix<MT,SO,false>::isAliased(
const Other* alias )
const noexcept
2683 return matrix_.isAliased( alias );
2700 template<
typename MT
2702 inline bool HermitianMatrix<MT,SO,false>::canSMPAssign() const noexcept
2704 return matrix_.canSMPAssign();
2720 template<
typename MT
2722 template<
typename MT2
2725 inline decltype(
auto) HermitianMatrix<MT,SO,false>::construct( const Matrix<MT2,SO2>& m, T )
2735 template<
typename MT
2737 template<
typename MT2 >
2738 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:657
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSFORMATION_TYPE(T)
Constraint on the data type.In case the given data type T is a transformation expression (i....
Definition: Transformation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type,...
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
Constraint on the data type.
Header file for auxiliary alias declarations.
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:432
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
Constraint on the data type.
Constraint on the data type.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression,...
Definition: Assert.h:117
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.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i....
Definition: Computation.h:81
Constraint on the data type.
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
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:799
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:851
Header file for the MAYBE_UNUSED function template.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type,...
Definition: Volatile.h:79
bool isDiagonal(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is diagonal.
Definition: DenseMatrix.h:2328
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: IntegralConstant.h:132
Header file for the extended initializer_list functionality.
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:677
Header file for the implementation of a matrix representation of an initializer list.
Header file for the DisableIf class template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
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:9091
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:370
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.
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
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
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 the HermitianElement class.
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:615
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
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:558
#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,...
Definition: Symmetric.h:79
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
Header file for all forward declarations for expression class templates.
#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,...
Definition: Reference.h:79
bool isHermitian(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is Hermitian.
Definition: DenseMatrix.h:1406
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:282
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.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VIEW_TYPE(T)
Constraint on the data type.In case the given data type T is a view type (i.e. a subvector,...
Definition: View.h:81
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
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.
Header file for the HermitianProxy class.
Header file for the IntegralConstant class template.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
Header file for the IsComplex type trait.
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:494
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
#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,...
Definition: Hermitian.h:79
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1324
#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,...
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 clear shim.
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:825