35 #ifndef _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SPARSENUMERIC_H_ 36 #define _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SPARSENUMERIC_H_ 103 template<
typename MT
105 class SymmetricMatrix<MT,SO,false,true>
106 :
public SparseMatrix< SymmetricMatrix<MT,SO,false,true>, SO >
110 using OT = OppositeType_<MT>;
111 using TT = TransposeType_<MT>;
112 using ET = ElementType_<MT>;
117 using This = SymmetricMatrix<MT,SO,false,true>;
118 using BaseType = SparseMatrix<This,SO>;
120 using OppositeType = SymmetricMatrix<OT,!SO,false,true>;
133 template<
typename NewType >
136 using Other = SymmetricMatrix< typename MT::template Rebind<NewType>::Other >;
143 template<
size_t NewM
147 using Other = SymmetricMatrix< typename MT::template Resize<NewM,NewN>::Other >;
158 using IteratorType = Iterator_<MT>;
160 using IteratorCategory = std::forward_iterator_tag;
161 using ValueType = SymmetricElement<MT>;
162 using PointerType = ValueType;
163 using ReferenceType = ValueType;
164 using DifferenceType = ptrdiff_t;
167 using iterator_category = IteratorCategory;
168 using value_type = ValueType;
169 using pointer = PointerType;
170 using reference = ReferenceType;
171 using difference_type = DifferenceType;
191 inline Iterator( IteratorType pos, MT& matrix,
size_t index )
214 inline const Iterator operator++(
int ) {
227 return ReferenceType( pos_, matrix_, index_ );
236 inline PointerType operator->()
const {
237 return PointerType( pos_, matrix_, index_ );
258 return pos_ == rhs.pos_;
269 return !( *
this == rhs );
280 return pos_ - rhs.pos_;
289 inline IteratorType base()
const {
305 enum :
bool { smpAssignable =
false };
311 explicit inline SymmetricMatrix();
312 explicit inline SymmetricMatrix(
size_t n );
313 explicit inline SymmetricMatrix(
size_t n,
size_t nonzeros );
314 explicit inline SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
315 explicit inline SymmetricMatrix( initializer_list< initializer_list<ElementType> > list );
317 inline SymmetricMatrix(
const SymmetricMatrix& m );
318 inline SymmetricMatrix( SymmetricMatrix&& m ) noexcept;
320 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,SO>& m );
321 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,!SO>& m );
332 inline Reference operator()(
size_t i,
size_t j );
334 inline Reference at(
size_t i,
size_t j );
348 inline SymmetricMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
350 inline SymmetricMatrix& operator=(
const SymmetricMatrix& rhs );
351 inline SymmetricMatrix& operator=( SymmetricMatrix&& rhs ) noexcept;
353 template<
typename MT2 >
354 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix& > operator=(
const Matrix<MT2,SO>& rhs );
356 template<
typename MT2 >
357 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix& > operator=(
const Matrix<MT2,SO>& rhs );
359 template<
typename MT2 >
360 inline SymmetricMatrix& operator=(
const Matrix<MT2,!SO>& rhs );
362 template<
typename MT2 >
363 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix& >
operator+=(
const Matrix<MT2,SO>& rhs );
365 template<
typename MT2 >
366 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix& >
operator+=(
const Matrix<MT2,SO>& rhs );
368 template<
typename MT2 >
369 inline SymmetricMatrix&
operator+=(
const Matrix<MT2,!SO>& rhs );
371 template<
typename MT2 >
372 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix& >
operator-=(
const Matrix<MT2,SO>& rhs );
374 template<
typename MT2 >
375 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix& >
operator-=(
const Matrix<MT2,SO>& rhs );
377 template<
typename MT2 >
378 inline SymmetricMatrix&
operator-=(
const Matrix<MT2,!SO>& rhs );
380 template<
typename MT2 >
381 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix& > operator%=(
const Matrix<MT2,SO>& rhs );
383 template<
typename MT2 >
384 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix& > operator%=(
const Matrix<MT2,SO>& rhs );
386 template<
typename MT2 >
387 inline SymmetricMatrix& operator%=(
const Matrix<MT2,!SO>& rhs );
389 template<
typename ST >
390 inline EnableIf_< IsNumeric<ST>, SymmetricMatrix >&
operator*=( ST rhs );
392 template<
typename ST >
393 inline EnableIf_< IsNumeric<ST>, SymmetricMatrix >&
operator/=( ST rhs );
400 inline size_t rows() const noexcept;
401 inline
size_t columns() const noexcept;
402 inline
size_t capacity() const noexcept;
403 inline
size_t capacity(
size_t i ) const noexcept;
405 inline
size_t nonZeros(
size_t i ) const;
407 inline
void reset(
size_t i );
409 inline
void resize (
size_t n,
bool preserve=true );
410 inline
void reserve(
size_t nonzeros );
411 inline
void reserve(
size_t i,
size_t nonzeros );
413 inline
void trim(
size_t i );
415 inline
void swap( SymmetricMatrix& m ) noexcept;
424 inline
void append (
size_t i,
size_t j, const
ElementType& value,
bool check=false );
425 inline
void finalize(
size_t i );
432 inline
void erase(
size_t i,
size_t j );
436 template< typename Pred >
437 inline
void erase( Pred predicate );
439 template< typename Pred >
440 inline
void erase(
size_t i,
Iterator first,
Iterator last, Pred predicate );
447 inline
Iterator find (
size_t i,
size_t j );
449 inline
Iterator lowerBound(
size_t i,
size_t j );
451 inline
Iterator upperBound(
size_t i,
size_t j );
462 template< typename Other > inline SymmetricMatrix& scale( const Other& scalar );
469 inline
bool isIntact() const noexcept;
476 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
477 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
479 inline
bool canSMPAssign() const noexcept;
492 template<
bool RF, typename MT2,
bool SO2,
bool DF2,
bool NF2 >
493 friend
bool isDefault( const SymmetricMatrix<MT2,SO2,DF2,NF2>& m );
529 template< typename MT
531 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix()
548 template<
typename MT
550 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n )
570 template<
typename MT
572 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
size_t nonzeros )
573 : matrix_( n, n, nonzeros )
594 template<
typename MT
596 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
597 : matrix_( n, n, nonzeros )
631 template<
typename MT
633 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix( initializer_list< initializer_list<ElementType> > list )
652 template<
typename MT
654 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const SymmetricMatrix& m )
655 : matrix_( m.matrix_ )
670 template<
typename MT
672 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix( SymmetricMatrix&& m ) noexcept
673 : matrix_( std::move( m.matrix_ ) )
692 template<
typename MT
694 template<
typename MT2 >
695 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,SO>& m )
698 if( !IsSymmetric<MT2>::value && !
isSymmetric( matrix_ ) ) {
719 template<
typename MT
721 template<
typename MT2 >
722 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,!SO>& m )
723 : matrix_(
trans( ~m ) )
725 if( !IsSymmetric<MT2>::value && !
isSymmetric( matrix_ ) ) {
759 template<
typename MT
762 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
788 template<
typename MT
791 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
const 818 template<
typename MT
821 SymmetricMatrix<MT,SO,false,true>::at(
size_t i,
size_t j )
851 template<
typename MT
854 SymmetricMatrix<MT,SO,false,true>::at(
size_t i,
size_t j )
const 880 template<
typename MT
885 return Iterator( matrix_.begin(i), matrix_, i );
903 template<
typename MT
908 return matrix_.begin(i);
926 template<
typename MT
931 return matrix_.cbegin(i);
949 template<
typename MT
954 return Iterator( matrix_.end(i), matrix_, i );
972 template<
typename MT
977 return matrix_.end(i);
995 template<
typename MT
1000 return matrix_.cend(i);
1039 template<
typename MT
1041 inline SymmetricMatrix<MT,SO,false,true>&
1042 SymmetricMatrix<MT,SO,false,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1044 const InitializerMatrix<ElementType> tmp( list, list.size() );
1071 template<
typename MT
1073 inline SymmetricMatrix<MT,SO,false,true>&
1074 SymmetricMatrix<MT,SO,false,true>::operator=(
const SymmetricMatrix& rhs )
1076 matrix_ = rhs.matrix_;
1094 template<
typename MT
1096 inline SymmetricMatrix<MT,SO,false,true>&
1097 SymmetricMatrix<MT,SO,false,true>::operator=( SymmetricMatrix&& rhs ) noexcept
1099 matrix_ = std::move( rhs.matrix_ );
1123 template<
typename MT
1125 template<
typename MT2 >
1126 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1127 SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1129 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1157 template<
typename MT
1159 template<
typename MT2 >
1160 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1161 SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1163 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1167 if( IsSymmetric<MT2>::value ) {
1177 matrix_ = std::move( tmp );
1202 template<
typename MT
1204 template<
typename MT2 >
1205 inline SymmetricMatrix<MT,SO,false,true>&
1206 SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,!SO>& rhs )
1208 return this->operator=(
trans( ~rhs ) );
1227 template<
typename MT
1229 template<
typename MT2 >
1230 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1233 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1261 template<
typename MT
1263 template<
typename MT2 >
1264 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1267 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1271 if( IsSymmetric<MT2>::value ) {
1275 const ResultType_<MT2> tmp( ~rhs );
1307 template<
typename MT
1309 template<
typename MT2 >
1310 inline SymmetricMatrix<MT,SO,false,true>&
1332 template<
typename MT
1334 template<
typename MT2 >
1335 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1338 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1366 template<
typename MT
1368 template<
typename MT2 >
1369 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1372 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1376 if( IsSymmetric<MT2>::value ) {
1380 const ResultType_<MT2> tmp( ~rhs );
1412 template<
typename MT
1414 template<
typename MT2 >
1415 inline SymmetricMatrix<MT,SO,false,true>&
1438 template<
typename MT
1440 template<
typename MT2 >
1441 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1442 SymmetricMatrix<MT,SO,false,true>::operator%=(
const Matrix<MT2,SO>& rhs )
1444 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1473 template<
typename MT
1475 template<
typename MT2 >
1476 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1477 SymmetricMatrix<MT,SO,false,true>::operator%=(
const Matrix<MT2,SO>& rhs )
1479 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1483 if( IsSymmetric<MT2>::value ) {
1487 const ResultType_<MT2> tmp( ~rhs );
1519 template<
typename MT
1521 template<
typename MT2 >
1522 inline SymmetricMatrix<MT,SO,false,true>&
1523 SymmetricMatrix<MT,SO,false,true>::operator%=(
const Matrix<MT2,!SO>& rhs )
1525 return this->operator%=(
trans( ~rhs ) );
1539 template<
typename MT
1541 template<
typename ST >
1542 inline EnableIf_< IsNumeric<ST>, SymmetricMatrix<MT,SO,false,true> >&
1559 template<
typename MT
1561 template<
typename ST >
1562 inline EnableIf_< IsNumeric<ST>, SymmetricMatrix<MT,SO,false,true> >&
1588 template<
typename MT
1592 return matrix_.rows();
1604 template<
typename MT
1608 return matrix_.columns();
1620 template<
typename MT
1624 return matrix_.capacity();
1641 template<
typename MT
1645 return matrix_.capacity(i);
1657 template<
typename MT
1661 return matrix_.nonZeros();
1679 template<
typename MT
1683 return matrix_.nonZeros(i);
1695 template<
typename MT
1741 template<
typename MT
1745 for( Iterator_<MT> it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1747 const size_t j( it->index() );
1753 const Iterator_<MT> pos( matrix_.find( i, j ) );
1755 matrix_.erase( j, pos );
1758 const Iterator_<MT> pos( matrix_.find( j, i ) );
1760 matrix_.erase( j, pos );
1778 template<
typename MT
1805 template<
typename MT
1815 matrix_.resize( n, n,
true );
1832 template<
typename MT
1834 inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t nonzeros )
1836 matrix_.reserve( nonzeros );
1856 template<
typename MT
1858 inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t i,
size_t nonzeros )
1860 matrix_.reserve( i, nonzeros );
1877 template<
typename MT
1879 inline void SymmetricMatrix<MT,SO,false,true>::trim()
1899 template<
typename MT
1901 inline void SymmetricMatrix<MT,SO,false,true>::trim(
size_t i )
1919 template<
typename MT
1923 matrix_.shrinkToFit();
1936 template<
typename MT
1942 swap( matrix_, m.matrix_ );
1970 template<
typename MT
1976 matrix_.set( j, i, value );
1977 return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
1998 template<
typename MT
2001 SymmetricMatrix<MT,SO,false,true>::insert(
size_t i,
size_t j,
const ElementType& value )
2004 matrix_.insert( j, i, value );
2005 return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
2066 template<
typename MT
2068 inline void SymmetricMatrix<MT,SO,false,true>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
2070 matrix_.append( i, j, value, check );
2071 if( i != j && ( !check || !isDefault<strict>( value ) ) )
2072 matrix_.insert( j, i, value );
2092 template<
typename MT
2094 inline void SymmetricMatrix<MT,SO,false,true>::finalize(
size_t i )
2120 template<
typename MT
2122 inline void SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
size_t j )
2124 matrix_.erase( i, j );
2126 matrix_.erase( j, i );
2144 template<
typename MT
2147 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator pos )
2149 const Iterator_<MT> base( pos.base() );
2151 if( base == matrix_.end( i ) )
2154 const size_t j( base->index() );
2158 return Iterator( matrix_.erase( i, base ), matrix_, i );
2163 matrix_.erase( j, matrix_.find( i, j ) );
2164 return Iterator( matrix_.erase( i, base ), matrix_, i );
2168 matrix_.erase( j, matrix_.find( j, i ) );
2169 return Iterator( matrix_.erase( i, base ), matrix_, i );
2190 template<
typename MT
2193 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator first,
Iterator last )
2195 for( Iterator_<MT> it=first.base(); it!=last.base(); ++it )
2197 const size_t j( it->index() );
2204 matrix_.erase( i, j );
2208 matrix_.erase( j, i );
2212 return Iterator( matrix_.erase( i, first.base(), last.base() ), matrix_, i );
2240 template<
typename MT
2242 template<
typename Pred >
2243 inline void SymmetricMatrix<MT,SO,false,true>::erase( Pred predicate )
2245 matrix_.erase( predicate );
2281 template<
typename MT
2283 template<
typename Pred >
2285 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator first,
Iterator last, Pred predicate )
2287 for(
Iterator it=first; it!=last; ++it ) {
2288 const size_t j( it->index() );
2289 if( i != j && predicate( it->value() ) ) {
2291 matrix_.erase( i, j );
2293 matrix_.erase( j, i );
2297 matrix_.erase( i, first.base(), last.base(), predicate );
2329 template<
typename MT
2332 SymmetricMatrix<MT,SO,false,true>::find(
size_t i,
size_t j )
2334 return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
2356 template<
typename MT
2359 SymmetricMatrix<MT,SO,false,true>::find(
size_t i,
size_t j )
const 2361 return matrix_.find( i, j );
2383 template<
typename MT
2386 SymmetricMatrix<MT,SO,false,true>::lowerBound(
size_t i,
size_t j )
2388 return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2410 template<
typename MT
2413 SymmetricMatrix<MT,SO,false,true>::lowerBound(
size_t i,
size_t j )
const 2415 return matrix_.lowerBound( i, j );
2437 template<
typename MT
2440 SymmetricMatrix<MT,SO,false,true>::upperBound(
size_t i,
size_t j )
2442 return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2464 template<
typename MT
2467 SymmetricMatrix<MT,SO,false,true>::upperBound(
size_t i,
size_t j )
const 2469 return matrix_.upperBound( i, j );
2489 template<
typename MT
2505 template<
typename MT
2509 if( !IsBuiltin<ElementType>::value )
2536 template<
typename MT
2538 template<
typename Other >
2539 inline SymmetricMatrix<MT,SO,false,true>&
2540 SymmetricMatrix<MT,SO,false,true>::scale(
const Other& scalar )
2542 matrix_.scale( scalar );
2567 template<
typename MT
2598 template<
typename MT
2600 template<
typename Other >
2601 inline bool SymmetricMatrix<MT,SO,false,true>::canAlias(
const Other* alias )
const noexcept
2603 return matrix_.canAlias( alias );
2620 template<
typename MT
2622 template<
typename Other >
2623 inline bool SymmetricMatrix<MT,SO,false,true>::isAliased(
const Other* alias )
const noexcept
2625 return matrix_.isAliased( alias );
2642 template<
typename MT
2644 inline bool SymmetricMatrix<MT,SO,false,true>::canSMPAssign() const noexcept
2646 return matrix_.canSMPAssign();
#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
Header file for auxiliary alias declarations.
Constraint on the data type.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3077
#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 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:522
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
Constraint on the data type.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3076
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:364
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3074
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
BLAZE_ALWAYS_INLINE void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:775
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5829
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3078
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:827
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3083
#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:560
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:733
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3084
Header file for the extended initializer_list functionality.
Constraint on the data type.
Header file for the NumericProxy class.
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:474
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:408
Header file for the implementation of the base template of the SymmetricMatrix.
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:670
Header file for the implementation of a matrix representation of an initializer list.
Header file for the DisableIf class template.
Header file for the IsSymmetric type trait.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3082
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the SymmetricElement class.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5908
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5891
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
#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
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3079
#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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
Header file for the isZero shim.
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
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:506
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:714
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:430
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:8893
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 all forward declarations for expression class templates.
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
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
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:1357
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
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:272
Header file for the SymmetricValue class.
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE void conjugate(T &a) noexcept(IsNumeric< T >::value)
In-place conjugation of the given value/object.
Definition: Conjugate.h:120
bool isSymmetric(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is symmetric.
Definition: DenseMatrix.h:841
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:490
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
EnableIf_< IsNumeric< ST >, MT &> operator/=(DenseMatrix< MT, SO > &mat, ST scalar)
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:655
#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.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3081
#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
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
#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:1375
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
EnableIf_< IsNumeric< ST >, MT &> operator*=(DenseMatrix< MT, SO > &mat, ST scalar)
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:593
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:908
Header file for the Size type trait.
#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
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:801