35 #ifndef _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SPARSENONNUMERIC_H_
36 #define _BLAZE_MATH_ADAPTORS_SYMMETRICMATRIX_SPARSENONNUMERIC_H_
103 template<
typename MT
105 class SymmetricMatrix<MT,SO,false,false>
106 :
public SparseMatrix< SymmetricMatrix<MT,SO,false,false>, SO >
115 typedef typename MT::template Rebind< SharedValue<ET> >::Other MatrixType;
120 typedef SymmetricMatrix<MT,SO,false,false>
This;
122 typedef SymmetricMatrix<OT,!SO,false,false>
OppositeType;
127 typedef NonNumericProxy<MatrixType>
Reference;
134 template<
typename ET >
137 typedef SymmetricMatrix< typename MT::template Rebind<ET>::Other > Other;
144 template<
typename IteratorType >
145 class SharedElement :
private SparseElement
149 typedef ET ValueType;
150 typedef size_t IndexType;
153 typedef SharedElement* Pointer;
154 typedef const SharedElement* ConstPointer;
162 inline SharedElement( IteratorType pos )
173 template<
typename T >
inline SharedElement& operator=(
const T& v ) {
185 template<
typename T >
inline SharedElement& operator+=(
const T& v ) {
197 template<
typename T >
inline SharedElement& operator-=(
const T& v ) {
209 template<
typename T >
inline SharedElement& operator*=(
const T& v ) {
221 template<
typename T >
inline SharedElement& operator/=(
const T& v ) {
232 inline Pointer operator->() {
242 inline ConstPointer operator->()
const {
253 return *pos_->value();
263 return *pos_->value();
272 inline IndexType index()
const {
273 return pos_->index();
287 template<
typename SparseElementType
288 ,
typename IteratorType >
293 typedef std::forward_iterator_tag IteratorCategory;
294 typedef SparseElementType ValueType;
295 typedef SparseElementType PointerType;
296 typedef SparseElementType ReferenceType;
297 typedef ptrdiff_t DifferenceType;
300 typedef IteratorCategory iterator_category;
301 typedef ValueType value_type;
302 typedef PointerType pointer;
303 typedef ReferenceType reference;
304 typedef DifferenceType difference_type;
310 inline SharedIterator()
320 inline SharedIterator( IteratorType pos )
330 template<
typename SparseElementType2,
typename IteratorType2 >
331 inline SharedIterator(
const SharedIterator<SparseElementType2,IteratorType2>& it )
341 inline SharedIterator& operator++() {
352 inline const SharedIterator operator++(
int ) {
353 const SharedIterator tmp( *
this );
365 return ReferenceType( pos_ );
374 inline PointerType operator->()
const {
375 return PointerType( pos_ );
385 inline bool operator==(
const SharedIterator& rhs )
const {
386 return pos_ == rhs.pos_;
396 inline bool operator!=(
const SharedIterator& rhs )
const {
397 return !( *
this == rhs );
407 inline DifferenceType
operator-(
const SharedIterator& rhs )
const {
408 return pos_ - rhs.pos_;
417 inline IteratorType base()
const {
428 template<
typename SparseElementType2,
typename IteratorType2 >
friend class SharedIterator;
435 typedef SharedIterator< SharedElement< typename MatrixType::Iterator >
440 typedef SharedIterator< const SharedElement< typename MatrixType::ConstIterator >
447 enum { smpAssignable = 0 };
453 explicit inline SymmetricMatrix();
454 explicit inline SymmetricMatrix(
size_t n );
455 explicit inline SymmetricMatrix(
size_t n,
size_t nonzeros );
456 explicit inline SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros );
458 inline SymmetricMatrix(
const SymmetricMatrix& m );
459 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,SO>& m );
460 template<
typename MT2 >
inline SymmetricMatrix(
const Matrix<MT2,!SO>& m );
471 inline Reference operator()(
size_t i,
size_t j );
485 inline SymmetricMatrix& operator=(
const SymmetricMatrix& rhs );
487 template<
typename MT2 >
488 inline typename DisableIf< IsComputation<MT2>, SymmetricMatrix& >::Type
489 operator=(
const Matrix<MT2,SO>& rhs );
491 template<
typename MT2 >
492 inline typename EnableIf< IsComputation<MT2>, SymmetricMatrix& >::Type
493 operator=(
const Matrix<MT2,SO>& rhs );
495 template<
typename MT2 >
496 inline SymmetricMatrix& operator=(
const Matrix<MT2,!SO>& rhs );
498 template<
typename MT2 >
499 inline SymmetricMatrix& operator+=(
const Matrix<MT2,SO>& rhs );
501 template<
typename MT2 >
502 inline SymmetricMatrix& operator+=(
const Matrix<MT2,!SO>& rhs );
504 template<
typename MT2 >
505 inline SymmetricMatrix& operator-=(
const Matrix<MT2,SO>& rhs );
507 template<
typename MT2 >
508 inline SymmetricMatrix& operator-=(
const Matrix<MT2,!SO>& rhs );
510 template<
typename MT2,
bool SO2 >
511 inline SymmetricMatrix& operator*=(
const Matrix<MT2,SO2>& rhs );
513 template<
typename Other >
514 inline typename EnableIf< IsNumeric<Other>, SymmetricMatrix >::Type&
515 operator*=( Other rhs );
517 template<
typename Other >
518 inline typename EnableIf< IsNumeric<Other>, SymmetricMatrix >::Type&
519 operator/=( Other rhs );
526 inline size_t rows()
const;
529 inline size_t capacity(
size_t i )
const;
531 inline size_t nonZeros(
size_t i )
const;
533 inline void reset(
size_t i );
537 inline void erase(
size_t i,
size_t j );
540 inline void resize (
size_t n,
bool preserve=
true );
541 inline void reserve(
size_t nonzeros );
542 inline void reserve(
size_t i,
size_t nonzeros );
544 inline void trim(
size_t i );
545 inline SymmetricMatrix& transpose();
546 template<
typename Other >
inline SymmetricMatrix& scale(
const Other& scalar );
547 template<
typename Other >
inline SymmetricMatrix& scaleDiagonal( Other scale );
548 inline void swap( SymmetricMatrix& m ) ;
555 inline Iterator find (
size_t i,
size_t j );
557 inline Iterator lowerBound(
size_t i,
size_t j );
559 inline Iterator upperBound(
size_t i,
size_t j );
567 inline void append (
size_t i,
size_t j,
const ElementType& value,
bool check=
false );
568 inline void finalize(
size_t i );
576 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
577 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
579 inline bool canSMPAssign()
const;
587 template<
typename MT2 >
void assign( DenseMatrix<MT2,SO>& rhs );
588 template<
typename MT2 >
void assign(
const DenseMatrix<MT2,SO>& rhs );
589 template<
typename MT2 >
void assign( SparseMatrix<MT2,SO>& rhs );
590 template<
typename MT2 >
void assign(
const SparseMatrix<MT2,SO>& rhs );
602 template<
typename MT2,
bool SO2,
bool DF2,
bool NF2 >
603 friend bool isDefault(
const SymmetricMatrix<MT2,SO2,DF2,NF2>& m );
638 template<
typename MT
640 inline SymmetricMatrix<MT,SO,false,false>::SymmetricMatrix()
657 template<
typename MT
659 inline SymmetricMatrix<MT,SO,false,false>::SymmetricMatrix(
size_t n )
679 template<
typename MT
681 inline SymmetricMatrix<MT,SO,false,false>::SymmetricMatrix(
size_t n,
size_t nonzeros )
682 : matrix_( n, n, nonzeros )
701 template<
typename MT
703 inline SymmetricMatrix<MT,SO,false,false>::SymmetricMatrix(
size_t n,
const std::vector<size_t>& nonzeros )
704 : matrix_( n, n, nonzeros )
720 template<
typename MT
722 inline SymmetricMatrix<MT,SO,false,false>::SymmetricMatrix(
const SymmetricMatrix& m )
727 resize( matrix_, m.rows(), m.columns() );
746 template<
typename MT
748 template<
typename MT2 >
749 inline SymmetricMatrix<MT,SO,false,false>::SymmetricMatrix(
const Matrix<MT2,SO>& m )
754 typedef typename RemoveAdaptor<typename MT2::ResultType>::Type RT;
755 typedef typename If< IsComputation<MT2>, RT,
const MT2& >::Type Tmp;
757 if( IsLower<MT2>::value || IsUpper<MT2>::value )
758 throw std::invalid_argument(
"Invalid setup of symmetric matrix" );
762 if( !IsSymmetric<MT2>::value && !
isSymmetric( tmp ) )
763 throw std::invalid_argument(
"Invalid setup of symmetric matrix" );
765 resize( matrix_, tmp.rows(), tmp.columns() );
784 template<
typename MT
786 template<
typename MT2 >
787 inline SymmetricMatrix<MT,SO,false,false>::SymmetricMatrix(
const Matrix<MT2,!SO>& m )
792 typedef typename RemoveAdaptor<typename MT2::ResultType>::Type RT;
793 typedef typename If< IsComputation<MT2>, RT,
const MT2& >::Type Tmp;
795 if( IsLower<MT2>::value || IsUpper<MT2>::value )
796 throw std::invalid_argument(
"Invalid setup of symmetric matrix" );
800 if( !IsSymmetric<MT2>::value && !
isSymmetric( tmp ) )
801 throw std::invalid_argument(
"Invalid setup of symmetric matrix" );
803 resize( matrix_, tmp.rows(), tmp.columns() );
832 template<
typename MT
835 SymmetricMatrix<MT,SO,false,false>::operator()(
size_t i,
size_t j )
858 template<
typename MT
861 SymmetricMatrix<MT,SO,false,false>::operator()(
size_t i,
size_t j )
const
866 return *matrix_(i,j);
884 template<
typename MT
889 return Iterator( matrix_.begin(i) );
907 template<
typename MT
930 template<
typename MT
953 template<
typename MT
976 template<
typename MT
999 template<
typename MT
1028 template<
typename MT
1030 inline SymmetricMatrix<MT,SO,false,false>&
1031 SymmetricMatrix<MT,SO,false,false>::operator=(
const SymmetricMatrix& rhs )
1035 if( &rhs ==
this )
return *
this;
1037 resize( matrix_, rhs.rows(), rhs.columns() );
1063 template<
typename MT
1065 template<
typename MT2 >
1066 inline typename DisableIf< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,false>& >::Type
1067 SymmetricMatrix<MT,SO,false,false>::operator=(
const Matrix<MT2,SO>& rhs )
1071 if( IsLower<MT2>::value || IsUpper<MT2>::value ||
1072 ( !IsSymmetric<MT2>::value && !
isSymmetric( ~rhs ) ) )
1073 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1075 if( (~rhs).canAlias(
this ) ) {
1076 SymmetricMatrix tmp( ~rhs );
1107 template<
typename MT
1109 template<
typename MT2 >
1110 inline typename EnableIf< IsComputation<MT2>, SymmetricMatrix<MT,SO,false,false>& >::Type
1111 SymmetricMatrix<MT,SO,false,false>::operator=(
const Matrix<MT2,SO>& rhs )
1115 if( IsLower<MT2>::value || IsUpper<MT2>::value || !
isSquare( ~rhs ) )
1116 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1120 if( !IsSymmetric<MT2>::value && !
isSymmetric( tmp ) )
1121 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1123 resize( matrix_, tmp.rows(), tmp.columns() );
1149 template<
typename MT
1151 template<
typename MT2 >
1152 inline SymmetricMatrix<MT,SO,false,false>&
1153 SymmetricMatrix<MT,SO,false,false>::operator=(
const Matrix<MT2,!SO>& rhs )
1155 return this->operator=(
trans( ~rhs ) );
1174 template<
typename MT
1176 template<
typename MT2 >
1177 inline SymmetricMatrix<MT,SO,false,false>&
1178 SymmetricMatrix<MT,SO,false,false>::operator+=(
const Matrix<MT2,SO>& rhs )
1182 typedef typename AddTrait<MT,typename MT2::ResultType>::Type Tmp;
1184 if( IsLower<MT2>::value || IsUpper<MT2>::value || !
isSquare( ~rhs ) )
1185 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1187 Tmp tmp( (*
this) + ~rhs );
1189 if( !IsSymmetric<Tmp>::value && !
isSymmetric( tmp ) )
1190 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1192 resize( matrix_, tmp.rows(), tmp.columns() );
1218 template<
typename MT
1220 template<
typename MT2 >
1221 inline SymmetricMatrix<MT,SO,false,false>&
1222 SymmetricMatrix<MT,SO,false,false>::operator+=(
const Matrix<MT2,!SO>& rhs )
1224 return this->operator+=(
trans( ~rhs ) );
1243 template<
typename MT
1245 template<
typename MT2 >
1246 inline SymmetricMatrix<MT,SO,false,false>&
1247 SymmetricMatrix<MT,SO,false,false>::operator-=(
const Matrix<MT2,SO>& rhs )
1251 typedef typename SubTrait<MT,typename MT2::ResultType>::Type Tmp;
1253 if( IsLower<MT2>::value || IsUpper<MT2>::value || !
isSquare( ~rhs ) )
1254 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1256 Tmp tmp( (*
this) - ~rhs );
1258 if( !IsSymmetric<Tmp>::value && !
isSymmetric( tmp ) )
1259 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1261 resize( matrix_, tmp.rows(), tmp.columns() );
1287 template<
typename MT
1289 template<
typename MT2 >
1290 inline SymmetricMatrix<MT,SO,false,false>&
1291 SymmetricMatrix<MT,SO,false,false>::operator-=(
const Matrix<MT2,!SO>& rhs )
1293 return this->operator-=(
trans( ~rhs ) );
1311 template<
typename MT
1313 template<
typename MT2
1315 inline SymmetricMatrix<MT,SO,false,false>&
1316 SymmetricMatrix<MT,SO,false,false>::operator*=(
const Matrix<MT2,SO2>& rhs )
1320 typedef typename MultTrait<MT,typename MT2::ResultType>::Type Tmp;
1322 if( matrix_.rows() != (~rhs).
columns() )
1323 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1325 Tmp tmp( (*
this) * ~rhs );
1327 if( !IsSymmetric<Tmp>::value && !
isSymmetric( tmp ) )
1328 throw std::invalid_argument(
"Invalid assignment to symmetric matrix" );
1330 resize( matrix_, tmp.rows(), tmp.columns() );
1350 template<
typename MT
1352 template<
typename Other >
1353 inline typename EnableIf< IsNumeric<Other>, SymmetricMatrix<MT,SO,false,false> >::Type&
1354 SymmetricMatrix<MT,SO,false,false>::operator*=( Other rhs )
1356 for(
size_t i=0UL; i<
rows(); ++i ) {
1359 *element->value() *= rhs;
1376 template<
typename MT
1378 template<
typename Other >
1379 inline typename EnableIf< IsNumeric<Other>, SymmetricMatrix<MT,SO,false,false> >::Type&
1380 SymmetricMatrix<MT,SO,false,false>::operator/=( Other rhs )
1384 for(
size_t i=0UL; i<
rows(); ++i ) {
1387 *element->value() /= rhs;
1410 template<
typename MT
1414 return matrix_.rows();
1426 template<
typename MT
1430 return matrix_.columns();
1442 template<
typename MT
1446 return matrix_.capacity();
1463 template<
typename MT
1467 return matrix_.capacity(i);
1479 template<
typename MT
1483 return matrix_.nonZeros();
1501 template<
typename MT
1505 return matrix_.nonZeros(i);
1517 template<
typename MT
1567 template<
typename MT
1573 const size_t j( it->index() );
1581 matrix_.erase( j, pos );
1586 matrix_.erase( j, pos );
1604 template<
typename MT
1630 template<
typename MT
1635 SharedValue<ET> shared( value );
1638 matrix_.set( j, i, shared );
1640 return Iterator( matrix_.set( i, j, shared ) );
1661 template<
typename MT
1664 SymmetricMatrix<MT,SO,false,false>::insert(
size_t i,
size_t j,
const ElementType& value )
1666 SharedValue<ET> shared( value );
1669 matrix_.insert( j, i, shared );
1671 return Iterator( matrix_.insert( i, j, shared ) );
1687 template<
typename MT
1689 inline void SymmetricMatrix<MT,SO,false,false>::erase(
size_t i,
size_t j )
1691 matrix_.erase( i, j );
1693 matrix_.erase( j, i );
1711 template<
typename MT
1714 SymmetricMatrix<MT,SO,false,false>::erase(
size_t i,
Iterator pos )
1716 if( pos ==
end( i ) )
1719 const size_t j( pos->index() );
1722 return Iterator( matrix_.erase( i, pos.base() ) );
1726 matrix_.erase( j, matrix_.find( i, j ) );
1727 return Iterator( matrix_.erase( i, pos.base() ) );
1731 matrix_.erase( j, matrix_.find( j, i ) );
1732 return Iterator( matrix_.erase( i, pos.base() ) );
1753 template<
typename MT
1756 SymmetricMatrix<MT,SO,false,false>::erase(
size_t i,
Iterator first,
Iterator last )
1758 for(
Iterator it=first; it!=last; ++it )
1760 const size_t j( it->index() );
1767 matrix_.erase( i, j );
1771 matrix_.erase( j, i );
1775 return Iterator( matrix_.erase( i, first.base(), last.base() ) );
1796 template<
typename MT
1806 matrix_.resize( n, n,
true );
1823 template<
typename MT
1825 inline void SymmetricMatrix<MT,SO,false,false>::reserve(
size_t nonzeros )
1827 matrix_.reserve( nonzeros );
1847 template<
typename MT
1849 inline void SymmetricMatrix<MT,SO,false,false>::reserve(
size_t i,
size_t nonzeros )
1851 matrix_.reserve( i, nonzeros );
1868 template<
typename MT
1870 inline void SymmetricMatrix<MT,SO,false,false>::trim()
1890 template<
typename MT
1892 inline void SymmetricMatrix<MT,SO,false,false>::trim(
size_t i )
1906 template<
typename MT
1908 inline SymmetricMatrix<MT,SO,false,false>& SymmetricMatrix<MT,SO,false,false>::transpose()
1923 template<
typename MT
1925 template<
typename Other >
1926 inline SymmetricMatrix<MT,SO,false,false>&
1927 SymmetricMatrix<MT,SO,false,false>::scale(
const Other& scalar )
1929 for(
size_t i=0UL; i<
rows(); ++i ) {
1932 ( *element->value() ).scale( scalar );
1948 template<
typename MT
1950 template<
typename Other >
1951 inline SymmetricMatrix<MT,SO,false,false>&
1952 SymmetricMatrix<MT,SO,false,false>::scaleDiagonal( Other scalar )
1954 matrix_.scaleDiagonal( scalar );
1969 template<
typename MT
1975 swap( matrix_, m.matrix_ );
2005 template<
typename MT
2008 SymmetricMatrix<MT,SO,false,false>::find(
size_t i,
size_t j )
2010 return Iterator( matrix_.find( i, j ) );
2032 template<
typename MT
2035 SymmetricMatrix<MT,SO,false,false>::find(
size_t i,
size_t j )
const
2059 template<
typename MT
2062 SymmetricMatrix<MT,SO,false,false>::lowerBound(
size_t i,
size_t j )
2064 return Iterator( matrix_.lowerBound( i, j ) );
2086 template<
typename MT
2089 SymmetricMatrix<MT,SO,false,false>::lowerBound(
size_t i,
size_t j )
const
2113 template<
typename MT
2116 SymmetricMatrix<MT,SO,false,false>::upperBound(
size_t i,
size_t j )
2118 return Iterator( matrix_.upperBound( i, j ) );
2140 template<
typename MT
2143 SymmetricMatrix<MT,SO,false,false>::upperBound(
size_t i,
size_t j )
const
2214 template<
typename MT
2216 inline void SymmetricMatrix<MT,SO,false,false>::append(
size_t i,
size_t j,
const ElementType& value,
bool check )
2218 SharedValue<ET> shared( value );
2220 matrix_.append( i, j, shared, check );
2221 if( i != j && ( !check || !
isDefault( value ) ) )
2222 matrix_.insert( j, i, shared );
2242 template<
typename MT
2244 inline void SymmetricMatrix<MT,SO,false,false>::finalize(
size_t i )
2271 template<
typename MT
2273 template<
typename Other >
2274 inline bool SymmetricMatrix<MT,SO,false,false>::canAlias(
const Other* alias )
const
2276 return matrix_.canAlias( alias );
2293 template<
typename MT
2295 template<
typename Other >
2296 inline bool SymmetricMatrix<MT,SO,false,false>::isAliased(
const Other* alias )
const
2298 return matrix_.isAliased( alias );
2315 template<
typename MT
2317 inline bool SymmetricMatrix<MT,SO,false,false>::canSMPAssign()
const
2319 return matrix_.canSMPAssign();
2337 template<
typename MT
2339 template<
typename MT2 >
2347 std::vector<size_t> nonzeros(
rows(), 0UL );
2350 for(
size_t i=0UL; i<
rows(); ++i ) {
2355 matrix_.reserve(
sum );
2356 for(
size_t i=0UL; i<
rows(); ++i ) {
2357 matrix_.reserve( i, nonzeros[i] );
2360 for(
size_t i=0UL; i<
rows(); ++i ) {
2361 for(
size_t j=i; j<
columns(); ++j ) {
2363 SharedValue<ET> shared;
2364 move( *shared, (~rhs)(i,j) );
2365 matrix_.append( i, j, shared,
false );
2367 matrix_.append( j, i, shared,
false );
2388 template<
typename MT
2390 template<
typename MT2 >
2398 std::vector<size_t> nonzeros(
rows(), 0UL );
2401 for(
size_t i=0UL; i<
rows(); ++i ) {
2406 matrix_.reserve(
sum );
2407 for(
size_t i=0UL; i<
rows(); ++i ) {
2408 matrix_.reserve( i, nonzeros[i] );
2411 for(
size_t i=0UL; i<
rows(); ++i ) {
2412 for(
size_t j=i; j<
columns(); ++j ) {
2414 const SharedValue<ET> shared( (~rhs)(i,j) );
2415 matrix_.append( i, j, shared,
false );
2417 matrix_.append( j, i, shared,
false );
2438 template<
typename MT
2440 template<
typename MT2 >
2448 std::vector<size_t> nonzeros(
rows(), 0UL );
2451 for(
size_t i=0UL; i<
rows(); ++i ) {
2456 matrix_.reserve(
sum );
2457 for(
size_t i=0UL; i<
rows(); ++i ) {
2458 matrix_.reserve( i, nonzeros[i] );
2461 for(
size_t i=0UL; i<
rows(); ++i ) {
2462 for(
typename MT2::Iterator it=(~rhs).lowerBound(i,i); it!=(~rhs).
end(i); ++it ) {
2464 SharedValue<ET> shared;
2465 move( *shared, it->value() );
2466 matrix_.append( i, it->index(), shared, false );
2467 if( i != it->index() )
2468 matrix_.append( it->index(), i, shared, false );
2489 template<
typename MT
2491 template<
typename MT2 >
2499 std::vector<size_t> nonzeros(
rows(), 0UL );
2502 for(
size_t i=0UL; i<
rows(); ++i ) {
2507 matrix_.reserve(
sum );
2508 for(
size_t i=0UL; i<
rows(); ++i ) {
2509 matrix_.reserve( i, nonzeros[i] );
2512 for(
size_t i=0UL; i<
rows(); ++i ) {
2515 const SharedValue<ET> shared( it->value() );
2516 matrix_.append( i, it->index(), shared, false );
2517 if( i != it->index() )
2518 matrix_.append( it->index(), i, shared, false );
BLAZE_ALWAYS_INLINE int16_t sum(const sse_int16_t &a)
Returns the sum of all elements in the 16-bit integral intrinsic vector.
Definition: Reduction.h:63
#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.
Constraint on the data type.
void swap(SymmetricMatrix< MT, SO, DF, NF > &a, SymmetricMatrix< MT, SO, DF, NF > &b)
Swapping the contents of two matrices.
Definition: SymmetricMatrix.h:195
#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:4838
Header file for the subtraction trait.
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:4772
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
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i...
Definition: Computation.h:118
Constraint on the data type.
bool isSymmetric(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is symmetric.
Definition: DenseMatrix.h:731
Constraint on the data type.
Header file for the SharedValue class.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
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:4709
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:2472
#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.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2474
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:4736
Header file for the multiplication trait.
Header file for the IsSymmetric type trait.
Header file for the clear shim.
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:4754
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
#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
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
BLAZE_ALWAYS_INLINE void clear(const NonNumericProxy< MT > &proxy)
Clearing the represented element.
Definition: NonNumericProxy.h:854
Constraint on the data type.
Header file for the IsLower type trait.
Header file for the SparseElement base class.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2475
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
#define BLAZE_CONSTRAINT_MUST_NOT_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is a numeric (integral or floating point) d...
Definition: Numeric.h:118
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:2476
Header file for the RemoveAdaptor type trait.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2480
Header file for the EnableIf class template.
Header file for the NonNumericProxy class.
Header file for the IsNumeric type trait.
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T >, Set< T, sizeof(T)> >::Type::Type set(T value)
Sets all values in the vector to the given integral value.
Definition: Set.h:211
#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:2477
Header file for run time assertion macros.
Header file for the addition trait.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of the base template of the SymmetricMatrix.
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_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:2481
Header file for the isDefault shim.
BLAZE_ALWAYS_INLINE bool isDefault(const NonNumericProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: NonNumericProxy.h:874
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE void reset(const NonNumericProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: NonNumericProxy.h:833
#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:932
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:2473
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 basic type definitions.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2479
Header file for the IsUpper type trait.
#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