35 #ifndef _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SPARSENUMERIC_H_ 36 #define _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SPARSENUMERIC_H_ 105 template<
typename MT
107 class SymmetricMatrix<MT,SO,false,true>
108 :
public SparseMatrix< SymmetricMatrix<MT,SO,false,true>, SO >
112 using OT = OppositeType_t<MT>;
113 using TT = TransposeType_t<MT>;
114 using ET = ElementType_t<MT>;
119 using This = SymmetricMatrix<MT,SO,false,true>;
120 using BaseType = SparseMatrix<This,SO>;
121 using ResultType = This;
122 using OppositeType = SymmetricMatrix<OT,!SO,false,true>;
123 using TransposeType = SymmetricMatrix<TT,!SO,false,true>;
124 using ElementType = ET;
125 using ReturnType = ReturnType_t<MT>;
126 using CompositeType =
const This&;
127 using Reference = NumericProxy<MT>;
128 using ConstReference = ConstReference_t<MT>;
129 using ConstIterator = ConstIterator_t<MT>;
135 template<
typename NewType >
138 using Other = SymmetricMatrix< typename MT::template Rebind<NewType>::Other >;
145 template<
size_t NewM
149 using Other = SymmetricMatrix< typename MT::template Resize<NewM,NewN>::Other >;
160 using IteratorType = Iterator_t<MT>;
162 using IteratorCategory = std::forward_iterator_tag;
163 using ValueType = SymmetricElement<MT>;
164 using PointerType = ValueType;
165 using ReferenceType = ValueType;
166 using DifferenceType = ptrdiff_t;
169 using iterator_category = IteratorCategory;
170 using value_type = ValueType;
171 using pointer = PointerType;
172 using reference = ReferenceType;
173 using difference_type = DifferenceType;
193 inline Iterator( IteratorType pos, MT& matrix,
size_t index )
205 inline Iterator& operator++() {
216 inline const Iterator operator++(
int ) {
217 const Iterator tmp( *
this );
229 return ReferenceType( pos_, matrix_, index_ );
238 inline PointerType operator->()
const {
239 return PointerType( pos_, matrix_, index_ );
248 inline operator ConstIterator()
const {
259 inline bool operator==(
const Iterator& rhs )
const {
260 return pos_ == rhs.pos_;
270 inline bool operator!=(
const Iterator& rhs )
const {
271 return !( *
this == rhs );
281 inline DifferenceType
operator-(
const Iterator& rhs )
const {
282 return pos_ - rhs.pos_;
291 inline IteratorType base()
const {
307 static constexpr
bool smpAssignable =
false;
313 explicit inline SymmetricMatrix();
314 explicit inline SymmetricMatrix(
size_t n );
315 explicit inline SymmetricMatrix(
size_t n,
size_t nonzeros );
316 explicit inline SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
317 inline SymmetricMatrix( initializer_list< initializer_list<ElementType> > list );
319 inline SymmetricMatrix(
const SymmetricMatrix& m );
320 inline SymmetricMatrix( SymmetricMatrix&& m ) noexcept;
322 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,SO>& m );
323 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,!SO>& m );
330 ~SymmetricMatrix() =
default;
337 inline Reference operator()(
size_t i,
size_t j );
338 inline ConstReference operator()(
size_t i,
size_t j )
const;
339 inline Reference at(
size_t i,
size_t j );
340 inline ConstReference at(
size_t i,
size_t j )
const;
341 inline Iterator
begin (
size_t i );
342 inline ConstIterator
begin (
size_t i )
const;
343 inline ConstIterator
cbegin(
size_t i )
const;
344 inline Iterator
end (
size_t i );
345 inline ConstIterator
end (
size_t i )
const;
346 inline ConstIterator
cend (
size_t i )
const;
353 inline SymmetricMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
355 inline SymmetricMatrix& operator=(
const SymmetricMatrix& rhs );
356 inline SymmetricMatrix& operator=( SymmetricMatrix&& rhs ) noexcept;
358 template<
typename MT2 >
359 inline auto operator=(
const Matrix<MT2,SO>& rhs )
360 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
362 template<
typename MT2 >
363 inline auto operator=(
const Matrix<MT2,SO>& rhs )
364 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
366 template<
typename MT2 >
367 inline auto operator=(
const Matrix<MT2,!SO>& rhs ) -> SymmetricMatrix&;
369 template<
typename MT2 >
370 inline auto operator+=(
const Matrix<MT2,SO>& rhs )
371 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
373 template<
typename MT2 >
374 inline auto operator+=(
const Matrix<MT2,SO>& rhs )
375 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
377 template<
typename MT2 >
378 inline auto operator+=(
const Matrix<MT2,!SO>& rhs )
381 template<
typename MT2 >
382 inline auto operator-=(
const Matrix<MT2,SO>& rhs )
383 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
385 template<
typename MT2 >
386 inline auto operator-=(
const Matrix<MT2,SO>& rhs )
387 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
389 template<
typename MT2 >
390 inline auto operator-=(
const Matrix<MT2,!SO>& rhs )
393 template<
typename MT2 >
394 inline auto operator%=(
const Matrix<MT2,SO>& rhs )
395 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
397 template<
typename MT2 >
398 inline auto operator%=(
const Matrix<MT2,SO>& rhs )
399 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
401 template<
typename MT2 >
402 inline auto operator%=(
const Matrix<MT2,!SO>& rhs ) -> SymmetricMatrix&;
404 template<
typename ST >
405 inline auto operator*=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, SymmetricMatrix& >;
407 template<
typename ST >
408 inline auto operator/=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, SymmetricMatrix& >;
415 inline size_t rows() const noexcept;
416 inline
size_t columns() const noexcept;
417 inline
size_t capacity() const noexcept;
418 inline
size_t capacity(
size_t i ) const noexcept;
420 inline
size_t nonZeros(
size_t i ) const;
422 inline
void reset(
size_t i );
424 inline
void resize (
size_t n,
bool preserve=true );
425 inline
void reserve(
size_t nonzeros );
426 inline
void reserve(
size_t i,
size_t nonzeros );
428 inline
void trim(
size_t i );
430 inline
void swap( SymmetricMatrix& m ) noexcept;
437 inline Iterator
set (
size_t i,
size_t j, const ElementType& value );
438 inline Iterator insert (
size_t i,
size_t j, const ElementType& value );
439 inline
void append (
size_t i,
size_t j, const ElementType& value,
bool check=false );
440 inline
void finalize(
size_t i );
447 inline
void erase(
size_t i,
size_t j );
448 inline Iterator erase(
size_t i, Iterator pos );
449 inline Iterator erase(
size_t i, Iterator first, Iterator last );
451 template< typename Pred >
452 inline
void erase( Pred predicate );
454 template< typename Pred >
455 inline
void erase(
size_t i, Iterator first, Iterator last, Pred predicate );
462 inline Iterator find (
size_t i,
size_t j );
463 inline ConstIterator find (
size_t i,
size_t j ) const;
464 inline Iterator lowerBound(
size_t i,
size_t j );
465 inline ConstIterator lowerBound(
size_t i,
size_t j ) const;
466 inline Iterator upperBound(
size_t i,
size_t j );
467 inline ConstIterator upperBound(
size_t i,
size_t j ) const;
477 template< typename Other > inline SymmetricMatrix& scale( const Other& scalar );
484 inline
bool isIntact() const noexcept;
491 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
492 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
494 inline
bool canSMPAssign() const noexcept;
507 template<
bool RF, typename MT2,
bool SO2,
bool DF2,
bool NF2 >
508 friend
bool isDefault( const SymmetricMatrix<MT2,SO2,DF2,NF2>& m );
546 template< typename MT
548 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix()
565 template<
typename MT
567 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n )
587 template<
typename MT
589 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
size_t nonzeros )
590 : matrix_( n, n, nonzeros )
611 template<
typename MT
613 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
614 : matrix_( n, n, nonzeros )
648 template<
typename MT
650 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix( initializer_list< initializer_list<ElementType> > list )
669 template<
typename MT
671 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const SymmetricMatrix& m )
672 : matrix_( m.matrix_ )
687 template<
typename MT
689 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix( SymmetricMatrix&& m ) noexcept
690 : matrix_( std::move( m.matrix_ ) )
709 template<
typename MT
711 template<
typename MT2 >
712 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,SO>& m )
715 if( !IsSymmetric_v<MT2> && !
isSymmetric( matrix_ ) ) {
736 template<
typename MT
738 template<
typename MT2 >
739 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,!SO>& m )
740 : matrix_(
trans( ~m ) )
742 if( !IsSymmetric_v<MT2> && !
isSymmetric( matrix_ ) ) {
776 template<
typename MT
778 inline typename SymmetricMatrix<MT,SO,false,true>::Reference
779 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
784 return Reference( matrix_, i, j );
805 template<
typename MT
807 inline typename SymmetricMatrix<MT,SO,false,true>::ConstReference
808 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
const 835 template<
typename MT
837 inline typename SymmetricMatrix<MT,SO,false,true>::Reference
838 SymmetricMatrix<MT,SO,false,true>::at(
size_t i,
size_t j )
868 template<
typename MT
870 inline typename SymmetricMatrix<MT,SO,false,true>::ConstReference
871 SymmetricMatrix<MT,SO,false,true>::at(
size_t i,
size_t j )
const 897 template<
typename MT
899 inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
902 return Iterator( matrix_.begin(i), matrix_, i );
920 template<
typename MT
922 inline typename SymmetricMatrix<MT,SO,false,true>::ConstIterator
925 return matrix_.begin(i);
943 template<
typename MT
945 inline typename SymmetricMatrix<MT,SO,false,true>::ConstIterator
948 return matrix_.cbegin(i);
966 template<
typename MT
968 inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
971 return Iterator( matrix_.end(i), matrix_, i );
989 template<
typename MT
991 inline typename SymmetricMatrix<MT,SO,false,true>::ConstIterator
994 return matrix_.end(i);
1012 template<
typename MT
1014 inline typename SymmetricMatrix<MT,SO,false,true>::ConstIterator
1017 return matrix_.cend(i);
1056 template<
typename MT
1058 inline SymmetricMatrix<MT,SO,false,true>&
1059 SymmetricMatrix<MT,SO,false,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1061 const InitializerMatrix<ElementType> tmp( list, list.size() );
1088 template<
typename MT
1090 inline SymmetricMatrix<MT,SO,false,true>&
1091 SymmetricMatrix<MT,SO,false,true>::operator=(
const SymmetricMatrix& rhs )
1093 matrix_ = rhs.matrix_;
1111 template<
typename MT
1113 inline SymmetricMatrix<MT,SO,false,true>&
1114 SymmetricMatrix<MT,SO,false,true>::operator=( SymmetricMatrix&& rhs ) noexcept
1116 matrix_ = std::move( rhs.matrix_ );
1140 template<
typename MT
1142 template<
typename MT2 >
1143 inline auto SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1144 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1146 if( !IsSymmetric_v<MT2> && !
isSymmetric( ~rhs ) ) {
1174 template<
typename MT
1176 template<
typename MT2 >
1177 inline auto SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1178 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1180 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1184 if( IsSymmetric_v<MT2> ) {
1194 matrix_ = std::move( tmp );
1219 template<
typename MT
1221 template<
typename MT2 >
1222 inline auto SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,!SO>& rhs )
1225 return this->operator=(
trans( ~rhs ) );
1244 template<
typename MT
1246 template<
typename MT2 >
1248 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1250 if( !IsSymmetric_v<MT2> && !
isSymmetric( ~rhs ) ) {
1278 template<
typename MT
1280 template<
typename MT2 >
1282 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1284 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1288 if( IsSymmetric_v<MT2> ) {
1292 const ResultType_t<MT2> tmp( ~rhs );
1324 template<
typename MT
1326 template<
typename MT2 >
1349 template<
typename MT
1351 template<
typename MT2 >
1353 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1355 if( !IsSymmetric_v<MT2> && !
isSymmetric( ~rhs ) ) {
1383 template<
typename MT
1385 template<
typename MT2 >
1387 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1389 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1393 if( IsSymmetric_v<MT2> ) {
1397 const ResultType_t<MT2> tmp( ~rhs );
1429 template<
typename MT
1431 template<
typename MT2 >
1455 template<
typename MT
1457 template<
typename MT2 >
1458 inline auto SymmetricMatrix<MT,SO,false,true>::operator%=(
const Matrix<MT2,SO>& rhs )
1459 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1461 if( !IsSymmetric_v<MT2> && !
isSymmetric( ~rhs ) ) {
1490 template<
typename MT
1492 template<
typename MT2 >
1493 inline auto SymmetricMatrix<MT,SO,false,true>::operator%=(
const Matrix<MT2,SO>& rhs )
1494 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1496 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1500 if( IsSymmetric_v<MT2> ) {
1504 const ResultType_t<MT2> tmp( ~rhs );
1536 template<
typename MT
1538 template<
typename MT2 >
1539 inline auto SymmetricMatrix<MT,SO,false,true>::operator%=(
const Matrix<MT2,!SO>& rhs )
1542 return this->operator%=(
trans( ~rhs ) );
1556 template<
typename MT
1558 template<
typename ST >
1560 -> EnableIf_t< IsNumeric_v<ST>, SymmetricMatrix& >
1576 template<
typename MT
1578 template<
typename ST >
1580 -> EnableIf_t< IsNumeric_v<ST>, SymmetricMatrix& >
1605 template<
typename MT
1609 return matrix_.rows();
1621 template<
typename MT
1625 return matrix_.columns();
1637 template<
typename MT
1641 return matrix_.capacity();
1658 template<
typename MT
1662 return matrix_.capacity(i);
1674 template<
typename MT
1678 return matrix_.nonZeros();
1696 template<
typename MT
1700 return matrix_.nonZeros(i);
1712 template<
typename MT
1758 template<
typename MT
1764 for(
auto it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1766 const size_t j( it->index() );
1772 const Iterator_t<MT> pos( matrix_.find( i, j ) );
1774 erase( matrix_, j, pos );
1777 const Iterator_t<MT> pos( matrix_.find( j, i ) );
1779 erase( matrix_, j, pos );
1797 template<
typename MT
1824 template<
typename MT
1834 matrix_.resize( n, n,
true );
1851 template<
typename MT
1853 inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t nonzeros )
1855 matrix_.reserve( nonzeros );
1875 template<
typename MT
1877 inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t i,
size_t nonzeros )
1879 matrix_.reserve( i, nonzeros );
1896 template<
typename MT
1898 inline void SymmetricMatrix<MT,SO,false,true>::trim()
1918 template<
typename MT
1920 inline void SymmetricMatrix<MT,SO,false,true>::trim(
size_t i )
1938 template<
typename MT
1942 matrix_.shrinkToFit();
1955 template<
typename MT
1961 swap( matrix_, m.matrix_ );
1989 template<
typename MT
1991 inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
1995 matrix_.set( j, i, value );
1996 return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
2017 template<
typename MT
2019 inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
2020 SymmetricMatrix<MT,SO,false,true>::insert(
size_t i,
size_t j,
const ElementType& value )
2023 matrix_.insert( j, i, value );
2024 return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
2085 template<
typename MT
2087 inline void SymmetricMatrix<MT,SO,false,true>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
2089 matrix_.append( i, j, value, check );
2090 if( i != j && ( !check || !isDefault<strict>( value ) ) )
2091 matrix_.insert( j, i, value );
2111 template<
typename MT
2113 inline void SymmetricMatrix<MT,SO,false,true>::finalize(
size_t i )
2139 template<
typename MT
2141 inline void SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
size_t j )
2145 erase( matrix_, i, j );
2147 erase( matrix_, j, i );
2165 template<
typename MT
2167 inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
2168 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i, Iterator pos )
2172 const Iterator_t<MT> base( pos.base() );
2174 if( base == matrix_.end( i ) )
2177 const size_t j( base->index() );
2181 return Iterator( erase( matrix_, i, base ), matrix_, i );
2186 erase( matrix_, j, matrix_.find( i, j ) );
2187 return Iterator( erase( matrix_, i, base ), matrix_, i );
2191 erase( matrix_, j, matrix_.find( j, i ) );
2192 return Iterator( erase(matrix_, i, base ), matrix_, i );
2213 template<
typename MT
2215 inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
2216 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i, Iterator first, Iterator last )
2220 for(
auto it=first.base(); it!=last.base(); ++it )
2222 const size_t j( it->index() );
2229 erase( matrix_, i, j );
2233 erase( matrix_, j, i );
2237 return Iterator( erase( matrix_, i, first.base(), last.base() ), matrix_, i );
2265 template<
typename MT
2267 template<
typename Pred >
2268 inline void SymmetricMatrix<MT,SO,false,true>::erase( Pred predicate )
2272 erase( matrix_, predicate );
2308 template<
typename MT
2310 template<
typename Pred >
2312 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i, Iterator first, Iterator last, Pred predicate )
2316 for(
auto it=first; it!=last; ++it ) {
2317 const size_t j( it->index() );
2318 if( i != j && predicate( it->value() ) ) {
2320 erase( matrix_, i, j );
2322 erase( matrix_, j, i );
2326 erase( matrix_, i, first.base(), last.base(), predicate );
2358 template<
typename MT
2360 inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
2361 SymmetricMatrix<MT,SO,false,true>::find(
size_t i,
size_t j )
2363 return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
2385 template<
typename MT
2387 inline typename SymmetricMatrix<MT,SO,false,true>::ConstIterator
2388 SymmetricMatrix<MT,SO,false,true>::find(
size_t i,
size_t j )
const 2390 return matrix_.find( i, j );
2412 template<
typename MT
2414 inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
2415 SymmetricMatrix<MT,SO,false,true>::lowerBound(
size_t i,
size_t j )
2417 return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2439 template<
typename MT
2441 inline typename SymmetricMatrix<MT,SO,false,true>::ConstIterator
2442 SymmetricMatrix<MT,SO,false,true>::lowerBound(
size_t i,
size_t j )
const 2444 return matrix_.lowerBound( i, j );
2466 template<
typename MT
2468 inline typename SymmetricMatrix<MT,SO,false,true>::Iterator
2469 SymmetricMatrix<MT,SO,false,true>::upperBound(
size_t i,
size_t j )
2471 return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2493 template<
typename MT
2495 inline typename SymmetricMatrix<MT,SO,false,true>::ConstIterator
2496 SymmetricMatrix<MT,SO,false,true>::upperBound(
size_t i,
size_t j )
const 2498 return matrix_.upperBound( i, j );
2518 template<
typename MT
2534 template<
typename MT
2538 if( !IsBuiltin_v<ElementType> )
2565 template<
typename MT
2567 template<
typename Other >
2568 inline SymmetricMatrix<MT,SO,false,true>&
2569 SymmetricMatrix<MT,SO,false,true>::scale(
const Other& scalar )
2571 matrix_.scale( scalar );
2596 template<
typename MT
2627 template<
typename MT
2629 template<
typename Other >
2630 inline bool SymmetricMatrix<MT,SO,false,true>::canAlias(
const Other* alias )
const noexcept
2632 return matrix_.canAlias( alias );
2649 template<
typename MT
2651 template<
typename Other >
2652 inline bool SymmetricMatrix<MT,SO,false,true>::isAliased(
const Other* alias )
const noexcept
2654 return matrix_.isAliased( alias );
2671 template<
typename MT
2673 inline bool SymmetricMatrix<MT,SO,false,true>::canSMPAssign() const noexcept
2675 return matrix_.canSMPAssign();
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSFORMATION_TYPE(T)
Constraint on the data type.In case the given data type T is a transformation expression (i....
Definition: Transformation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type,...
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
Constraint on the data type.
Header file for auxiliary alias declarations.
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:432
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.The Size_v variable template provides a convenien...
Definition: Size.h:176
Constraint on the data type.
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,...
Definition: Assert.h:117
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
Header file for basic type definitions.
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:750
#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
Header file for the isZero shim.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i....
Definition: Computation.h:81
Constraint on the data type.
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:799
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:851
Header file for the MAYBE_UNUSED function template.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type,...
Definition: Volatile.h:79
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
Header file for the extended initializer_list functionality.
Constraint on the data type.
Header file for the NumericProxy class.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
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:482
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:416
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:677
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.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the SymmetricElement class.
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:9091
#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
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:370
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
Constraint on the data type.
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
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
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
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:438
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
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:615
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( ).
Definition: DenseMatrix.h:558
#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,...
Definition: Symmetric.h:79
BLAZE_ALWAYS_INLINE void conjugate(T &a) noexcept(IsNumeric_v< T >)
In-place conjugation of the given value/object.
Definition: Conjugate.h:120
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
Header file for all forward declarations for expression class templates.
#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,...
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:282
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
Header file for the SymmetricValue class.
Constraint on the data type.
Constraint on the data type.
bool isSymmetric(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is symmetric.
Definition: DenseMatrix.h:1328
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VIEW_TYPE(T)
Constraint on the data type.In case the given data type T is a view type (i.e. a subvector,...
Definition: View.h:81
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
#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.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
auto operator *=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:494
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
#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,...
Definition: Hermitian.h:79
#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
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
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,...
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 clear shim.
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:825