35 #ifndef _BLAZE_MATH_VIEWS_SPARSESUBMATRIX_H_
36 #define _BLAZE_MATH_VIEWS_SPARSESUBMATRIX_H_
468 template<
typename MT
470 ,
bool SO = IsColumnMajorMatrix<MT>::value >
471 class SparseSubmatrix :
public SparseMatrix< SparseSubmatrix<MT,AF,SO>, SO >
501 ,
typename IteratorType >
517 typedef typename std::iterator_traits<IteratorType>::value_type
SET;
619 return pos_->value();
645 ,
typename IteratorType >
690 template<
typename MatrixType2,
typename IteratorType2 >
746 template<
typename MatrixType2,
typename IteratorType2 >
758 template<
typename MatrixType2,
typename IteratorType2 >
760 return !( *
this == rhs );
780 inline IteratorType
base()
const {
813 enum { smpAssignable = MT::smpAssignable };
819 explicit inline SparseSubmatrix( Operand matrix,
size_t rindex,
size_t cindex,
size_t m,
size_t n );
831 inline Reference
operator()(
size_t i,
size_t j );
832 inline ConstReference
operator()(
size_t i,
size_t j )
const;
833 inline Reference
at(
size_t i,
size_t j );
834 inline ConstReference
at(
size_t i,
size_t j )
const;
835 inline Iterator
begin (
size_t i );
836 inline ConstIterator
begin (
size_t i )
const;
837 inline ConstIterator
cbegin(
size_t i )
const;
838 inline Iterator
end (
size_t i );
839 inline ConstIterator
end (
size_t i )
const;
840 inline ConstIterator
cend (
size_t i )
const;
854 template<
typename Other >
856 operator*=( Other rhs );
858 template<
typename Other >
860 operator/=( Other rhs );
867 inline size_t row()
const;
868 inline size_t rows()
const;
869 inline size_t column()
const;
872 inline size_t capacity(
size_t i )
const;
874 inline size_t nonZeros(
size_t i )
const;
876 inline void reset(
size_t i );
877 inline Iterator
set(
size_t i,
size_t j,
const ElementType& value );
878 inline Iterator
insert(
size_t i,
size_t j,
const ElementType& value );
879 inline void erase(
size_t i,
size_t j );
880 inline Iterator
erase(
size_t i, Iterator pos );
881 inline Iterator
erase(
size_t i, Iterator first, Iterator last );
882 inline void reserve(
size_t nonzeros );
883 void reserve(
size_t i,
size_t nonzeros );
885 inline void trim(
size_t i );
888 template<
typename Other >
inline SparseSubmatrix& scale(
const Other& scalar );
895 inline Iterator
find (
size_t i,
size_t j );
896 inline ConstIterator
find (
size_t i,
size_t j )
const;
897 inline Iterator
lowerBound(
size_t i,
size_t j );
898 inline ConstIterator
lowerBound(
size_t i,
size_t j )
const;
899 inline Iterator
upperBound(
size_t i,
size_t j );
900 inline ConstIterator
upperBound(
size_t i,
size_t j )
const;
907 inline void append (
size_t i,
size_t j,
const ElementType& value,
bool check=
false );
915 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
916 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
951 template<
bool AF1,
typename MT2,
bool AF2,
bool SO2 >
955 template<
typename MT2,
bool AF2,
bool SO2 >
958 template<
typename MT2,
bool AF2,
bool SO2 >
961 template<
typename MT2,
bool AF2,
bool SO2 >
964 template<
typename MT2,
bool AF2,
bool SO2 >
967 template<
typename MT2,
bool AF2,
bool SO2,
typename VT,
bool TF >
971 template<
typename MT2,
bool AF2,
bool SO2,
typename MT3,
bool SO3 >
975 template<
typename MT2,
bool AF2,
bool SO2,
typename VT,
bool TF >
979 template<
typename MT2,
bool AF2,
bool SO2,
typename MT3,
bool SO3 >
983 template<
typename MT2,
bool AF2,
bool SO2,
typename VT,
bool TF >
987 template<
typename MT2,
bool AF2,
bool SO2,
typename MT3,
bool SO3 >
991 template<
typename MT2,
bool AF2,
bool SO2,
typename VT,
bool TF >
995 template<
typename MT2,
bool AF2,
bool SO2 >
1037 template<
typename MT
1072 template<
typename MT
1081 return matrix_(row_+i,column_+j);
1096 template<
typename MT
1105 return const_cast<const MT&
>( matrix_ )(row_+i,column_+j);
1121 template<
typename MT
1133 return (*
this)(i,j);
1149 template<
typename MT
1161 return (*
this)(i,j);
1177 template<
typename MT
1185 if( column_ == 0UL )
1186 return Iterator( matrix_.begin( i + row_ ), column_ );
1188 return Iterator( matrix_.lowerBound( i + row_, column_ ), column_ );
1204 template<
typename MT
1212 if( column_ == 0UL )
1213 return ConstIterator( matrix_.cbegin( i + row_ ), column_ );
1215 return ConstIterator( matrix_.lowerBound( i + row_, column_ ), column_ );
1231 template<
typename MT
1239 if( column_ == 0UL )
1240 return ConstIterator( matrix_.cbegin( i + row_ ), column_ );
1242 return ConstIterator( matrix_.lowerBound( i + row_, column_ ), column_ );
1258 template<
typename MT
1266 if( matrix_.columns() == column_ +
n_ )
1267 return Iterator( matrix_.end( i + row_ ), column_ );
1269 return Iterator( matrix_.lowerBound( i + row_, column_ +
n_ ), column_ );
1285 template<
typename MT
1293 if( matrix_.columns() == column_ +
n_ )
1296 return ConstIterator( matrix_.lowerBound( i + row_, column_ +
n_ ), column_ );
1312 template<
typename MT
1320 if( matrix_.columns() == column_ +
n_ )
1323 return ConstIterator( matrix_.lowerBound( i + row_, column_ +
n_ ), column_ );
1350 template<
typename MT
1356 using blaze::assign;
1361 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && row_ == rhs.row_ && column_ == rhs.column_ ) )
1364 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
1368 if( !tryAssign( matrix_, rhs, row_, column_ ) ) {
1374 if( rhs.canAlias( &matrix_ ) ) {
1377 assign( left, tmp );
1381 assign( left, rhs );
1405 template<
typename MT
1408 template<
typename MT2
1413 using blaze::assign;
1422 Right right( ~rhs );
1424 if( !tryAssign( matrix_, right, row_, column_ ) ) {
1433 assign( left, tmp );
1437 assign( left, right );
1460 template<
typename MT
1463 template<
typename MT2
1468 using blaze::assign;
1482 const AddType tmp( *
this + (~rhs) );
1484 if( !tryAssign( matrix_, tmp, row_, column_ ) ) {
1491 assign( left, tmp );
1513 template<
typename MT
1516 template<
typename MT2
1521 using blaze::assign;
1535 const SubType tmp( *
this - (~rhs) );
1537 if( !tryAssign( matrix_, tmp, row_, column_ ) ) {
1544 assign( left, tmp );
1566 template<
typename MT
1569 template<
typename MT2
1574 using blaze::assign;
1589 const MultType tmp( *
this * (~rhs) );
1591 if( !tryAssign( matrix_, tmp, row_, column_ ) ) {
1598 assign( left, tmp );
1621 template<
typename MT
1624 template<
typename Other >
1630 for(
size_t i=0UL; i<
rows(); ++i ) {
1633 element->value() *= rhs;
1658 template<
typename MT
1661 template<
typename Other >
1675 const Tmp tmp( Tmp(1)/static_cast<Tmp>( rhs ) );
1676 for(
size_t i=0UL; i<
rows(); ++i ) {
1679 element->value() *= tmp;
1683 for(
size_t i=0UL; i<
rows(); ++i ) {
1686 element->value() /= rhs;
1708 template<
typename MT
1723 template<
typename MT
1738 template<
typename MT
1753 template<
typename MT
1768 template<
typename MT
1773 return nonZeros() + matrix_.capacity() - matrix_.nonZeros();
1789 template<
typename MT
1795 return nonZeros( i ) + matrix_.capacity( row_+i ) - matrix_.nonZeros( row_+i );
1805 template<
typename MT
1810 size_t nonzeros( 0UL );
1812 for(
size_t i=0UL; i<
rows(); ++i )
1831 template<
typename MT
1847 template<
typename MT
1852 for(
size_t i=row_; i<row_+
m_; ++i )
1856 ?(
max( i+1UL, column_ ) )
1857 :(
max( i, column_ ) ) )
1861 ?(
min( i, column_+
n_ ) )
1862 :(
min( i+1UL, column_+
n_ ) ) )
1865 matrix_.erase( i, matrix_.lowerBound( i, jbegin ), matrix_.lowerBound( i, jend ) );
1882 template<
typename MT
1889 const size_t index( row_ + i );
1893 ?(
max( i+1UL, column_ ) )
1894 :(
max( i, column_ ) ) )
1898 ?(
min( i, column_+
n_ ) )
1899 :(
min( i+1UL, column_+
n_ ) ) )
1902 matrix_.erase( index, matrix_.lowerBound( index, jbegin ), matrix_.lowerBound( index, jend ) );
1919 template<
typename MT
1925 return Iterator( matrix_.set( row_+i, column_+j, value ), column_ );
1943 template<
typename MT
1949 return Iterator( matrix_.insert( row_+i, column_+j, value ), column_ );
1963 template<
typename MT
1971 matrix_.erase( row_ + i, column_ + j );
1987 template<
typename MT
1994 return Iterator( matrix_.erase( row_+i, pos.base() ), column_ );
2012 template<
typename MT
2019 return Iterator( matrix_.erase( row_+i, first.base(), last.base() ), column_ );
2034 template<
typename MT
2039 const size_t current(
capacity() );
2041 if( nonzeros > current ) {
2042 matrix_.reserve( matrix_.capacity() + nonzeros - current );
2063 template<
typename MT
2068 const size_t current(
capacity( i ) );
2069 const size_t index ( row_ + i );
2071 if( nonzeros > current ) {
2072 matrix_.reserve( index, matrix_.capacity( index ) + nonzeros - current );
2088 template<
typename MT
2093 for(
size_t i=0UL; i<
rows(); ++i )
2110 template<
typename MT
2116 matrix_.trim( row_ + i );
2138 template<
typename MT
2143 using blaze::assign;
2149 if( !tryAssign( matrix_,
trans( *
this ), row_, column_ ) ) {
2156 assign( left, tmp );
2180 template<
typename MT
2185 using blaze::assign;
2191 if( !tryAssign( matrix_,
trans( *
this ), row_, column_ ) ) {
2198 assign( left, tmp );
2215 template<
typename MT
2218 template<
typename Other >
2223 for(
size_t i=0UL; i<
rows(); ++i ) {
2226 element->value() *= scalar;
2243 template<
typename MT
2250 if( ( row_ +
m_ <= column_ ) || ( column_ +
n_ <= row_ ) )
2280 template<
typename MT
2286 const typename MT::Iterator pos( matrix_.find( row_ + i, column_ + j ) );
2288 if( pos != matrix_.end( row_ + i ) )
2311 template<
typename MT
2319 if( pos != matrix_.end( row_ + i ) )
2342 template<
typename MT
2348 return Iterator( matrix_.lowerBound( row_ + i, column_ + j ), column_ );
2368 template<
typename MT
2374 return ConstIterator( matrix_.lowerBound( row_ + i, column_ + j ), column_ );
2394 template<
typename MT
2400 return Iterator( matrix_.upperBound( row_ + i, column_ + j ), column_ );
2420 template<
typename MT
2426 return ConstIterator( matrix_.upperBound( row_ + i, column_ + j ), column_ );
2487 template<
typename MT
2492 if( column_ +
n_ == matrix_.columns() ) {
2493 matrix_.append( row_ + i, column_ + j, value, check );
2495 else if( !check || !
isDefault( value ) ) {
2496 matrix_.insert( row_ + i, column_ + j, value );
2515 template<
typename MT
2520 matrix_.trim( row_ + i );
2543 template<
typename MT
2546 template<
typename Other >
2549 return matrix_.isAliased( alias );
2564 template<
typename MT
2567 template<
typename Other >
2570 return matrix_.isAliased( alias );
2585 template<
typename MT
2606 template<
typename MT
2609 template<
typename MT2
2618 for(
size_t i=0UL; i<
rows(); ++i ) {
2619 for(
size_t j=0UL; j<
columns(); ++j ) {
2621 set( i, j, (~rhs)(i,j) );
2623 append( i, j, (~rhs)(i,j),
true );
2642 template<
typename MT
2645 template<
typename MT2 >
2653 for(
size_t i=0UL; i<(~rhs).
rows(); ++i ) {
2656 set( i, element->index(), element->value() );
2658 append( i, element->index(), element->value(), true );
2677 template<
typename MT
2680 template<
typename MT2 >
2691 std::vector<size_t> rowLengths(
m_, 0UL );
2692 for(
size_t j=0UL; j<
n_; ++j ) {
2693 for( RhsIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2694 ++rowLengths[element->index()];
2698 for(
size_t i=0UL; i<
m_; ++i ) {
2699 reserve( i, rowLengths[i] );
2703 for(
size_t j=0UL; j<
n_; ++j ) {
2704 for( RhsIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2706 set( element->index(), j, element->value() );
2708 append( element->index(), j, element->value(), true );
2725 template<
typename MT
2728 template<
typename MT2
2740 const AddType tmp(
serial( *
this + (~rhs) ) );
2758 template<
typename MT
2761 template<
typename MT2
2773 const AddType tmp(
serial( *
this + (~rhs) ) );
2791 template<
typename MT
2794 template<
typename MT2
2806 const SubType tmp(
serial( *
this - (~rhs) ) );
2824 template<
typename MT
2827 template<
typename MT2
2839 const SubType tmp(
serial( *
this - (~rhs) ) );
2866 template<
typename MT
2898 ,
typename IteratorType >
2914 typedef typename std::iterator_traits<IteratorType>::value_type
SET;
2922 typedef typename SET::ValueType
ValueType;
2924 typedef typename IfTrue<returnConst,CRT,RT>::Type
Reference;
3015 inline Reference
value()
const {
3016 return pos_->value();
3025 inline IndexType
index()
const {
3042 ,
typename IteratorType >
3043 class SubmatrixIterator
3048 typedef SubmatrixElement<MatrixType,IteratorType>
ValueType;
3087 template<
typename MatrixType2,
typename IteratorType2 >
3088 inline SubmatrixIterator(
const SubmatrixIterator<MatrixType2,IteratorType2>& it )
3122 inline ReferenceType
operator*()
const {
3143 template<
typename MatrixType2,
typename IteratorType2 >
3144 inline bool operator==(
const SubmatrixIterator<MatrixType2,IteratorType2>& rhs )
const {
3145 return base() == rhs.base();
3155 template<
typename MatrixType2,
typename IteratorType2 >
3156 inline bool operator!=(
const SubmatrixIterator<MatrixType2,IteratorType2>& rhs )
const {
3157 return !( *
this == rhs );
3168 return pos_ - rhs.pos_;
3177 inline IteratorType
base()
const {
3187 inline size_t offset()
const {
3202 typedef SubmatrixIterator<const MT,typename MT::ConstIterator>
ConstIterator;
3205 typedef typename If< IsConst<MT>,
ConstIterator, SubmatrixIterator<MT,typename MT::Iterator> >::Type
Iterator;
3210 enum { smpAssignable = MT::smpAssignable };
3216 explicit inline SparseSubmatrix( Operand matrix,
size_t rindex,
size_t cindex,
size_t m,
size_t n );
3228 inline Reference
operator()(
size_t i,
size_t j );
3229 inline ConstReference
operator()(
size_t i,
size_t j )
const;
3230 inline Reference
at(
size_t i,
size_t j );
3231 inline ConstReference
at(
size_t i,
size_t j )
const;
3232 inline Iterator
begin (
size_t i );
3233 inline ConstIterator
begin (
size_t i )
const;
3234 inline ConstIterator
cbegin(
size_t i )
const;
3235 inline Iterator
end (
size_t i );
3236 inline ConstIterator
end (
size_t i )
const;
3237 inline ConstIterator
cend (
size_t i )
const;
3247 template<
typename MT2,
bool SO >
inline SparseSubmatrix& operator+=(
const Matrix<MT2,SO>& rhs );
3248 template<
typename MT2,
bool SO >
inline SparseSubmatrix& operator-=(
const Matrix<MT2,SO>& rhs );
3249 template<
typename MT2,
bool SO >
inline SparseSubmatrix& operator*=(
const Matrix<MT2,SO>& rhs );
3251 template<
typename Other >
3253 operator*=( Other rhs );
3255 template<
typename Other >
3257 operator/=( Other rhs );
3264 inline size_t row()
const;
3265 inline size_t rows()
const;
3266 inline size_t column()
const;
3267 inline size_t columns()
const;
3269 inline size_t capacity(
size_t i )
const;
3271 inline size_t nonZeros(
size_t i )
const;
3272 inline void reset();
3273 inline void reset(
size_t i );
3274 inline Iterator
set(
size_t i,
size_t j,
const ElementType& value );
3275 inline Iterator
insert(
size_t i,
size_t j,
const ElementType& value );
3276 inline void erase(
size_t i,
size_t j );
3277 inline Iterator
erase(
size_t i, Iterator pos );
3278 inline Iterator
erase(
size_t i, Iterator first, Iterator last );
3279 inline void reserve(
size_t nonzeros );
3280 void reserve(
size_t i,
size_t nonzeros );
3282 inline void trim(
size_t j );
3285 template<
typename Other >
inline SparseSubmatrix& scale(
const Other& scalar );
3292 inline Iterator
find (
size_t i,
size_t j );
3293 inline ConstIterator
find (
size_t i,
size_t j )
const;
3294 inline Iterator
lowerBound(
size_t i,
size_t j );
3295 inline ConstIterator
lowerBound(
size_t i,
size_t j )
const;
3296 inline Iterator
upperBound(
size_t i,
size_t j );
3297 inline ConstIterator
upperBound(
size_t i,
size_t j )
const;
3304 inline void append (
size_t i,
size_t j,
const ElementType& value,
bool check=
false );
3312 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
3313 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
3317 template<
typename MT2,
bool SO >
inline void assign (
const DenseMatrix<MT2,SO>& rhs );
3318 template<
typename MT2 >
inline void assign (
const SparseMatrix<MT2,true>& rhs );
3319 template<
typename MT2 >
inline void assign (
const SparseMatrix<MT2,false>& rhs );
3320 template<
typename MT2,
bool SO >
inline void addAssign(
const DenseMatrix<MT2,SO>& rhs );
3321 template<
typename MT2,
bool SO >
inline void addAssign(
const SparseMatrix<MT2,SO>& rhs );
3322 template<
typename MT2,
bool SO >
inline void subAssign(
const DenseMatrix<MT2,SO>& rhs );
3323 template<
typename MT2,
bool SO >
inline void subAssign(
const SparseMatrix<MT2,SO>& rhs );
3347 template<
bool AF1,
typename MT2,
bool AF2,
bool SO2 >
3348 friend const SparseSubmatrix<MT2,AF1,SO2>
3349 submatrix(
const SparseSubmatrix<MT2,AF2,SO2>& sm,
size_t row,
size_t column,
size_t m,
size_t n );
3351 template<
typename MT2,
bool AF2,
bool SO2 >
3352 friend bool isIntact(
const SparseSubmatrix<MT2,AF2,SO2>& sm );
3354 template<
typename MT2,
bool AF2,
bool SO2 >
3355 friend bool isSame(
const SparseSubmatrix<MT2,AF2,SO2>& a,
const SparseMatrix<MT2,SO2>& b );
3357 template<
typename MT2,
bool AF2,
bool SO2 >
3358 friend bool isSame(
const SparseMatrix<MT2,SO2>& a,
const SparseSubmatrix<MT2,AF2,SO2>& b );
3360 template<
typename MT2,
bool AF2,
bool SO2 >
3361 friend bool isSame(
const SparseSubmatrix<MT2,AF2,SO2>& a,
const SparseSubmatrix<MT2,AF2,SO2>& b );
3363 template<
typename MT2,
bool AF2,
bool SO2,
typename VT,
bool TF >
3364 friend bool tryAssign(
const SparseSubmatrix<MT2,AF2,SO2>& lhs,
const Vector<VT,TF>& rhs,
3367 template<
typename MT2,
bool AF2,
bool SO2,
typename MT3,
bool SO3 >
3368 friend bool tryAssign(
const SparseSubmatrix<MT2,AF2,SO2>& lhs,
const Matrix<MT3,SO3>& rhs,
3371 template<
typename MT2,
bool AF2,
bool SO2,
typename VT,
bool TF >
3372 friend bool tryAddAssign(
const SparseSubmatrix<MT2,AF2,SO2>& lhs,
const Vector<VT,TF>& rhs,
3375 template<
typename MT2,
bool AF2,
bool SO2,
typename MT3,
bool SO3 >
3376 friend bool tryAddAssign(
const SparseSubmatrix<MT2,AF2,SO2>& lhs,
const Matrix<MT3,SO3>& rhs,
3379 template<
typename MT2,
bool AF2,
bool SO2,
typename VT,
bool TF >
3380 friend bool trySubAssign(
const SparseSubmatrix<MT2,AF2,SO2>& lhs,
const Vector<VT,TF>& rhs,
3383 template<
typename MT2,
bool AF2,
bool SO2,
typename MT3,
bool SO3 >
3384 friend bool trySubAssign(
const SparseSubmatrix<MT2,AF2,SO2>& lhs,
const Matrix<MT3,SO3>& rhs,
3387 template<
typename MT2,
bool AF2,
bool SO2,
typename VT,
bool TF >
3388 friend bool tryMultAssign(
const SparseSubmatrix<MT2,AF2,SO2>& lhs,
const Vector<VT,TF>& rhs,
3391 template<
typename MT2,
bool AF2,
bool SO2 >
3392 friend typename DerestrictTrait< SparseSubmatrix<MT2,AF2,SO2> >::Type
3393 derestrict( SparseSubmatrix<MT2,AF2,SO2>& sm );
3432 template<
typename MT
3468 template<
typename MT
3476 return matrix_(row_+i,column_+j);
3493 template<
typename MT
3501 return const_cast<const MT&
>( matrix_ )(row_+i,column_+j);
3519 template<
typename MT
3530 return (*
this)(i,j);
3548 template<
typename MT
3559 return (*
this)(i,j);
3572 template<
typename MT
3580 return Iterator( matrix_.begin( j + column_ ), row_ );
3582 return Iterator( matrix_.lowerBound( row_, j + column_ ), row_ );
3595 template<
typename MT
3603 return ConstIterator( matrix_.cbegin( j + column_ ), row_ );
3605 return ConstIterator( matrix_.lowerBound( row_, j + column_ ), row_ );
3618 template<
typename MT
3626 return ConstIterator( matrix_.cbegin( j + column_ ), row_ );
3628 return ConstIterator( matrix_.lowerBound( row_, j + column_ ), row_ );
3641 template<
typename MT
3648 if( matrix_.rows() == row_ +
m_ )
3649 return Iterator( matrix_.end( j + column_ ), row_ );
3651 return Iterator( matrix_.lowerBound( row_ +
m_, j + column_ ), row_ );
3664 template<
typename MT
3671 if( matrix_.rows() == row_ +
m_ )
3674 return ConstIterator( matrix_.lowerBound( row_ +
m_, j + column_ ), row_ );
3687 template<
typename MT
3694 if( matrix_.rows() == row_ +
m_ )
3697 return ConstIterator( matrix_.lowerBound( row_ +
m_, j + column_ ), row_ );
3726 template<
typename MT
3728 inline SparseSubmatrix<MT,AF,true>&
3731 using blaze::assign;
3736 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && row_ == rhs.row_ && column_ == rhs.column_ ) )
3739 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
3743 if( !tryAssign( matrix_, rhs, row_, column_ ) ) {
3747 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3749 if( rhs.canAlias( &matrix_ ) ) {
3750 const ResultType tmp( rhs );
3752 assign( left, tmp );
3756 assign( left, rhs );
3782 template<
typename MT
3784 template<
typename MT2
3786 inline SparseSubmatrix<MT,AF,true>&
3789 using blaze::assign;
3798 Right right( ~rhs );
3800 if( !tryAssign( matrix_, right, row_, column_ ) ) {
3804 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3806 if( IsReference<Right>::value && right.canAlias( &matrix_ ) ) {
3809 assign( left, tmp );
3813 assign( left, right );
3838 template<
typename MT
3840 template<
typename MT2
3842 inline SparseSubmatrix<MT,AF,true>&
3843 SparseSubmatrix<MT,AF,true>::operator+=(
const Matrix<MT2,SO>& rhs )
3845 using blaze::assign;
3851 typedef typename AddTrait<ResultType,typename MT2::ResultType>::Type AddType;
3859 const AddType tmp( *
this + (~rhs) );
3861 if( !tryAssign( matrix_, tmp, row_, column_ ) ) {
3865 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3868 assign( left, tmp );
3892 template<
typename MT
3894 template<
typename MT2
3896 inline SparseSubmatrix<MT,AF,true>&
3897 SparseSubmatrix<MT,AF,true>::operator-=(
const Matrix<MT2,SO>& rhs )
3899 using blaze::assign;
3905 typedef typename SubTrait<ResultType,typename MT2::ResultType>::Type SubType;
3913 const SubType tmp( *
this - (~rhs) );
3915 if( !tryAssign( matrix_, tmp, row_, column_ ) ) {
3919 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3922 assign( left, tmp );
3946 template<
typename MT
3948 template<
typename MT2
3950 inline SparseSubmatrix<MT,AF,true>&
3951 SparseSubmatrix<MT,AF,true>::operator*=(
const Matrix<MT2,SO>& rhs )
3953 using blaze::assign;
3959 typedef typename MultTrait<ResultType,typename MT2::ResultType>::Type MultType;
3968 const MultType tmp( *
this * (~rhs) );
3970 if( !tryAssign( matrix_, tmp, row_, column_ ) ) {
3974 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
3977 assign( left, tmp );
4002 template<
typename MT
4004 template<
typename Other >
4005 inline typename EnableIf< IsNumeric<Other>, SparseSubmatrix<MT,AF,true> >::Type&
4006 SparseSubmatrix<MT,AF,true>::operator*=( Other rhs )
4010 for(
size_t i=0UL; i<
columns(); ++i ) {
4013 element->value() *= rhs;
4040 template<
typename MT
4042 template<
typename Other >
4043 inline typename EnableIf< IsNumeric<Other>, SparseSubmatrix<MT,AF,true> >::Type&
4044 SparseSubmatrix<MT,AF,true>::operator/=( Other rhs )
4050 typedef typename DivTrait<ElementType,Other>::Type DT;
4051 typedef typename If< IsNumeric<DT>, DT, Other >::Type Tmp;
4055 if( IsNumeric<DT>::value && IsFloatingPoint<DT>::value ) {
4056 const Tmp tmp( Tmp(1)/static_cast<Tmp>( rhs ) );
4057 for(
size_t i=0UL; i<
columns(); ++i ) {
4060 element->value() *= tmp;
4064 for(
size_t i=0UL; i<
columns(); ++i ) {
4067 element->value() /= rhs;
4091 template<
typename MT
4107 template<
typename MT
4123 template<
typename MT
4139 template<
typename MT
4155 template<
typename MT
4159 return nonZeros() + matrix_.capacity() - matrix_.nonZeros();
4172 template<
typename MT
4177 return nonZeros( j ) + matrix_.capacity( column_+j ) - matrix_.nonZeros( column_+j );
4189 template<
typename MT
4193 size_t nonzeros( 0UL );
4195 for(
size_t i=0UL; i<
columns(); ++i )
4211 template<
typename MT
4228 template<
typename MT
4232 for(
size_t j=column_; j<column_+
n_; ++j )
4234 const size_t ibegin( ( IsLower<MT>::value )
4235 ?( ( IsUniLower<MT>::value || IsStrictlyLower<MT>::value )
4236 ?(
max( j+1UL, row_ ) )
4237 :(
max( j, row_ ) ) )
4239 const size_t iend ( ( IsUpper<MT>::value )
4240 ?( ( IsUniUpper<MT>::value || IsStrictlyUpper<MT>::value )
4241 ?(
min( j, row_+
m_ ) )
4242 :(
min( j+1UL, row_+
m_ ) ) )
4245 matrix_.erase( j, matrix_.lowerBound( ibegin, j ), matrix_.lowerBound( iend, j ) );
4259 template<
typename MT
4265 const size_t index( column_ + j );
4267 const size_t ibegin( ( IsLower<MT>::value )
4268 ?( ( IsUniLower<MT>::value || IsStrictlyLower<MT>::value )
4269 ?(
max( j+1UL, row_ ) )
4270 :(
max( j, row_ ) ) )
4272 const size_t iend ( ( IsUpper<MT>::value )
4273 ?( ( IsUniUpper<MT>::value || IsStrictlyUpper<MT>::value )
4274 ?(
min( j, row_+
m_ ) )
4275 :(
min( j+1UL, row_+
m_ ) ) )
4278 matrix_.erase( index, matrix_.lowerBound( ibegin, index ), matrix_.lowerBound( iend, index ) );
4297 template<
typename MT
4302 return Iterator( matrix_.set( row_+i, column_+j, value ), row_ );
4322 template<
typename MT
4327 return Iterator( matrix_.insert( row_+i, column_+j, value ), row_ );
4343 template<
typename MT
4350 matrix_.erase( row_ + i, column_ + j );
4366 template<
typename MT
4372 return Iterator( matrix_.erase( column_+j, pos.base() ), row_ );
4389 template<
typename MT
4395 return Iterator( matrix_.erase( column_+j, first.base(), last.base() ), row_ );
4412 template<
typename MT
4416 const size_t current(
capacity() );
4418 if( nonzeros > current ) {
4419 matrix_.reserve( matrix_.capacity() + nonzeros - current );
4438 template<
typename MT
4442 const size_t current(
capacity( j ) );
4443 const size_t index ( column_ + j );
4445 if( nonzeros > current ) {
4446 matrix_.reserve( index, matrix_.capacity( index ) + nonzeros - current );
4463 template<
typename MT
4467 for(
size_t j=0UL; j<
columns(); ++j )
4485 template<
typename MT
4490 matrix_.trim( column_ + j );
4514 template<
typename MT
4518 using blaze::assign;
4524 if( !tryAssign( matrix_,
trans( *
this ), row_, column_ ) ) {
4528 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
4529 const ResultType tmp(
trans( *
this ) );
4531 assign( left, tmp );
4557 template<
typename MT
4561 using blaze::assign;
4567 if( !tryAssign( matrix_,
ctrans( *
this ), row_, column_ ) ) {
4571 typename DerestrictTrait<This>::Type left( derestrict( *
this ) );
4572 const ResultType tmp(
ctrans(*
this) );
4574 assign( left, tmp );
4593 template<
typename MT
4595 template<
typename Other >
4596 inline SparseSubmatrix<MT,AF,true>& SparseSubmatrix<MT,AF,true>::scale(
const Other& scalar )
4600 for(
size_t i=0UL; i<
columns(); ++i ) {
4603 element->value() *= scalar;
4622 template<
typename MT
4626 BLAZE_INTERNAL_ASSERT( IsSymmetric<MT>::value || IsHermitian<MT>::value,
"Invalid matrix detected" );
4628 if( ( row_ +
m_ <= column_ ) || ( column_ + n_ <= row_ ) )
4660 template<
typename MT
4665 const typename MT::Iterator pos( matrix_.find( row_ + i, column_ + j ) );
4667 if( pos != matrix_.end( column_ + j ) )
4692 template<
typename MT
4699 if( pos != matrix_.end( column_ + j ) )
4724 template<
typename MT
4729 return Iterator( matrix_.lowerBound( row_ + i, column_ + j ), row_ );
4751 template<
typename MT
4756 return ConstIterator( matrix_.lowerBound( row_ + i, column_ + j ), row_ );
4778 template<
typename MT
4783 return Iterator( matrix_.upperBound( row_ + i, column_ + j ), row_ );
4805 template<
typename MT
4810 return ConstIterator( matrix_.upperBound( row_ + i, column_ + j ), row_ );
4873 template<
typename MT
4877 if( row_ +
m_ == matrix_.rows() ) {
4878 matrix_.append( row_ + i, column_ + j, value, check );
4880 else if( !check || !
isDefault( value ) ) {
4881 matrix_.insert( row_ + i, column_ + j, value );
4902 template<
typename MT
4906 matrix_.trim( column_ + j );
4931 template<
typename MT
4933 template<
typename Other >
4936 return matrix_.isAliased( alias );
4953 template<
typename MT
4955 template<
typename Other >
4958 return matrix_.isAliased( alias );
4975 template<
typename MT
4997 template<
typename MT
4999 template<
typename MT2
5008 for(
size_t j=0UL; j<
columns(); ++j ) {
5009 for(
size_t i=0UL; i<
rows(); ++i ) {
5010 if( IsSymmetric<MT>::value || IsHermitian<MT>::value )
5011 set( i, j, (~rhs)(i,j) );
5013 append( i, j, (~rhs)(i,j),
true );
5034 template<
typename MT
5036 template<
typename MT2 >
5044 for(
size_t j=0UL; j<(~rhs).
columns(); ++j ) {
5046 if( IsSymmetric<MT>::value || IsHermitian<MT>::value )
5047 set( element->index(), j, element->value() );
5049 append( element->index(), j, element->value(), true );
5070 template<
typename MT
5072 template<
typename MT2 >
5083 std::vector<size_t> columnLengths( n_, 0UL );
5084 for(
size_t i=0UL; i<
m_; ++i ) {
5085 for( RhsIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5086 ++columnLengths[element->index()];
5090 for(
size_t j=0UL; j<
n_; ++j ) {
5091 reserve( j, columnLengths[j] );
5095 for(
size_t i=0UL; i<
m_; ++i ) {
5096 for( RhsIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5097 if( IsSymmetric<MT>::value || IsHermitian<MT>::value )
5098 set( i, element->index(), element->value() );
5100 append( i, element->index(), element->value(), true );
5119 template<
typename MT
5121 template<
typename MT2
5125 typedef typename AddTrait<ResultType,typename MT2::ResultType>::Type AddType;
5133 const AddType tmp(
serial( *
this + (~rhs) ) );
5153 template<
typename MT
5155 template<
typename MT2
5159 typedef typename AddTrait<ResultType,typename MT2::ResultType>::Type AddType;
5167 const AddType tmp(
serial( *
this + (~rhs) ) );
5187 template<
typename MT
5189 template<
typename MT2
5193 typedef typename SubTrait<ResultType,typename MT2::ResultType>::Type SubType;
5201 const SubType tmp(
serial( *
this - (~rhs) ) );
5221 template<
typename MT
5223 template<
typename MT2
5227 typedef typename SubTrait<ResultType,typename MT2::ResultType>::Type SubType;
5235 const SubType tmp(
serial( *
this - (~rhs) ) );
5258 template<
typename MT,
bool AF,
bool SO >
5259 inline void reset( SparseSubmatrix<MT,AF,SO>& sm );
5261 template<
typename MT,
bool AF,
bool SO >
5262 inline void reset( SparseSubmatrix<MT,AF,SO>& sm,
size_t i );
5264 template<
typename MT,
bool AF,
bool SO >
5265 inline void clear( SparseSubmatrix<MT,AF,SO>& sm );
5267 template<
typename MT,
bool AF,
bool SO >
5268 inline bool isDefault(
const SparseSubmatrix<MT,AF,SO>& sm );
5270 template<
typename MT,
bool AF,
bool SO >
5271 inline bool isIntact(
const SparseSubmatrix<MT,AF,SO>& sm );
5273 template<
typename MT,
bool AF,
bool SO >
5274 inline bool isSymmetric(
const SparseSubmatrix<MT,AF,SO>& sm );
5276 template<
typename MT,
bool AF,
bool SO >
5277 inline bool isHermitian(
const SparseSubmatrix<MT,AF,SO>& sm );
5279 template<
typename MT,
bool AF,
bool SO >
5280 inline bool isLower(
const SparseSubmatrix<MT,AF,SO>& sm );
5282 template<
typename MT,
bool AF,
bool SO >
5283 inline bool isUniLower(
const SparseSubmatrix<MT,AF,SO>& sm );
5285 template<
typename MT,
bool AF,
bool SO >
5288 template<
typename MT,
bool AF,
bool SO >
5289 inline bool isUpper(
const SparseSubmatrix<MT,AF,SO>& sm );
5291 template<
typename MT,
bool AF,
bool SO >
5292 inline bool isUniUpper(
const SparseSubmatrix<MT,AF,SO>& sm );
5294 template<
typename MT,
bool AF,
bool SO >
5297 template<
typename MT,
bool AF,
bool SO >
5298 inline bool isSame(
const SparseSubmatrix<MT,AF,SO>& a,
const SparseMatrix<MT,SO>& b );
5300 template<
typename MT,
bool AF,
bool SO >
5301 inline bool isSame(
const SparseMatrix<MT,SO>& a,
const SparseSubmatrix<MT,AF,SO>& b );
5303 template<
typename MT,
bool AF,
bool SO >
5304 inline bool isSame(
const SparseSubmatrix<MT,AF,SO>& a,
const SparseSubmatrix<MT,AF,SO>& b );
5316 template<
typename MT
5339 template<
typename MT
5358 template<
typename MT
5386 template<
typename MT
5395 const size_t iend( ( SO ==
rowMajor)?( sm.rows() ):( sm.columns() ) );
5397 for(
size_t i=0UL; i<iend; ++i ) {
5398 for( ConstIterator element=sm.begin(i); element!=sm.end(i); ++element )
5399 if( !
isDefault( element->value() ) )
return false;
5425 template<
typename MT
5430 return ( sm.row_ + sm.m_ <= sm.matrix_.rows() &&
5431 sm.column_ + sm.n_ <= sm.matrix_.columns() &&
5459 template<
typename MT
5468 else return isSymmetric( static_cast<const BaseType&>( sm ) );
5495 template<
typename MT
5504 else return isHermitian( static_cast<const BaseType&>( sm ) );
5541 template<
typename MT
5550 else return isLower( static_cast<const BaseType&>( sm ) );
5586 template<
typename MT
5595 else return isUniLower( static_cast<const BaseType&>( sm ) );
5631 template<
typename MT
5677 template<
typename MT
5686 else return isUpper( static_cast<const BaseType&>( sm ) );
5722 template<
typename MT
5731 else return isUniUpper( static_cast<const BaseType&>( sm ) );
5767 template<
typename MT
5793 template<
typename MT
5798 return (
isSame( a.matrix_, ~b ) && ( a.rows() == (~b).
rows() ) && ( a.columns() == (~b).
columns() ) );
5815 template<
typename MT
5820 return (
isSame( ~a, b.matrix_ ) && ( (~a).rows() == b.rows() ) && ( (~a).columns() == b.columns() ) );
5837 template<
typename MT
5842 return (
isSame( a.matrix_, b.matrix_ ) &&
5843 ( a.row_ == b.row_ ) && ( a.column_ == b.column_ ) &&
5844 ( a.m_ == b.m_ ) && ( a.n_ == b.n_ ) );
5865 template<
typename MT
5870 inline bool tryAssign(
const SparseSubmatrix<MT,AF,SO>& lhs,
const Vector<VT,TF>& rhs,
5878 return tryAssign( lhs.matrix_, ~rhs, lhs.row_ + row, lhs.column_ + column );
5900 template<
typename MT1
5905 inline bool tryAssign(
const SparseSubmatrix<MT1,AF,SO1>& lhs,
const Matrix<MT2,SO2>& rhs,
5906 size_t row,
size_t column )
5913 return tryAssign( lhs.matrix_, ~rhs, lhs.row_ + row, lhs.column_ + column );
5935 template<
typename MT
5940 inline bool tryAddAssign(
const SparseSubmatrix<MT,AF,SO>& lhs,
const Vector<VT,TF>& rhs,
5941 size_t row,
size_t column )
5948 return tryAddAssign( lhs.matrix_, ~rhs, lhs.row_ + row, lhs.column_ + column );
5970 template<
typename MT1
5975 inline bool tryAddAssign(
const SparseSubmatrix<MT1,AF,SO1>& lhs,
const Matrix<MT2,SO2>& rhs,
5976 size_t row,
size_t column )
5983 return tryAddAssign( lhs.matrix_, ~rhs, lhs.row_ + row, lhs.column_ + column );
6006 template<
typename MT
6011 inline bool trySubAssign(
const SparseSubmatrix<MT,AF,SO>& lhs,
const Vector<VT,TF>& rhs,
6012 size_t row,
size_t column )
6019 return trySubAssign( lhs.matrix_, ~rhs, lhs.row_ + row, lhs.column_ + column );
6042 template<
typename MT1
6047 inline bool trySubAssign(
const SparseSubmatrix<MT1,AF,SO1>& lhs,
const Matrix<MT2,SO2>& rhs,
6048 size_t row,
size_t column )
6055 return trySubAssign( lhs.matrix_, ~rhs, lhs.row_ + row, lhs.column_ + column );
6078 template<
typename MT
6083 inline bool tryMultAssign(
const SparseSubmatrix<MT,AF,SO>& lhs,
const Vector<VT,TF>& rhs,
6084 size_t row,
size_t column )
6091 return tryMultAssign( lhs.matrix_, ~rhs, lhs.row_ + row, lhs.column_ + column );
6112 template<
typename MT
6115 inline typename DerestrictTrait< SparseSubmatrix<MT,AF,SO> >::Type
6116 derestrict( SparseSubmatrix<MT,AF,SO>& sm )
6118 typedef typename DerestrictTrait< SparseSubmatrix<MT,AF,SO> >::Type
ReturnType;
6119 return ReturnType( derestrict( sm.matrix_ ), sm.row_, sm.column_, sm.m_, sm.n_ );
6152 inline const SparseSubmatrix<MT,AF1,SO>
6153 submatrix(
const SparseSubmatrix<MT,AF2,SO>& sm,
size_t row,
size_t column,
size_t m,
size_t n )
6157 if( ( row + m > sm.rows() ) || ( column + n > sm.columns() ) ) {
6161 return SparseSubmatrix<MT,AF1,SO>( sm.matrix_, sm.row_ +
row, sm.column_ +
column, m, n );
6177 template<
typename MT,
bool AF,
bool SO >
6178 struct IsRestricted< SparseSubmatrix<MT,AF,SO> > :
public If< IsRestricted<MT>, TrueType, FalseType >::Type
6180 enum { value = IsRestricted<MT>::value };
6197 template<
typename MT,
bool AF,
bool SO >
6198 struct DerestrictTrait< SparseSubmatrix<MT,AF,SO> >
6200 typedef SparseSubmatrix< typename RemoveReference< typename DerestrictTrait<MT>::Type >::Type, AF > Type;
6216 template<
typename MT,
bool AF,
bool SO,
typename T >
6217 struct AddTrait< SparseSubmatrix<MT,AF,SO>, T >
6219 typedef typename AddTrait< typename SubmatrixTrait<MT>::Type, T >::Type Type;
6222 template<
typename T,
typename MT,
bool AF,
bool TF >
6223 struct AddTrait< T, SparseSubmatrix<MT,AF,TF> >
6225 typedef typename AddTrait< T, typename SubmatrixTrait<MT>::Type >::Type Type;
6241 template<
typename MT,
bool AF,
bool SO,
typename T >
6242 struct SubTrait< SparseSubmatrix<MT,AF,SO>, T >
6244 typedef typename SubTrait< typename SubmatrixTrait<MT>::Type, T >::Type Type;
6247 template<
typename T,
typename MT,
bool AF,
bool TF >
6248 struct SubTrait< T, SparseSubmatrix<MT,AF,TF> >
6250 typedef typename SubTrait< T, typename SubmatrixTrait<MT>::Type >::Type Type;
6266 template<
typename MT,
bool AF,
bool SO,
typename T >
6267 struct MultTrait< SparseSubmatrix<MT,AF,SO>, T >
6269 typedef typename MultTrait< typename SubmatrixTrait<MT>::Type, T >::Type Type;
6272 template<
typename T,
typename MT,
bool AF,
bool TF >
6273 struct MultTrait< T, SparseSubmatrix<MT,AF,TF> >
6275 typedef typename MultTrait< T, typename SubmatrixTrait<MT>::Type >::Type Type;
6291 template<
typename MT,
bool AF,
bool SO,
typename T >
6292 struct DivTrait< SparseSubmatrix<MT,AF,SO>, T >
6294 typedef typename DivTrait< typename SubmatrixTrait<MT>::Type, T >::Type Type;
6297 template<
typename T,
typename MT,
bool AF,
bool TF >
6298 struct DivTrait< T, SparseSubmatrix<MT,AF,TF> >
6300 typedef typename DivTrait< T, typename SubmatrixTrait<MT>::Type >::Type Type;
6316 template<
typename MT,
bool AF,
bool SO >
6317 struct SubmatrixTrait< SparseSubmatrix<MT,AF,SO> >
6335 template<
typename MT,
bool AF1,
bool SO,
bool AF2 >
6336 struct SubmatrixExprTrait< SparseSubmatrix<MT,AF1,SO>, AF2 >
6338 typedef SparseSubmatrix<MT,AF2,SO> Type;
6346 template<
typename MT,
bool AF1,
bool SO,
bool AF2 >
6347 struct SubmatrixExprTrait< const SparseSubmatrix<MT,AF1,SO>, AF2 >
6349 typedef SparseSubmatrix<MT,AF2,SO> Type;
6357 template<
typename MT,
bool AF1,
bool SO,
bool AF2 >
6358 struct SubmatrixExprTrait< volatile SparseSubmatrix<MT,AF1,SO>, AF2 >
6360 typedef SparseSubmatrix<MT,AF2,SO> Type;
6368 template<
typename MT,
bool AF1,
bool SO,
bool AF2 >
6369 struct SubmatrixExprTrait< const volatile SparseSubmatrix<MT,AF1,SO>, AF2 >
6371 typedef SparseSubmatrix<MT,AF2,SO> Type;
6387 template<
typename MT,
bool AF,
bool SO >
6388 struct RowTrait< SparseSubmatrix<MT,AF,SO> >
6406 template<
typename MT,
bool AF,
bool SO >
6407 struct ColumnTrait< SparseSubmatrix<MT,AF,SO> >
If< IsConst< MT >, ConstIterator, SubmatrixIterator< MT, typename MT::Iterator > >::Type Iterator
Iterator over non-constant elements.
Definition: SparseSubmatrix.h:808
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
Constraint on the data type.
Pointer difference type of the Blaze library.
SubmatrixElement & operator*=(const T &v)
Multiplication assignment to the accessed sparse submatrix element.
Definition: SparseSubmatrix.h:585
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1729
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type set(T value)
Sets all values in the vector to the given 2-byte integral value.
Definition: Set.h:73
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:98
Header file for mathematical functions.
ValueType value_type
Type of the underlying elements.
Definition: SparseSubmatrix.h:658
size_t columns() const
Returns the number of columns of the sparse submatrix.
Definition: SparseSubmatrix.h:1756
#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
Iterator lowerBound(size_t i, size_t j)
Returns an iterator to the first index not less then the given index.
Definition: SparseSubmatrix.h:2346
Header file for the alignment flag values.
Header file for the IsUniUpper type trait.
Compile time type selection.The If class template selects one of the two given types T2 and T3 depend...
Definition: If.h:112
Header file for the subtraction trait.
ConstIterator cbegin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: SparseSubmatrix.h:1235
MT::ElementType ElementType
Type of the submatrix elements.
Definition: SparseSubmatrix.h:486
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
SubmatrixIterator()
Default constructor for the SubmatrixIterator class.
Definition: SparseSubmatrix.h:667
Header file for the row trait.
void reserve(size_t nonzeros)
Setting the minimum capacity of the sparse submatrix.
Definition: SparseSubmatrix.h:2037
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:250
bool isStrictlyLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly lower triangular matrix.
Definition: DenseMatrix.h:1201
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SparseSubmatrix.h:650
PointerType pointer
Pointer return type.
Definition: SparseSubmatrix.h:659
Base template for the SubmatrixTrait class.
Definition: SubmatrixTrait.h:118
DifferenceType difference_type
Difference between two iterators.
Definition: SparseSubmatrix.h:661
bool isStrictlyUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly upper triangular matrix.
Definition: DenseMatrix.h:1434
const size_t m_
The number of rows of the submatrix.
Definition: SparseSubmatrix.h:944
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
Header file for the IsDiagonal type trait.
#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
SparseSubmatrix< MT, AF, SO > MatrixType
Type of the matrix.
Definition: Matrix.h:85
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:79
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SparseSubmatrix.h:484
BLAZE_ALWAYS_INLINE bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b)
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:647
SparseSubmatrix< MT, AF, SO > This
Type of this SparseSubmatrix instance.
Definition: SparseSubmatrix.h:482
SubmatrixElement & operator-=(const T &v)
Subtraction assignment to the accessed sparse submatrix element.
Definition: SparseSubmatrix.h:573
bool isSymmetric(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is symmetric.
Definition: DenseMatrix.h:697
Reference operator()(size_t i, size_t j)
2D-access to the sparse submatrix elements.
Definition: SparseSubmatrix.h:1076
Header file for the IsColumnMajorMatrix type trait.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
size_t row() const
Returns the index of the first row of the submatrix in the underlying sparse matrix.
Definition: SparseSubmatrix.h:1711
SubmatrixIterator(const SubmatrixIterator< MatrixType2, IteratorType2 > &it)
Conversion constructor from different SubmatrixIterator instances.
Definition: SparseSubmatrix.h:691
size_t m_
The current number of rows of the sparse matrix.
Definition: CompressedMatrix.h:2749
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
void addAssign(const DenseMatrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a dense matrix.
Definition: SparseSubmatrix.h:2730
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix)
Returns the maximum capacity of the matrix.
Definition: Matrix.h:340
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:308
void reset()
Reset to the default initial values.
Definition: SparseSubmatrix.h:1850
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename ColumnExprTrait< MT >::Type >::Type column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:107
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SUBMATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a submatrix type (i.e. a dense or sparse submatrix), a compilation error is created.
Definition: Submatrix.h:118
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:90
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower or upper unitriangular matrix ty...
Definition: UniTriangular.h:118
CRT ConstReference
Reference-to-const return type.
Definition: SparseSubmatrix.h:528
SubmatrixElement & operator+=(const T &v)
Addition assignment to the accessed sparse submatrix element.
Definition: SparseSubmatrix.h:561
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
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:378
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:90
Constraints on the storage order of matrix types.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a transposition expression (i...
Definition: TransExpr.h:118
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: SparseSubmatrix.h:487
const size_t column_
The first column of the submatrix.
Definition: SparseSubmatrix.h:943
Iterator find(size_t i, size_t j)
Searches for a specific submatrix element.
Definition: SparseSubmatrix.h:2284
bool operator==(const SubmatrixIterator< MatrixType2, IteratorType2 > &rhs) const
Equality comparison between two SubmatrixIterator objects.
Definition: SparseSubmatrix.h:747
Header file for the IsUniLower type trait.
Base class for all submatrices.The Submatrix class serves as a tag for all submatrices (i...
Definition: Submatrix.h:64
bool isLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a lower triangular matrix.
Definition: DenseMatrix.h:1044
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:117
Iterator end(size_t i)
Returns an iterator just past the last non-zero element of row/column i.
Definition: SparseSubmatrix.h:1262
IteratorCategory iterator_category
The iterator category.
Definition: SparseSubmatrix.h:657
std::iterator_traits< IteratorType >::value_type SET
Type of the underlying sparse elements.
Definition: SparseSubmatrix.h:517
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
Constraint on the data type.
size_t capacity() const
Returns the maximum capacity of the sparse submatrix.
Definition: SparseSubmatrix.h:1771
Header file for the SparseMatrix base class.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse submatrix.
Definition: SparseSubmatrix.h:1808
const size_t n_
The number of columns of the submatrix.
Definition: SparseSubmatrix.h:945
size_t offset_
Offset within the according row/column of the sparse matrix.
Definition: SparseSubmatrix.h:636
Constraint on the data type.
Header file for the matrix storage order types.
Constraint on the data type.
MT::ConstReference ConstReference
Reference to a constant submatrix value.
Definition: SparseSubmatrix.h:491
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:85
ConstIterator cend(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: SparseSubmatrix.h:1316
size_t rows() const
Returns the number of rows of the sparse submatrix.
Definition: SparseSubmatrix.h:1726
bool hasOverlap() const
Checking whether there exists an overlap in the context of a symmetric matrix.
Definition: SparseSubmatrix.h:2246
Header file for the DisableIf class template.
IteratorType base() const
Access to the current position of the submatrix iterator.
Definition: SparseSubmatrix.h:780
Reference value() const
Access to the current value of the sparse submatrix element.
Definition: SparseSubmatrix.h:618
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Operand matrix_
The sparse matrix containing the submatrix.
Definition: SparseSubmatrix.h:941
const size_t row_
The first row of the submatrix.
Definition: SparseSubmatrix.h:942
Header file for the IsSymmetric type trait.
size_t offset_
The offset of the according row/column of the sparse matrix.
Definition: SparseSubmatrix.h:798
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Header file for the IsFloatingPoint type trait.
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: ColumnMajorMatrix.h:79
SparseSubmatrix & operator=(const SparseSubmatrix &rhs)
Copy assignment operator for SparseSubmatrix.
Definition: SparseSubmatrix.h:1354
IteratorType pos_
Iterator to the current position within the sparse submatrix.
Definition: SparseSubmatrix.h:635
void append(size_t i, size_t j, const ElementType &value, bool check=false)
Appending an element to the specified row/column of the sparse submatrix.
Definition: SparseSubmatrix.h:2490
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
#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
Header file for the Or class template.
SubmatrixElement< MatrixType, IteratorType > ValueType
Type of the underlying elements.
Definition: SparseSubmatrix.h:651
Constraint on the data type.
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
const MT::ElementType min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1682
SubmatrixTrait< MT >::Type ResultType
Result type for expression template evaluations.
Definition: SparseSubmatrix.h:483
const CTransExprTrait< MT >::Type ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatConjExpr.h:974
Access proxy for a specific element of the sparse submatrix.
Definition: SparseSubmatrix.h:502
IndexType index() const
Access to the current index of the sparse element.
Definition: SparseSubmatrix.h:628
size_t column() const
Returns the index of the first column of the submatrix in the underlying sparse matrix.
Definition: SparseSubmatrix.h:1741
bool isAliased(const Other *alias) const
Returns whether the submatrix is aliased with the given address alias.
Definition: SparseSubmatrix.h:2568
Iterator begin(size_t i)
Returns an iterator to the first non-zero element of row/column i.
Definition: SparseSubmatrix.h:1181
Iterator upperBound(size_t i, size_t j)
Returns an iterator to the first index greater then the given index.
Definition: SparseSubmatrix.h:2398
Header file for the IsLower type trait.
Iterator set(size_t i, size_t j, const ElementType &value)
Setting an element of the sparse submatrix.
Definition: SparseSubmatrix.h:1923
If< IsConst< MT >, ConstReference, typename MT::Reference >::Type Reference
Reference to a non-constant submatrix value.
Definition: SparseSubmatrix.h:494
Header file for the SparseElement base class.
void erase(size_t i, size_t j)
Erasing an element from the sparse submatrix.
Definition: SparseSubmatrix.h:1966
Constraint on the data type.
DifferenceType operator-(const SubmatrixIterator &rhs) const
Calculating the number of elements between two submatrix iterators.
Definition: SparseSubmatrix.h:770
bool isUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper triangular matrix.
Definition: DenseMatrix.h:1277
ValueType PointerType
Pointer return type.
Definition: SparseSubmatrix.h:652
Iterator insert(size_t i, size_t j, const ElementType &value)
Inserting an element into the sparse submatrix.
Definition: SparseSubmatrix.h:1947
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
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:187
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
bool isUniLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a lower unitriangular matrix.
Definition: DenseMatrix.h:1121
Compile time check for floating point data types.This type trait tests whether or not the given templ...
Definition: IsFloatingPoint.h:94
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
const bool unaligned
Alignment flag for unaligned vectors and matrices.Via this flag it is possible to specify subvectors...
Definition: AlignmentFlag.h:64
Constraint on the data type.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2590
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:527
ReferenceType operator*() const
Direct access to the current sparse submatrix element.
Definition: SparseSubmatrix.h:725
Header file for the serial shim.
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:85
Header file for the DerestrictTrait class template.
bool canSMPAssign() const
Returns whether the submatrix can be used in SMP assignments.
Definition: SparseSubmatrix.h:2588
Constraint on the data type.
Header file for the IsNumeric type trait.
SET::ConstReference CRT
Reference-to-const type of the underlying sparse element.
Definition: SparseSubmatrix.h:520
PointerType operator->() const
Direct access to the current sparse submatrix element.
Definition: SparseSubmatrix.h:735
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename RowExprTrait< MT >::Type >::Type row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:107
Reference at(size_t i, size_t j)
Checked access to the submatrix elements.
Definition: SparseSubmatrix.h:1125
const SubmatrixElement * operator->() const
Direct access to the sparse submatrix element at the current iterator position.
Definition: SparseSubmatrix.h:608
const SubmatrixIterator operator++(int)
Post-increment operator.
Definition: SparseSubmatrix.h:713
#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
Header file for the SubmatrixExprTrait class template.
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: RowMajorMatrix.h:79
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
Header file for the IsConst type trait.
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:138
SubmatrixIterator & operator++()
Pre-increment operator.
Definition: SparseSubmatrix.h:702
Base template for the MultTrait class.
Definition: MultTrait.h:138
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
SparseSubmatrix & ctranspose()
In-place conjugate transpose of the submatrix.
Definition: SparseSubmatrix.h:2183
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
SubmatrixElement & operator/=(const T &v)
Division assignment to the accessed sparse submatrix element.
Definition: SparseSubmatrix.h:597
View on a specific submatrix of a sparse matrix.The SparseSubmatrix template represents a view on a s...
Definition: Forward.h:53
#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
void assign(const DenseMatrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a dense matrix.
Definition: SparseSubmatrix.h:2611
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2591
Header file for the column trait.
Header file for the isDefault shim.
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:94
Constraint on the data type.
Constraint on the data type.
Constraints on the storage order of matrix types.
SparseSubmatrix & transpose()
In-place transpose of the submatrix.
Definition: SparseSubmatrix.h:2141
Base class for all sparse element types.The SparseElement class is the base class for all sparse elem...
Definition: SparseElement.h:57
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
Evaluation of the return type of the derestrict function.Via this type trait it is possible to evalua...
Definition: DerestrictTrait.h:74
Header file for the IsReference type trait.
Iterator over the elements of the sparse submatrix.
Definition: SparseSubmatrix.h:646
Header file for the RemoveReference type trait.
Compile time check for constant data types.The IsConst type trait tests whether or not the given temp...
Definition: IsConst.h:94
SubmatrixIterator< const MT, typename MT::ConstIterator > ConstIterator
Iterator over constant elements.
Definition: SparseSubmatrix.h:805
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SparseSubmatrix.h:654
Base template for the DivTrait class.
Definition: DivTrait.h:138
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
size_t n_
The current number of columns of the sparse matrix.
Definition: CompressedMatrix.h:2750
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SparseSubmatrix.h:485
SubmatrixExprTrait< MT, unaligned >::Type submatrix(Matrix< MT, SO > &matrix, size_t row, size_t column, size_t m, size_t n)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:146
SubmatrixElement & operator=(const T &v)
Assignment to the accessed sparse submatrix element.
Definition: SparseSubmatrix.h:549
void subAssign(const DenseMatrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a dense matrix.
Definition: SparseSubmatrix.h:2796
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:164
SET::ValueType ValueType
The value type of the row element.
Definition: SparseSubmatrix.h:525
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:944
const bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71
boost::false_type FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: FalseType.h:61
size_t IndexType
The index type of the row element.
Definition: SparseSubmatrix.h:526
ValueType ReferenceType
Reference return type.
Definition: SparseSubmatrix.h:653
bool isHermitian(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is Hermitian.
Definition: DenseMatrix.h:767
const SparseSubmatrix & CompositeType
Data type for composite expression templates.
Definition: SparseSubmatrix.h:488
ReferenceType reference
Reference return type.
Definition: SparseSubmatrix.h:660
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
SubmatrixIterator(IteratorType iterator, size_t index)
Constructor for the SubmatrixIterator class.
Definition: SparseSubmatrix.h:679
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
void finalize(size_t i)
Finalizing the element insertion of a row/column.
Definition: SparseSubmatrix.h:2518
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:324
SET::Reference RT
Reference type of the underlying sparse element.
Definition: SparseSubmatrix.h:519
Compile time type check.This class tests whether the given template parameter T is a reference type (...
Definition: IsReference.h:94
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:237
SparseSubmatrix(Operand matrix, size_t rindex, size_t cindex, size_t m, size_t n)
The constructor for SparseSubmatrix.
Definition: SparseSubmatrix.h:1040
bool isUniUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper unitriangular matrix.
Definition: DenseMatrix.h:1354
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2589
Base template for the SubTrait class.
Definition: SubTrait.h:138
Header file for the Submatrix base class.
#define BLAZE_THROW_LOGIC_ERROR(MESSAGE)
Macro for the emission of a std::logic_error exceptionThis macro encapsulates the default way of Blaz...
Definition: Exception.h:283
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a N-dimensional matrix type...
Definition: Matrix.h:79
Header file for the IsUpper type trait.
Header file for exception macros.
boost::true_type TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
IfTrue< returnConst, CRT, RT >::Type Reference
Reference return type.
Definition: SparseSubmatrix.h:527
If< IsExpression< MT >, MT, MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: SparseSubmatrix.h:477
IteratorType pos_
Iterator to the current sparse element.
Definition: SparseSubmatrix.h:797
Header file for the IsHermitian type trait.
Header file for the IsRestricted 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
size_t offset() const
Access to the offset of the submatrix iterator.
Definition: SparseSubmatrix.h:790
SubmatrixElement(IteratorType pos, size_t offset)
Constructor for the SubmatrixElement class.
Definition: SparseSubmatrix.h:537
#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
Compile time type selection.The IfTrue class template selects one of the two given types T1 and T2 de...
Definition: If.h:59
Header file for the IsExpression type trait class.
Constraint on the data type.
Header file for the FunctionTrace class.
bool canAlias(const Other *alias) const
Returns whether the submatrix can alias with the given address alias.
Definition: SparseSubmatrix.h:2547
void trim()
Removing all excessive capacity from all rows/columns.
Definition: SparseSubmatrix.h:2091
bool operator!=(const SubmatrixIterator< MatrixType2, IteratorType2 > &rhs) const
Inequality comparison between two SubmatrixIterator objects.
Definition: SparseSubmatrix.h:759