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 >
119 typedef HermitianMatrix<MT,SO,false>
This;
134 template<
typename ET >
137 typedef HermitianMatrix< typename MT::template Rebind<ET>::Other > Other;
150 typedef std::forward_iterator_tag IteratorCategory;
151 typedef HermitianElement<MT> ValueType;
152 typedef ValueType PointerType;
153 typedef ValueType ReferenceType;
154 typedef ptrdiff_t DifferenceType;
157 typedef IteratorCategory iterator_category;
158 typedef ValueType value_type;
159 typedef PointerType pointer;
160 typedef ReferenceType reference;
161 typedef DifferenceType difference_type;
181 inline Iterator( IteratorType pos, MT& matrix,
size_t index )
204 inline const Iterator operator++(
int ) {
217 return ReferenceType( pos_, matrix_, index_ );
226 inline PointerType operator->()
const {
227 return PointerType( pos_, matrix_, index_ );
248 return pos_ == rhs.pos_;
259 return !( *
this == rhs );
270 return pos_ - rhs.pos_;
279 inline IteratorType base()
const {
295 enum { smpAssignable = 0 };
301 explicit inline HermitianMatrix();
302 explicit inline HermitianMatrix(
size_t n );
303 explicit inline HermitianMatrix(
size_t n,
size_t nonzeros );
304 explicit inline HermitianMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
306 inline HermitianMatrix(
const HermitianMatrix& m );
307 template<
typename MT2,
bool SO2 >
inline HermitianMatrix(
const Matrix<MT2,SO2>& m );
318 inline Reference operator()(
size_t i,
size_t j );
319 inline ConstReference operator()(
size_t i,
size_t j )
const;
320 inline Reference at(
size_t i,
size_t j );
321 inline ConstReference at(
size_t i,
size_t j )
const;
323 inline ConstIterator
begin (
size_t i )
const;
324 inline ConstIterator
cbegin(
size_t i )
const;
326 inline ConstIterator
end (
size_t i )
const;
327 inline ConstIterator
cend (
size_t i )
const;
334 inline HermitianMatrix& operator=(
const HermitianMatrix& rhs );
336 template<
typename MT2,
bool SO2 >
337 inline typename DisableIf< IsComputation<MT2>, HermitianMatrix& >::Type
338 operator=(
const Matrix<MT2,SO2>& rhs );
340 template<
typename MT2,
bool SO2 >
341 inline typename EnableIf< IsComputation<MT2>, HermitianMatrix& >::Type
342 operator=(
const Matrix<MT2,SO2>& rhs );
344 template<
typename MT2 >
345 inline typename EnableIf< IsBuiltin<typename MT2::ElementType>, HermitianMatrix& >::Type
346 operator=(
const Matrix<MT2,!SO>& rhs );
348 template<
typename MT2,
bool SO2 >
349 inline typename DisableIf< IsComputation<MT2>, HermitianMatrix& >::Type
350 operator+=(
const Matrix<MT2,SO2>& rhs );
352 template<
typename MT2,
bool SO2 >
353 inline typename EnableIf< IsComputation<MT2>, HermitianMatrix& >::Type
354 operator+=(
const Matrix<MT2,SO2>& rhs );
356 template<
typename MT2 >
357 inline typename EnableIf< IsBuiltin<typename MT2::ElementType>, HermitianMatrix& >::Type
358 operator+=(
const Matrix<MT2,!SO>& rhs );
360 template<
typename MT2,
bool SO2 >
361 inline typename DisableIf< IsComputation<MT2>, HermitianMatrix& >::Type
362 operator-=(
const Matrix<MT2,SO2>& rhs );
364 template<
typename MT2,
bool SO2 >
365 inline typename EnableIf< IsComputation<MT2>, HermitianMatrix& >::Type
366 operator-=(
const Matrix<MT2,SO2>& rhs );
368 template<
typename MT2 >
369 inline typename EnableIf< IsBuiltin<typename MT2::ElementType>, HermitianMatrix& >::Type
370 operator-=(
const Matrix<MT2,!SO>& rhs );
372 template<
typename MT2,
bool SO2 >
373 inline HermitianMatrix& operator*=(
const Matrix<MT2,SO2>& rhs );
375 template<
typename Other >
376 inline typename EnableIf< IsNumeric<Other>, HermitianMatrix >::Type&
377 operator*=( Other rhs );
379 template<
typename Other >
380 inline typename EnableIf< IsNumeric<Other>, HermitianMatrix >::Type&
381 operator/=( Other rhs );
388 inline size_t rows()
const;
391 inline size_t capacity(
size_t i )
const;
393 inline size_t nonZeros(
size_t i )
const;
395 inline void reset(
size_t i );
397 inline Iterator set(
size_t i,
size_t j,
const ElementType& value );
398 inline Iterator insert(
size_t i,
size_t j,
const ElementType& value );
399 inline void erase(
size_t i,
size_t j );
402 inline void resize (
size_t n,
bool preserve=
true );
403 inline void reserve(
size_t nonzeros );
404 inline void reserve(
size_t i,
size_t nonzeros );
406 inline void trim(
size_t i );
409 template<
typename Other >
inline HermitianMatrix& scale(
const Other& scalar );
410 template<
typename Other >
inline HermitianMatrix& scaleDiagonal( Other scale );
411 inline void swap( HermitianMatrix& m ) ;
418 inline Iterator find (
size_t i,
size_t j );
419 inline ConstIterator find (
size_t i,
size_t j )
const;
420 inline Iterator lowerBound(
size_t i,
size_t j );
421 inline ConstIterator lowerBound(
size_t i,
size_t j )
const;
422 inline Iterator upperBound(
size_t i,
size_t j );
423 inline ConstIterator upperBound(
size_t i,
size_t j )
const;
430 inline void append (
size_t i,
size_t j,
const ElementType& value,
bool check=
false );
431 inline void finalize(
size_t i );
445 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
446 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
448 inline bool canSMPAssign()
const;
456 template<
typename MT2,
bool SO2,
typename T >
457 inline const MT2& construct(
const Matrix<MT2,SO2>& m, T );
459 template<
typename MT2 >
460 inline typename TransExprTrait<MT2>::Type construct(
const Matrix<MT2,!SO>& m,
TrueType );
472 template<
typename MT2,
bool SO2,
bool DF2 >
473 friend bool isDefault(
const HermitianMatrix<MT2,SO2,DF2>& m );
509 template<
typename MT
511 inline HermitianMatrix<MT,SO,false>::HermitianMatrix()
528 template<
typename MT
530 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n )
550 template<
typename MT
552 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n,
size_t nonzeros )
553 : matrix_( n, n, nonzeros )
574 template<
typename MT
576 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
577 : matrix_( n, n, nonzeros )
593 template<
typename MT
595 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
const HermitianMatrix& m )
596 : matrix_( m.matrix_ )
615 template<
typename MT
617 template<
typename MT2
619 inline HermitianMatrix<MT,SO,false>::HermitianMatrix(
const Matrix<MT2,SO2>& m )
620 : matrix_( construct( m, typename IsBuiltin<typename MT2::
ElementType>::Type() ) )
622 if( !IsHermitian<MT2>::value && !
isHermitian( matrix_ ) ) {
654 template<
typename MT
657 HermitianMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
684 template<
typename MT
687 HermitianMatrix<MT,SO,false>::operator()(
size_t i,
size_t j )
const
715 template<
typename MT
718 HermitianMatrix<MT,SO,false>::at(
size_t i,
size_t j )
749 template<
typename MT
752 HermitianMatrix<MT,SO,false>::at(
size_t i,
size_t j )
const
778 template<
typename MT
783 return Iterator( matrix_.begin(i), matrix_, i );
801 template<
typename MT
806 return matrix_.begin(i);
824 template<
typename MT
829 return matrix_.cbegin(i);
847 template<
typename MT
852 return Iterator( matrix_.end(i), matrix_, i );
870 template<
typename MT
875 return matrix_.end(i);
893 template<
typename MT
898 return matrix_.cend(i);
922 template<
typename MT
924 inline HermitianMatrix<MT,SO,false>&
925 HermitianMatrix<MT,SO,false>::operator=(
const HermitianMatrix& rhs )
927 matrix_ = rhs.matrix_;
951 template<
typename MT
953 template<
typename MT2
955 inline typename DisableIf< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >::Type
956 HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
958 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
986 template<
typename MT
988 template<
typename MT2
990 inline typename EnableIf< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >::Type
991 HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,SO2>& rhs )
993 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
997 if( IsHermitian<MT2>::value ) {
1007 move( matrix_, tmp );
1032 template<
typename MT
1034 template<
typename MT2 >
1035 inline typename EnableIf< IsBuiltin<typename MT2::ElementType>, HermitianMatrix<MT,SO,false>& >::Type
1036 HermitianMatrix<MT,SO,false>::operator=(
const Matrix<MT2,!SO>& rhs )
1038 return this->operator=(
trans( ~rhs ) );
1057 template<
typename MT
1059 template<
typename MT2
1061 inline typename DisableIf< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >::Type
1062 HermitianMatrix<MT,SO,false>::operator+=(
const Matrix<MT2,SO2>& rhs )
1064 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1092 template<
typename MT
1094 template<
typename MT2
1096 inline typename EnableIf< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >::Type
1097 HermitianMatrix<MT,SO,false>::operator+=(
const Matrix<MT2,SO2>& rhs )
1099 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1103 if( IsHermitian<MT2>::value ) {
1139 template<
typename MT
1141 template<
typename MT2 >
1142 inline typename EnableIf< IsBuiltin<typename MT2::ElementType>, HermitianMatrix<MT,SO,false>& >::Type
1143 HermitianMatrix<MT,SO,false>::operator+=(
const Matrix<MT2,!SO>& rhs )
1145 return this->operator+=(
trans( ~rhs ) );
1164 template<
typename MT
1166 template<
typename MT2
1168 inline typename DisableIf< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >::Type
1169 HermitianMatrix<MT,SO,false>::operator-=(
const Matrix<MT2,SO2>& rhs )
1171 if( !IsHermitian<MT2>::value && !
isHermitian( ~rhs ) ) {
1199 template<
typename MT
1201 template<
typename MT2
1203 inline typename EnableIf< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >::Type
1204 HermitianMatrix<MT,SO,false>::operator-=(
const Matrix<MT2,SO2>& rhs )
1206 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1210 if( IsHermitian<MT2>::value ) {
1246 template<
typename MT
1248 template<
typename MT2 >
1249 inline typename EnableIf< IsBuiltin<typename MT2::ElementType>, HermitianMatrix<MT,SO,false>& >::Type
1250 HermitianMatrix<MT,SO,false>::operator-=(
const Matrix<MT2,!SO>& rhs )
1252 return this->operator-=(
trans( ~rhs ) );
1270 template<
typename MT
1272 template<
typename MT2
1274 inline HermitianMatrix<MT,SO,false>&
1275 HermitianMatrix<MT,SO,false>::operator*=(
const Matrix<MT2,SO2>& rhs )
1277 if( matrix_.rows() != (~rhs).
columns() ) {
1281 MT tmp( matrix_ * ~rhs );
1287 move( matrix_, tmp );
1306 template<
typename MT
1308 template<
typename Other >
1309 inline typename EnableIf< IsNumeric<Other>, HermitianMatrix<MT,SO,false> >::Type&
1310 HermitianMatrix<MT,SO,false>::operator*=( Other rhs )
1326 template<
typename MT
1328 template<
typename Other >
1329 inline typename EnableIf< IsNumeric<Other>, HermitianMatrix<MT,SO,false> >::Type&
1330 HermitianMatrix<MT,SO,false>::operator/=( Other rhs )
1355 template<
typename MT
1359 return matrix_.rows();
1371 template<
typename MT
1375 return matrix_.columns();
1387 template<
typename MT
1391 return matrix_.capacity();
1408 template<
typename MT
1412 return matrix_.capacity(i);
1424 template<
typename MT
1428 return matrix_.nonZeros();
1446 template<
typename MT
1450 return matrix_.nonZeros(i);
1462 template<
typename MT
1508 template<
typename MT
1512 for(
typename MT::Iterator it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1514 const size_t j( it->index() );
1520 const typename MT::Iterator pos( matrix_.find( i, j ) );
1522 matrix_.erase( j, pos );
1525 const typename MT::Iterator pos( matrix_.find( j, i ) );
1527 matrix_.erase( j, pos );
1545 template<
typename MT
1572 template<
typename MT
1584 matrix_.set( j, i,
conj( value ) );
1585 return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
1607 template<
typename MT
1610 HermitianMatrix<MT,SO,false>::insert(
size_t i,
size_t j,
const ElementType& value )
1619 matrix_.insert( j, i,
conj( value ) );
1620 return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
1636 template<
typename MT
1638 inline void HermitianMatrix<MT,SO,false>::erase(
size_t i,
size_t j )
1640 matrix_.erase( i, j );
1642 matrix_.erase( j, i );
1660 template<
typename MT
1663 HermitianMatrix<MT,SO,false>::erase(
size_t i,
Iterator pos )
1667 if( base == matrix_.end( i ) )
1670 const size_t j( base->index() );
1674 return Iterator( matrix_.erase( i, base ), matrix_, i );
1679 matrix_.erase( j, matrix_.find( i, j ) );
1680 return Iterator( matrix_.erase( i, base ), matrix_, i );
1684 matrix_.erase( j, matrix_.find( j, i ) );
1685 return Iterator( matrix_.erase( i, base ), matrix_, i );
1706 template<
typename MT
1709 HermitianMatrix<MT,SO,false>::erase(
size_t i,
Iterator first,
Iterator last )
1711 for(
typename MT::Iterator it=first.base(); it!=last.base(); ++it )
1713 const size_t j( it->index() );
1720 matrix_.erase( i, j );
1724 matrix_.erase( j, i );
1728 return Iterator( matrix_.erase( i, first.base(), last.base() ), matrix_, i );
1749 template<
typename MT
1759 matrix_.resize( n, n,
true );
1776 template<
typename MT
1778 inline void HermitianMatrix<MT,SO,false>::reserve(
size_t nonzeros )
1780 matrix_.reserve( nonzeros );
1800 template<
typename MT
1802 inline void HermitianMatrix<MT,SO,false>::reserve(
size_t i,
size_t nonzeros )
1804 matrix_.reserve( i, nonzeros );
1821 template<
typename MT
1823 inline void HermitianMatrix<MT,SO,false>::trim()
1843 template<
typename MT
1845 inline void HermitianMatrix<MT,SO,false>::trim(
size_t i )
1859 template<
typename MT
1863 if( IsComplex<ElementType>::value )
1864 matrix_.transpose();
1877 template<
typename MT
1894 template<
typename MT
1896 template<
typename Other >
1897 inline HermitianMatrix<MT,SO,false>&
1898 HermitianMatrix<MT,SO,false>::scale(
const Other& scalar )
1900 matrix_.scale( scalar );
1914 template<
typename MT
1916 template<
typename Other >
1917 inline HermitianMatrix<MT,SO,false>&
1918 HermitianMatrix<MT,SO,false>::scaleDiagonal( Other scalar )
1920 matrix_.scaleDiagonal( scalar );
1935 template<
typename MT
1941 swap( matrix_, m.matrix_ );
1971 template<
typename MT
1974 HermitianMatrix<MT,SO,false>::find(
size_t i,
size_t j )
1976 return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
1998 template<
typename MT
2001 HermitianMatrix<MT,SO,false>::find(
size_t i,
size_t j )
const
2003 return matrix_.find( i, j );
2025 template<
typename MT
2028 HermitianMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
2030 return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2052 template<
typename MT
2055 HermitianMatrix<MT,SO,false>::lowerBound(
size_t i,
size_t j )
const
2057 return matrix_.lowerBound( i, j );
2079 template<
typename MT
2082 HermitianMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
2084 return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2106 template<
typename MT
2109 HermitianMatrix<MT,SO,false>::upperBound(
size_t i,
size_t j )
const
2111 return matrix_.upperBound( i, j );
2184 template<
typename MT
2186 inline void HermitianMatrix<MT,SO,false>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
2194 matrix_.append( i, j, value, check );
2196 matrix_.insert( j, i,
conj( value ) );
2216 template<
typename MT
2218 inline void HermitianMatrix<MT,SO,false>::finalize(
size_t i )
2244 template<
typename MT
2275 template<
typename MT
2277 template<
typename Other >
2278 inline bool HermitianMatrix<MT,SO,false>::canAlias(
const Other* alias )
const
2280 return matrix_.canAlias( alias );
2297 template<
typename MT
2299 template<
typename Other >
2300 inline bool HermitianMatrix<MT,SO,false>::isAliased(
const Other* alias )
const
2302 return matrix_.isAliased( alias );
2319 template<
typename MT
2321 inline bool HermitianMatrix<MT,SO,false>::canSMPAssign()
const
2323 return matrix_.canSMPAssign();
2339 template<
typename MT
2341 template<
typename MT2
2344 inline const MT2& HermitianMatrix<MT,SO,false>::construct(
const Matrix<MT2,SO2>& m, T )
2354 template<
typename MT
2356 template<
typename MT2 >
2357 inline typename TransExprTrait<MT2>::Type
2358 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:116
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type set(T value)
Sets all values in the vector to the given 2-byte integral value.
Definition: Set.h:73
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:1511
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:7820
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix)
Checks if the given matrix is a square matrix.
Definition: Matrix.h:603
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:229
void move(CompressedMatrix< Type, SO > &dst, CompressedMatrix< Type, SO > &src)
Moving the contents of one compressed matrix to another.
Definition: CompressedMatrix.h:5016
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:292
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:250
bool isReal(const DiagonalProxy< MT > &proxy)
Returns whether the matrix element represents a real number.
Definition: DiagonalProxy.h:569
#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:81
Constraint on the data type.
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix)
Returns the maximum capacity of the matrix.
Definition: Matrix.h:340
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:308
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:4926
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:584
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2582
#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:116
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:378
Constraint on the data type.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2584
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
Constraint on the data type.
Constraint on the data type.
Header file for the SparseMatrix base class.
ConjExprTrait< typename DiagonalProxy< MT >::RepresentedType >::Type conj(const DiagonalProxy< MT > &proxy)
Computing the complex conjugate of the represented element.
Definition: DiagonalProxy.h:487
Header file for utility functions for sparse matrices.
Header file for the IsSquare type trait.
Constraint on the data type.
bool isDefault(const CompressedMatrix< Type, SO > &m)
Returns whether the given compressed matrix is in default state.
Definition: CompressedMatrix.h:4953
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)
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:4998
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:4980
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
#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:116
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
Header file for the Columns type trait.
Constraint on the data type.
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:642
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
Constraints on the storage order of matrix types.
#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:118
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:187
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:532
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
Header file for all forward declarations for expression class templates.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2590
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:527
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
Header file for the implementation of the base template of the HeritianMatrix.
#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:116
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
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:79
#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:118
#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:116
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2591
Header file for the isDefault shim.
Header file for the TransExprTrait class template.
Constraint on the data type.
Constraint on the data type.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:256
Header file for the move shim.
#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:79
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:944
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:767
#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:118
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:2583
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:324
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:237
Header file for the IsComplex type trait.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2589
#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:116
Header file for exception macros.
boost::true_type TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
#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:143
Header file for the IsHermitian type trait.
Header file for the isReal shim.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:79
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:558