35 #ifndef _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SPARSENUMERIC_H_ 36 #define _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SPARSENUMERIC_H_ 101 template<
typename MT
103 class SymmetricMatrix<MT,SO,false,true>
104 :
public SparseMatrix< SymmetricMatrix<MT,SO,false,true>, SO >
108 using OT = OppositeType_<MT>;
109 using TT = TransposeType_<MT>;
110 using ET = ElementType_<MT>;
115 using This = SymmetricMatrix<MT,SO,false,true>;
116 using BaseType = SparseMatrix<This,SO>;
118 using OppositeType = SymmetricMatrix<OT,!SO,false,true>;
131 template<
typename NewType >
134 using Other = SymmetricMatrix< typename MT::template Rebind<NewType>::Other >;
141 template<
size_t NewM
145 using Other = SymmetricMatrix< typename MT::template Resize<NewM,NewN>::Other >;
156 using IteratorType = Iterator_<MT>;
158 using IteratorCategory = std::forward_iterator_tag;
159 using ValueType = SymmetricElement<MT>;
160 using PointerType = ValueType;
161 using ReferenceType = ValueType;
162 using DifferenceType = ptrdiff_t;
165 using iterator_category = IteratorCategory;
166 using value_type = ValueType;
167 using pointer = PointerType;
168 using reference = ReferenceType;
169 using difference_type = DifferenceType;
189 inline Iterator( IteratorType pos, MT& matrix,
size_t index )
212 inline const Iterator operator++(
int ) {
225 return ReferenceType( pos_, matrix_, index_ );
234 inline PointerType operator->()
const {
235 return PointerType( pos_, matrix_, index_ );
256 return pos_ == rhs.pos_;
267 return !( *
this == rhs );
278 return pos_ - rhs.pos_;
287 inline IteratorType base()
const {
303 enum :
bool { smpAssignable =
false };
309 explicit inline SymmetricMatrix();
310 explicit inline SymmetricMatrix(
size_t n );
311 explicit inline SymmetricMatrix(
size_t n,
size_t nonzeros );
312 explicit inline SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
314 inline SymmetricMatrix(
const SymmetricMatrix& m );
315 inline SymmetricMatrix( SymmetricMatrix&& m ) noexcept;
317 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,SO>& m );
318 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,!SO>& m );
329 inline Reference operator()(
size_t i,
size_t j );
331 inline Reference at(
size_t i,
size_t j );
345 inline SymmetricMatrix& operator=(
const SymmetricMatrix& rhs );
346 inline SymmetricMatrix& operator=( SymmetricMatrix&& rhs ) noexcept;
348 template<
typename MT2 >
349 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix& > operator=(
const Matrix<MT2,SO>& rhs );
351 template<
typename MT2 >
352 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix& > operator=(
const Matrix<MT2,SO>& rhs );
354 template<
typename MT2 >
355 inline SymmetricMatrix& operator=(
const Matrix<MT2,!SO>& rhs );
357 template<
typename MT2 >
358 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix& >
operator+=(
const Matrix<MT2,SO>& rhs );
360 template<
typename MT2 >
361 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix& >
operator+=(
const Matrix<MT2,SO>& rhs );
363 template<
typename MT2 >
364 inline SymmetricMatrix&
operator+=(
const Matrix<MT2,!SO>& rhs );
366 template<
typename MT2 >
367 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix& >
operator-=(
const Matrix<MT2,SO>& rhs );
369 template<
typename MT2 >
370 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix& >
operator-=(
const Matrix<MT2,SO>& rhs );
372 template<
typename MT2 >
373 inline SymmetricMatrix&
operator-=(
const Matrix<MT2,!SO>& rhs );
375 template<
typename MT2 >
376 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix& > operator%=(
const Matrix<MT2,SO>& rhs );
378 template<
typename MT2 >
379 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix& > operator%=(
const Matrix<MT2,SO>& rhs );
381 template<
typename MT2 >
382 inline SymmetricMatrix& operator%=(
const Matrix<MT2,!SO>& rhs );
384 template<
typename MT2,
bool SO2 >
385 inline SymmetricMatrix&
operator*=(
const Matrix<MT2,SO2>& rhs );
387 template<
typename Other >
388 inline EnableIf_< IsNumeric<Other>, SymmetricMatrix >&
operator*=( Other rhs );
390 template<
typename Other >
391 inline EnableIf_< IsNumeric<Other>, SymmetricMatrix >&
operator/=( Other rhs );
398 inline size_t rows() const noexcept;
399 inline
size_t columns() const noexcept;
400 inline
size_t capacity() const noexcept;
401 inline
size_t capacity(
size_t i ) const noexcept;
403 inline
size_t nonZeros(
size_t i ) const;
405 inline
void reset(
size_t i );
407 inline
void resize (
size_t n,
bool preserve=true );
408 inline
void reserve(
size_t nonzeros );
409 inline
void reserve(
size_t i,
size_t nonzeros );
411 inline
void trim(
size_t i );
413 inline
void swap( SymmetricMatrix& m ) noexcept;
422 inline
void append (
size_t i,
size_t j, const
ElementType& value,
bool check=false );
423 inline
void finalize(
size_t i );
430 inline
void erase(
size_t i,
size_t j );
434 template< typename Pred >
435 inline
void erase( Pred predicate );
437 template< typename Pred >
438 inline
void erase(
size_t i,
Iterator first,
Iterator last, Pred predicate );
445 inline
Iterator find (
size_t i,
size_t j );
447 inline
Iterator lowerBound(
size_t i,
size_t j );
449 inline
Iterator upperBound(
size_t i,
size_t j );
460 template< typename Other > inline SymmetricMatrix& scale( const Other& scalar );
461 template< typename Other > inline SymmetricMatrix& scaleDiagonal( const Other& scale );
468 inline
bool isIntact() const noexcept;
475 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
476 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
478 inline
bool canSMPAssign() const noexcept;
491 template<
bool RF, typename MT2,
bool SO2,
bool DF2,
bool NF2 >
492 friend
bool isDefault( const SymmetricMatrix<MT2,SO2,DF2,NF2>& m );
528 template< typename MT
530 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix()
547 template<
typename MT
549 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n )
569 template<
typename MT
571 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
size_t nonzeros )
572 : matrix_( n, n, nonzeros )
593 template<
typename MT
595 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
596 : matrix_( n, n, nonzeros )
612 template<
typename MT
614 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const SymmetricMatrix& m )
615 : matrix_( m.matrix_ )
630 template<
typename MT
632 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix( SymmetricMatrix&& m ) noexcept
633 : matrix_( std::move( m.matrix_ ) )
652 template<
typename MT
654 template<
typename MT2 >
655 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,SO>& m )
658 if( !IsSymmetric<MT2>::value && !
isSymmetric( matrix_ ) ) {
679 template<
typename MT
681 template<
typename MT2 >
682 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,!SO>& m )
683 : matrix_(
trans( ~m ) )
685 if( !IsSymmetric<MT2>::value && !
isSymmetric( matrix_ ) ) {
719 template<
typename MT
722 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
748 template<
typename MT
751 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
const 778 template<
typename MT
781 SymmetricMatrix<MT,SO,false,true>::at(
size_t i,
size_t j )
811 template<
typename MT
814 SymmetricMatrix<MT,SO,false,true>::at(
size_t i,
size_t j )
const 840 template<
typename MT
845 return Iterator( matrix_.begin(i), matrix_, i );
863 template<
typename MT
868 return matrix_.begin(i);
886 template<
typename MT
891 return matrix_.cbegin(i);
909 template<
typename MT
914 return Iterator( matrix_.end(i), matrix_, i );
932 template<
typename MT
937 return matrix_.end(i);
955 template<
typename MT
960 return matrix_.cend(i);
984 template<
typename MT
986 inline SymmetricMatrix<MT,SO,false,true>&
987 SymmetricMatrix<MT,SO,false,true>::operator=(
const SymmetricMatrix& rhs )
989 matrix_ = rhs.matrix_;
1007 template<
typename MT
1009 inline SymmetricMatrix<MT,SO,false,true>&
1010 SymmetricMatrix<MT,SO,false,true>::operator=( SymmetricMatrix&& rhs ) noexcept
1012 matrix_ = std::move( rhs.matrix_ );
1036 template<
typename MT
1038 template<
typename MT2 >
1039 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1040 SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1042 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1070 template<
typename MT
1072 template<
typename MT2 >
1073 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1074 SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1076 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1080 if( IsSymmetric<MT2>::value ) {
1090 matrix_ = std::move( tmp );
1115 template<
typename MT
1117 template<
typename MT2 >
1118 inline SymmetricMatrix<MT,SO,false,true>&
1119 SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,!SO>& rhs )
1121 return this->operator=(
trans( ~rhs ) );
1140 template<
typename MT
1142 template<
typename MT2 >
1143 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1146 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1174 template<
typename MT
1176 template<
typename MT2 >
1177 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1180 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1184 if( IsSymmetric<MT2>::value ) {
1188 const ResultType_<MT2> tmp( ~rhs );
1220 template<
typename MT
1222 template<
typename MT2 >
1223 inline SymmetricMatrix<MT,SO,false,true>&
1245 template<
typename MT
1247 template<
typename MT2 >
1248 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1251 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1279 template<
typename MT
1281 template<
typename MT2 >
1282 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1285 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1289 if( IsSymmetric<MT2>::value ) {
1293 const ResultType_<MT2> tmp( ~rhs );
1325 template<
typename MT
1327 template<
typename MT2 >
1328 inline SymmetricMatrix<MT,SO,false,true>&
1351 template<
typename MT
1353 template<
typename MT2 >
1354 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1355 SymmetricMatrix<MT,SO,false,true>::operator%=(
const Matrix<MT2,SO>& rhs )
1357 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1386 template<
typename MT
1388 template<
typename MT2 >
1389 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1390 SymmetricMatrix<MT,SO,false,true>::operator%=(
const Matrix<MT2,SO>& rhs )
1392 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1396 if( IsSymmetric<MT2>::value ) {
1400 const ResultType_<MT2> tmp( ~rhs );
1432 template<
typename MT
1434 template<
typename MT2 >
1435 inline SymmetricMatrix<MT,SO,false,true>&
1436 SymmetricMatrix<MT,SO,false,true>::operator%=(
const Matrix<MT2,!SO>& rhs )
1438 return this->operator%=(
trans( ~rhs ) );
1456 template<
typename MT
1458 template<
typename MT2
1460 inline SymmetricMatrix<MT,SO,false,true>&
1463 if( matrix_.rows() != (~rhs).
columns() ) {
1467 MT tmp( matrix_ * ~rhs );
1473 matrix_ = std::move( tmp );
1492 template<
typename MT
1494 template<
typename Other >
1495 inline EnableIf_< IsNumeric<Other>, SymmetricMatrix<MT,SO,false,true> >&
1512 template<
typename MT
1514 template<
typename Other >
1515 inline EnableIf_< IsNumeric<Other>, SymmetricMatrix<MT,SO,false,true> >&
1541 template<
typename MT
1545 return matrix_.rows();
1557 template<
typename MT
1561 return matrix_.columns();
1573 template<
typename MT
1577 return matrix_.capacity();
1594 template<
typename MT
1598 return matrix_.capacity(i);
1610 template<
typename MT
1614 return matrix_.nonZeros();
1632 template<
typename MT
1636 return matrix_.nonZeros(i);
1648 template<
typename MT
1694 template<
typename MT
1698 for( Iterator_<MT> it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1700 const size_t j( it->index() );
1706 const Iterator_<MT> pos( matrix_.find( i, j ) );
1708 matrix_.erase( j, pos );
1711 const Iterator_<MT> pos( matrix_.find( j, i ) );
1713 matrix_.erase( j, pos );
1731 template<
typename MT
1758 template<
typename MT
1768 matrix_.resize( n, n,
true );
1785 template<
typename MT
1787 inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t nonzeros )
1789 matrix_.reserve( nonzeros );
1809 template<
typename MT
1811 inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t i,
size_t nonzeros )
1813 matrix_.reserve( i, nonzeros );
1830 template<
typename MT
1832 inline void SymmetricMatrix<MT,SO,false,true>::trim()
1852 template<
typename MT
1854 inline void SymmetricMatrix<MT,SO,false,true>::trim(
size_t i )
1872 template<
typename MT
1876 matrix_.shrinkToFit();
1889 template<
typename MT
1895 swap( matrix_, m.matrix_ );
1923 template<
typename MT
1929 matrix_.set( j, i, value );
1930 return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
1951 template<
typename MT
1954 SymmetricMatrix<MT,SO,false,true>::insert(
size_t i,
size_t j,
const ElementType& value )
1957 matrix_.insert( j, i, value );
1958 return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
2019 template<
typename MT
2021 inline void SymmetricMatrix<MT,SO,false,true>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
2023 matrix_.append( i, j, value, check );
2024 if( i != j && ( !check || !isDefault<strict>( value ) ) )
2025 matrix_.insert( j, i, value );
2045 template<
typename MT
2047 inline void SymmetricMatrix<MT,SO,false,true>::finalize(
size_t i )
2073 template<
typename MT
2075 inline void SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
size_t j )
2077 matrix_.erase( i, j );
2079 matrix_.erase( j, i );
2097 template<
typename MT
2100 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator pos )
2102 const Iterator_<MT> base( pos.base() );
2104 if( base == matrix_.end( i ) )
2107 const size_t j( base->index() );
2111 return Iterator( matrix_.erase( i, base ), matrix_, i );
2116 matrix_.erase( j, matrix_.find( i, j ) );
2117 return Iterator( matrix_.erase( i, base ), matrix_, i );
2121 matrix_.erase( j, matrix_.find( j, i ) );
2122 return Iterator( matrix_.erase( i, base ), matrix_, i );
2143 template<
typename MT
2146 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator first,
Iterator last )
2148 for( Iterator_<MT> it=first.base(); it!=last.base(); ++it )
2150 const size_t j( it->index() );
2157 matrix_.erase( i, j );
2161 matrix_.erase( j, i );
2165 return Iterator( matrix_.erase( i, first.base(), last.base() ), matrix_, i );
2193 template<
typename MT
2195 template<
typename Pred >
2196 inline void SymmetricMatrix<MT,SO,false,true>::erase( Pred predicate )
2198 matrix_.erase( predicate );
2234 template<
typename MT
2236 template<
typename Pred >
2238 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator first,
Iterator last, Pred predicate )
2240 for(
Iterator it=first; it!=last; ++it ) {
2241 const size_t j( it->index() );
2242 if( i != j && predicate( it->value() ) ) {
2244 matrix_.erase( i, j );
2246 matrix_.erase( j, i );
2250 matrix_.erase( i, first.base(), last.base(), predicate );
2282 template<
typename MT
2285 SymmetricMatrix<MT,SO,false,true>::find(
size_t i,
size_t j )
2287 return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
2309 template<
typename MT
2312 SymmetricMatrix<MT,SO,false,true>::find(
size_t i,
size_t j )
const 2314 return matrix_.find( i, j );
2336 template<
typename MT
2339 SymmetricMatrix<MT,SO,false,true>::lowerBound(
size_t i,
size_t j )
2341 return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2363 template<
typename MT
2366 SymmetricMatrix<MT,SO,false,true>::lowerBound(
size_t i,
size_t j )
const 2368 return matrix_.lowerBound( i, j );
2390 template<
typename MT
2393 SymmetricMatrix<MT,SO,false,true>::upperBound(
size_t i,
size_t j )
2395 return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2417 template<
typename MT
2420 SymmetricMatrix<MT,SO,false,true>::upperBound(
size_t i,
size_t j )
const 2422 return matrix_.upperBound( i, j );
2442 template<
typename MT
2458 template<
typename MT
2462 if( !IsBuiltin<ElementType>::value )
2489 template<
typename MT
2491 template<
typename Other >
2492 inline SymmetricMatrix<MT,SO,false,true>&
2493 SymmetricMatrix<MT,SO,false,true>::scale(
const Other& scalar )
2495 matrix_.scale( scalar );
2512 template<
typename MT
2514 template<
typename Other >
2515 inline SymmetricMatrix<MT,SO,false,true>&
2516 SymmetricMatrix<MT,SO,false,true>::scaleDiagonal(
const Other& scalar )
2518 matrix_.scaleDiagonal( scalar );
2543 template<
typename MT
2574 template<
typename MT
2576 template<
typename Other >
2577 inline bool SymmetricMatrix<MT,SO,false,true>::canAlias(
const Other* alias )
const noexcept
2579 return matrix_.canAlias( alias );
2596 template<
typename MT
2598 template<
typename Other >
2599 inline bool SymmetricMatrix<MT,SO,false,true>::isAliased(
const Other* alias )
const noexcept
2601 return matrix_.isAliased( alias );
2618 template<
typename MT
2620 inline bool SymmetricMatrix<MT,SO,false,true>::canSMPAssign() const noexcept
2622 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:3079
#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 Rows type trait.
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:356
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
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1411
Constraint on the data type.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3078
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:198
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:560
BLAZE_ALWAYS_INLINE void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:609
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5845
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3080
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:661
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3085
#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:394
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:731
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3086
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1393
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:308
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:242
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.
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:3084
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
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:5924
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5907
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3077
#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:3081
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the Columns type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
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:340
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:548
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:264
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:580
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:270
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:700
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:324
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3082
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:790
#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:3083
#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:252
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:600
#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
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:742
#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:635