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 ET >
138 typedef HermitianMatrix< typename MT::template Rebind<ET>::Other > Other;
149 typedef Iterator_<MT> IteratorType;
151 typedef std::forward_iterator_tag IteratorCategory;
152 typedef HermitianElement<MT> ValueType;
153 typedef ValueType PointerType;
154 typedef ValueType ReferenceType;
155 typedef ptrdiff_t DifferenceType;
158 typedef IteratorCategory iterator_category;
159 typedef ValueType value_type;
160 typedef PointerType pointer;
161 typedef ReferenceType reference;
162 typedef DifferenceType difference_type;
182 inline Iterator( IteratorType pos, MT& matrix,
size_t index )
205 inline const Iterator operator++(
int ) {
218 return ReferenceType( pos_, matrix_, index_ );
227 inline PointerType operator->()
const {
228 return PointerType( pos_, matrix_, index_ );
249 return pos_ == rhs.pos_;
260 return !( *
this == rhs );
271 return pos_ - rhs.pos_;
280 inline IteratorType base()
const {
296 enum :
bool { smpAssignable =
false };
302 explicit inline HermitianMatrix();
303 explicit inline HermitianMatrix(
size_t n );
304 explicit inline HermitianMatrix(
size_t n,
size_t nonzeros );
305 explicit inline HermitianMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
307 inline HermitianMatrix(
const HermitianMatrix& m );
308 inline HermitianMatrix( HermitianMatrix&& m ) noexcept;
310 template< typename MT2,
bool SO2 >
311 inline HermitianMatrix( const Matrix<MT2,SO2>& m );
322 inline Reference operator()(
size_t i,
size_t j );
323 inline ConstReference operator()(
size_t i,
size_t j ) const;
324 inline Reference at(
size_t i,
size_t j );
325 inline ConstReference at(
size_t i,
size_t j ) const;
327 inline ConstIterator
begin (
size_t i ) const;
328 inline ConstIterator
cbegin(
size_t i ) const;
330 inline ConstIterator
end (
size_t i ) const;
331 inline ConstIterator
cend (
size_t i ) const;
338 inline HermitianMatrix& operator=( const HermitianMatrix& rhs );
339 inline HermitianMatrix& operator=( HermitianMatrix&& rhs ) noexcept;
341 template< typename MT2,
bool SO2 >
342 inline
DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
344 template< typename MT2,
bool SO2 >
345 inline
EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
347 template< typename MT2 >
349 operator=( const Matrix<MT2,!SO>& rhs );
351 template< typename MT2,
bool SO2 >
352 inline
DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
354 template< typename MT2,
bool SO2 >
355 inline
EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
357 template< typename MT2 >
359 operator+=( const Matrix<MT2,!SO>& rhs );
361 template< typename MT2,
bool SO2 >
362 inline
DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
364 template< typename MT2,
bool SO2 >
365 inline
EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
367 template< typename MT2 >
369 operator-=( const Matrix<MT2,!SO>& rhs );
371 template< typename MT2,
bool SO2 >
372 inline HermitianMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
374 template< typename Other >
375 inline
EnableIf_< IsNumeric<Other>, HermitianMatrix >& operator*=( Other rhs );
377 template< typename Other >
378 inline
EnableIf_< IsNumeric<Other>, HermitianMatrix >& operator/=( Other rhs );
385 inline
size_t rows() const noexcept;
386 inline
size_t columns() const noexcept;
387 inline
size_t capacity() const noexcept;
388 inline
size_t capacity(
size_t i ) const noexcept;
390 inline
size_t nonZeros(
size_t i ) const;
392 inline
void reset(
size_t i );
394 inline
Iterator set(
size_t i,
size_t j, const ElementType& value );
395 inline
Iterator insert(
size_t i,
size_t j, const ElementType& value );
396 inline
void erase(
size_t i,
size_t j );
399 inline
void resize (
size_t n,
bool preserve=true );
400 inline
void reserve(
size_t nonzeros );
401 inline
void reserve(
size_t i,
size_t nonzeros );
403 inline
void trim(
size_t i );
406 template< typename Other > inline HermitianMatrix& scale( const Other& scalar );
407 template< typename Other > inline HermitianMatrix& scaleDiagonal( Other scale );
408 inline
void swap( HermitianMatrix& m ) noexcept;
415 inline
Iterator find (
size_t i,
size_t j );
416 inline ConstIterator find (
size_t i,
size_t j ) const;
417 inline
Iterator lowerBound(
size_t i,
size_t j );
418 inline ConstIterator lowerBound(
size_t i,
size_t j ) const;
419 inline
Iterator upperBound(
size_t i,
size_t j );
420 inline ConstIterator upperBound(
size_t i,
size_t j ) const;
427 inline
void append (
size_t i,
size_t j, const ElementType& value,
bool check=false );
428 inline
void finalize(
size_t i );
435 inline
bool isIntact() const noexcept;
442 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
443 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
445 inline
bool canSMPAssign() const noexcept;
453 template< typename MT2,
bool SO2, typename T >
454 inline const MT2& construct( const Matrix<MT2,SO2>& m, T );
456 template< typename MT2 >
469 template< typename MT2,
bool SO2,
bool DF2 >
470 friend
bool isDefault( const HermitianMatrix<MT2,SO2,DF2>& m );
506 template< typename MT
508 inline HermitianMatrix<MT,SO,false>::HermitianMatrix()
525 template<
typename MT
527 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n )
547 template<
typename MT
549 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n,
size_t nonzeros )
550 : matrix_( n, n, nonzeros )
571 template<
typename MT
573 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
574 : matrix_( n, n, nonzeros )
590 template<
typename MT
592 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
const HermitianMatrix& m )
593 : matrix_( m.matrix_ )
608 template<
typename MT
610 inline HermitianMatrix<MT,SO,false>::HermitianMatrix( HermitianMatrix&& m ) noexcept
611 : matrix_(
std::move( m.matrix_ ) )
630 template<
typename MT
632 template<
typename MT2
634 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
const Matrix<MT2,SO2>& m )
635 : matrix_( construct( m, typename IsBuiltin<
ElementType_<MT2> >::Type() ) )
637 if( !IsHermitian<MT2>::value && !
isHermitian( matrix_ ) ) {
669 template<
typename MT
672 HermitianMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
699 template<
typename MT
702 HermitianMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
const
730 template<
typename MT
733 HermitianMatrix<MT,SO,false>::at(
size_t i,
size_t j )
764 template<
typename MT
767 HermitianMatrix<MT,SO,false>::at(
size_t i,
size_t j )
const
793 template<
typename MT
798 return Iterator( matrix_.begin(i), matrix_, i );
816 template<
typename MT
821 return matrix_.begin(i);
839 template<
typename MT
844 return matrix_.cbegin(i);
862 template<
typename MT
867 return Iterator( matrix_.end(i), matrix_, i );
885 template<
typename MT
890 return matrix_.end(i);
908 template<
typename MT
913 return matrix_.cend(i);
937 template<
typename MT
939 inline HermitianMatrix<MT,SO,false>&
940 HermitianMatrix<MT,SO,false>::operator=(
const HermitianMatrix& rhs )
942 matrix_ = rhs.matrix_;
960 template<
typename MT
962 inline HermitianMatrix<MT,SO,false>&
963 HermitianMatrix<MT,SO,false>::operator=( HermitianMatrix&& rhs ) noexcept
965 matrix_ = std::move( rhs.matrix_ );
989 template<
typename MT
991 template<
typename MT2
993 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
994 HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
996 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1024 template<
typename MT
1026 template<
typename MT2
1028 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1029 HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
1031 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1035 if( IsHermitian<MT2>::value ) {
1045 matrix_ = std::move( tmp );
1070 template<
typename MT
1072 template<
typename MT2 >
1073 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,false>& >
1074 HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,!SO>& rhs )
1076 return this->operator=(
trans( ~rhs ) );
1095 template<
typename MT
1097 template<
typename MT2
1099 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1102 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1130 template<
typename MT
1132 template<
typename MT2
1134 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1137 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1141 if( IsHermitian<MT2>::value ) {
1145 const ResultType_<MT2> tmp( ~rhs );
1177 template<
typename MT
1179 template<
typename MT2 >
1180 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,false>& >
1202 template<
typename MT
1204 template<
typename MT2
1206 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1209 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1237 template<
typename MT
1239 template<
typename MT2
1241 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1244 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1248 if( IsHermitian<MT2>::value ) {
1252 const ResultType_<MT2> tmp( ~rhs );
1284 template<
typename MT
1286 template<
typename MT2 >
1287 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,false>& >
1308 template<
typename MT
1310 template<
typename MT2
1312 inline HermitianMatrix<MT,SO,false>&
1315 if( matrix_.rows() != (~rhs).
columns() ) {
1319 MT tmp( matrix_ * ~rhs );
1325 matrix_ = std::move( tmp );
1344 template<
typename MT
1346 template<
typename Other >
1347 inline EnableIf_< IsNumeric<Other>, HermitianMatrix<MT,SO,false> >&
1364 template<
typename MT
1366 template<
typename Other >
1367 inline EnableIf_< IsNumeric<Other>, HermitianMatrix<MT,SO,false> >&
1393 template<
typename MT
1397 return matrix_.rows();
1409 template<
typename MT
1413 return matrix_.columns();
1425 template<
typename MT
1429 return matrix_.capacity();
1446 template<
typename MT
1450 return matrix_.capacity(i);
1462 template<
typename MT
1466 return matrix_.nonZeros();
1484 template<
typename MT
1488 return matrix_.nonZeros(i);
1500 template<
typename MT
1546 template<
typename MT
1550 for( Iterator_<MT> it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1552 const size_t j( it->index() );
1558 const Iterator_<MT> pos( matrix_.find( i, j ) );
1560 matrix_.erase( j, pos );
1563 const Iterator_<MT> pos( matrix_.find( j, i ) );
1565 matrix_.erase( j, pos );
1583 template<
typename MT
1610 template<
typename MT
1622 matrix_.set( j, i,
conj( value ) );
1623 return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
1645 template<
typename MT
1648 HermitianMatrix<MT,SO,false>::insert(
size_t i,
size_t j,
const ElementType& value )
1657 matrix_.insert( j, i,
conj( value ) );
1658 return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
1674 template<
typename MT
1676 inline void HermitianMatrix<MT,SO,false>::erase(
size_t i,
size_t j )
1678 matrix_.erase( i, j );
1680 matrix_.erase( j, i );
1698 template<
typename MT
1701 HermitianMatrix<MT,SO,false>::erase(
size_t i,
Iterator pos )
1703 const Iterator_<MT> base( pos.base() );
1705 if( base == matrix_.end( i ) )
1708 const size_t j( base->index() );
1712 return Iterator( matrix_.erase( i, base ), matrix_, i );
1717 matrix_.erase( j, matrix_.find( i, j ) );
1718 return Iterator( matrix_.erase( i, base ), matrix_, i );
1722 matrix_.erase( j, matrix_.find( j, i ) );
1723 return Iterator( matrix_.erase( i, base ), matrix_, i );
1744 template<
typename MT
1747 HermitianMatrix<MT,SO,false>::erase(
size_t i,
Iterator first,
Iterator last )
1749 for( Iterator_<MT> it=first.base(); it!=last.base(); ++it )
1751 const size_t j( it->index() );
1758 matrix_.erase( i, j );
1762 matrix_.erase( j, i );
1766 return Iterator( matrix_.erase( i, first.base(), last.base() ), matrix_, i );
1787 template<
typename MT
1797 matrix_.resize( n, n,
true );
1814 template<
typename MT
1816 inline void HermitianMatrix<MT,SO,false>::reserve(
size_t nonzeros )
1818 matrix_.reserve( nonzeros );
1838 template<
typename MT
1840 inline void HermitianMatrix<MT,SO,false>::reserve(
size_t i,
size_t nonzeros )
1842 matrix_.reserve( i, nonzeros );
1859 template<
typename MT
1861 inline void HermitianMatrix<MT,SO,false>::trim()
1881 template<
typename MT
1883 inline void HermitianMatrix<MT,SO,false>::trim(
size_t i )
1897 template<
typename MT
1901 if( IsComplex<ElementType>::value )
1902 matrix_.transpose();
1915 template<
typename MT
1932 template<
typename MT
1934 template<
typename Other >
1935 inline HermitianMatrix<MT,SO,false>&
1936 HermitianMatrix<MT,SO,false>::scale(
const Other& scalar )
1938 matrix_.scale( scalar );
1952 template<
typename MT
1954 template<
typename Other >
1955 inline HermitianMatrix<MT,SO,false>&
1956 HermitianMatrix<MT,SO,false>::scaleDiagonal( Other scalar )
1958 matrix_.scaleDiagonal( scalar );
1972 template<
typename MT
1978 swap( matrix_, m.matrix_ );
2008 template<
typename MT
2011 HermitianMatrix<MT,SO,false>::find(
size_t i,
size_t j )
2013 return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
2035 template<
typename MT
2038 HermitianMatrix<MT,SO,false>::find(
size_t i,
size_t j )
const
2040 return matrix_.find( i, j );
2062 template<
typename MT
2065 HermitianMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
2067 return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2089 template<
typename MT
2092 HermitianMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
const
2094 return matrix_.lowerBound( i, j );
2116 template<
typename MT
2119 HermitianMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
2121 return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2143 template<
typename MT
2146 HermitianMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
const
2148 return matrix_.upperBound( i, j );
2221 template<
typename MT
2223 inline void HermitianMatrix<MT,SO,false>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
2231 matrix_.append( i, j, value, check );
2233 matrix_.insert( j, i,
conj( value ) );
2253 template<
typename MT
2255 inline void HermitianMatrix<MT,SO,false>::finalize(
size_t i )
2281 template<
typename MT
2312 template<
typename MT
2314 template<
typename Other >
2315 inline bool HermitianMatrix<MT,SO,false>::canAlias(
const Other* alias )
const noexcept
2317 return matrix_.canAlias( alias );
2334 template<
typename MT
2336 template<
typename Other >
2337 inline bool HermitianMatrix<MT,SO,false>::isAliased(
const Other* alias )
const noexcept
2339 return matrix_.isAliased( alias );
2356 template<
typename MT
2358 inline bool HermitianMatrix<MT,SO,false>::canSMPAssign() const noexcept
2360 return matrix_.canSMPAssign();
2376 template<
typename MT
2378 template<
typename MT2
2381 inline const MT2& HermitianMatrix<MT,SO,false>::construct(
const Matrix<MT2,SO2>& m, T )
2391 template<
typename MT
2393 template<
typename MT2 >
2394 inline TransExprTrait_<MT2>
2395 HermitianMatrix<MT,SO,false>::construct(
const Matrix<MT2,!SO>& m, TrueType )
#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:1158
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
bool isDiagonal(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is diagonal.
Definition: DenseMatrix.h:1499
Header file for the Rows type trait.
Header file for the UNUSED_PARAMETER function template.
const DMatDMatMultExpr< T1, T2 > 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:7800
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:346
Header file for basic type definitions.
bool isReal(const DiagonalProxy< MT > &proxy)
Returns whether the matrix element represents a real number.
Definition: DiagonalProxy.h:595
#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:188
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:2643
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5077
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:590
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2636
#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
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:384
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:2639
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:298
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:232
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
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
bool isDefault(const CompressedMatrix< Type, SO > &m)
Returns whether the given compressed matrix is in default state.
Definition: CompressedMatrix.h:5104
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:5148
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5131
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
#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.
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:330
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2640
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:538
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:254
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2641
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:2645
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:2642
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
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2646
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:258
Header file for the TransExprTrait class template.
Constraint on the data type.
Constraint on the data type.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:314
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2637
#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:950
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
bool isHermitian(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is Hermitian.
Definition: DenseMatrix.h:759
#define BLAZE_CONSTRAINT_MUST_NOT_BE_EXPRESSION_TYPE(T)
Constraint on the data type.In case the given data type T is an expression (i.e. a type derived from ...
Definition: Expression.h:81
Header file for the HermitianProxy class.
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2638
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
Header file for the IsComplex type trait.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2644
#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:609
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:564