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_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>;
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_t<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 {
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 );
328 ~SymmetricMatrix() =
default;
335 inline Reference operator()(
size_t i,
size_t j );
337 inline Reference at(
size_t i,
size_t j );
351 inline SymmetricMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
353 inline SymmetricMatrix& operator=(
const SymmetricMatrix& rhs );
354 inline SymmetricMatrix& operator=( SymmetricMatrix&& rhs ) noexcept;
356 template<
typename MT2 >
357 inline auto operator=(
const Matrix<MT2,SO>& rhs )
358 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
360 template<
typename MT2 >
361 inline auto operator=(
const Matrix<MT2,SO>& rhs )
362 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
364 template<
typename MT2 >
365 inline auto operator=(
const Matrix<MT2,!SO>& rhs ) -> SymmetricMatrix&;
367 template<
typename MT2 >
368 inline auto operator+=(
const Matrix<MT2,SO>& rhs )
369 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
371 template<
typename MT2 >
372 inline auto operator+=(
const Matrix<MT2,SO>& rhs )
373 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
375 template<
typename MT2 >
376 inline auto operator+=(
const Matrix<MT2,!SO>& rhs )
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 )
391 template<
typename MT2 >
392 inline auto operator%=(
const Matrix<MT2,SO>& rhs )
393 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
395 template<
typename MT2 >
396 inline auto operator%=(
const Matrix<MT2,SO>& rhs )
397 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >;
399 template<
typename MT2 >
400 inline auto operator%=(
const Matrix<MT2,!SO>& rhs ) -> SymmetricMatrix&;
402 template<
typename ST >
403 inline auto operator*=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, SymmetricMatrix& >;
405 template<
typename ST >
406 inline auto operator/=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, SymmetricMatrix& >;
413 inline size_t rows() const noexcept;
414 inline
size_t columns() const noexcept;
415 inline
size_t capacity() const noexcept;
416 inline
size_t capacity(
size_t i ) const noexcept;
418 inline
size_t nonZeros(
size_t i ) const;
420 inline
void reset(
size_t i );
422 inline
void resize (
size_t n,
bool preserve=true );
423 inline
void reserve(
size_t nonzeros );
424 inline
void reserve(
size_t i,
size_t nonzeros );
426 inline
void trim(
size_t i );
428 inline
void swap( SymmetricMatrix& m ) noexcept;
437 inline
void append (
size_t i,
size_t j, const
ElementType& value,
bool check=false );
438 inline
void finalize(
size_t i );
445 inline
void erase(
size_t i,
size_t j );
449 template< typename Pred >
450 inline
void erase( Pred predicate );
452 template< typename Pred >
453 inline
void erase(
size_t i,
Iterator first,
Iterator last, Pred predicate );
460 inline
Iterator find (
size_t i,
size_t j );
462 inline
Iterator lowerBound(
size_t i,
size_t j );
464 inline
Iterator upperBound(
size_t i,
size_t j );
475 template< typename Other > inline SymmetricMatrix& scale( const Other& scalar );
482 inline
bool isIntact() const noexcept;
489 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
490 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
492 inline
bool canSMPAssign() const noexcept;
505 template<
bool RF, typename MT2,
bool SO2,
bool DF2,
bool NF2 >
506 friend
bool isDefault( const SymmetricMatrix<MT2,SO2,DF2,NF2>& m );
542 template< typename MT
544 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix()
561 template<
typename MT
563 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n )
583 template<
typename MT
585 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
size_t nonzeros )
586 : matrix_( n, n, nonzeros )
607 template<
typename MT
609 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
610 : matrix_( n, n, nonzeros )
644 template<
typename MT
646 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix( initializer_list< initializer_list<ElementType> > list )
665 template<
typename MT
667 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const SymmetricMatrix& m )
668 : matrix_( m.matrix_ )
683 template<
typename MT
685 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix( SymmetricMatrix&& m ) noexcept
686 : matrix_( std::move( m.matrix_ ) )
705 template<
typename MT
707 template<
typename MT2 >
708 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,SO>& m )
711 if( !IsSymmetric_v<MT2> && !
isSymmetric( matrix_ ) ) {
732 template<
typename MT
734 template<
typename MT2 >
735 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,!SO>& m )
736 : matrix_(
trans( ~m ) )
738 if( !IsSymmetric_v<MT2> && !
isSymmetric( matrix_ ) ) {
772 template<
typename MT
775 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
801 template<
typename MT
804 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
const 831 template<
typename MT
834 SymmetricMatrix<MT,SO,false,true>::at(
size_t i,
size_t j )
864 template<
typename MT
867 SymmetricMatrix<MT,SO,false,true>::at(
size_t i,
size_t j )
const 893 template<
typename MT
898 return Iterator( matrix_.begin(i), matrix_, i );
916 template<
typename MT
921 return matrix_.begin(i);
939 template<
typename MT
944 return matrix_.cbegin(i);
962 template<
typename MT
967 return Iterator( matrix_.end(i), matrix_, i );
985 template<
typename MT
990 return matrix_.end(i);
1008 template<
typename MT
1013 return matrix_.cend(i);
1052 template<
typename MT
1054 inline SymmetricMatrix<MT,SO,false,true>&
1055 SymmetricMatrix<MT,SO,false,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1057 const InitializerMatrix<ElementType> tmp( list, list.size() );
1084 template<
typename MT
1086 inline SymmetricMatrix<MT,SO,false,true>&
1087 SymmetricMatrix<MT,SO,false,true>::operator=(
const SymmetricMatrix& rhs )
1089 matrix_ = rhs.matrix_;
1107 template<
typename MT
1109 inline SymmetricMatrix<MT,SO,false,true>&
1110 SymmetricMatrix<MT,SO,false,true>::operator=( SymmetricMatrix&& rhs ) noexcept
1112 matrix_ = std::move( rhs.matrix_ );
1136 template<
typename MT
1138 template<
typename MT2 >
1139 inline auto SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1140 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1142 if( !IsSymmetric_v<MT2> && !
isSymmetric( ~rhs ) ) {
1170 template<
typename MT
1172 template<
typename MT2 >
1173 inline auto SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1174 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1176 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1180 if( IsSymmetric_v<MT2> ) {
1190 matrix_ = std::move( tmp );
1215 template<
typename MT
1217 template<
typename MT2 >
1218 inline auto SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,!SO>& rhs )
1221 return this->operator=(
trans( ~rhs ) );
1240 template<
typename MT
1242 template<
typename MT2 >
1244 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1246 if( !IsSymmetric_v<MT2> && !
isSymmetric( ~rhs ) ) {
1274 template<
typename MT
1276 template<
typename MT2 >
1278 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1280 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1284 if( IsSymmetric_v<MT2> ) {
1288 const ResultType_t<MT2> tmp( ~rhs );
1320 template<
typename MT
1322 template<
typename MT2 >
1345 template<
typename MT
1347 template<
typename MT2 >
1349 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1351 if( !IsSymmetric_v<MT2> && !
isSymmetric( ~rhs ) ) {
1379 template<
typename MT
1381 template<
typename MT2 >
1383 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1385 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1389 if( IsSymmetric_v<MT2> ) {
1393 const ResultType_t<MT2> tmp( ~rhs );
1425 template<
typename MT
1427 template<
typename MT2 >
1451 template<
typename MT
1453 template<
typename MT2 >
1454 inline auto SymmetricMatrix<MT,SO,false,true>::operator%=(
const Matrix<MT2,SO>& rhs )
1455 -> DisableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1457 if( !IsSymmetric_v<MT2> && !
isSymmetric( ~rhs ) ) {
1486 template<
typename MT
1488 template<
typename MT2 >
1489 inline auto SymmetricMatrix<MT,SO,false,true>::operator%=(
const Matrix<MT2,SO>& rhs )
1490 -> EnableIf_t< IsComputation_v<MT2>, SymmetricMatrix& >
1492 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1496 if( IsSymmetric_v<MT2> ) {
1500 const ResultType_t<MT2> tmp( ~rhs );
1532 template<
typename MT
1534 template<
typename MT2 >
1535 inline auto SymmetricMatrix<MT,SO,false,true>::operator%=(
const Matrix<MT2,!SO>& rhs )
1538 return this->operator%=(
trans( ~rhs ) );
1552 template<
typename MT
1554 template<
typename ST >
1556 -> EnableIf_t< IsNumeric_v<ST>, SymmetricMatrix& >
1572 template<
typename MT
1574 template<
typename ST >
1576 -> EnableIf_t< IsNumeric_v<ST>, SymmetricMatrix& >
1601 template<
typename MT
1605 return matrix_.rows();
1617 template<
typename MT
1621 return matrix_.columns();
1633 template<
typename MT
1637 return matrix_.capacity();
1654 template<
typename MT
1658 return matrix_.capacity(i);
1670 template<
typename MT
1674 return matrix_.nonZeros();
1692 template<
typename MT
1696 return matrix_.nonZeros(i);
1708 template<
typename MT
1754 template<
typename MT
1760 for(
auto it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1762 const size_t j( it->index() );
1768 const Iterator_t<MT> pos( matrix_.find( i, j ) );
1770 erase( matrix_, j, pos );
1773 const Iterator_t<MT> pos( matrix_.find( j, i ) );
1775 erase( matrix_, j, pos );
1793 template<
typename MT
1820 template<
typename MT
1830 matrix_.resize( n, n,
true );
1847 template<
typename MT
1849 inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t nonzeros )
1851 matrix_.reserve( nonzeros );
1871 template<
typename MT
1873 inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t i,
size_t nonzeros )
1875 matrix_.reserve( i, nonzeros );
1892 template<
typename MT
1894 inline void SymmetricMatrix<MT,SO,false,true>::trim()
1914 template<
typename MT
1916 inline void SymmetricMatrix<MT,SO,false,true>::trim(
size_t i )
1934 template<
typename MT
1938 matrix_.shrinkToFit();
1951 template<
typename MT
1957 swap( matrix_, m.matrix_ );
1985 template<
typename MT
1991 matrix_.set( j, i, value );
1992 return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
2013 template<
typename MT
2016 SymmetricMatrix<MT,SO,false,true>::insert(
size_t i,
size_t j,
const ElementType& value )
2019 matrix_.insert( j, i, value );
2020 return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
2081 template<
typename MT
2083 inline void SymmetricMatrix<MT,SO,false,true>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
2085 matrix_.append( i, j, value, check );
2086 if( i != j && ( !check || !isDefault<strict>( value ) ) )
2087 matrix_.insert( j, i, value );
2107 template<
typename MT
2109 inline void SymmetricMatrix<MT,SO,false,true>::finalize(
size_t i )
2135 template<
typename MT
2137 inline void SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
size_t j )
2141 erase( matrix_, i, j );
2143 erase( matrix_, j, i );
2161 template<
typename MT
2164 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator pos )
2168 const Iterator_t<MT> base( pos.base() );
2170 if( base == matrix_.end( i ) )
2173 const size_t j( base->index() );
2177 return Iterator( erase( matrix_, i, base ), matrix_, i );
2182 erase( matrix_, j, matrix_.find( i, j ) );
2183 return Iterator( erase( matrix_, i, base ), matrix_, i );
2187 erase( matrix_, j, matrix_.find( j, i ) );
2188 return Iterator( erase(matrix_, i, base ), matrix_, i );
2209 template<
typename MT
2212 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator first,
Iterator last )
2216 for(
auto it=first.base(); it!=last.base(); ++it )
2218 const size_t j( it->index() );
2225 erase( matrix_, i, j );
2229 erase( matrix_, j, i );
2233 return Iterator( erase( matrix_, i, first.base(), last.base() ), matrix_, i );
2261 template<
typename MT
2263 template<
typename Pred >
2264 inline void SymmetricMatrix<MT,SO,false,true>::erase( Pred predicate )
2268 erase( matrix_, predicate );
2304 template<
typename MT
2306 template<
typename Pred >
2308 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator first,
Iterator last, Pred predicate )
2312 for(
auto it=first; it!=last; ++it ) {
2313 const size_t j( it->index() );
2314 if( i != j && predicate( it->value() ) ) {
2316 erase( matrix_, i, j );
2318 erase( matrix_, j, i );
2322 erase( matrix_, i, first.base(), last.base(), predicate );
2354 template<
typename MT
2357 SymmetricMatrix<MT,SO,false,true>::find(
size_t i,
size_t j )
2359 return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
2381 template<
typename MT
2384 SymmetricMatrix<MT,SO,false,true>::find(
size_t i,
size_t j )
const 2386 return matrix_.find( i, j );
2408 template<
typename MT
2411 SymmetricMatrix<MT,SO,false,true>::lowerBound(
size_t i,
size_t j )
2413 return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2435 template<
typename MT
2438 SymmetricMatrix<MT,SO,false,true>::lowerBound(
size_t i,
size_t j )
const 2440 return matrix_.lowerBound( i, j );
2462 template<
typename MT
2465 SymmetricMatrix<MT,SO,false,true>::upperBound(
size_t i,
size_t j )
2467 return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2489 template<
typename MT
2492 SymmetricMatrix<MT,SO,false,true>::upperBound(
size_t i,
size_t j )
const 2494 return matrix_.upperBound( i, j );
2514 template<
typename MT
2530 template<
typename MT
2534 if( !IsBuiltin_v<ElementType> )
2561 template<
typename MT
2563 template<
typename Other >
2564 inline SymmetricMatrix<MT,SO,false,true>&
2565 SymmetricMatrix<MT,SO,false,true>::scale(
const Other& scalar )
2567 matrix_.scale( scalar );
2592 template<
typename MT
2623 template<
typename MT
2625 template<
typename Other >
2626 inline bool SymmetricMatrix<MT,SO,false,true>::canAlias(
const Other* alias )
const noexcept
2628 return matrix_.canAlias( alias );
2645 template<
typename MT
2647 template<
typename Other >
2648 inline bool SymmetricMatrix<MT,SO,false,true>::isAliased(
const Other* alias )
const noexcept
2650 return matrix_.isAliased( alias );
2667 template<
typename MT
2669 inline bool SymmetricMatrix<MT,SO,false,true>::canSMPAssign() const noexcept
2671 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:3078
#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
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:354
Header file for the UNUSED_PARAMETER function template.
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.
Constraint on the data type.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3077
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
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:799
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5828
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3079
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:851
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
#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
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
Header file for the extended initializer_list functionality.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
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:673
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:3083
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:5907
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5890
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
#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:3080
#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:3086
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.
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
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:8908
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 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:611
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
#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
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
#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:281
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:539
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
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.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3082
#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
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:290
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
#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
#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, 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
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
Header file for the clear shim.
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:825