35#ifndef _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SPARSESCALAR_H_
36#define _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SPARSESCALAR_H_
105class SymmetricMatrix<MT,SO,false,true>
106 :
public SparseMatrix< SymmetricMatrix<MT,SO,false,true>, SO >
110 using OT = OppositeType_t<MT>;
111 using TT = TransposeType_t<MT>;
112 using ET = ElementType_t<MT>;
117 using This = SymmetricMatrix<MT,SO,false,true>;
118 using BaseType = SparseMatrix<This,SO>;
119 using ResultType = This;
120 using OppositeType = SymmetricMatrix<OT,!SO,false,true>;
121 using TransposeType = SymmetricMatrix<TT,!SO,false,true>;
122 using ElementType = ET;
123 using TagType = TagType_t<MT>;
124 using ReturnType = ReturnType_t<MT>;
125 using CompositeType =
const This&;
126 using Reference = ScalarProxy<MT>;
127 using ConstReference = ConstReference_t<MT>;
128 using ConstIterator = ConstIterator_t<MT>;
134 template<
typename NewType >
137 using Other = SymmetricMatrix< typename MT::template Rebind<NewType>::Other >;
144 template<
size_t NewM
148 using Other = SymmetricMatrix< typename MT::template Resize<NewM,NewN>::Other >;
159 using IteratorType = Iterator_t<MT>;
161 using IteratorCategory = std::forward_iterator_tag;
162 using ValueType = SymmetricElement<MT>;
163 using PointerType = ValueType;
164 using ReferenceType = ValueType;
168 using iterator_category = IteratorCategory;
169 using value_type = ValueType;
170 using pointer = PointerType;
171 using reference = ReferenceType;
172 using difference_type = DifferenceType;
192 inline Iterator( IteratorType pos, MT& matrix,
size_t index )
204 inline Iterator& operator++() {
215 inline const Iterator operator++(
int ) {
216 const Iterator tmp( *
this );
228 return ReferenceType( pos_, matrix_, index_ );
237 inline PointerType operator->()
const {
238 return PointerType( pos_, matrix_, index_ );
247 inline operator ConstIterator()
const {
258 inline bool operator==(
const Iterator& rhs )
const {
259 return pos_ == rhs.pos_;
269 inline bool operator!=(
const Iterator& rhs )
const {
270 return !( *
this == rhs );
280 inline DifferenceType
operator-(
const Iterator& rhs )
const {
281 return pos_ - rhs.pos_;
290 inline IteratorType base()
const {
306 static constexpr bool smpAssignable =
false;
312 inline SymmetricMatrix();
313 explicit inline SymmetricMatrix(
size_t n );
314 inline SymmetricMatrix(
size_t n,
size_t nonzeros );
315 inline SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
318 inline SymmetricMatrix(
const SymmetricMatrix& m );
319 inline SymmetricMatrix( SymmetricMatrix&& m )
noexcept;
321 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,SO>& m );
322 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,!SO>& m );
329 ~SymmetricMatrix() =
default;
336 inline Reference operator()(
size_t i,
size_t j );
337 inline ConstReference operator()(
size_t i,
size_t j )
const;
338 inline Reference at(
size_t i,
size_t j );
339 inline ConstReference at(
size_t i,
size_t j )
const;
340 inline Iterator
begin (
size_t i );
341 inline ConstIterator
begin (
size_t i )
const;
342 inline ConstIterator
cbegin(
size_t i )
const;
343 inline Iterator
end (
size_t i );
344 inline ConstIterator
end (
size_t i )
const;
345 inline ConstIterator
cend (
size_t i )
const;
354 inline SymmetricMatrix& operator=(
const SymmetricMatrix& rhs );
355 inline SymmetricMatrix& operator=( SymmetricMatrix&& rhs )
noexcept;
357 template<
typename MT2 >
358 inline auto operator=(
const Matrix<MT2,SO>& rhs )
359 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
361 template<
typename MT2 >
362 inline auto operator=(
const Matrix<MT2,SO>& rhs )
363 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
365 template<
typename MT2 >
366 inline auto operator=(
const Matrix<MT2,!SO>& rhs ) -> SymmetricMatrix&;
368 template<
typename MT2 >
369 inline auto operator+=(
const Matrix<MT2,SO>& rhs )
370 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
372 template<
typename MT2 >
373 inline auto operator+=(
const Matrix<MT2,SO>& rhs )
374 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
376 template<
typename MT2 >
377 inline auto operator+=(
const Matrix<MT2,!SO>& rhs ) -> SymmetricMatrix&;
379 template<
typename MT2 >
380 inline auto operator-=(
const Matrix<MT2,SO>& rhs )
381 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
383 template<
typename MT2 >
384 inline auto operator-=(
const Matrix<MT2,SO>& rhs )
385 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
387 template<
typename MT2 >
388 inline auto operator-=(
const Matrix<MT2,!SO>& rhs ) -> SymmetricMatrix&;
390 template<
typename MT2 >
391 inline auto operator%=(
const Matrix<MT2,SO>& rhs )
392 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
394 template<
typename MT2 >
395 inline auto operator%=(
const Matrix<MT2,SO>& rhs )
396 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
398 template<
typename MT2 >
399 inline auto operator%=(
const Matrix<MT2,!SO>& rhs ) -> SymmetricMatrix&;
401 template<
typename ST >
402 inline auto operator*=( ST rhs ) -> EnableIf_t< IsScalar_v<ST>, SymmetricMatrix& >;
404 template<
typename ST >
405 inline auto operator/=( ST rhs ) -> EnableIf_t< IsScalar_v<ST>, SymmetricMatrix& >;
412 inline size_t rows() const noexcept;
413 inline
size_t columns() const noexcept;
414 inline
size_t capacity() const noexcept;
415 inline
size_t capacity(
size_t i ) const noexcept;
417 inline
size_t nonZeros(
size_t i ) const;
419 inline
void reset(
size_t i );
421 inline
void resize (
size_t n,
bool preserve=true );
422 inline
void reserve(
size_t nonzeros );
423 inline
void reserve(
size_t i,
size_t nonzeros );
425 inline
void trim(
size_t i );
427 inline
void swap( SymmetricMatrix& m ) noexcept;
434 inline Iterator
set (
size_t i,
size_t j, const ElementType& value );
435 inline Iterator insert (
size_t i,
size_t j, const ElementType& value );
436 inline
void append (
size_t i,
size_t j, const ElementType& value,
bool check=false );
437 inline
void finalize(
size_t i );
444 inline
void erase(
size_t i,
size_t j );
445 inline Iterator erase(
size_t i, Iterator pos );
446 inline Iterator erase(
size_t i, Iterator first, Iterator last );
448 template< typename Pred >
449 inline
void erase( Pred predicate );
451 template< typename Pred >
452 inline
void erase(
size_t i, Iterator first, Iterator last, Pred predicate );
459 inline Iterator
find (
size_t i,
size_t j );
460 inline ConstIterator
find (
size_t i,
size_t j ) const;
461 inline Iterator
lowerBound(
size_t i,
size_t j );
462 inline ConstIterator
lowerBound(
size_t i,
size_t j ) const;
463 inline Iterator
upperBound(
size_t i,
size_t j );
464 inline ConstIterator
upperBound(
size_t i,
size_t j ) const;
474 template< typename Other > inline SymmetricMatrix& scale( const Other& scalar );
481 inline
bool isIntact() const noexcept;
488 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
489 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
491 inline
bool canSMPAssign() const noexcept;
540inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix()
559inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n )
581inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
size_t nonzeros )
582 : matrix_( n, n, nonzeros )
605inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
606 : matrix_( n, n, nonzeros )
663inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const SymmetricMatrix& m )
664 : matrix_( m.matrix_ )
681inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix( SymmetricMatrix&& m ) noexcept
682 : matrix_( std::move( m.matrix_ ) )
703template<
typename MT2 >
704inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,SO>& m )
707 if( !IsSymmetric_v<MT2> && !
isSymmetric( matrix_ ) ) {
730template<
typename MT2 >
731inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,!SO>& m )
732 : matrix_(
trans( *m ) )
734 if( !IsSymmetric_v<MT2> && !
isSymmetric( matrix_ ) ) {
770inline typename SymmetricMatrix<MT,SO,false,true>::Reference
771 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
776 return Reference( matrix_, i, j );
799inline typename SymmetricMatrix<MT,SO,false,true>::ConstReference
800 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
const
829inline typename SymmetricMatrix<MT,SO,false,true>::Reference
830 SymmetricMatrix<MT,SO,false,true>::at(
size_t i,
size_t j )
862inline typename SymmetricMatrix<MT,SO,false,true>::ConstReference
863 SymmetricMatrix<MT,SO,false,true>::at(
size_t i,
size_t j )
const
891inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
894 return Iterator( matrix_.begin(i), matrix_, i );
914inline typename SymmetricMatrix<MT,SO,false,true>::ConstIterator
917 return matrix_.begin(i);
937inline typename SymmetricMatrix<MT,SO,false,true>::ConstIterator
940 return matrix_.cbegin(i);
960inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
963 return Iterator( matrix_.end(i), matrix_, i );
983inline typename SymmetricMatrix<MT,SO,false,true>::ConstIterator
986 return matrix_.end(i);
1004template<
typename MT
1006inline typename SymmetricMatrix<MT,SO,false,true>::ConstIterator
1009 return matrix_.cend(i);
1048template<
typename MT
1050inline SymmetricMatrix<MT,SO,false,true>&
1053 const InitializerMatrix<ElementType> tmp( list, list.size() );
1080template<
typename MT
1082inline SymmetricMatrix<MT,SO,false,true>&
1083 SymmetricMatrix<MT,SO,false,true>::operator=(
const SymmetricMatrix& rhs )
1085 matrix_ = rhs.matrix_;
1103template<
typename MT
1105inline SymmetricMatrix<MT,SO,false,true>&
1106 SymmetricMatrix<MT,SO,false,true>::operator=( SymmetricMatrix&& rhs )
noexcept
1108 matrix_ = std::move( rhs.matrix_ );
1132template<
typename MT
1134template<
typename MT2 >
1135inline auto SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1136 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1138 if( !IsSymmetric_v<MT2> && !
isSymmetric( *rhs ) ) {
1166template<
typename MT
1168template<
typename MT2 >
1169inline auto SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1170 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1172 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1176 if( IsSymmetric_v<MT2> ) {
1186 matrix_ = std::move( tmp );
1211template<
typename MT
1213template<
typename MT2 >
1214inline auto SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,!SO>& rhs )
1217 return this->operator=(
trans( *rhs ) );
1236template<
typename MT
1238template<
typename MT2 >
1240 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1242 if( !IsSymmetric_v<MT2> && !
isSymmetric( *rhs ) ) {
1270template<
typename MT
1272template<
typename MT2 >
1274 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1276 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1280 if( IsSymmetric_v<MT2> ) {
1284 const ResultType_t<MT2> tmp( *rhs );
1316template<
typename MT
1318template<
typename MT2 >
1341template<
typename MT
1343template<
typename MT2 >
1345 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1347 if( !IsSymmetric_v<MT2> && !
isSymmetric( *rhs ) ) {
1375template<
typename MT
1377template<
typename MT2 >
1379 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1381 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1385 if( IsSymmetric_v<MT2> ) {
1389 const ResultType_t<MT2> tmp( *rhs );
1421template<
typename MT
1423template<
typename MT2 >
1447template<
typename MT
1449template<
typename MT2 >
1450inline auto SymmetricMatrix<MT,SO,false,true>::operator%=(
const Matrix<MT2,SO>& rhs )
1451 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1453 if( !IsSymmetric_v<MT2> && !
isSymmetric( *rhs ) ) {
1482template<
typename MT
1484template<
typename MT2 >
1485inline auto SymmetricMatrix<MT,SO,false,true>::operator%=(
const Matrix<MT2,SO>& rhs )
1486 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1488 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1492 if( IsSymmetric_v<MT2> ) {
1496 const ResultType_t<MT2> tmp( *rhs );
1528template<
typename MT
1530template<
typename MT2 >
1531inline auto SymmetricMatrix<MT,SO,false,true>::operator%=(
const Matrix<MT2,!SO>& rhs )
1534 return this->operator%=(
trans( *rhs ) );
1548template<
typename MT
1550template<
typename ST >
1552 -> EnableIf_t< IsScalar_v<ST>, SymmetricMatrix& >
1568template<
typename MT
1570template<
typename ST >
1572 -> EnableIf_t< IsScalar_v<ST>, SymmetricMatrix& >
1597template<
typename MT
1601 return matrix_.rows();
1613template<
typename MT
1617 return matrix_.columns();
1629template<
typename MT
1633 return matrix_.capacity();
1650template<
typename MT
1654 return matrix_.capacity(i);
1666template<
typename MT
1670 return matrix_.nonZeros();
1688template<
typename MT
1692 return matrix_.nonZeros(i);
1704template<
typename MT
1750template<
typename MT
1756 for(
auto it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1758 const size_t j( it->index() );
1764 const Iterator_t<MT> pos( matrix_.find( i, j ) );
1766 erase( matrix_, j, pos );
1769 const Iterator_t<MT> pos( matrix_.find( j, i ) );
1771 erase( matrix_, j, pos );
1789template<
typename MT
1817template<
typename MT
1827 matrix_.resize( n, n,
true );
1844template<
typename MT
1846inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t nonzeros )
1848 matrix_.reserve( nonzeros );
1868template<
typename MT
1870inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t i,
size_t nonzeros )
1872 matrix_.reserve( i, nonzeros );
1889template<
typename MT
1891inline void SymmetricMatrix<MT,SO,false,true>::trim()
1911template<
typename MT
1913inline void SymmetricMatrix<MT,SO,false,true>::trim(
size_t i )
1931template<
typename MT
1935 matrix_.shrinkToFit();
1948template<
typename MT
1954 swap( matrix_, m.matrix_ );
1982template<
typename MT
1984inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
1988 matrix_.set( j, i, value );
1989 return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
2010template<
typename MT
2012inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
2013 SymmetricMatrix<MT,SO,false,true>::insert(
size_t i,
size_t j,
const ElementType& value )
2016 matrix_.insert( j, i, value );
2017 return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
2078template<
typename MT
2080inline void SymmetricMatrix<MT,SO,false,true>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
2082 matrix_.append( i, j, value, check );
2083 if( i != j && ( !check || !isDefault<strict>( value ) ) )
2084 matrix_.insert( j, i, value );
2104template<
typename MT
2106inline void SymmetricMatrix<MT,SO,false,true>::finalize(
size_t i )
2132template<
typename MT
2134inline void SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
size_t j )
2138 erase( matrix_, i, j );
2140 erase( matrix_, j, i );
2158template<
typename MT
2160inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
2161 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i, Iterator pos )
2165 const Iterator_t<MT> base( pos.base() );
2167 if( base == matrix_.end( i ) )
2170 const size_t j( base->index() );
2174 return Iterator( erase( matrix_, i, base ), matrix_, i );
2179 erase( matrix_, j, matrix_.find( i, j ) );
2180 return Iterator( erase( matrix_, i, base ), matrix_, i );
2184 erase( matrix_, j, matrix_.find( j, i ) );
2185 return Iterator( erase(matrix_, i, base ), matrix_, i );
2206template<
typename MT
2208inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
2209 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i, Iterator first, Iterator last )
2213 for(
auto it=first.base(); it!=last.base(); ++it )
2215 const size_t j( it->index() );
2222 erase( matrix_, i, j );
2226 erase( matrix_, j, i );
2230 return Iterator( erase( matrix_, i, first.base(), last.base() ), matrix_, i );
2258template<
typename MT
2260template<
typename Pred >
2261inline void SymmetricMatrix<MT,SO,false,true>::erase( Pred predicate )
2265 erase( matrix_, predicate );
2301template<
typename MT
2303template<
typename Pred >
2305 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i, Iterator first, Iterator last, Pred predicate )
2309 for(
auto it=first; it!=last; ++it ) {
2310 const size_t j( it->index() );
2311 if( i != j && predicate( it->value() ) ) {
2313 erase( matrix_, i, j );
2315 erase( matrix_, j, i );
2319 erase( matrix_, i, first.base(), last.base(), predicate );
2351template<
typename MT
2353inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
2356 return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
2378template<
typename MT
2380inline typename SymmetricMatrix<MT,SO,false,true>::ConstIterator
2383 return matrix_.find( i, j );
2405template<
typename MT
2407inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
2410 return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2432template<
typename MT
2434inline typename SymmetricMatrix<MT,SO,false,true>::ConstIterator
2437 return matrix_.lowerBound( i, j );
2459template<
typename MT
2461inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
2464 return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2486template<
typename MT
2488inline typename SymmetricMatrix<MT,SO,false,true>::ConstIterator
2491 return matrix_.upperBound( i, j );
2511template<
typename MT
2527template<
typename MT
2531 if( !IsBuiltin_v<ElementType> )
2558template<
typename MT
2560template<
typename Other >
2561inline SymmetricMatrix<MT,SO,false,true>&
2562 SymmetricMatrix<MT,SO,false,true>::scale(
const Other& scalar )
2564 matrix_.scale( scalar );
2589template<
typename MT
2620template<
typename MT
2622template<
typename Other >
2623inline bool SymmetricMatrix<MT,SO,false,true>::canAlias(
const Other* alias )
const noexcept
2625 return matrix_.canAlias( alias );
2642template<
typename MT
2644template<
typename Other >
2645inline bool SymmetricMatrix<MT,SO,false,true>::isAliased(
const Other* alias )
const noexcept
2647 return matrix_.isAliased( alias );
2664template<
typename MT
2666inline bool SymmetricMatrix<MT,SO,false,true>::canSMPAssign() const noexcept
2668 return matrix_.canSMPAssign();
Header file for auxiliary alias declarations.
Header file for run time assertion macros.
Header file for the conjugate shim.
Constraint on the data type.
constexpr const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:751
Header file for the EnableIf class template.
Constraint on the data type.
Header file for the IsBuiltin type trait.
Header file for the IsComputation type trait class.
Header file for the isDefault shim.
Header file for the IsScalar type trait.
Header file for the IsSquare type trait.
Header file for the IsSymmetric type trait.
Constraint on the data type.
Header file for the MAYBE_UNUSED function template.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the ScalarProxy class.
Constraint on the data type.
Header file for the SymmetricElement class.
Header file for the SymmetricValue class.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of the base template of the SymmetricMatrix.
Initializer list type of the Blaze library.
Pointer difference type of the Blaze library.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
Header file for the SparseMatrix base class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.
Definition: Volatile.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.
Definition: Pointer.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.
Definition: Const.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.
Definition: Reference.h:79
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( ).
Definition: DenseMatrix.h:574
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:386
auto operator*=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:510
bool isSymmetric(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is symmetric.
Definition: DenseMatrix.h:1456
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:9640
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:448
bool isZero(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a zero matrix.
Definition: DenseMatrix.h:1819
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:207
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:225
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VIEW_TYPE(T)
Constraint on the data type.
Definition: View.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Hermitian.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Upper.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: SparseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(T)
Constraint on the data type.
Definition: Resizable.h:61
#define BLAZE_CONSTRAINT_MUST_BE_SCALAR_TYPE(T)
Constraint on the data type.
Definition: Scalar.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSFORMATION_TYPE(T)
Constraint on the data type.
Definition: Transformation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.
Definition: StorageOrder.h:63
BLAZE_ALWAYS_INLINE void conjugate(T &a) noexcept(IsNumeric_v< T >)
In-place conjugation of the given value/object.
Definition: Conjugate.h:118
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.
Definition: Size.h:176
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:253
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
constexpr void clear(Matrix< MT, SO > &matrix)
Clearing the given matrix.
Definition: Matrix.h:960
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:628
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:644
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:730
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:562
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:692
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition: Matrix.h:806
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:660
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:1108
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:584
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:1221
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:518
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:1195
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:1169
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:1383
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition: Assert.h:117
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:75
MT::Iterator upperBound(SparseMatrix< MT, SO > &sm, size_t i, size_t j)
Returns an iterator to the first index greater than the given index.
Definition: SparseMatrix.h:244
MT::Iterator lowerBound(SparseMatrix< MT, SO > &sm, size_t i, size_t j)
Returns an iterator to the first index not less than the given index.
Definition: SparseMatrix.h:194
MT::Iterator find(SparseMatrix< MT, SO > &sm, size_t i, size_t j)
Searches for a specific matrix element.
Definition: SparseMatrix.h:144
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition: StaticAssert.h:112
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition: Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
Header file for the exception macros of the math module.
Header file for the extended initializer_list functionality.
Constraints on the storage order of matrix types.
Header file for all forward declarations for expression class templates.
Header file for the Size type trait.
Header file for the isZero shim.
Header file for utility functions for sparse matrices.
Header file for basic type definitions.