35 #ifndef _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SPARSENUMERIC_H_
36 #define _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SPARSENUMERIC_H_
100 class SymmetricMatrix<MT,SO,false,true>
101 :
public SparseMatrix< SymmetricMatrix<MT,SO,false,true>, SO >
112 typedef SymmetricMatrix<MT,SO,false,true>
This;
114 typedef SymmetricMatrix<OT,!SO,false,true>
OppositeType;
127 template<
typename ET >
130 typedef SymmetricMatrix< typename MT::template Rebind<ET>::Other > Other;
143 template<
typename T >
144 struct BuiltinType {
typedef INVALID_TYPE Type; };
150 template<
typename T >
151 struct ComplexType {
typedef typename T::value_type Type; };
157 typedef typename If< IsComplex<ElementType>
158 , ComplexType<ElementType>
159 , BuiltinType<ElementType> >::Type::Type ValueType;
161 typedef ValueType value_type;
170 inline SymmetricValue( ElementType& v1, ElementType& v2 )
182 inline SymmetricValue& operator=(
const SymmetricValue& sv ) {
196 template<
typename T >
inline SymmetricValue& operator=(
const T& v ) {
210 template<
typename T >
inline SymmetricValue& operator+=(
const T& v ) {
224 template<
typename T >
inline SymmetricValue& operator-=(
const T& v ) {
238 template<
typename T >
inline SymmetricValue& operator*=(
const T& v ) {
252 template<
typename T >
inline SymmetricValue& operator/=(
const T& v ) {
278 inline ValueType
real()
const {
292 inline void real( ValueType value )
const {
307 inline ValueType imag()
const {
321 inline void imag( ValueType value )
const {
339 class SymmetricElement :
private SparseElement
348 typedef SymmetricValue ValueType;
349 typedef size_t IndexType;
352 typedef SymmetricElement* Pointer;
361 inline SymmetricElement( IteratorType e1, IteratorType e2 )
373 template<
typename T >
inline SymmetricElement& operator=(
const T& v ) {
387 template<
typename T >
inline SymmetricElement& operator+=(
const T& v ) {
401 template<
typename T >
inline SymmetricElement& operator-=(
const T& v ) {
415 template<
typename T >
inline SymmetricElement& operator*=(
const T& v ) {
429 template<
typename T >
inline SymmetricElement& operator/=(
const T& v ) {
442 inline Pointer operator->() {
452 inline Reference value()
const {
453 return Reference( e1_->value(), e2_->value() );
462 inline IndexType index()
const {
484 typedef std::forward_iterator_tag IteratorCategory;
485 typedef SymmetricElement ValueType;
486 typedef ValueType PointerType;
487 typedef ValueType ReferenceType;
488 typedef ptrdiff_t DifferenceType;
491 typedef IteratorCategory iterator_category;
492 typedef ValueType value_type;
493 typedef PointerType pointer;
494 typedef ReferenceType reference;
495 typedef DifferenceType difference_type;
515 inline Iterator( IteratorType pos, MT& matrix,
size_t index )
538 inline const Iterator operator++(
int ) {
551 const IteratorType pos2( SO ? matrix_->find( index_, pos_->index() )
552 : matrix_->find( pos_->index(), index_ ) );
554 return ReferenceType( pos_, pos2 );
563 inline PointerType operator->()
const {
564 const IteratorType pos2( SO ? matrix_->find( index_, pos_->index() )
565 : matrix_->find( pos_->index(), index_ ) );
567 return PointerType( pos_, pos2 );
588 return pos_ == rhs.pos_;
599 return !( *
this == rhs );
610 return pos_ - rhs.pos_;
619 inline IteratorType base()
const {
635 enum { smpAssignable = 0 };
641 explicit inline SymmetricMatrix();
642 explicit inline SymmetricMatrix(
size_t n );
643 explicit inline SymmetricMatrix(
size_t n,
size_t nonzeros );
644 explicit inline SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
646 inline SymmetricMatrix(
const SymmetricMatrix& m );
647 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,SO>& m );
648 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,!SO>& m );
659 inline Reference operator()(
size_t i,
size_t j );
660 inline ConstReference operator()(
size_t i,
size_t j )
const;
662 inline ConstIterator
begin (
size_t i )
const;
663 inline ConstIterator
cbegin(
size_t i )
const;
665 inline ConstIterator
end (
size_t i )
const;
666 inline ConstIterator
cend (
size_t i )
const;
673 inline SymmetricMatrix& operator=(
const SymmetricMatrix& rhs );
675 template<
typename MT2 >
676 inline typename DisableIf< IsComputation<MT2>, SymmetricMatrix& >::Type
677 operator=(
const Matrix<MT2,SO>& rhs );
679 template<
typename MT2 >
680 inline typename EnableIf< IsComputation<MT2>, SymmetricMatrix& >::Type
681 operator=(
const Matrix<MT2,SO>& rhs );
683 template<
typename MT2 >
684 inline SymmetricMatrix& operator=(
const Matrix<MT2,!SO>& rhs );
686 template<
typename MT2 >
687 inline typename DisableIf< IsComputation<MT2>, SymmetricMatrix& >::Type
688 operator+=(
const Matrix<MT2,SO>& rhs );
690 template<
typename MT2 >
691 inline typename EnableIf< IsComputation<MT2>, SymmetricMatrix& >::Type
692 operator+=(
const Matrix<MT2,SO>& rhs );
694 template<
typename MT2 >
695 inline SymmetricMatrix& operator+=(
const Matrix<MT2,!SO>& rhs );
697 template<
typename MT2 >
698 inline typename DisableIf< IsComputation<MT2>, SymmetricMatrix& >::Type
699 operator-=(
const Matrix<MT2,SO>& rhs );
701 template<
typename MT2 >
702 inline typename EnableIf< IsComputation<MT2>, SymmetricMatrix& >::Type
703 operator-=(
const Matrix<MT2,SO>& rhs );
705 template<
typename MT2 >
706 inline SymmetricMatrix& operator-=(
const Matrix<MT2,!SO>& rhs );
708 template<
typename MT2,
bool SO2 >
709 inline SymmetricMatrix& operator*=(
const Matrix<MT2,SO2>& rhs );
711 template<
typename Other >
712 inline typename EnableIf< IsNumeric<Other>, SymmetricMatrix >::Type&
713 operator*=( Other rhs );
715 template<
typename Other >
716 inline typename EnableIf< IsNumeric<Other>, SymmetricMatrix >::Type&
717 operator/=( Other rhs );
724 inline size_t rows()
const;
727 inline size_t capacity(
size_t i )
const;
729 inline size_t nonZeros(
size_t i )
const;
731 inline void reset(
size_t i );
733 inline Iterator set(
size_t i,
size_t j,
const ElementType& value );
734 inline Iterator insert(
size_t i,
size_t j,
const ElementType& value );
735 inline void erase(
size_t i,
size_t j );
738 inline void resize (
size_t n,
bool preserve=
true );
739 inline void reserve(
size_t nonzeros );
740 inline void reserve(
size_t i,
size_t nonzeros );
742 inline void trim(
size_t i );
743 inline SymmetricMatrix& transpose();
744 template<
typename Other >
inline SymmetricMatrix& scale(
const Other& scalar );
745 template<
typename Other >
inline SymmetricMatrix& scaleDiagonal( Other scale );
746 inline void swap( SymmetricMatrix& m ) ;
753 inline Iterator find (
size_t i,
size_t j );
754 inline ConstIterator find (
size_t i,
size_t j )
const;
755 inline Iterator lowerBound(
size_t i,
size_t j );
756 inline ConstIterator lowerBound(
size_t i,
size_t j )
const;
757 inline Iterator upperBound(
size_t i,
size_t j );
758 inline ConstIterator upperBound(
size_t i,
size_t j )
const;
765 inline void append (
size_t i,
size_t j,
const ElementType& value,
bool check=
false );
766 inline void finalize(
size_t i );
773 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
774 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
776 inline bool canSMPAssign()
const;
789 template<
typename MT2,
bool SO2,
bool DF2,
bool NF2 >
790 friend bool isDefault(
const SymmetricMatrix<MT2,SO2,DF2,NF2>& m );
825 template<
typename MT
827 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix()
844 template<
typename MT
846 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n )
866 template<
typename MT
868 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
size_t nonzeros )
869 : matrix_( n, n, nonzeros )
890 template<
typename MT
892 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
893 : matrix_( n, n, nonzeros )
909 template<
typename MT
911 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const SymmetricMatrix& m )
912 : matrix_( m.matrix_ )
930 template<
typename MT
932 template<
typename MT2 >
933 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,SO>& m )
936 if( !IsSymmetric<MT2>::value && !
isSymmetric( matrix_ ) )
937 throw std::invalid_argument(
"Invalid setup of symmetric matrix" );
955 template<
typename MT
957 template<
typename MT2 >
958 inline SymmetricMatrix<MT,SO,false,true>::SymmetricMatrix(
const Matrix<MT2,!SO>& m )
959 : matrix_(
trans( ~m ) )
961 if( !IsSymmetric<MT2>::value && !
isSymmetric( matrix_ ) )
962 throw std::invalid_argument(
"Invalid setup of symmetric matrix" );
990 template<
typename MT
993 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
1016 template<
typename MT
1019 SymmetricMatrix<MT,SO,false,true>::operator()(
size_t i,
size_t j )
const
1024 return matrix_(i,j);
1042 template<
typename MT
1047 return Iterator( matrix_.begin(i), matrix_, i );
1065 template<
typename MT
1070 return matrix_.begin(i);
1088 template<
typename MT
1093 return matrix_.cbegin(i);
1111 template<
typename MT
1116 return Iterator( matrix_.end(i), matrix_, i );
1134 template<
typename MT
1139 return matrix_.end(i);
1157 template<
typename MT
1162 return matrix_.cend(i);
1186 template<
typename MT
1188 inline SymmetricMatrix<MT,SO,false,true>&
1189 SymmetricMatrix<MT,SO,false,true>::operator=(
const SymmetricMatrix& rhs )
1191 matrix_ = rhs.matrix_;
1212 template<
typename MT
1214 template<
typename MT2 >
1215 inline typename DisableIf< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >::Type
1216 SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1218 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) )
1219 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1242 template<
typename MT
1244 template<
typename MT2 >
1245 inline typename EnableIf< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >::Type
1246 SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,SO>& rhs )
1248 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) )
1249 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1251 if( IsSymmetric<MT2>::value ) {
1258 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1260 move( matrix_, tmp );
1282 template<
typename MT
1284 template<
typename MT2 >
1285 inline SymmetricMatrix<MT,SO,false,true>&
1286 SymmetricMatrix<MT,SO,false,true>::operator=(
const Matrix<MT2,!SO>& rhs )
1288 return this->operator=(
trans( ~rhs ) );
1307 template<
typename MT
1309 template<
typename MT2 >
1310 inline typename DisableIf< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >::Type
1311 SymmetricMatrix<MT,SO,false,true>::operator+=(
const Matrix<MT2,SO>& rhs )
1313 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) )
1314 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1337 template<
typename MT
1339 template<
typename MT2 >
1340 inline typename EnableIf< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >::Type
1341 SymmetricMatrix<MT,SO,false,true>::operator+=(
const Matrix<MT2,SO>& rhs )
1343 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) )
1344 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1346 if( IsSymmetric<MT2>::value ) {
1353 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1378 template<
typename MT
1380 template<
typename MT2 >
1381 inline SymmetricMatrix<MT,SO,false,true>&
1382 SymmetricMatrix<MT,SO,false,true>::operator+=(
const Matrix<MT2,!SO>& rhs )
1384 return this->operator+=(
trans( ~rhs ) );
1403 template<
typename MT
1405 template<
typename MT2 >
1406 inline typename DisableIf< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >::Type
1407 SymmetricMatrix<MT,SO,false,true>::operator-=(
const Matrix<MT2,SO>& rhs )
1409 if( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) )
1410 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1433 template<
typename MT
1435 template<
typename MT2 >
1436 inline typename EnableIf< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,true>& >::Type
1437 SymmetricMatrix<MT,SO,false,true>::operator-=(
const Matrix<MT2,SO>& rhs )
1439 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) )
1440 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1442 if( IsSymmetric<MT2>::value ) {
1449 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1474 template<
typename MT
1476 template<
typename MT2 >
1477 inline SymmetricMatrix<MT,SO,false,true>&
1478 SymmetricMatrix<MT,SO,false,true>::operator-=(
const Matrix<MT2,!SO>& rhs )
1480 return this->operator-=(
trans( ~rhs ) );
1498 template<
typename MT
1500 template<
typename MT2
1502 inline SymmetricMatrix<MT,SO,false,true>&
1503 SymmetricMatrix<MT,SO,false,true>::operator*=(
const Matrix<MT2,SO2>& rhs )
1505 if( matrix_.rows() != (~rhs).
columns() )
1506 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1508 MT tmp( matrix_ * ~rhs );
1511 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1513 move( matrix_, tmp );
1529 template<
typename MT
1531 template<
typename Other >
1532 inline typename EnableIf< IsNumeric<Other>, SymmetricMatrix<MT,SO,false,true> >::Type&
1533 SymmetricMatrix<MT,SO,false,true>::operator*=( Other rhs )
1549 template<
typename MT
1551 template<
typename Other >
1552 inline typename EnableIf< IsNumeric<Other>, SymmetricMatrix<MT,SO,false,true> >::Type&
1553 SymmetricMatrix<MT,SO,false,true>::operator/=( Other rhs )
1578 template<
typename MT
1582 return matrix_.rows();
1594 template<
typename MT
1598 return matrix_.columns();
1610 template<
typename MT
1614 return matrix_.capacity();
1631 template<
typename MT
1635 return matrix_.capacity(i);
1647 template<
typename MT
1651 return matrix_.nonZeros();
1669 template<
typename MT
1673 return matrix_.nonZeros(i);
1685 template<
typename MT
1731 template<
typename MT
1735 for(
typename MT::Iterator it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1737 const size_t j( it->index() );
1743 const typename MT::Iterator pos( matrix_.find( i, j ) );
1745 matrix_.erase( j, pos );
1748 const typename MT::Iterator pos( matrix_.find( j, i ) );
1750 matrix_.erase( j, pos );
1768 template<
typename MT
1794 template<
typename MT
1800 matrix_.set( j, i, value );
1801 return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
1822 template<
typename MT
1825 SymmetricMatrix<MT,SO,false,true>::insert(
size_t i,
size_t j,
const ElementType& value )
1828 matrix_.insert( j, i, value );
1829 return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
1845 template<
typename MT
1847 inline void SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
size_t j )
1849 matrix_.erase( i, j );
1851 matrix_.erase( j, i );
1869 template<
typename MT
1872 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator pos )
1876 if( base == matrix_.end( i ) )
1879 const size_t j( base->index() );
1883 return Iterator( matrix_.erase( i, base ), matrix_, i );
1888 matrix_.erase( j, matrix_.find( i, j ) );
1889 return Iterator( matrix_.erase( i, base ), matrix_, i );
1893 matrix_.erase( j, matrix_.find( j, i ) );
1894 return Iterator( matrix_.erase( i, base ), matrix_, i );
1915 template<
typename MT
1918 SymmetricMatrix<MT,SO,false,true>::erase(
size_t i,
Iterator first,
Iterator last )
1920 for(
typename MT::Iterator it=first.base(); it!=last.base(); ++it )
1922 const size_t j( it->index() );
1929 matrix_.erase( i, j );
1933 matrix_.erase( j, i );
1937 return Iterator( matrix_.erase( i, first.base(), last.base() ), matrix_, i );
1958 template<
typename MT
1968 matrix_.resize( n, n,
true );
1985 template<
typename MT
1987 inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t nonzeros )
1989 matrix_.reserve( nonzeros );
2009 template<
typename MT
2011 inline void SymmetricMatrix<MT,SO,false,true>::reserve(
size_t i,
size_t nonzeros )
2013 matrix_.reserve( i, nonzeros );
2030 template<
typename MT
2032 inline void SymmetricMatrix<MT,SO,false,true>::trim()
2052 template<
typename MT
2054 inline void SymmetricMatrix<MT,SO,false,true>::trim(
size_t i )
2068 template<
typename MT
2070 inline SymmetricMatrix<MT,SO,false,true>& SymmetricMatrix<MT,SO,false,true>::transpose()
2085 template<
typename MT
2087 template<
typename Other >
2088 inline SymmetricMatrix<MT,SO,false,true>&
2089 SymmetricMatrix<MT,SO,false,true>::scale(
const Other& scalar )
2091 matrix_.scale( scalar );
2105 template<
typename MT
2107 template<
typename Other >
2108 inline SymmetricMatrix<MT,SO,false,true>&
2109 SymmetricMatrix<MT,SO,false,true>::scaleDiagonal( Other scalar )
2111 matrix_.scaleDiagonal( scalar );
2126 template<
typename MT
2132 swap( matrix_, m.matrix_ );
2162 template<
typename MT
2165 SymmetricMatrix<MT,SO,false,true>::find(
size_t i,
size_t j )
2167 return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
2189 template<
typename MT
2192 SymmetricMatrix<MT,SO,false,true>::find(
size_t i,
size_t j )
const
2194 return matrix_.find( i, j );
2216 template<
typename MT
2219 SymmetricMatrix<MT,SO,false,true>::lowerBound(
size_t i,
size_t j )
2221 return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2243 template<
typename MT
2246 SymmetricMatrix<MT,SO,false,true>::lowerBound(
size_t i,
size_t j )
const
2248 return matrix_.lowerBound( i, j );
2270 template<
typename MT
2273 SymmetricMatrix<MT,SO,false,true>::upperBound(
size_t i,
size_t j )
2275 return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2297 template<
typename MT
2300 SymmetricMatrix<MT,SO,false,true>::upperBound(
size_t i,
size_t j )
const
2302 return matrix_.upperBound( i, j );
2371 template<
typename MT
2373 inline void SymmetricMatrix<MT,SO,false,true>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
2375 matrix_.append( i, j, value, check );
2376 if( i != j && ( !check || !
isDefault( value ) ) )
2377 matrix_.insert( j, i, value );
2397 template<
typename MT
2399 inline void SymmetricMatrix<MT,SO,false,true>::finalize(
size_t i )
2426 template<
typename MT
2428 template<
typename Other >
2429 inline bool SymmetricMatrix<MT,SO,false,true>::canAlias(
const Other* alias )
const
2431 return matrix_.canAlias( alias );
2448 template<
typename MT
2450 template<
typename Other >
2451 inline bool SymmetricMatrix<MT,SO,false,true>::isAliased(
const Other* alias )
const
2453 return matrix_.isAliased( alias );
2470 template<
typename MT
2472 inline bool SymmetricMatrix<MT,SO,false,true>::canSMPAssign()
const
2474 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:116
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 UNUSED_PARAMETER function template.
const DMatDMatMultExpr< T1, T2 > 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:8247
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix)
Checks if the given matrix is a square matrix.
Definition: Matrix.h:902
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:237
void move(CompressedMatrix< Type, SO > &dst, CompressedMatrix< Type, SO > &src)
Moving the contents of one compressed matrix to another.
Definition: CompressedMatrix.h:4825
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:300
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:258
#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:242
Constraint on the data type.
bool isSymmetric(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is symmetric.
Definition: DenseMatrix.h:692
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:821
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2507
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix)
Returns the maximum capacity of the matrix.
Definition: Matrix.h:348
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:316
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:4762
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2501
#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:116
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:386
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:2503
Header file for the implementation of the base template of the SymmetricMatrix.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:861
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 isDefault(const CompressedMatrix< Type, SO > &m)
Returns whether the given compressed matrix is in default state.
Definition: CompressedMatrix.h:4789
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 If class template.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:4807
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
#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:116
Constraint on the data type.
Header file for the SparseElement base class.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2504
Constraints on the storage order of matrix types.
#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:118
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:195
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:535
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
Header file for all forward declarations for expression class templates.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2509
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:841
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:116
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2506
Header file for run time assertion macros.
Utility type for generic codes.
Constraint on the data type.
Constraint on the data type.
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
#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:79
#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:118
#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:116
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2510
Header file for the isDefault shim.
Constraint on the data type.
Constraint on the data type.
double real
Floating point data type of the Blaze library.This type definition offers the possibility to switch t...
Definition: Precision.h:47
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:200
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, sse_int16_t >::Type set(T value)
Sets all values in the vector to the given 2-byte integral value.
Definition: Set.h:73
Header file for the move shim.
#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:79
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:937
Header file for the IsComputation type trait class.
#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:118
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2502
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:332
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
Header file for the IsComplex type trait.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2508
#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:143
Header file for the IsResizable 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:79