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 typedef OppositeType_<MT> OT;
109 typedef TransposeType_<MT> TT;
110 typedef ElementType_<MT> ET;
115 typedef SymmetricMatrix<MT,SO,false,true>
This;
116 typedef SparseMatrix<This,SO>
BaseType;
118 typedef SymmetricMatrix<OT,!SO,false,true>
OppositeType;
131 template<
typename NewType >
134 typedef SymmetricMatrix< typename MT::template Rebind<NewType>::Other > Other;
141 template<
size_t NewM
145 typedef SymmetricMatrix< typename MT::template Resize<NewM,NewN>::Other > Other;
156 typedef Iterator_<MT> IteratorType;
158 typedef std::forward_iterator_tag IteratorCategory;
159 typedef SymmetricElement<MT> ValueType;
160 typedef ValueType PointerType;
161 typedef ValueType ReferenceType;
162 typedef ptrdiff_t DifferenceType;
165 typedef IteratorCategory iterator_category;
166 typedef ValueType value_type;
167 typedef PointerType pointer;
168 typedef ReferenceType reference;
169 typedef DifferenceType difference_type;
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 );
330 inline ConstReference operator()(
size_t i,
size_t j )
const;
331 inline Reference at(
size_t i,
size_t j );
332 inline ConstReference at(
size_t i,
size_t j )
const;
334 inline ConstIterator
begin (
size_t i )
const;
335 inline ConstIterator
cbegin(
size_t i )
const;
337 inline ConstIterator
end (
size_t i )
const;
338 inline ConstIterator
cend (
size_t i )
const;
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,
bool SO2 >
376 inline SymmetricMatrix&
operator*=(
const Matrix<MT2,SO2>& rhs );
378 template<
typename Other >
379 inline EnableIf_< IsNumeric<Other>, SymmetricMatrix >&
operator*=( Other rhs );
381 template<
typename Other >
382 inline EnableIf_< IsNumeric<Other>, SymmetricMatrix >&
operator/=( Other rhs );
389 inline size_t rows() const noexcept;
390 inline
size_t columns() const noexcept;
391 inline
size_t capacity() const noexcept;
392 inline
size_t capacity(
size_t i ) const noexcept;
394 inline
size_t nonZeros(
size_t i ) const;
396 inline
void reset(
size_t i );
398 inline
void resize (
size_t n,
bool preserve=true );
399 inline
void reserve(
size_t nonzeros );
400 inline
void reserve(
size_t i,
size_t nonzeros );
402 inline
void trim(
size_t i );
403 inline
void swap( SymmetricMatrix& m ) noexcept;
410 inline
Iterator set (
size_t i,
size_t j, const ElementType& value );
411 inline
Iterator insert (
size_t i,
size_t j, const ElementType& value );
412 inline
void append (
size_t i,
size_t j, const ElementType& value,
bool check=false );
413 inline
void finalize(
size_t i );
420 inline
void erase(
size_t i,
size_t j );
424 template< typename Pred >
425 inline
void erase( Pred predicate );
427 template< typename Pred >
428 inline
void erase(
size_t i,
Iterator first,
Iterator last, Pred predicate );
435 inline
Iterator find (
size_t i,
size_t j );
436 inline ConstIterator find (
size_t i,
size_t j ) const;
437 inline
Iterator lowerBound(
size_t i,
size_t j );
438 inline ConstIterator lowerBound(
size_t i,
size_t j ) const;
439 inline
Iterator upperBound(
size_t i,
size_t j );
440 inline ConstIterator upperBound(
size_t i,
size_t j ) const;
450 template< typename Other > inline SymmetricMatrix& scale( const Other& scalar );
451 template< typename Other > inline SymmetricMatrix& scaleDiagonal( const Other& scale );
458 inline
bool isIntact() const noexcept;
465 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
466 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
468 inline
bool canSMPAssign() const noexcept;
481 template<
bool RF, typename MT2,
bool SO2,
bool DF2,
bool NF2 >
482 friend
bool isDefault( const SymmetricMatrix<MT2,SO2,DF2,NF2>& m );
518 template< typename MT
520 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix()
537 template<
typename MT
539 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n )
559 template<
typename MT
561 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
size_t nonzeros )
562 : matrix_( n, n, nonzeros )
583 template<
typename MT
585 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
586 : matrix_( n, n, nonzeros )
602 template<
typename MT
604 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const SymmetricMatrix& m )
605 : matrix_( m.matrix_ )
620 template<
typename MT
622 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix( SymmetricMatrix&& m ) noexcept
623 : matrix_( std::move( m.matrix_ ) )
642 template<
typename MT
644 template<
typename MT2 >
645 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,SO>& m )
648 if( !IsSymmetric<MT2>::value && !
isSymmetric( matrix_ ) ) {
669 template<
typename MT
671 template<
typename MT2 >
672 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,!SO>& m )
673 : matrix_(
trans( ~m ) )
675 if( !IsSymmetric<MT2>::value && !
isSymmetric( matrix_ ) ) {
709 template<
typename MT
712 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
738 template<
typename MT
741 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
const 768 template<
typename MT
771 SymmetricMatrix<MT,SO,false,true>::at(
size_t i,
size_t j )
801 template<
typename MT
804 SymmetricMatrix<MT,SO,false,true>::at(
size_t i,
size_t j )
const 830 template<
typename MT
835 return Iterator( matrix_.begin(i), matrix_, i );
853 template<
typename MT
858 return matrix_.begin(i);
876 template<
typename MT
881 return matrix_.cbegin(i);
899 template<
typename MT
904 return Iterator( matrix_.end(i), matrix_, i );
922 template<
typename MT
927 return matrix_.end(i);
945 template<
typename MT
950 return matrix_.cend(i);
974 template<
typename MT
976 inline SymmetricMatrix<MT,SO,false,true>&
977 SymmetricMatrix<MT,SO,false,true>::operator=(
const SymmetricMatrix& rhs )
979 matrix_ = rhs.matrix_;
997 template<
typename MT
999 inline SymmetricMatrix<MT,SO,false,true>&
1000 SymmetricMatrix<MT,SO,false,true>::operator=( SymmetricMatrix&& rhs ) noexcept
1002 matrix_ = std::move( rhs.matrix_ );
1026 template<
typename MT
1028 template<
typename MT2 >
1029 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1030 SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1032 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1060 template<
typename MT
1062 template<
typename MT2 >
1063 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1064 SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1066 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1070 if( IsSymmetric<MT2>::value ) {
1080 matrix_ = std::move( tmp );
1105 template<
typename MT
1107 template<
typename MT2 >
1108 inline SymmetricMatrix<MT,SO,false,true>&
1109 SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,!SO>& rhs )
1111 return this->operator=(
trans( ~rhs ) );
1130 template<
typename MT
1132 template<
typename MT2 >
1133 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1136 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1164 template<
typename MT
1166 template<
typename MT2 >
1167 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1170 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1174 if( IsSymmetric<MT2>::value ) {
1178 const ResultType_<MT2> tmp( ~rhs );
1210 template<
typename MT
1212 template<
typename MT2 >
1213 inline SymmetricMatrix<MT,SO,false,true>&
1235 template<
typename MT
1237 template<
typename MT2 >
1238 inline DisableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1241 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) {
1269 template<
typename MT
1271 template<
typename MT2 >
1272 inline EnableIf_< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >
1275 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1279 if( IsSymmetric<MT2>::value ) {
1283 const ResultType_<MT2> tmp( ~rhs );
1315 template<
typename MT
1317 template<
typename MT2 >
1318 inline SymmetricMatrix<MT,SO,false,true>&
1339 template<
typename MT
1341 template<
typename MT2
1343 inline SymmetricMatrix<MT,SO,false,true>&
1346 if( matrix_.rows() != (~rhs).
columns() ) {
1350 MT tmp( matrix_ * ~rhs );
1356 matrix_ = std::move( tmp );
1375 template<
typename MT
1377 template<
typename Other >
1378 inline EnableIf_< IsNumeric<Other>, SymmetricMatrix<MT,SO,false,true> >&
1395 template<
typename MT
1397 template<
typename Other >
1398 inline EnableIf_< IsNumeric<Other>, SymmetricMatrix<MT,SO,false,true> >&
1424 template<
typename MT
1428 return matrix_.rows();
1440 template<
typename MT
1444 return matrix_.columns();
1456 template<
typename MT
1460 return matrix_.capacity();
1477 template<
typename MT
1481 return matrix_.capacity(i);
1493 template<
typename MT
1497 return matrix_.nonZeros();
1515 template<
typename MT
1519 return matrix_.nonZeros(i);
1531 template<
typename MT
1577 template<
typename MT
1581 for( Iterator_<MT> it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1583 const size_t j( it->index() );
1589 const Iterator_<MT> pos( matrix_.find( i, j ) );
1591 matrix_.erase( j, pos );
1594 const Iterator_<MT> pos( matrix_.find( j, i ) );
1596 matrix_.erase( j, pos );
1614 template<
typename MT
1641 template<
typename MT
1651 matrix_.resize( n, n,
true );
1668 template<
typename MT
1670 inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t nonzeros )
1672 matrix_.reserve( nonzeros );
1692 template<
typename MT
1694 inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t i,
size_t nonzeros )
1696 matrix_.reserve( i, nonzeros );
1713 template<
typename MT
1715 inline void SymmetricMatrix<MT,SO,false,true>::trim()
1735 template<
typename MT
1737 inline void SymmetricMatrix<MT,SO,false,true>::trim(
size_t i )
1752 template<
typename MT
1758 swap( matrix_, m.matrix_ );
1786 template<
typename MT
1792 matrix_.set( j, i, value );
1793 return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
1814 template<
typename MT
1817 SymmetricMatrix<MT,SO,false,true>::insert(
size_t i,
size_t j,
const ElementType& value )
1820 matrix_.insert( j, i, value );
1821 return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
1882 template<
typename MT
1884 inline void SymmetricMatrix<MT,SO,false,true>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
1886 matrix_.append( i, j, value, check );
1887 if( i != j && ( !check || !
isDefault( value ) ) )
1888 matrix_.insert( j, i, value );
1908 template<
typename MT
1910 inline void SymmetricMatrix<MT,SO,false,true>::finalize(
size_t i )
1936 template<
typename MT
1938 inline void SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
size_t j )
1940 matrix_.erase( i, j );
1942 matrix_.erase( j, i );
1960 template<
typename MT
1963 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator pos )
1965 const Iterator_<MT> base( pos.base() );
1967 if( base == matrix_.end( i ) )
1970 const size_t j( base->index() );
1974 return Iterator( matrix_.erase( i, base ), matrix_, i );
1979 matrix_.erase( j, matrix_.find( i, j ) );
1980 return Iterator( matrix_.erase( i, base ), matrix_, i );
1984 matrix_.erase( j, matrix_.find( j, i ) );
1985 return Iterator( matrix_.erase( i, base ), matrix_, i );
2006 template<
typename MT
2009 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator first,
Iterator last )
2011 for( Iterator_<MT> it=first.base(); it!=last.base(); ++it )
2013 const size_t j( it->index() );
2020 matrix_.erase( i, j );
2024 matrix_.erase( j, i );
2028 return Iterator( matrix_.erase( i, first.base(), last.base() ), matrix_, i );
2056 template<
typename MT
2058 template<
typename Pred >
2059 inline void SymmetricMatrix<MT,SO,false,true>::erase( Pred predicate )
2061 matrix_.erase( predicate );
2097 template<
typename MT
2099 template<
typename Pred >
2101 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator first,
Iterator last, Pred predicate )
2103 for(
Iterator it=first; it!=last; ++it ) {
2104 const size_t j( it->index() );
2105 if( i != j && predicate( it->value() ) ) {
2107 matrix_.erase( i, j );
2109 matrix_.erase( j, i );
2113 matrix_.erase( i, first.base(), last.base(), predicate );
2145 template<
typename MT
2148 SymmetricMatrix<MT,SO,false,true>::find(
size_t i,
size_t j )
2150 return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
2172 template<
typename MT
2175 SymmetricMatrix<MT,SO,false,true>::find(
size_t i,
size_t j )
const 2177 return matrix_.find( i, j );
2199 template<
typename MT
2202 SymmetricMatrix<MT,SO,false,true>::lowerBound(
size_t i,
size_t j )
2204 return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2226 template<
typename MT
2229 SymmetricMatrix<MT,SO,false,true>::lowerBound(
size_t i,
size_t j )
const 2231 return matrix_.lowerBound( i, j );
2253 template<
typename MT
2256 SymmetricMatrix<MT,SO,false,true>::upperBound(
size_t i,
size_t j )
2258 return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2280 template<
typename MT
2283 SymmetricMatrix<MT,SO,false,true>::upperBound(
size_t i,
size_t j )
const 2285 return matrix_.upperBound( i, j );
2305 template<
typename MT
2321 template<
typename MT
2325 if( !IsBuiltin<ElementType>::value )
2341 template<
typename MT
2343 template<
typename Other >
2344 inline SymmetricMatrix<MT,SO,false,true>&
2345 SymmetricMatrix<MT,SO,false,true>::scale(
const Other& scalar )
2347 matrix_.scale( scalar );
2361 template<
typename MT
2363 template<
typename Other >
2364 inline SymmetricMatrix<MT,SO,false,true>&
2365 SymmetricMatrix<MT,SO,false,true>::scaleDiagonal(
const Other& scalar )
2367 matrix_.scaleDiagonal( scalar );
2392 template<
typename MT
2423 template<
typename MT
2425 template<
typename Other >
2426 inline bool SymmetricMatrix<MT,SO,false,true>::canAlias(
const Other* alias )
const noexcept
2428 return matrix_.canAlias( alias );
2445 template<
typename MT
2447 template<
typename Other >
2448 inline bool SymmetricMatrix<MT,SO,false,true>::isAliased(
const Other* alias )
const noexcept
2450 return matrix_.isAliased( alias );
2467 template<
typename MT
2469 inline bool SymmetricMatrix<MT,SO,false,true>::canSMPAssign() const noexcept
2471 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.
#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:352
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:1339
Constraint on the data type.
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:194
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2935
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5556
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:596
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2928
#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:390
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
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:1321
Constraint on the data type.
Header file for the NumericProxy class.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2931
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:304
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:238
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.
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:5635
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5618
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2939
#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
Header file for the Columns type trait.
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:336
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2932
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:544
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:260
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:2933
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.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2937
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2934
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:1285
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
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2938
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:267
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:697
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:320
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2929
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE(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
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:733
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
#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
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2930
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:249
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2936
#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:1303
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:677
const DMatDMatMultExpr< T1, T2, false, false, false, false > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7505
#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:570