35 #ifndef _BLAZE_MATH_SPARSE_COMPRESSEDMATRIX_H_ 36 #define _BLAZE_MATH_SPARSE_COMPRESSEDMATRIX_H_ 219 template<
typename Type
220 ,
bool SO = defaultStorageOrder >
241 explicit Element() =
default;
242 Element(
const Element& rhs ) =
default;
243 Element( Element&& rhs ) =
default;
247 inline Element&
operator=(
const Element& rhs )
249 this->value_ = rhs.value_;
253 inline Element&
operator=( Element&& rhs )
255 this->value_ = std::move( rhs.value_ );
259 template<
typename Other >
263 this->value_ = rhs.value();
267 template<
typename Other >
272 this->value_ = std::move( rhs.value() );
276 template<
typename Other >
284 template<
typename Other >
286 , IsRValueReference<Other&&> >, Element& >
289 this->value_ = std::move( v );
305 struct Uninitialized {};
328 template<
typename NewType >
337 template<
size_t NewM
358 explicit CompressedMatrix(
size_t m,
size_t n,
const std::vector<size_t>& nonzeros );
396 inline CompressedMatrix&
operator=(
const CompressedMatrix& rhs );
397 inline CompressedMatrix&
operator=( CompressedMatrix&& rhs ) noexcept;
403 template<
typename MT,
bool SO2 >
inline CompressedMatrix& operator%=(
const DenseMatrix<MT,SO2>& rhs );
404 template<
typename MT,
bool SO2 >
inline CompressedMatrix& operator%=(
const SparseMatrix<MT,SO2>& rhs );
411 inline size_t rows()
const noexcept;
412 inline size_t columns()
const noexcept;
413 inline size_t capacity()
const noexcept;
414 inline size_t capacity(
size_t i )
const noexcept;
416 inline size_t nonZeros(
size_t i )
const;
418 inline void reset(
size_t i );
420 void resize (
size_t m,
size_t n,
bool preserve=
true );
421 inline void reserve(
size_t nonzeros );
422 void reserve(
size_t i,
size_t nonzeros );
424 inline void trim (
size_t i );
426 inline void swap( CompressedMatrix& sm ) noexcept;
433 inline Iterator set (
size_t i,
size_t j,
const Type& value );
435 inline void append (
size_t i,
size_t j,
const Type& value,
bool check=
false );
443 inline void erase(
size_t i,
size_t j );
447 template<
typename Pred >
448 inline void erase( Pred predicate );
450 template<
typename Pred >
473 template<
typename Other >
inline CompressedMatrix& scale(
const Other& scalar );
480 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
481 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
556 template<
typename Type,
bool SO >
571 template<
typename Type
591 template<
typename Type
596 for(
size_t i=1UL; i<2UL*
m_+2UL; ++i )
611 template<
typename Type
616 begin_[0UL] = allocate<Element>( nonzeros );
617 for(
size_t i=1UL; i<(2UL*
m_+1UL); ++i )
635 template<
typename Type
640 BLAZE_USER_ASSERT( nonzeros.size() == m,
"Size of capacity vector and number of rows don't match" );
642 size_t newCapacity( 0UL );
643 for( std::vector<size_t>::const_iterator it=nonzeros.begin(); it!=nonzeros.end(); ++it )
646 begin_[0UL] =
end_[0UL] = allocate<Element>( newCapacity );
647 for(
size_t i=0UL; i<
m_; ++i ) {
674 template<
typename Type
681 for(
const auto& rowList : list )
685 for(
const Type& element : rowList ) {
686 if( !isDefault<strict>( element ) )
703 template<
typename Type
708 const size_t nonzeros( sm.
nonZeros() );
710 begin_[0UL] = allocate<Element>( nonzeros );
711 for(
size_t i=0UL; i<
m_; ++i ) {
713 begin_[i+1UL] =
end_[i];
715 end_[
m_] = begin_[0UL]+nonzeros;
725 template<
typename Type
748 template<
typename Type
750 template<
typename MT
767 template<
typename Type
769 template<
typename MT
787 template<
typename Type
812 template<
typename Type
845 template<
typename Type
868 template<
typename Type
878 if( pos ==
end_[i] || pos->index_ != j )
899 template<
typename Type
926 template<
typename Type
953 template<
typename Type
975 template<
typename Type
997 template<
typename Type
1019 template<
typename Type
1041 template<
typename Type
1063 template<
typename Type
1103 template<
typename Type
1115 for(
const auto& rowList : list )
1119 for(
const Type& element : rowList ) {
1120 if( !isDefault<strict>( element ) )
1143 template<
typename Type
1150 if( &rhs ==
this )
return *
this;
1152 const size_t nonzeros( rhs.
nonZeros() );
1159 newBegin[0UL] = allocate<Element>( nonzeros );
1160 for(
size_t i=0UL; i<rhs.
m_; ++i ) {
1162 newBegin[i+1UL] = newEnd[i];
1164 newEnd[rhs.
m_] = newBegin[0UL]+nonzeros;
1170 if( newBegin !=
nullptr ) {
1176 for(
size_t i=0UL; i<rhs.
m_; ++i ) {
1196 template<
typename Type
1201 if(
begin_ !=
nullptr ) {
1214 rhs.capacity_ = 0UL;
1215 rhs.begin_ =
nullptr;
1232 template<
typename Type
1234 template<
typename MT
1239 using blaze::assign;
1264 template<
typename Type
1266 template<
typename MT
1271 using blaze::assign;
1300 template<
typename Type
1302 template<
typename MT
1307 using blaze::addAssign;
1329 template<
typename Type
1331 template<
typename MT
1335 using blaze::subAssign;
1358 template<
typename Type
1360 template<
typename MT
1365 using blaze::schurAssign;
1396 template<
typename Type
1398 template<
typename MT
1428 template<
typename Type
1442 template<
typename Type
1456 template<
typename Type
1478 template<
typename Type
1493 template<
typename Type
1497 size_t nonzeros( 0UL );
1499 for(
size_t i=0UL; i<
m_; ++i )
1518 template<
typename Type
1533 template<
typename Type
1537 for(
size_t i=0UL; i<
m_; ++i )
1554 template<
typename Type
1571 template<
typename Type
1575 if(
end_ !=
nullptr )
1598 template<
typename Type
1607 if( m ==
m_ && n ==
n_ )
return;
1614 for(
size_t i=0UL; i<2UL*m+2UL; ++i ) {
1623 Iterator* newEnd ( newBegin+m+1UL );
1625 newBegin[0UL] =
begin_[0UL];
1628 for(
size_t i=0UL; i<
m_; ++i ) {
1629 newEnd [i] =
end_ [i];
1630 newBegin[i+1UL] =
begin_[i+1UL];
1632 for(
size_t i=m_; i<m; ++i ) {
1633 newBegin[i+1UL] = newEnd[i] =
begin_[
m_];
1637 for(
size_t i=0UL; i<m; ++i ) {
1638 newBegin[i+1UL] = newEnd[i] =
begin_[0UL];
1654 for(
size_t i=0UL; i<
m_; ++i )
1658 for(
size_t i=
m_; i<m; ++i ) {
1665 for(
size_t i=0UL; i<m; ++i )
1669 for(
size_t i=0UL; i<m; ++i )
1695 template<
typename Type
1719 template<
typename Type
1730 const size_t current(
capacity(i) );
1732 if( current >= nonzeros )
return;
1734 const ptrdiff_t additional( nonzeros - current );
1738 const size_t newCapacity(
begin_[
m_] -
begin_[0UL] + additional );
1744 newBegin[0UL] = allocate<Element>( newCapacity );
1745 newEnd [
m_ ] = newBegin[0UL]+newCapacity;
1747 for(
size_t k=0UL; k<i; ++k ) {
1749 newBegin[k+1UL] = newBegin[k] +
capacity(k);
1752 newBegin[i+1UL] = newBegin[i] + nonzeros;
1753 for(
size_t k=i+1UL; k<
m_; ++k ) {
1755 newBegin[k+1UL] = newBegin[k] +
capacity(k);
1769 for(
size_t j=
m_-1UL; j>i; --j ) {
1771 end_ [j] += additional;
1791 template<
typename Type
1795 for(
size_t i=0UL; i<
m_; ++i )
1812 template<
typename Type
1818 if( i < (
m_ - 1UL ) )
1834 template<
typename Type
1851 template<
typename Type
1874 template<
typename Type
1878 size_t nonzeros( 2UL*
capacity()+1UL );
1894 template<
typename Type
1903 newBegin[0UL] = allocate<Element>( nonzeros );
1905 for(
size_t k=0UL; k<
m_; ++k ) {
1908 newBegin[k+1UL] = newBegin[k] + (
begin_[k+1UL] -
begin_[k] );
1911 newEnd[
m_] = newBegin[0UL]+nonzeros;
1916 if( newBegin !=
nullptr ) {
1932 template<
typename Type
1937 return static_cast<Iterator>( it );
1950 template<
typename Type
1980 template<
typename Type
1990 if( pos !=
end_[i] && pos->index_ == j ) {
1991 pos->value() = value;
1994 else return insert( pos, i, j, value );
2012 template<
typename Type
2022 if( pos !=
end_[i] && pos->index_ == j ) {
2026 return insert( pos, i, j, value );
2041 template<
typename Type
2050 pos->value_ = value;
2059 pos->value_ = value;
2062 for(
size_t k=i+1UL; k<
m_+1UL; ++k ) {
2075 newBegin[0UL] = allocate<Element>( newCapacity );
2077 for(
size_t k=0UL; k<i; ++k ) {
2078 const size_t nonzeros(
end_[k] -
begin_[k] );
2080 newEnd [k] = newBegin[k] + nonzeros;
2081 newBegin[k+1UL] = newBegin[k] + total;
2083 newEnd [i] = newBegin[i] + (
end_[i] -
begin_[i] ) + 1;
2084 newBegin[i+1UL] = newBegin[i] + (
begin_[i+1] -
begin_[i] ) + 1;
2085 for(
size_t k=i+1UL; k<
m_; ++k ) {
2086 const size_t nonzeros(
end_[k] -
begin_[k] );
2088 newEnd [k] = newBegin[k] + nonzeros;
2089 newBegin[k+1UL] = newBegin[k] + total;
2092 newEnd[
m_] = newEnd[
capacity_] = newBegin[0UL]+newCapacity;
2095 tmp->value_ = value;
2097 std::move( pos,
end_[m_-1UL],
castUp( tmp+1UL ) );
2163 template<
typename Type
2172 end_[i]->value_ = value;
2174 if( !check || !isDefault<strict>(
end_[i]->value_ ) ) {
2175 end_[i]->index_ = j;
2195 template<
typename Type
2225 template<
typename Type
2233 if( pos !=
end_[i] )
2250 template<
typename Type
2258 if( pos !=
end_[i] )
2278 template<
typename Type
2317 template<
typename Type
2319 template<
typename Pred >
2322 for(
size_t i=0UL; i<
m_; ++i ) {
2324 [predicate=predicate](
const ElementBase& element) {
2325 return predicate( element.
value() );
2359 template<
typename Type
2361 template<
typename Pred >
2369 const auto pos = std::remove_if(
castUp( first ),
castUp( last ),
2370 [predicate=predicate](
const ElementBase& element ) {
2371 return predicate( element.
value() );
2402 template<
typename Type
2407 return const_cast<Iterator>(
const_cast<const This&
>( *this ).
find( i, j ) );
2427 template<
typename Type
2433 if( pos !=
end_[i] && pos->index_ == j )
2435 else return end_[i];
2455 template<
typename Type
2480 template<
typename Type
2486 return std::lower_bound(
begin_[i],
end_[i], j,
2487 [](
const Element& element,
size_t index )
2489 return element.index() < index;
2510 template<
typename Type
2535 template<
typename Type
2541 return std::upper_bound(
begin_[i],
end_[i], j,
2542 [](
size_t index,
const Element& element )
2544 return index < element.index();
2563 template<
typename Type
2579 template<
typename Type
2607 template<
typename Type
2609 template<
typename Other >
2612 for(
size_t i=0UL; i<
m_; ++i )
2614 element->value_ *= scalar;
2639 template<
typename Type
2641 template<
typename Other >
2644 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2659 template<
typename Type
2661 template<
typename Other >
2664 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2679 template<
typename Type
2699 template<
typename Type
2701 template<
typename MT
2708 if(
m_ == 0UL ||
n_ == 0UL )
2711 size_t nonzeros( 0UL );
2713 for(
size_t i=1UL; i<=
m_; ++i )
2716 for(
size_t i=0UL; i<
m_; ++i )
2727 for(
size_t j=jbegin; j<jend; ++j )
2731 for(
size_t k=i+1UL; k<=
m_; ++k )
2735 end_[i]->value_ = (~rhs)(i,j);
2737 if( !isDefault<strict>(
end_[i]->value_ ) ) {
2738 end_[i]->index_ = j;
2761 template<
typename Type
2763 template<
typename MT >
2771 if(
m_ == 0UL ||
begin_[0] ==
nullptr )
2774 for(
size_t i=0UL; i<
m_; ++i ) {
2793 template<
typename Type
2795 template<
typename MT >
2808 std::vector<size_t> rowLengths(
m_, 0UL );
2809 for(
size_t j=0UL; j<
n_; ++j ) {
2810 for( RhsIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2811 ++rowLengths[element->index()];
2815 for(
size_t i=0UL; i<
m_; ++i ) {
2820 for(
size_t j=0UL; j<
n_; ++j ) {
2821 for( RhsIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2822 append( element->index(), j, element->value() );
2839 template<
typename Type
2841 template<
typename MT
2865 template<
typename Type
2867 template<
typename MT
2891 template<
typename Type
2893 template<
typename MT
2917 template<
typename Type
2919 template<
typename MT
2943 template<
typename Type
2945 template<
typename MT
2954 for(
size_t i=0UL; i<
m_; ++i ) {
2957 element->value_ *= (~rhs)(i,element->index_);
2983 template<
typename Type >
2985 :
public SparseMatrix< CompressedMatrix<Type,true>, true >
3004 explicit Element() =
default;
3005 Element(
const Element& rhs ) =
default;
3006 Element( Element&& rhs ) =
default;
3010 inline Element&
operator=(
const Element& rhs )
3012 this->value_ = rhs.value_;
3016 inline Element&
operator=( Element&& rhs )
3018 this->value_ = std::move( rhs.value_ );
3022 template<
typename Other >
3026 this->value_ = rhs.value();
3030 template<
typename Other >
3035 this->value_ = std::move( rhs.value() );
3039 template<
typename Other >
3047 template<
typename Other >
3049 , IsRValueReference<Other&&> >, Element& >
3052 this->value_ = std::move( v );
3068 struct Uninitialized {};
3091 template<
typename NewType >
3100 template<
size_t NewM
3121 explicit CompressedMatrix(
size_t m,
size_t n,
const std::vector<size_t>& nonzeros );
3159 inline CompressedMatrix&
operator=(
const CompressedMatrix& rhs );
3160 inline CompressedMatrix&
operator=( CompressedMatrix&& rhs ) noexcept;
3166 template<
typename MT,
bool SO >
inline CompressedMatrix& operator%=(
const DenseMatrix<MT,SO>& rhs );
3167 template<
typename MT,
bool SO >
inline CompressedMatrix& operator%=(
const SparseMatrix<MT,SO>& rhs );
3174 inline size_t rows()
const noexcept;
3175 inline size_t columns()
const noexcept;
3176 inline size_t capacity()
const noexcept;
3177 inline size_t capacity(
size_t j )
const noexcept;
3179 inline size_t nonZeros(
size_t j )
const;
3180 inline void reset();
3181 inline void reset(
size_t j );
3182 inline void clear();
3183 void resize (
size_t m,
size_t n,
bool preserve=
true );
3184 inline void reserve(
size_t nonzeros );
3185 void reserve(
size_t j,
size_t nonzeros );
3186 inline void trim ();
3187 inline void trim (
size_t j );
3189 inline void swap( CompressedMatrix& sm ) noexcept;
3196 inline Iterator set (
size_t i,
size_t j,
const Type& value );
3197 inline Iterator insert (
size_t i,
size_t j,
const Type& value );
3198 inline void append (
size_t i,
size_t j,
const Type& value,
bool check=
false );
3206 inline void erase(
size_t i,
size_t j );
3210 template<
typename Pred >
3211 inline void erase( Pred predicate );
3213 template<
typename Pred >
3236 template<
typename Other >
inline CompressedMatrix& scale(
const Other& scalar );
3243 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
3244 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
3320 template<
typename Type >
3336 template<
typename Type >
3357 template<
typename Type >
3361 for(
size_t j=1UL; j<2UL*
n_+2UL; ++j )
3378 template<
typename Type >
3382 begin_[0UL] = allocate<Element>( nonzeros );
3383 for(
size_t j=1UL; j<(2UL*
n_+1UL); ++j )
3402 template<
typename Type >
3406 BLAZE_USER_ASSERT( nonzeros.size() == n,
"Size of capacity vector and number of columns don't match" );
3408 size_t newCapacity( 0UL );
3409 for( std::vector<size_t>::const_iterator it=nonzeros.begin(); it!=nonzeros.end(); ++it )
3412 begin_[0UL] =
end_[0UL] = allocate<Element>( newCapacity );
3413 for(
size_t j=0UL; j<
n_; ++j ) {
3442 template<
typename Type >
3446 for(
size_t j=0UL; j<
n_; ++j )
3450 for(
const auto& rowList : list )
3452 if( rowList.size() <= j ) {
3457 auto pos( rowList.begin() );
3458 std::advance( pos, j );
3459 if( !isDefault<strict>( *pos ) )
3460 append( i, j, *pos );
3477 template<
typename Type >
3481 const size_t nonzeros( sm.
nonZeros() );
3483 begin_[0UL] = allocate<Element>( nonzeros );
3484 for(
size_t j=0UL; j<
n_; ++j ) {
3485 end_[j] = castDown( std::copy( sm.
begin(j), sm.
end(j), castUp( begin_[j] ) ) );
3486 begin_[j+1UL] =
end_[j];
3488 end_[
n_] = begin_[0UL]+nonzeros;
3500 template<
typename Type >
3524 template<
typename Type >
3525 template<
typename MT
3530 using blaze::assign;
3532 assign( *
this, ~dm );
3544 template<
typename Type >
3545 template<
typename MT
3550 using blaze::assign;
3552 assign( *
this, ~sm );
3565 template<
typename Type >
3570 , begin_( new
Iterator[2UL*n+2UL] )
3571 ,
end_ ( begin_+(n+1UL) )
3573 begin_[0UL] =
nullptr;
3591 template<
typename Type >
3594 if( begin_ !=
nullptr ) {
3625 template<
typename Type >
3649 template<
typename Type >
3658 if( pos ==
end_[j] || pos->index_ != i )
3681 template<
typename Type >
3691 return (*
this)(i,j);
3709 template<
typename Type >
3719 return (*
this)(i,j);
3732 template<
typename Type >
3750 template<
typename Type >
3768 template<
typename Type >
3786 template<
typename Type >
3804 template<
typename Type >
3822 template<
typename Type >
3863 template<
typename Type >
3872 for(
size_t j=0UL; j<
n_; ++j )
3876 for(
const auto& rowList : list )
3878 if( rowList.size() <= j ) {
3883 auto pos( rowList.begin() );
3884 std::advance( pos, j );
3885 if( !isDefault<strict>( *pos ) )
3886 append( i, j, *pos );
3909 template<
typename Type >
3915 if( &rhs ==
this )
return *
this;
3917 const size_t nonzeros( rhs.
nonZeros() );
3924 newBegin[0UL] = allocate<Element>( nonzeros );
3925 for(
size_t j=0UL; j<rhs.
n_; ++j ) {
3926 newEnd[j] = castDown( std::copy( rhs.
begin_[j], rhs.
end_[j], castUp( newBegin[j] ) ) );
3927 newBegin[j+1UL] = newEnd[j];
3929 newEnd[rhs.
n_] = newBegin[0UL]+nonzeros;
3931 swap( begin_, newBegin );
3935 if( newBegin !=
nullptr ) {
3941 for(
size_t j=0UL; j<rhs.
n_; ++j ) {
3942 end_[j] = castDown( std::copy( rhs.
begin_[j], rhs.
end_[j], castUp( begin_[j] ) ) );
3943 begin_[j+1UL] =
end_[j];
3963 template<
typename Type >
3967 if( begin_ !=
nullptr ) {
4000 template<
typename Type >
4001 template<
typename MT
4006 using blaze::assign;
4008 if( (~rhs).canAlias(
this ) ) {
4014 assign( *
this, ~rhs );
4033 template<
typename Type >
4034 template<
typename MT
4039 using blaze::assign;
4041 if( (~rhs).canAlias(
this ) ||
4050 assign( *
this, ~rhs );
4070 template<
typename Type >
4071 template<
typename MT
4075 using blaze::addAssign;
4081 addAssign( *
this, ~rhs );
4099 template<
typename Type >
4100 template<
typename MT
4104 using blaze::subAssign;
4110 subAssign( *
this, ~rhs );
4129 template<
typename Type >
4130 template<
typename MT
4135 using blaze::schurAssign;
4141 if( (~rhs).canAlias(
this ) ) {
4147 schurAssign( *
this, tmp );
4168 template<
typename Type >
4169 template<
typename MT
4201 template<
typename Type >
4216 template<
typename Type >
4231 template<
typename Type >
4234 if( begin_ !=
nullptr )
4235 return end_[
n_] - begin_[0UL];
4249 template<
typename Type >
4253 return begin_[j+1UL] - begin_[j];
4265 template<
typename Type >
4268 size_t nonzeros( 0UL );
4270 for(
size_t j=0UL; j<
n_; ++j )
4286 template<
typename Type >
4290 return end_[j] - begin_[j];
4302 template<
typename Type >
4305 for(
size_t j=0UL; j<
n_; ++j )
4306 end_[j] = begin_[j];
4322 template<
typename Type >
4326 end_[j] = begin_[j];
4340 template<
typename Type >
4343 if(
end_ !=
nullptr )
4368 template<
typename Type >
4376 if( m ==
m_ && n == n_ )
return;
4378 if( begin_ ==
nullptr )
4381 end_ = begin_+n+1UL;
4383 for(
size_t j=0UL; j<2UL*n+2UL; ++j ) {
4384 begin_[j] =
nullptr;
4392 Iterator* newEnd ( newBegin+n+1UL );
4394 newBegin[0UL] = begin_[0UL];
4397 for(
size_t j=0UL; j<
n_; ++j ) {
4398 newEnd [j] =
end_ [j];
4399 newBegin[j+1UL] = begin_[j+1UL];
4401 for(
size_t j=n_; j<n; ++j ) {
4402 newBegin[j+1UL] = newEnd[j] = begin_[
n_];
4406 for(
size_t j=0UL; j<n; ++j ) {
4407 newBegin[j+1UL] = newEnd[j] = begin_[0UL];
4413 swap( newBegin, begin_ );
4423 for(
size_t j=0UL; j<
n_; ++j )
4424 end_[j] = begin_[j];
4427 for(
size_t j=n_; j<n; ++j ) {
4428 begin_[j+1UL] =
end_[j] = begin_[
n_];
4434 for(
size_t j=0UL; j<n; ++j )
4435 end_[j] = lowerBound( m, j );
4438 for(
size_t j=0UL; j<n; ++j )
4439 end_[j] = begin_[j];
4466 template<
typename Type >
4470 reserveElements( nonzeros );
4488 template<
typename Type >
4498 const size_t current(
capacity(j) );
4500 if( current >= nonzeros )
return;
4502 const ptrdiff_t additional( nonzeros - current );
4504 if(
end_[n_] - begin_[n_] < additional )
4506 const size_t newCapacity( begin_[n_] - begin_[0UL] + additional );
4510 Iterator* newEnd ( newBegin+n_+1UL );
4512 newBegin[0UL] = allocate<Element>( newCapacity );
4513 newEnd [
n_ ] = newBegin[0UL]+newCapacity;
4515 for(
size_t k=0UL; k<j; ++k ) {
4516 newEnd [k ] = castDown(
transfer( begin_[k],
end_[k], castUp( newBegin[k] ) ) );
4517 newBegin[k+1UL] = newBegin[k] +
capacity(k);
4519 newEnd [j ] = castDown(
transfer( begin_[j],
end_[j], castUp( newBegin[j] ) ) );
4520 newBegin[j+1UL] = newBegin[j] + nonzeros;
4521 for(
size_t k=j+1UL; k<
n_; ++k ) {
4522 newEnd [k ] = castDown(
transfer( begin_[k],
end_[k], castUp( newBegin[k] ) ) );
4523 newBegin[k+1UL] = newBegin[k] +
capacity(k);
4528 swap( newBegin, begin_ );
4536 begin_[
n_] += additional;
4537 for(
size_t k=n_-1UL; k>j; --k ) {
4538 begin_[k] = castDown( std::move_backward( begin_[k],
end_[k], castUp(
end_[k]+additional ) ) );
4539 end_ [k] += additional;
4560 template<
typename Type >
4563 for(
size_t j=0UL; j<
n_; ++j )
4581 template<
typename Type >
4586 if( j < ( n_ - 1UL ) )
4587 end_[j+1] = castDown( std::move( begin_[j+1],
end_[j+1], castUp(
end_[j] ) ) );
4588 begin_[j+1] =
end_[j];
4604 template<
typename Type >
4622 template<
typename Type >
4646 template<
typename Type >
4649 size_t nonzeros( 2UL*
capacity()+1UL );
4667 template<
typename Type >
4675 newBegin[0UL] = allocate<Element>( nonzeros );
4677 for(
size_t k=0UL; k<
n_; ++k ) {
4679 newEnd [k] = castDown(
transfer( begin_[k],
end_[k], castUp( newBegin[k] ) ) );
4680 newBegin[k+1UL] = newBegin[k] + ( begin_[k+1UL] - begin_[k] );
4683 newEnd[
n_] = newBegin[0UL]+nonzeros;
4685 swap( newBegin, begin_ );
4688 if( newBegin !=
nullptr ) {
4705 template<
typename Type >
4709 return static_cast<Iterator>( it );
4722 template<
typename Type >
4726 return static_cast<IteratorBase
>( it );
4752 template<
typename Type >
4759 const Iterator pos( lowerBound( i, j ) );
4761 if( pos !=
end_[j] && pos->index_ == i ) {
4762 pos->value() = value;
4765 else return insert( pos, i, j, value );
4785 template<
typename Type >
4792 const Iterator pos( lowerBound( i, j ) );
4794 if( pos !=
end_[j] && pos->index_ == i ) {
4798 return insert( pos, i, j, value );
4815 template<
typename Type >
4821 if( begin_[j+1UL] -
end_[j] != 0 ) {
4822 std::move_backward( pos,
end_[j], castUp(
end_[j]+1UL ) );
4823 pos->value_ = value;
4829 else if(
end_[n_] - begin_[n_] != 0 ) {
4830 std::move_backward( pos,
end_[n_-1UL], castUp(
end_[n_-1]+1UL ) );
4832 pos->value_ = value;
4835 for(
size_t k=j+1UL; k<n_+1UL; ++k ) {
4843 size_t newCapacity( extendCapacity() );
4848 newBegin[0UL] = allocate<Element>( newCapacity );
4850 for(
size_t k=0UL; k<j; ++k ) {
4851 const size_t nonzeros(
end_[k] - begin_[k] );
4852 const size_t total( begin_[k+1UL] - begin_[k] );
4853 newEnd [k] = newBegin[k] + nonzeros;
4854 newBegin[k+1UL] = newBegin[k] + total;
4856 newEnd [j] = newBegin[j] + (
end_[j] - begin_[j] ) + 1;
4857 newBegin[j+1UL] = newBegin[j] + ( begin_[j+1UL] - begin_[j] ) + 1;
4858 for(
size_t k=j+1UL; k<
n_; ++k ) {
4859 const size_t nonzeros(
end_[k] - begin_[k] );
4860 const size_t total( begin_[k+1UL] - begin_[k] );
4861 newEnd [k] = newBegin[k] + nonzeros;
4862 newBegin[k+1UL] = newBegin[k] + total;
4865 newEnd[
n_] = newEnd[
capacity_] = newBegin[0UL]+newCapacity;
4867 Iterator tmp = castDown( std::move( begin_[0UL], pos, castUp( newBegin[0UL] ) ) );
4868 tmp->value_ = value;
4870 std::move( pos,
end_[n_-1UL], castUp( tmp+1UL ) );
4872 swap( newBegin, begin_ );
4937 template<
typename Type >
4945 end_[j]->value_ = value;
4947 if( !check || !isDefault<strict>(
end_[j]->value_ ) ) {
4948 end_[j]->index_ = i;
4970 template<
typename Type >
4975 begin_[j+1UL] =
end_[j];
5001 template<
typename Type >
5007 const Iterator pos( find( i, j ) );
5008 if( pos !=
end_[j] )
5009 end_[j] = castDown( std::move( pos+1,
end_[j], castUp( pos ) ) );
5025 template<
typename Type >
5032 if( pos !=
end_[j] )
5033 end_[j] = castDown( std::move( pos+1,
end_[j], castUp( pos ) ) );
5052 template<
typename Type >
5062 end_[j] = castDown( std::move( last,
end_[j], castUp( first ) ) );
5092 template<
typename Type >
5093 template<
typename Pred >
5096 for(
size_t j=0UL; j<
n_; ++j ) {
5097 end_[j] = castDown( std::remove_if( castUp( begin_[j] ), castUp(
end_[j] ),
5098 [predicate=predicate](
const ElementBase& element ) {
5099 return predicate( element.value() );
5132 template<
typename Type >
5133 template<
typename Pred >
5141 const auto pos = std::remove_if( castUp( first ), castUp( last ),
5142 [predicate=predicate](
const ElementBase& element ) {
5143 return predicate( element.value() );
5146 end_[j] = castDown( std::move( last, end_[j], pos ) );
5175 template<
typename Type >
5179 return const_cast<Iterator>(
const_cast<const This&
>( *this ).
find( i, j ) );
5200 template<
typename Type >
5205 if( pos != end_[j] && pos->index_ == i )
5207 else return end_[j];
5227 template<
typename Type >
5251 template<
typename Type >
5256 return std::lower_bound( begin_[j], end_[j], i,
5257 [](
const Element& element,
size_t index )
5259 return element.index() < index;
5280 template<
typename Type >
5304 template<
typename Type >
5309 return std::upper_bound( begin_[j], end_[j], i,
5310 [](
size_t index,
const Element& element )
5312 return index < element.index();
5333 template<
typename Type >
5350 template<
typename Type >
5379 template<
typename Type >
5380 template<
typename Other >
5383 for(
size_t j=0UL; j<
n_; ++j )
5384 for(
Iterator element=begin_[j]; element!=end_[j]; ++element )
5385 element->value_ *= scalar;
5412 template<
typename Type >
5413 template<
typename Other >
5416 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5433 template<
typename Type >
5434 template<
typename Other >
5437 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5454 template<
typename Type >
5475 template<
typename Type >
5476 template<
typename MT
5483 if(
m_ == 0UL || n_ == 0UL )
5486 size_t nonzeros( 0UL );
5488 for(
size_t j=1UL; j<=
n_; ++j )
5489 begin_[j] = end_[j] = end_[n_];
5491 for(
size_t j=0UL; j<
n_; ++j )
5493 begin_[j] = end_[j] = begin_[0UL]+nonzeros;
5495 const size_t ibegin( ( IsLower<MT>::value )
5496 ?( IsStrictlyLower<MT>::value ? j+1UL : j )
5498 const size_t iend ( ( IsUpper<MT>::value )
5499 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5502 for(
size_t i=ibegin; i<iend; ++i )
5505 reserveElements( extendCapacity() );
5506 for(
size_t k=j+1UL; k<=
n_; ++k )
5507 begin_[k] = end_[k] = end_[n_];
5510 end_[j]->value_ = (~rhs)(i,j);
5512 if( !isDefault<strict>( end_[j]->value_ ) ) {
5513 end_[j]->index_ = i;
5520 begin_[
n_] = begin_[0UL]+nonzeros;
5538 template<
typename Type >
5539 template<
typename MT >
5547 if( n_ == 0UL || begin_[0] ==
nullptr )
5550 for(
size_t j=0UL; j<
n_; ++j ) {
5551 end_[j] = castDown( std::copy( (~rhs).
begin(j), (~rhs).
end(j), castUp( begin_[j] ) ) );
5552 begin_[j+1UL] = end_[j];
5571 template<
typename Type >
5572 template<
typename MT >
5582 using RhsIterator = ConstIterator_<MT>;
5585 std::vector<size_t> columnLengths( n_, 0UL );
5586 for(
size_t i=0UL; i<
m_; ++i ) {
5587 for( RhsIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5588 ++columnLengths[element->index()];
5592 for(
size_t j=0UL; j<
n_; ++j ) {
5593 begin_[j+1UL] = end_[j+1UL] = begin_[j] + columnLengths[j];
5597 for(
size_t i=0UL; i<
m_; ++i ) {
5598 for( RhsIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5599 append( i, element->index(), element->value() );
5618 template<
typename Type >
5619 template<
typename MT
5626 CompressedMatrix tmp(
serial( *
this + (~rhs) ) );
5645 template<
typename Type >
5646 template<
typename MT
5653 CompressedMatrix tmp(
serial( *
this + (~rhs) ) );
5672 template<
typename Type >
5673 template<
typename MT
5680 CompressedMatrix tmp(
serial( *
this - (~rhs) ) );
5699 template<
typename Type >
5700 template<
typename MT
5707 CompressedMatrix tmp(
serial( *
this - (~rhs) ) );
5726 template<
typename Type >
5727 template<
typename MT
5736 for(
size_t j=0UL; j<
n_; ++j ) {
5739 element->value_ *= (~rhs)(element->index_,j);
5761 template<
typename Type,
bool SO >
5762 inline void reset( CompressedMatrix<Type,SO>& m );
5764 template<
typename Type,
bool SO >
5765 inline void reset( CompressedMatrix<Type,SO>& m,
size_t i );
5767 template<
typename Type,
bool SO >
5768 inline void clear( CompressedMatrix<Type,SO>& m );
5770 template<
bool RF,
typename Type,
bool SO >
5771 inline bool isDefault(
const CompressedMatrix<Type,SO>& m );
5773 template<
typename Type,
bool SO >
5774 inline bool isIntact(
const CompressedMatrix<Type,SO>& m );
5776 template<
typename Type,
bool SO >
5777 inline void swap( CompressedMatrix<Type,SO>& a, CompressedMatrix<Type,SO>& b ) noexcept;
5789 template<
typename Type
5791 inline void reset( CompressedMatrix<Type,SO>& m )
5811 template<
typename Type
5813 inline void reset( CompressedMatrix<Type,SO>& m,
size_t i )
5827 template<
typename Type
5829 inline void clear( CompressedMatrix<Type,SO>& m )
5866 return ( m.rows() == 0UL && m.columns() == 0UL );
5889 template<
typename Type
5891 inline bool isIntact(
const CompressedMatrix<Type,SO>& m )
5893 return ( m.nonZeros() <= m.capacity() );
5906 template<
typename Type
5908 inline void swap( CompressedMatrix<Type,SO>& a, CompressedMatrix<Type,SO>& b ) noexcept
5925 template<
typename T,
bool SO >
5926 struct IsResizable< CompressedMatrix<T,SO> >
5943 template<
typename T,
bool SO >
5944 struct IsShrinkable< CompressedMatrix<T,SO> >
5961 template<
typename T1,
bool SO,
typename T2,
size_t M,
size_t N >
5962 struct AddTrait< CompressedMatrix<T1,SO>, StaticMatrix<T2,M,N,SO> >
5964 using Type = StaticMatrix< AddTrait_<T1,T2>, M, N, SO >;
5967 template<
typename T1,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
5968 struct AddTrait< CompressedMatrix<T1,SO1>, StaticMatrix<T2,M,N,SO2> >
5970 using Type = StaticMatrix< AddTrait_<T1,T2>, M, N, SO2 >;
5973 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
5974 struct AddTrait< StaticMatrix<T1,M,N,SO>, CompressedMatrix<T2,SO> >
5976 using Type = StaticMatrix< AddTrait_<T1,T2>, M, N, SO >;
5979 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
5980 struct AddTrait< StaticMatrix<T1,M,N,SO1>, CompressedMatrix<T2,SO2> >
5982 using Type = StaticMatrix< AddTrait_<T1,T2>, M, N, SO1 >;
5985 template<
typename T1,
bool SO,
typename T2,
size_t M,
size_t N >
5986 struct AddTrait< CompressedMatrix<T1,SO>, HybridMatrix<T2,M,N,SO> >
5988 using Type = HybridMatrix< AddTrait_<T1,T2>, M, N, SO >;
5991 template<
typename T1,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
5992 struct AddTrait< CompressedMatrix<T1,SO1>, HybridMatrix<T2,M,N,SO2> >
5994 using Type = HybridMatrix< AddTrait_<T1,T2>, M, N, SO2 >;
5997 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
5998 struct AddTrait< HybridMatrix<T1,M,N,SO>, CompressedMatrix<T2,SO> >
6000 using Type = HybridMatrix< AddTrait_<T1,T2>, M, N, SO >;
6003 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
6004 struct AddTrait< HybridMatrix<T1,M,N,SO1>, CompressedMatrix<T2,SO2> >
6006 using Type = HybridMatrix< AddTrait_<T1,T2>, M, N, SO1 >;
6009 template<
typename T1,
bool SO,
typename T2 >
6010 struct AddTrait< CompressedMatrix<T1,SO>, DynamicMatrix<T2,SO> >
6012 using Type = DynamicMatrix< AddTrait_<T1,T2>, SO >;
6015 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
6016 struct AddTrait< CompressedMatrix<T1,SO1>, DynamicMatrix<T2,SO2> >
6018 using Type = DynamicMatrix< AddTrait_<T1,T2>, SO2 >;
6021 template<
typename T1,
bool SO,
typename T2 >
6022 struct AddTrait< DynamicMatrix<T1,SO>, CompressedMatrix<T2,SO> >
6024 using Type = DynamicMatrix< AddTrait_<T1,T2>, SO >;
6027 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
6028 struct AddTrait< DynamicMatrix<T1,SO1>, CompressedMatrix<T2,SO2> >
6030 using Type = DynamicMatrix< AddTrait_<T1,T2>, SO1 >;
6033 template<
typename T1,
bool SO,
typename T2,
bool AF,
bool PF >
6034 struct AddTrait< CompressedMatrix<T1,SO>, CustomMatrix<T2,AF,PF,SO> >
6036 using Type = DynamicMatrix< AddTrait_<T1,T2>, SO >;
6039 template<
typename T1,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6040 struct AddTrait< CompressedMatrix<T1,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6042 using Type = DynamicMatrix< AddTrait_<T1,T2>, SO2 >;
6045 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6046 struct AddTrait< CustomMatrix<T1,AF,PF,SO>, CompressedMatrix<T2,SO> >
6048 using Type = DynamicMatrix< AddTrait_<T1,T2>, SO >;
6051 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
bool SO2 >
6052 struct AddTrait< CustomMatrix<T1,AF,PF,SO1>, CompressedMatrix<T2,SO2> >
6054 using Type = DynamicMatrix< AddTrait_<T1,T2>, SO1 >;
6057 template<
typename T1,
bool SO,
typename T2 >
6058 struct AddTrait< CompressedMatrix<T1,SO>, CompressedMatrix<T2,SO> >
6060 using Type = CompressedMatrix< AddTrait_<T1,T2>, SO >;
6063 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
6064 struct AddTrait< CompressedMatrix<T1,SO1>, CompressedMatrix<T2,SO2> >
6066 using Type = CompressedMatrix< AddTrait_<T1,T2>,
false >;
6082 template<
typename T1,
bool SO,
typename T2,
size_t M,
size_t N >
6083 struct SubTrait< CompressedMatrix<T1,SO>, StaticMatrix<T2,M,N,SO> >
6085 using Type = StaticMatrix< SubTrait_<T1,T2>, M, N, SO >;
6088 template<
typename T1,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6089 struct SubTrait< CompressedMatrix<T1,SO1>, StaticMatrix<T2,M,N,SO2> >
6091 using Type = StaticMatrix< SubTrait_<T1,T2>, M, N, SO2 >;
6094 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6095 struct SubTrait< StaticMatrix<T1,M,N,SO>, CompressedMatrix<T2,SO> >
6097 using Type = StaticMatrix< SubTrait_<T1,T2>, M, N, SO >;
6100 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
6101 struct SubTrait< StaticMatrix<T1,M,N,SO1>, CompressedMatrix<T2,SO2> >
6103 using Type = StaticMatrix< SubTrait_<T1,T2>, M, N, SO1 >;
6106 template<
typename T1,
bool SO,
typename T2,
size_t M,
size_t N >
6107 struct SubTrait< CompressedMatrix<T1,SO>, HybridMatrix<T2,M,N,SO> >
6109 using Type = HybridMatrix< SubTrait_<T1,T2>, M, N, SO >;
6112 template<
typename T1,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6113 struct SubTrait< CompressedMatrix<T1,SO1>, HybridMatrix<T2,M,N,SO2> >
6115 using Type = HybridMatrix< SubTrait_<T1,T2>, M, N, SO2 >;
6118 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6119 struct SubTrait< HybridMatrix<T1,M,N,SO>, CompressedMatrix<T2,SO> >
6121 using Type = HybridMatrix< SubTrait_<T1,T2>, M, N, SO >;
6124 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
6125 struct SubTrait< HybridMatrix<T1,M,N,SO1>, CompressedMatrix<T2,SO2> >
6127 using Type = HybridMatrix< SubTrait_<T1,T2>, M, N, SO1 >;
6130 template<
typename T1,
bool SO,
typename T2 >
6131 struct SubTrait< CompressedMatrix<T1,SO>, DynamicMatrix<T2,SO> >
6133 using Type = DynamicMatrix< SubTrait_<T1,T2>, SO >;
6136 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
6137 struct SubTrait< CompressedMatrix<T1,SO1>, DynamicMatrix<T2,SO2> >
6139 using Type = DynamicMatrix< SubTrait_<T1,T2>, SO2 >;
6142 template<
typename T1,
bool SO,
typename T2 >
6143 struct SubTrait< DynamicMatrix<T1,SO>, CompressedMatrix<T2,SO> >
6145 using Type = DynamicMatrix< SubTrait_<T1,T2>, SO >;
6148 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
6149 struct SubTrait< DynamicMatrix<T1,SO1>, CompressedMatrix<T2,SO2> >
6151 using Type = DynamicMatrix< SubTrait_<T1,T2>, SO1 >;
6154 template<
typename T1,
bool SO,
typename T2,
bool AF,
bool PF >
6155 struct SubTrait< CompressedMatrix<T1,SO>, CustomMatrix<T2,AF,PF,SO> >
6157 using Type = DynamicMatrix< SubTrait_<T1,T2>, SO >;
6160 template<
typename T1,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6161 struct SubTrait< CompressedMatrix<T1,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6163 using Type = DynamicMatrix< SubTrait_<T1,T2>, SO2 >;
6166 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6167 struct SubTrait< CustomMatrix<T1,AF,PF,SO>, CompressedMatrix<T2,SO> >
6169 using Type = DynamicMatrix< SubTrait_<T1,T2>, SO >;
6172 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
bool SO2 >
6173 struct SubTrait< CustomMatrix<T1,AF,PF,SO1>, CompressedMatrix<T2,SO2> >
6175 using Type = DynamicMatrix< SubTrait_<T1,T2>, SO1 >;
6178 template<
typename T1,
bool SO,
typename T2 >
6179 struct SubTrait< CompressedMatrix<T1,SO>, CompressedMatrix<T2,SO> >
6181 using Type = CompressedMatrix< SubTrait_<T1,T2>, SO >;
6184 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
6185 struct SubTrait< CompressedMatrix<T1,SO1>, CompressedMatrix<T2,SO2> >
6187 using Type = CompressedMatrix< SubTrait_<T1,T2>,
false >;
6203 template<
typename T1,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6204 struct SchurTrait< CompressedMatrix<T1,SO1>, StaticMatrix<T2,M,N,SO2> >
6206 using Type = CompressedMatrix< MultTrait_<T1,T2>, SO1 >;
6209 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
6210 struct SchurTrait< StaticMatrix<T1,M,N,SO1>, CompressedMatrix<T2,SO2> >
6212 using Type = CompressedMatrix< MultTrait_<T1,T2>, SO2 >;
6215 template<
typename T1,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6216 struct SchurTrait< CompressedMatrix<T1,SO1>, HybridMatrix<T2,M,N,SO2> >
6218 using Type = CompressedMatrix< MultTrait_<T1,T2>, SO1 >;
6221 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
6222 struct SchurTrait< HybridMatrix<T1,M,N,SO1>, CompressedMatrix<T2,SO2> >
6224 using Type = CompressedMatrix< MultTrait_<T1,T2>, SO2 >;
6227 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
6228 struct SchurTrait< CompressedMatrix<T1,SO1>, DynamicMatrix<T2,SO2> >
6230 using Type = CompressedMatrix< MultTrait_<T1,T2>, SO1 >;
6233 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
6234 struct SchurTrait< DynamicMatrix<T1,SO1>, CompressedMatrix<T2,SO2> >
6236 using Type = CompressedMatrix< MultTrait_<T1,T2>, SO2 >;
6239 template<
typename T1,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6240 struct SchurTrait< CompressedMatrix<T1,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6242 using Type = CompressedMatrix< MultTrait_<T1,T2>, SO1 >;
6245 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
bool SO2 >
6246 struct SchurTrait< CustomMatrix<T1,AF,PF,SO1>, CompressedMatrix<T2,SO2> >
6248 using Type = CompressedMatrix< MultTrait_<T1,T2>, SO2 >;
6251 template<
typename T1,
bool SO,
typename T2 >
6252 struct SchurTrait< CompressedMatrix<T1,SO>, CompressedMatrix<T2,SO> >
6254 using Type = CompressedMatrix< MultTrait_<T1,T2>, SO >;
6257 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
6258 struct SchurTrait< CompressedMatrix<T1,SO1>, CompressedMatrix<T2,SO2> >
6260 using Type = CompressedMatrix< MultTrait_<T1,T2>,
false >;
6276 template<
typename T1,
bool SO,
typename T2 >
6277 struct MultTrait< CompressedMatrix<T1,SO>, T2, EnableIf_< IsNumeric<T2> > >
6279 using Type = CompressedMatrix< MultTrait_<T1,T2>, SO >;
6282 template<
typename T1,
typename T2,
bool SO >
6283 struct MultTrait< T1, CompressedMatrix<T2,SO>, EnableIf_< IsNumeric<T1> > >
6285 using Type = CompressedMatrix< MultTrait_<T1,T2>, SO >;
6288 template<
typename T1,
bool SO,
typename T2,
size_t N >
6289 struct MultTrait< CompressedMatrix<T1,SO>, StaticVector<T2,N,false> >
6291 using Type = DynamicVector< MultTrait_<T1,T2>,
false >;
6294 template<
typename T1,
size_t N,
typename T2,
bool SO >
6295 struct MultTrait< StaticVector<T1,N,true>, CompressedMatrix<T2,SO> >
6297 using Type = DynamicVector< MultTrait_<T1,T2>,
true >;
6300 template<
typename T1,
bool SO,
typename T2,
size_t N >
6301 struct MultTrait< CompressedMatrix<T1,SO>, HybridVector<T2,N,false> >
6303 using Type = DynamicVector< MultTrait_<T1,T2>,
false >;
6306 template<
typename T1,
size_t N,
typename T2,
bool SO >
6307 struct MultTrait< HybridVector<T1,N,true>, CompressedMatrix<T2,SO> >
6309 using Type = DynamicVector< MultTrait_<T1,T2>,
true >;
6312 template<
typename T1,
bool SO,
typename T2 >
6313 struct MultTrait< CompressedMatrix<T1,SO>, DynamicVector<T2,false> >
6315 using Type = DynamicVector< MultTrait_<T1,T2>,
false >;
6318 template<
typename T1,
typename T2,
bool SO >
6319 struct MultTrait< DynamicVector<T1,true>, CompressedMatrix<T2,SO> >
6321 using Type = DynamicVector< MultTrait_<T1,T2>,
true >;
6324 template<
typename T1,
bool SO,
typename T2,
bool AF,
bool PF >
6325 struct MultTrait< CompressedMatrix<T1,SO>, CustomVector<T2,AF,PF,false> >
6327 using Type = DynamicVector< MultTrait_<T1,T2>,
false >;
6330 template<
typename T1,
bool AF,
bool PF,
typename T2,
bool SO >
6331 struct MultTrait< CustomVector<T1,AF,PF,true>, CompressedMatrix<T2,SO> >
6333 using Type = DynamicVector< MultTrait_<T1,T2>,
true >;
6336 template<
typename T1,
bool SO,
typename T2 >
6337 struct MultTrait< CompressedMatrix<T1,SO>, CompressedVector<T2,false> >
6339 using Type = CompressedVector< MultTrait_<T1,T2>,
false >;
6342 template<
typename T1,
typename T2,
bool SO >
6343 struct MultTrait< CompressedVector<T1,true>, CompressedMatrix<T2,SO> >
6345 using Type = CompressedVector< MultTrait_<T1,T2>,
true >;
6348 template<
typename T1,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6349 struct MultTrait< CompressedMatrix<T1,SO1>, StaticMatrix<T2,M,N,SO2> >
6351 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO1 >;
6354 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
6355 struct MultTrait< StaticMatrix<T1,M,N,SO1>, CompressedMatrix<T2,SO2> >
6357 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO1 >;
6360 template<
typename T1,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6361 struct MultTrait< CompressedMatrix<T1,SO1>, HybridMatrix<T2,M,N,SO2> >
6363 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO1 >;
6366 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
6367 struct MultTrait< HybridMatrix<T1,M,N,SO1>, CompressedMatrix<T2,SO2> >
6369 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO1 >;
6372 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
6373 struct MultTrait< CompressedMatrix<T1,SO1>, DynamicMatrix<T2,SO2> >
6375 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO1 >;
6378 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
6379 struct MultTrait< DynamicMatrix<T1,SO1>, CompressedMatrix<T2,SO2> >
6381 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO1 >;
6384 template<
typename T1,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6385 struct MultTrait< CompressedMatrix<T1,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6387 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO1 >;
6390 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
bool SO2 >
6391 struct MultTrait< CustomMatrix<T1,AF,PF,SO1>, CompressedMatrix<T2,SO2> >
6393 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO1 >;
6396 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
6397 struct MultTrait< CompressedMatrix<T1,SO1>, CompressedMatrix<T2,SO2> >
6399 using Type = CompressedMatrix< MultTrait_<T1,T2>, SO1 >;
6415 template<
typename T1,
bool SO,
typename T2 >
6416 struct DivTrait< CompressedMatrix<T1,SO>, T2, EnableIf_< IsNumeric<T2> > >
6418 using Type = CompressedMatrix< DivTrait_<T1,T2>, SO >;
6434 template<
typename T,
bool SO,
typename OP >
6435 struct UnaryMapTrait< CompressedMatrix<T,SO>, OP >
6437 using Type = CompressedMatrix< UnaryMapTrait_<T,OP>, SO >;
6453 template<
typename T1,
bool SO,
typename T2 >
6454 struct HighType< CompressedMatrix<T1,SO>, CompressedMatrix<T2,SO> >
6456 using Type = CompressedMatrix< typename HighType<T1,T2>::Type, SO >;
6472 template<
typename T1,
bool SO,
typename T2 >
6473 struct LowType< CompressedMatrix<T1,SO>, CompressedMatrix<T2,SO> >
6475 using Type = CompressedMatrix< typename LowType<T1,T2>::Type, SO >;
6491 template<
typename T,
bool SO,
size_t... CSAs >
6492 struct SubmatrixTrait< CompressedMatrix<T,SO>, CSAs... >
6494 using Type = CompressedMatrix<T,SO>;
6510 template<
typename T,
bool SO,
size_t... CRAs >
6511 struct RowTrait< CompressedMatrix<T,SO>, CRAs... >
6513 using Type = CompressedVector<T,true>;
6529 template<
typename T,
bool SO,
size_t... CRAs >
6530 struct RowsTrait< CompressedMatrix<T,SO>, CRAs... >
6532 using Type = CompressedMatrix<T,false>;
6548 template<
typename T,
bool SO,
size_t... CCAs >
6549 struct ColumnTrait< CompressedMatrix<T,SO>, CCAs... >
6551 using Type = CompressedVector<T,false>;
6567 template<
typename T,
bool SO,
size_t... CCAs >
6568 struct ColumnsTrait< CompressedMatrix<T,SO>, CCAs... >
6570 using Type = CompressedMatrix<T,true>;
6586 template<
typename T,
bool SO, ptrdiff_t... CBAs >
6587 struct BandTrait< CompressedMatrix<T,SO>, CBAs... >
6589 using Type = CompressedVector<T,defaultTransposeFlag>;
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:79
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Pointer difference type of the Blaze library.
void reserveElements(size_t nonzeros)
Reserving the specified number of compressed matrix elements.
Definition: CompressedMatrix.h:1896
Header file for auxiliary alias declarations.
Headerfile for the generic min algorithm.
Iterator * end_
Pointers one past the last non-zero element of each row.
Definition: CompressedMatrix.h:529
Header file for the Schur product trait.
void schurAssign(const DenseMatrix< MT, SO2 > &rhs)
Default implementation of the Schur product assignment of a dense matrix.
Definition: CompressedMatrix.h:2947
#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
void shrinkToFit()
Requesting the removal of unused capacity.
Definition: CompressedMatrix.h:1836
Header file for the subtraction trait.
bool canSMPAssign() const noexcept
Returns whether the matrix can be used in SMP assignments.
Definition: CompressedMatrix.h:2681
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:522
Header file for basic type definitions.
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: CompressedMatrix.h:2662
Header file for the row trait.
CompressedMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: CompressedMatrix.h:2581
CompressedMatrix()
The default constructor for CompressedMatrix.
Definition: CompressedMatrix.h:573
Header file for the serial shim.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:221
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
Iterator end(size_t i) noexcept
Returns an iterator just past the last non-zero element of row/column i.
Definition: CompressedMatrix.h:1022
Reference operator()(size_t i, size_t j) noexcept
2D-access to the compressed matrix elements.
Definition: CompressedMatrix.h:848
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:364
MatrixAccessProxy< This > Reference
Reference to a compressed matrix value.
Definition: CompressedMatrix.h:319
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
size_t m_
The current number of rows of the compressed matrix.
Definition: CompressedMatrix.h:3288
void clear()
Clearing the compressed matrix.
Definition: CompressedMatrix.h:1573
Header file for the And class template.
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:87
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3083
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
~CompressedMatrix()
The destructor for CompressedMatrix.
Definition: CompressedMatrix.h:814
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:560
Access proxy for sparse, matrices.The MatrixAccessProxy provides safe access to the elements of a no...
Definition: MatrixAccessProxy.h:101
size_t columns() const noexcept
Returns the current number of columns of the compressed matrix.
Definition: CompressedMatrix.h:1444
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:87
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3084
Header file for memory allocation and deallocation functionality.
Header file for the extended initializer_list functionality.
ConstIterator cbegin(size_t i) const noexcept
Returns an iterator to the first non-zero element of row/column i.
Definition: CompressedMatrix.h:1000
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1950
static const Type zero_
Neutral element for accesses to zero elements.
Definition: CompressedMatrix.h:531
Resize mechanism to obtain a CompressedMatrix with different fixed dimensions.
Definition: CompressedMatrix.h:3102
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
void swap(CompressedMatrix &sm) noexcept
Swapping the contents of two sparse matrices.
Definition: CompressedMatrix.h:1853
Header file for the band trait.
Constraint on the data type.
size_t capacity_
The current capacity of the pointer array.
Definition: CompressedMatrix.h:3290
Header file for the SparseMatrix base class.
ElementBase * IteratorBase
Iterator over non-constant base elements.
Definition: CompressedMatrix.h:227
size_t capacity_
The current capacity of the pointer array.
Definition: CompressedMatrix.h:527
void reserve(size_t nonzeros)
Setting the minimum capacity of the compressed matrix.
Definition: CompressedMatrix.h:1697
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
void reset()
Reset to the default initial values.
Definition: CompressedMatrix.h:1535
Headerfile for the generic max algorithm.
Header file for the ValueIndexPair class.
Header file for the LowType type trait.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Header file for the unary map trait.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3082
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1359
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5908
Header file for the If class template.
Header file for the IsFloatingPoint type trait.
Header file for the IsShrinkable type trait.
Iterator set(size_t i, size_t j, const Type &value)
Setting an element of the compressed matrix.
Definition: CompressedMatrix.h:1983
Header file for the MatrixAccessProxy class.
Header file for all forward declarations of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Header file for the IsSMPAssignable type trait.
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3079
void erase(size_t i, size_t j)
Erasing an element from the compressed matrix.
Definition: CompressedMatrix.h:2227
Iterator * end_
Pointers one past the last non-zero element of each column.
Definition: CompressedMatrix.h:3292
size_t rows() const noexcept
Returns the current number of rows of the compressed matrix.
Definition: CompressedMatrix.h:1430
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
#define BLAZE_CONSTRAINT_MUST_HAVE_SAME_SIZE(T1, T2)
Constraint on the size of two data types.In case the types T1 and T2 don't have the same size...
Definition: SameSize.h:60
Header file for the Not class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
size_t capacity() const noexcept
Returns the maximum capacity of the compressed matrix.
Definition: CompressedMatrix.h:1458
ConstIterator cend(size_t i) const noexcept
Returns an iterator just past the last non-zero element of row/column i.
Definition: CompressedMatrix.h:1066
Constraint on the data type.
CompressedMatrix< Type, SO > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:311
Header file for the IsLower type trait.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:506
Header file for the default storage order for all vectors of the Blaze library.
IteratorBase castUp(Iterator it) const noexcept
Performs an up-cast of the given iterator.
Definition: CompressedMatrix.h:1953
Iterator insert(size_t i, size_t j, const Type &value)
Inserting an element into the compressed matrix.
Definition: CompressedMatrix.h:2015
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:317
Header file for the exception macros of the math module.
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Compile time check for data types.This type trait tests whether or not the given template parameter i...
Definition: IsSMPAssignable.h:123
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:714
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:430
Constraint on the data type.
void subAssign(const DenseMatrix< MT, SO2 > &rhs)
Default implementation of the subtraction assignment of a dense matrix.
Definition: CompressedMatrix.h:2895
size_t nonZeros() const
Returns the number of non-zero elements in the compressed matrix.
Definition: CompressedMatrix.h:1495
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:608
CompressedMatrix & operator=(initializer_list< initializer_list< Type > > list)
List assignment to all matrix elements.
Definition: CompressedMatrix.h:1106
void resize(size_t m, size_t n, bool preserve=true)
Changing the size of the compressed matrix.
Definition: CompressedMatrix.h:1600
Header file for the IsNumeric type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: CompressedMatrix.h:2642
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
size_t determineColumns(initializer_list< initializer_list< Type > > list) noexcept
Determines the maximum number of columns specified by the given initializer list. ...
Definition: InitializerList.h:107
Header file for run time assertion macros.
Header file for the relaxation flag types.
Header file for the addition trait.
Resize mechanism to obtain a CompressedMatrix with different fixed dimensions.
Definition: CompressedMatrix.h:339
CompressedMatrix & transpose()
In-place transpose of the matrix.
Definition: CompressedMatrix.h:2565
Header file for the division trait.
void trim()
Removing all excessive capacity from all rows/columns.
Definition: CompressedMatrix.h:1793
Header file for the submatrix trait.
Constraint on the data type.
Header file for the columns trait.
Headerfile for the generic transfer algorithm.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
Header file for the column trait.
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:272
const Type & ConstReference
Reference to a constant compressed matrix value.
Definition: CompressedMatrix.h:320
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:101
Constraint on the data type.
Constraint on the data type.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:322
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
Iterator * begin_
Pointers to the first non-zero element of each column.
Definition: CompressedMatrix.h:3291
#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:81
void assign(const DenseMatrix< MT, SO2 > &rhs)
Default implementation of the assignment of a row-major dense matrix.
Definition: CompressedMatrix.h:2703
void append(size_t i, size_t j, const Type &value, bool check=false)
Appending an element to the specified row/column of the compressed matrix.
Definition: CompressedMatrix.h:2165
EnableIf_< IsBuiltin< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:230
void finalize(size_t i)
Finalizing the element insertion of a row/column.
Definition: CompressedMatrix.h:2197
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
Iterator find(size_t i, size_t j)
Searches for a specific matrix element.
Definition: CompressedMatrix.h:2405
Header file for the rows trait.
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
Iterator * begin_
Pointers to the first non-zero element of each row.
Definition: CompressedMatrix.h:528
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:490
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
size_t n_
The current number of columns of the compressed matrix.
Definition: CompressedMatrix.h:3289
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:73
Constraint on the size of two data types.
Iterator castDown(IteratorBase it) const noexcept
Performs a down-cast of the given iterator.
Definition: CompressedMatrix.h:1935
void addAssign(const DenseMatrix< MT, SO2 > &rhs)
Default implementation of the addition assignment of a dense matrix.
Definition: CompressedMatrix.h:2843
Header file for the default transpose flag for all vectors of the Blaze library.
Initializer list type of the Blaze library.
Iterator lowerBound(size_t i, size_t j)
Returns an iterator to the first index not less than the given index.
Definition: CompressedMatrix.h:2458
static const Type zero_
Neutral element for accesses to zero elements.
Definition: CompressedMatrix.h:3294
Compile time type check.This class tests whether the given template parameter T is an rvalue referenc...
Definition: IsRValueReference.h:77
Iterator upperBound(size_t i, size_t j)
Returns an iterator to the first index greater than the given index.
Definition: CompressedMatrix.h:2513
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:321
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
size_t extendCapacity() const noexcept
Calculating a new matrix capacity.
Definition: CompressedMatrix.h:1876
Rebind mechanism to obtain a CompressedMatrix with different data/element type.
Definition: CompressedMatrix.h:329
Rebind mechanism to obtain a CompressedMatrix with different data/element type.
Definition: CompressedMatrix.h:3092
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
Header file for the IsUpper type trait.
size_t n_
The current number of columns of the compressed matrix.
Definition: CompressedMatrix.h:526
OutputIterator transfer(InputIterator first, InputIterator last, OutputIterator dest)
Transfers the elements from the given source range to the destination range.
Definition: Transfer.h:70
ValueIndexPair< Type > ElementBase
Base class for the compressed matrix element.
Definition: CompressedMatrix.h:226
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: CompressedMatrix.h:902
Header file for the IsResizable type trait.
size_t m_
The current number of rows of the compressed matrix.
Definition: CompressedMatrix.h:525
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#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
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:316
Reference value()
Access to the current value of the value-index-pair.
Definition: ValueIndexPair.h:362
Header file for the HighType type trait.
Iterator begin(size_t i) noexcept
Returns an iterator to the first non-zero element of row/column i.
Definition: CompressedMatrix.h:956