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 typedef OppositeType_<MT> OT;
113 typedef TransposeType_<MT> TT;
114 typedef ElementType_<MT> ET;
119 typedef HermitianMatrix<MT,SO,false>
This;
120 typedef SparseMatrix<This,SO>
BaseType;
135 template<
typename NewType >
138 typedef HermitianMatrix< typename MT::template Rebind<NewType>::Other > Other;
145 template<
size_t NewM
149 typedef HermitianMatrix< typename MT::template Resize<NewM,NewN>::Other > Other;
160 typedef Iterator_<MT> IteratorType;
162 typedef std::forward_iterator_tag IteratorCategory;
163 typedef HermitianElement<MT> ValueType;
164 typedef ValueType PointerType;
165 typedef ValueType ReferenceType;
166 typedef ptrdiff_t DifferenceType;
169 typedef IteratorCategory iterator_category;
170 typedef ValueType value_type;
171 typedef PointerType pointer;
172 typedef ReferenceType reference;
173 typedef DifferenceType difference_type;
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 );
334 inline ConstReference operator()(
size_t i,
size_t j )
const;
335 inline Reference at(
size_t i,
size_t j );
336 inline ConstReference at(
size_t i,
size_t j )
const;
338 inline ConstIterator
begin (
size_t i )
const;
339 inline ConstIterator
cbegin(
size_t i )
const;
341 inline ConstIterator
end (
size_t i )
const;
342 inline ConstIterator
cend (
size_t i )
const;
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 HermitianMatrix&
operator*=(
const Matrix<MT2,SO2>& rhs );
385 template<
typename Other >
386 inline EnableIf_< IsNumeric<Other>, HermitianMatrix >&
operator*=( Other rhs );
388 template<
typename Other >
389 inline EnableIf_< IsNumeric<Other>, HermitianMatrix >&
operator/=( Other rhs );
396 inline size_t rows() const noexcept;
397 inline
size_t columns() const noexcept;
398 inline
size_t capacity() const noexcept;
399 inline
size_t capacity(
size_t i ) const noexcept;
401 inline
size_t nonZeros(
size_t i ) const;
403 inline
void reset(
size_t i );
405 inline
void resize (
size_t n,
bool preserve=true );
406 inline
void reserve(
size_t nonzeros );
407 inline
void reserve(
size_t i,
size_t nonzeros );
409 inline
void trim(
size_t i );
410 inline
void swap( HermitianMatrix& m ) noexcept;
417 inline
Iterator set (
size_t i,
size_t j, const ElementType& value );
418 inline
Iterator insert (
size_t i,
size_t j, const ElementType& value );
419 inline
void append (
size_t i,
size_t j, const ElementType& value,
bool check=false );
420 inline
void finalize(
size_t i );
427 inline
void erase(
size_t i,
size_t j );
431 template< typename Pred >
432 inline
void erase( Pred predicate );
434 template< typename Pred >
435 inline
void erase(
size_t i,
Iterator first,
Iterator last, Pred predicate );
442 inline
Iterator find (
size_t i,
size_t j );
443 inline ConstIterator find (
size_t i,
size_t j ) const;
444 inline
Iterator lowerBound(
size_t i,
size_t j );
445 inline ConstIterator lowerBound(
size_t i,
size_t j ) const;
446 inline
Iterator upperBound(
size_t i,
size_t j );
447 inline ConstIterator upperBound(
size_t i,
size_t j ) const;
457 template< typename Other > inline HermitianMatrix& scale( const Other& scalar );
458 template< typename Other > inline HermitianMatrix& scaleDiagonal( const Other& scale );
465 inline
bool isIntact() const noexcept;
472 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
473 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
475 inline
bool canSMPAssign() const noexcept;
483 template< typename MT2,
bool SO2, typename T >
484 inline const MT2& construct( const Matrix<MT2,SO2>& m, T );
486 template< typename MT2 >
499 template<
bool RF, typename MT2,
bool SO2,
bool DF2 >
500 friend
bool isDefault( const HermitianMatrix<MT2,SO2,DF2>& m );
536 template< typename MT
538 inline HermitianMatrix<MT,SO,false>::HermitianMatrix()
555 template<
typename MT
557 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n )
577 template<
typename MT
579 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n,
size_t nonzeros )
580 : matrix_( n, n, nonzeros )
601 template<
typename MT
603 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
604 : matrix_( n, n, nonzeros )
620 template<
typename MT
622 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
const HermitianMatrix& m )
623 : matrix_( m.matrix_ )
638 template<
typename MT
640 inline HermitianMatrix<MT,SO,false>::HermitianMatrix( HermitianMatrix&& m ) noexcept
641 : matrix_( std::move( m.matrix_ ) )
660 template<
typename MT
662 template<
typename MT2
664 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
const Matrix<MT2,SO2>& m )
665 : matrix_( construct( m, typename IsBuiltin<
ElementType_<MT2> >::Type() ) )
667 if( !IsHermitian<MT2>::value && !
isHermitian( matrix_ ) ) {
699 template<
typename MT
702 HermitianMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
729 template<
typename MT
732 HermitianMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
const 760 template<
typename MT
763 HermitianMatrix<MT,SO,false>::at(
size_t i,
size_t j )
794 template<
typename MT
797 HermitianMatrix<MT,SO,false>::at(
size_t i,
size_t j )
const 823 template<
typename MT
828 return Iterator( matrix_.begin(i), matrix_, i );
846 template<
typename MT
851 return matrix_.begin(i);
869 template<
typename MT
874 return matrix_.cbegin(i);
892 template<
typename MT
897 return Iterator( matrix_.end(i), matrix_, i );
915 template<
typename MT
920 return matrix_.end(i);
938 template<
typename MT
943 return matrix_.cend(i);
967 template<
typename MT
969 inline HermitianMatrix<MT,SO,false>&
970 HermitianMatrix<MT,SO,false>::operator=(
const HermitianMatrix& rhs )
972 matrix_ = rhs.matrix_;
990 template<
typename MT
992 inline HermitianMatrix<MT,SO,false>&
993 HermitianMatrix<MT,SO,false>::operator=( HermitianMatrix&& rhs ) noexcept
995 matrix_ = std::move( rhs.matrix_ );
1019 template<
typename MT
1021 template<
typename MT2
1023 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1024 HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1026 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1054 template<
typename MT
1056 template<
typename MT2
1058 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1059 HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1061 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1065 if( IsHermitian<MT2>::value ) {
1075 matrix_ = std::move( tmp );
1100 template<
typename MT
1102 template<
typename MT2 >
1103 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,false>& >
1104 HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,!SO>& rhs )
1106 return this->operator=(
trans( ~rhs ) );
1125 template<
typename MT
1127 template<
typename MT2
1129 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1132 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1160 template<
typename MT
1162 template<
typename MT2
1164 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1167 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1171 if( IsHermitian<MT2>::value ) {
1175 const ResultType_<MT2> tmp( ~rhs );
1207 template<
typename MT
1209 template<
typename MT2 >
1210 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,false>& >
1232 template<
typename MT
1234 template<
typename MT2
1236 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1239 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1267 template<
typename MT
1269 template<
typename MT2
1271 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1274 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1278 if( IsHermitian<MT2>::value ) {
1282 const ResultType_<MT2> tmp( ~rhs );
1314 template<
typename MT
1316 template<
typename MT2 >
1317 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,false>& >
1338 template<
typename MT
1340 template<
typename MT2
1342 inline HermitianMatrix<MT,SO,false>&
1345 if( matrix_.rows() != (~rhs).
columns() ) {
1349 MT tmp( matrix_ * ~rhs );
1355 matrix_ = std::move( tmp );
1374 template<
typename MT
1376 template<
typename Other >
1377 inline EnableIf_< IsNumeric<Other>, HermitianMatrix<MT,SO,false> >&
1394 template<
typename MT
1396 template<
typename Other >
1397 inline EnableIf_< IsNumeric<Other>, HermitianMatrix<MT,SO,false> >&
1423 template<
typename MT
1427 return matrix_.rows();
1439 template<
typename MT
1443 return matrix_.columns();
1455 template<
typename MT
1459 return matrix_.capacity();
1476 template<
typename MT
1480 return matrix_.capacity(i);
1492 template<
typename MT
1496 return matrix_.nonZeros();
1514 template<
typename MT
1518 return matrix_.nonZeros(i);
1530 template<
typename MT
1576 template<
typename MT
1580 for( Iterator_<MT> it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1582 const size_t j( it->index() );
1588 const Iterator_<MT> pos( matrix_.find( i, j ) );
1590 matrix_.erase( j, pos );
1593 const Iterator_<MT> pos( matrix_.find( j, i ) );
1595 matrix_.erase( j, pos );
1613 template<
typename MT
1640 template<
typename MT
1650 matrix_.resize( n, n,
true );
1667 template<
typename MT
1669 inline void HermitianMatrix<MT,SO,false>::reserve(
size_t nonzeros )
1671 matrix_.reserve( nonzeros );
1691 template<
typename MT
1693 inline void HermitianMatrix<MT,SO,false>::reserve(
size_t i,
size_t nonzeros )
1695 matrix_.reserve( i, nonzeros );
1712 template<
typename MT
1714 inline void HermitianMatrix<MT,SO,false>::trim()
1734 template<
typename MT
1736 inline void HermitianMatrix<MT,SO,false>::trim(
size_t i )
1751 template<
typename MT
1757 swap( matrix_, m.matrix_ );
1786 template<
typename MT
1798 matrix_.set( j, i,
conj( value ) );
1799 return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
1821 template<
typename MT
1824 HermitianMatrix<MT,SO,false>::insert(
size_t i,
size_t j,
const ElementType& value )
1833 matrix_.insert( j, i,
conj( value ) );
1834 return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
1899 template<
typename MT
1901 inline void HermitianMatrix<MT,SO,false>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
1909 matrix_.append( i, j, value, check );
1911 matrix_.insert( j, i,
conj( value ) );
1931 template<
typename MT
1933 inline void HermitianMatrix<MT,SO,false>::finalize(
size_t i )
1959 template<
typename MT
1961 inline void HermitianMatrix<MT,SO,false>::erase(
size_t i,
size_t j )
1963 matrix_.erase( i, j );
1965 matrix_.erase( j, i );
1983 template<
typename MT
1986 HermitianMatrix<MT,SO,false>::erase(
size_t i,
Iterator pos )
1988 const Iterator_<MT> base( pos.base() );
1990 if( base == matrix_.end( i ) )
1993 const size_t j( base->index() );
1997 return Iterator( matrix_.erase( i, base ), matrix_, i );
2002 matrix_.erase( j, matrix_.find( i, j ) );
2003 return Iterator( matrix_.erase( i, base ), matrix_, i );
2007 matrix_.erase( j, matrix_.find( j, i ) );
2008 return Iterator( matrix_.erase( i, base ), matrix_, i );
2029 template<
typename MT
2032 HermitianMatrix<MT,SO,false>::erase(
size_t i,
Iterator first,
Iterator last )
2034 for( Iterator_<MT> it=first.base(); it!=last.base(); ++it )
2036 const size_t j( it->index() );
2043 matrix_.erase( i, j );
2047 matrix_.erase( j, i );
2051 return Iterator( matrix_.erase( i, first.base(), last.base() ), matrix_, i );
2079 template<
typename MT
2081 template<
typename Pred >
2082 inline void HermitianMatrix<MT,SO,false>::erase( Pred predicate )
2084 matrix_.erase( [predicate=predicate](
const ElementType& value ) {
2085 return predicate( value ) || predicate(
conj( value ) );
2122 template<
typename MT
2124 template<
typename Pred >
2126 HermitianMatrix<MT,SO,false>::erase(
size_t i,
Iterator first,
Iterator last, Pred predicate )
2128 for(
Iterator it=first; it!=last; ++it ) {
2129 const size_t j( it->index() );
2130 if( i != j && predicate( it->value() ) ) {
2132 matrix_.erase( i, j );
2134 matrix_.erase( j, i );
2138 matrix_.erase( i, first.base(), last.base(), predicate );
2170 template<
typename MT
2173 HermitianMatrix<MT,SO,false>::find(
size_t i,
size_t j )
2175 return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
2197 template<
typename MT
2200 HermitianMatrix<MT,SO,false>::find(
size_t i,
size_t j )
const 2202 return matrix_.find( i, j );
2224 template<
typename MT
2227 HermitianMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
2229 return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2251 template<
typename MT
2254 HermitianMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
const 2256 return matrix_.lowerBound( i, j );
2278 template<
typename MT
2281 HermitianMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
2283 return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2305 template<
typename MT
2308 HermitianMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
const 2310 return matrix_.upperBound( i, j );
2330 template<
typename MT
2334 if( IsComplex<ElementType>::value )
2335 matrix_.transpose();
2348 template<
typename MT
2365 template<
typename MT
2367 template<
typename Other >
2368 inline HermitianMatrix<MT,SO,false>&
2369 HermitianMatrix<MT,SO,false>::scale(
const Other& scalar )
2371 matrix_.scale( scalar );
2385 template<
typename MT
2387 template<
typename Other >
2388 inline HermitianMatrix<MT,SO,false>&
2389 HermitianMatrix<MT,SO,false>::scaleDiagonal(
const Other& scalar )
2391 matrix_.scaleDiagonal( scalar );
2416 template<
typename MT
2447 template<
typename MT
2449 template<
typename Other >
2450 inline bool HermitianMatrix<MT,SO,false>::canAlias(
const Other* alias )
const noexcept
2452 return matrix_.canAlias( alias );
2469 template<
typename MT
2471 template<
typename Other >
2472 inline bool HermitianMatrix<MT,SO,false>::isAliased(
const Other* alias )
const noexcept
2474 return matrix_.isAliased( alias );
2491 template<
typename MT
2493 inline bool HermitianMatrix<MT,SO,false>::canSMPAssign() const noexcept
2495 return matrix_.canSMPAssign();
2511 template<
typename MT
2513 template<
typename MT2
2516 inline const MT2& HermitianMatrix<MT,SO,false>::construct(
const Matrix<MT2,SO2>& m, T )
2526 template<
typename MT
2528 template<
typename MT2 >
2529 inline TransExprTrait_<MT2>
2530 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:595
#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
const DMatForEachExpr< MT, Conj, SO > conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatForEachExpr.h:1214
Header file for auxiliary alias declarations.
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, 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:352
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:1339
Constraint on the data type.
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:194
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2935
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5556
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:596
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2928
#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:1577
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:390
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
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:1321
Constraint on the data type.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2931
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:304
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:238
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:143
Header file for the DisableIf class template.
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:5635
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5618
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2939
#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
Header file for the Columns type trait.
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:336
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2932
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:544
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:260
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:2933
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.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2937
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:553
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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2934
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:1285
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:775
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2938
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:267
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:320
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2929
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE(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
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:733
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
#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.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2930
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:249
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:573
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2936
#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:1303
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
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:677
const DMatDMatMultExpr< T1, T2, false, false, false, false > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7505
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:570