35#ifndef _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_
36#define _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_
247template<
typename Type
255 :
public DenseMatrix< HybridMatrix<Type,M,N,SO,AF,PF,Tag>, SO >
289 template<
typename NewType >
298 template<
size_t NewM
325 inline HybridMatrix(
size_t m,
size_t n,
const Type& init );
326 constexpr HybridMatrix( initializer_list< initializer_list<Type> > list );
328 template<
typename Other >
329 inline HybridMatrix(
size_t m,
size_t n,
const Other* array );
331 template<
typename Other,
size_t Rows,
size_t Cols >
332 inline HybridMatrix(
const Other (&array)[Rows][Cols] );
334 template<
typename Other,
size_t Rows,
size_t Cols >
335 inline HybridMatrix(
const std::array<std::array<Other,Cols>,Rows>& array );
339 template<
typename MT,
bool SO2 >
375 constexpr
HybridMatrix& operator=( initializer_list< initializer_list<Type> > list ) &;
377 template< typename Other,
size_t Rows,
size_t Cols >
378 constexpr
HybridMatrix& operator=( const Other (&array)[Rows][Cols] ) &;
380 template< typename Other,
size_t Rows,
size_t Cols >
381 constexpr
HybridMatrix& operator=( const std::array<std::array<Other,Cols>,Rows>& array ) &;
385 template< typename MT,
bool SO2 > inline
HybridMatrix& operator= ( const
Matrix<MT,SO2>& rhs ) &;
386 template< typename MT,
bool SO2 > inline
HybridMatrix& operator+=( const
Matrix<MT,SO2>& rhs ) &;
387 template< typename MT,
bool SO2 > inline
HybridMatrix& operator-=( const
Matrix<MT,SO2>& rhs ) &;
388 template< typename MT,
bool SO2 > inline
HybridMatrix& operator%=( const
Matrix<MT,SO2>& rhs ) &;
395 constexpr
size_t rows() const noexcept;
396 constexpr
size_t columns() const noexcept;
397 static constexpr
size_t spacing() noexcept;
398 static constexpr
size_t capacity() noexcept;
399 constexpr
size_t capacity(
size_t i ) const noexcept;
401 inline
size_t nonZeros(
size_t i ) const;
402 constexpr
void reset();
403 constexpr
void reset(
size_t i );
404 constexpr
void clear();
405 constexpr
void resize (
size_t m,
size_t n,
bool preserve=true );
406 constexpr
void extend (
size_t m,
size_t n,
bool preserve=true );
417 template< typename Other > inline
HybridMatrix& scale( const Other& scalar );
424 static inline
void* operator new ( std::
size_t size );
425 static inline
void* operator new[]( std::
size_t size );
426 static inline
void* operator new ( std::
size_t size, const std::nothrow_t& );
427 static inline
void* operator new[]( std::
size_t size, const std::nothrow_t& );
429 static inline
void operator delete (
void* ptr );
430 static inline
void operator delete[](
void* ptr );
431 static inline
void operator delete (
void* ptr, const std::nothrow_t& );
432 static inline
void operator delete[](
void* ptr, const std::nothrow_t& );
448 template< typename MT >
449 static constexpr
bool VectorizedAssign_v =
450 ( useOptimizedKernels &&
461 template< typename MT >
462 static constexpr
bool VectorizedAddAssign_v =
463 ( VectorizedAssign_v<MT> &&
472 template< typename MT >
473 static constexpr
bool VectorizedSubAssign_v =
474 ( VectorizedAssign_v<MT> &&
483 template< typename MT >
484 static constexpr
bool VectorizedSchurAssign_v =
485 ( VectorizedAssign_v<MT> &&
494 constexpr
bool isIntact() const noexcept;
501 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
502 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
504 static constexpr
bool isAligned() noexcept;
515 template< typename MT,
bool SO2 >
518 template< typename MT,
bool SO2 >
524 template< typename MT,
bool SO2 >
527 template< typename MT,
bool SO2 >
533 template< typename MT,
bool SO2 >
536 template< typename MT,
bool SO2 >
542 template< typename MT,
bool SO2 >
545 template< typename MT,
bool SO2 >
608template<
typename Type,
size_t M,
size_t N >
611template<
typename Type,
size_t M,
size_t N >
631template<
typename Type
661template<
typename Type
700template<
typename Type
722 for(
size_t i=0UL; i<m; ++i ) {
723 for(
size_t j=0UL; j<n; ++j )
726 if( IsNumeric_v<Type> ) {
727 for(
size_t j=n; j<
NN; ++j )
732 if( IsNumeric_v<Type> ) {
733 for(
size_t i=m; i<M; ++i )
734 for(
size_t j=0UL; j<
NN; ++j )
767template<
typename Type
789 for(
const auto& rowList : list ) {
791 for(
const auto& element : rowList ) {
792 v_[i*
NN+j] = element;
830template<
typename Type
837template<
typename Other >
853 for(
size_t i=0UL; i<m; ++i ) {
854 for(
size_t j=0UL; j<n; ++j )
855 v_[i*
NN+j] = array[i*n+j];
857 if( IsNumeric_v<Type> ) {
858 for(
size_t j=n; j<
NN; ++j )
863 if( IsNumeric_v<Type> ) {
864 for(
size_t i=m; i<M; ++i )
865 for(
size_t j=0UL; j<
NN; ++j )
895template<
typename Type
902template<
typename Other
915 for(
size_t i=0UL; i<Rows; ++i ) {
916 for(
size_t j=0UL; j<Cols; ++j )
917 v_[i*
NN+j] = array[i][j];
919 if( IsNumeric_v<Type> ) {
920 for(
size_t j=Cols; j<
NN; ++j )
925 if( IsNumeric_v<Type> ) {
926 for(
size_t i=Rows; i<M; ++i )
927 for(
size_t j=0UL; j<
NN; ++j )
957template<
typename Type
964template<
typename Other
977 for(
size_t i=0UL; i<Rows; ++i ) {
978 for(
size_t j=0UL; j<Cols; ++j )
979 v_[i*
NN+j] = array[i][j];
981 if( IsNumeric_v<Type> ) {
982 for(
size_t j=Cols; j<
NN; ++j )
987 if( IsNumeric_v<Type> ) {
988 for(
size_t i=Rows; i<M; ++i )
989 for(
size_t j=0UL; j<
NN; ++j )
1006template<
typename Type
1030template<
typename Type
1037template<
typename MT
1044 using blaze::assign;
1049 if( (*m).rows() > M || (*m).columns() > N ) {
1053 for(
size_t i=0UL; i<
m_; ++i ) {
1054 for(
size_t j=( IsSparseMatrix_v<MT> ? 0UL :
n_ );
1055 j<( IsNumeric_v<Type> ?
NN :
n_ );
1061 if( IsNumeric_v<Type> ) {
1062 for(
size_t i=
m_; i<M; ++i )
1063 for(
size_t j=0UL; j<
NN; ++j )
1092template<
typename Type
1119template<
typename Type
1147template<
typename Type
1163 return (*
this)(i,j);
1179template<
typename Type
1195 return (*
this)(i,j);
1212template<
typename Type
1239template<
typename Type
1262template<
typename Type
1286template<
typename Type
1313template<
typename Type
1340template<
typename Type
1367template<
typename Type
1394template<
typename Type
1421template<
typename Type
1448template<
typename Type
1478template<
typename Type
1491 for(
size_t i=0UL; i<m_; ++i )
1492 for(
size_t j=0UL; j<n_; ++j )
1525template<
typename Type
1537 const size_t m( list.size() );
1552 for(
const auto& rowList : list ) {
1554 for(
const auto& element : rowList ) {
1555 v_[i*NN+j] = element;
1559 clear( v_[i*NN+j] );
1590template<
typename Type
1597template<
typename Other
1608 for(
size_t i=0UL; i<Rows; ++i )
1609 for(
size_t j=0UL; j<Cols; ++j )
1610 v_[i*NN+j] = array[i][j];
1638template<
typename Type
1645template<
typename Other
1656 for(
size_t i=0UL; i<Rows; ++i )
1657 for(
size_t j=0UL; j<Cols; ++j )
1658 v_[i*NN+j] = array[i][j];
1673template<
typename Type
1683 using blaze::assign;
1688 resize( rhs.rows(), rhs.columns() );
1689 assign( *
this, *rhs );
1709template<
typename Type
1716template<
typename MT
1721 using blaze::assign;
1723 using TT =
decltype(
trans( *
this ) );
1724 using CT =
decltype(
ctrans( *
this ) );
1725 using IT =
decltype(
inv( *
this ) );
1729 if( (*rhs).rows() > M || (*rhs).columns() > N ) {
1733 if( IsSame_v<MT,TT> && (*rhs).isAliased(
this ) ) {
1736 else if( IsSame_v<MT,CT> && (*rhs).isAliased(
this ) ) {
1739 else if( !IsSame_v<MT,IT> && (*rhs).canAlias(
this ) ) {
1742 assign( *
this, tmp );
1745 resize( (*rhs).rows(), (*rhs).columns() );
1746 if( IsSparseMatrix_v<MT> )
1748 assign( *
this, *rhs );
1768template<
typename Type
1775template<
typename MT
1780 using blaze::addAssign;
1784 if( (*rhs).rows() != m_ || (*rhs).columns() != n_ ) {
1788 if( (*rhs).canAlias(
this ) ) {
1790 addAssign( *
this, tmp );
1793 addAssign( *
this, *rhs );
1813template<
typename Type
1820template<
typename MT
1825 using blaze::subAssign;
1829 if( (*rhs).rows() != m_ || (*rhs).columns() != n_ ) {
1833 if( (*rhs).canAlias(
this ) ) {
1835 subAssign( *
this, tmp );
1838 subAssign( *
this, *rhs );
1858template<
typename Type
1865template<
typename MT
1870 using blaze::schurAssign;
1874 if( (*rhs).rows() != m_ || (*rhs).columns() != n_ ) {
1878 if( (*rhs).canAlias(
this ) ) {
1880 schurAssign( *
this, tmp );
1883 schurAssign( *
this, *rhs );
1906template<
typename Type
1925template<
typename Type
1947template<
typename Type
1966template<
typename Type
1991template<
typename Type
2018template<
typename Type
2027 size_t nonzeros( 0UL );
2029 for(
size_t i=0UL; i<m_; ++i )
2030 for(
size_t j=0UL; j<n_; ++j )
2031 if( !isDefault<strict>( v_[i*NN+j] ) )
2051template<
typename Type
2062 const size_t jend( i*NN + n_ );
2063 size_t nonzeros( 0UL );
2065 for(
size_t j=i*NN; j<jend; ++j )
2066 if( !isDefault<strict>( v_[j] ) )
2079template<
typename Type
2090 for(
size_t i=0UL; i<m_; ++i )
2091 for(
size_t j=0UL; j<n_; ++j )
2092 clear( v_[i*NN+j] );
2108template<
typename Type
2120 for(
size_t j=0UL; j<n_; ++j )
2121 clear( v_[i*NN+j] );
2133template<
typename Type
2183template<
typename Type
2204 if( IsVectorizable_v<Type> && n < n_ ) {
2205 for(
size_t i=0UL; i<m; ++i )
2206 for(
size_t j=n; j<n_; ++j )
2207 clear( v_[i*NN+j] );
2210 if( IsVectorizable_v<Type> && m < m_ ) {
2211 for(
size_t i=m; i<m_; ++i )
2212 for(
size_t j=0UL; j<n_; ++j )
2213 clear( v_[i*NN+j] );
2237template<
typename Type
2258template<
typename Type
2269 const size_t maxrows(
max( m_, m.m_ ) );
2270 const size_t maxcols(
max( n_, m.n_ ) );
2272 for(
size_t i=0UL; i<maxrows; ++i ) {
2273 for(
size_t j=0UL; j<maxcols; ++j ) {
2274 swap( v_[i*NN+j], m(i,j) );
2303template<
typename Type
2310inline HybridMatrix<Type,M,N,SO,AF,PF,Tag>&
HybridMatrix<Type,M,N,SO,AF,PF,Tag>::transpose()
2315 if( m_ > N || n_ > M ) {
2319 const size_t maxsize(
max( m_, n_ ) );
2320 for(
size_t i=1UL; i<maxsize; ++i ) {
2321 for(
size_t j=0UL; j<i; ++j ) {
2322 swap( v_[i*NN+j], v_[j*NN+i] );
2326 if( IsVectorizable_v<Type> && m_ < n_ ) {
2327 for(
size_t i=0UL; i<m_; ++i ) {
2328 for(
size_t j=m_; j<n_; ++j ) {
2329 clear( v_[i*NN+j] );
2334 if( IsVectorizable_v<Type> && m_ > n_ ) {
2335 for(
size_t i=n_; i<m_; ++i ) {
2336 for(
size_t j=0UL; j<n_; ++j ) {
2337 clear( v_[i*NN+j] );
2362template<
typename Type
2369inline HybridMatrix<Type,M,N,SO,AF,PF,Tag>&
HybridMatrix<Type,M,N,SO,AF,PF,Tag>::ctranspose()
2374 if( m_ > N || n_ > M ) {
2378 const size_t maxsize(
max( m_, n_ ) );
2379 for(
size_t i=0UL; i<maxsize; ++i ) {
2380 for(
size_t j=0UL; j<i; ++j ) {
2381 cswap( v_[i*NN+j], v_[j*NN+i] );
2386 if( IsVectorizable_v<Type> && m_ < n_ ) {
2387 for(
size_t i=0UL; i<m_; ++i ) {
2388 for(
size_t j=m_; j<n_; ++j ) {
2389 clear( v_[i*NN+j] );
2394 if( IsVectorizable_v<Type> && m_ > n_ ) {
2395 for(
size_t i=n_; i<m_; ++i ) {
2396 for(
size_t j=0UL; j<n_; ++j ) {
2397 clear( v_[i*NN+j] );
2428template<
typename Type
2435template<
typename Other >
2439 for(
size_t i=0UL; i<m_; ++i )
2440 for(
size_t j=0UL; j<n_; ++j )
2441 v_[i*NN+j] *= scalar;
2466template<
typename Type
2479 return allocate<HybridMatrix>( 1UL );
2494template<
typename Type
2521template<
typename Type
2534 return allocate<HybridMatrix>( 1UL );
2549template<
typename Type
2572template<
typename Type
2592template<
typename Type
2612template<
typename Type
2632template<
typename Type
2663template<
typename Type
2672 if( m_ > M || n_ > N )
2675 if( IsVectorizable_v<Type> )
2677 for(
size_t i=0UL; i<m_; ++i ) {
2678 for(
size_t j=n_; j<NN; ++j ) {
2679 if( !isDefault<strict>( v_[i*NN+j] ) )
2684 for(
size_t i=m_; i<M; ++i ) {
2685 for(
size_t j=0UL; j<NN; ++j ) {
2686 if( !isDefault<strict>( v_[i*NN+j] ) )
2715template<
typename Type
2722template<
typename Other >
2725 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
2740template<
typename Type
2747template<
typename Other >
2750 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
2764template<
typename Type
2793template<
typename Type
2804 return loada( i, j );
2806 return loadu( i, j );
2826template<
typename Type
2846 return loada( &v_[i*NN+j] );
2866template<
typename Type
2884 return loadu( &v_[i*NN+j] );
2905template<
typename Type
2939template<
typename Type
2959 storea( &v_[i*NN+j], value );
2980template<
typename Type
2998 storeu( &v_[i*NN+j], value );
3020template<
typename Type
3040 stream( &v_[i*NN+j], value );
3056template<
typename Type
3063template<
typename MT
3070 for(
size_t i=0UL; i<m_; ++i ) {
3071 for(
size_t j=0UL; j<n_; ++j ) {
3072 v_[i*NN+j] = (*rhs)(i,j);
3090template<
typename Type
3097template<
typename MT
3106 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<MT> );
3108 const size_t jpos( remainder ?
prevMultiple( n_, SIMDSIZE ) : n_ );
3111 for(
size_t i=0UL; i<m_; ++i )
3115 for( ; j<jpos; j+=SIMDSIZE ) {
3116 store( i, j, (*rhs).load(i,j) );
3118 for( ; remainder && j<n_; ++j ) {
3119 v_[i*NN+j] = (*rhs)(i,j);
3137template<
typename Type
3144template<
typename MT >
3149 for(
size_t i=0UL; i<m_; ++i )
3150 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
3151 v_[i*NN+element->index()] = element->value();
3167template<
typename Type
3174template<
typename MT >
3181 for(
size_t j=0UL; j<n_; ++j )
3182 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
3183 v_[element->index()*NN+j] = element->value();
3199template<
typename Type
3206template<
typename MT
3213 for(
size_t i=0UL; i<m_; ++i )
3215 if( IsDiagonal_v<MT> )
3217 v_[i*NN+i] += (*rhs)(i,i);
3221 const size_t jbegin( ( IsUpper_v<MT> )
3222 ?( IsStrictlyUpper_v<MT> ? i+1UL : i )
3224 const size_t jend ( ( IsLower_v<MT> )
3225 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
3229 for(
size_t j=jbegin; j<jend; ++j ) {
3230 v_[i*NN+j] += (*rhs)(i,j);
3249template<
typename Type
3256template<
typename MT
3266 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<MT> );
3268 for(
size_t i=0UL; i<m_; ++i )
3270 const size_t jbegin( ( IsUpper_v<MT> )
3271 ?(
prevMultiple( ( IsStrictlyUpper_v<MT> ? i+1UL : i ), SIMDSIZE ) )
3273 const size_t jend ( ( IsLower_v<MT> )
3274 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
3278 const size_t jpos( remainder ?
prevMultiple( jend, SIMDSIZE ) : jend );
3283 for( ; j<jpos; j+=SIMDSIZE ) {
3284 store( i, j, load(i,j) + (*rhs).load(i,j) );
3286 for( ; remainder && j<jend; ++j ) {
3287 v_[i*NN+j] += (*rhs)(i,j);
3305template<
typename Type
3312template<
typename MT >
3317 for(
size_t i=0UL; i<m_; ++i )
3318 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
3319 v_[i*NN+element->index()] += element->value();
3335template<
typename Type
3342template<
typename MT >
3349 for(
size_t j=0UL; j<n_; ++j )
3350 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
3351 v_[element->index()*NN+j] += element->value();
3367template<
typename Type
3374template<
typename MT
3381 for(
size_t i=0UL; i<m_; ++i )
3383 if( IsDiagonal_v<MT> )
3385 v_[i*NN+i] -= (*rhs)(i,i);
3389 const size_t jbegin( ( IsUpper_v<MT> )
3390 ?( IsStrictlyUpper_v<MT> ? i+1UL : i )
3392 const size_t jend ( ( IsLower_v<MT> )
3393 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
3397 for(
size_t j=jbegin; j<jend; ++j ) {
3398 v_[i*NN+j] -= (*rhs)(i,j);
3417template<
typename Type
3424template<
typename MT
3434 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<MT> );
3436 for(
size_t i=0UL; i<m_; ++i )
3438 const size_t jbegin( ( IsUpper_v<MT> )
3439 ?(
prevMultiple( ( IsStrictlyUpper_v<MT> ? i+1UL : i ), SIMDSIZE ) )
3441 const size_t jend ( ( IsLower_v<MT> )
3442 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
3446 const size_t jpos( remainder ?
prevMultiple( jend, SIMDSIZE ) : jend );
3451 for( ; j<jpos; j+=SIMDSIZE ) {
3452 store( i, j, load(i,j) - (*rhs).load(i,j) );
3454 for( ; remainder && j<jend; ++j ) {
3455 v_[i*NN+j] -= (*rhs)(i,j);
3473template<
typename Type
3480template<
typename MT >
3485 for(
size_t i=0UL; i<m_; ++i )
3486 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
3487 v_[i*NN+element->index()] -= element->value();
3503template<
typename Type
3510template<
typename MT >
3517 for(
size_t j=0UL; j<n_; ++j )
3518 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
3519 v_[element->index()*NN+j] -= element->value();
3535template<
typename Type
3542template<
typename MT
3549 for(
size_t i=0UL; i<m_; ++i ) {
3550 for(
size_t j=0UL; j<n_; ++j ) {
3551 v_[i*NN+j] *= (*rhs)(i,j);
3569template<
typename Type
3576template<
typename MT
3585 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<MT> );
3587 for(
size_t i=0UL; i<m_; ++i )
3589 const size_t jpos( remainder ?
prevMultiple( n_, SIMDSIZE ) : n_ );
3594 for( ; j<jpos; j+=SIMDSIZE ) {
3595 store( i, j, load(i,j) * (*rhs).load(i,j) );
3597 for( ; remainder && j<n_; ++j ) {
3598 v_[i*NN+j] *= (*rhs)(i,j);
3616template<
typename Type
3623template<
typename MT >
3632 for(
size_t i=0UL; i<m_; ++i )
3633 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
3634 v_[i*NN+element->index()] = tmp.
v_[i*NN+element->index()] * element->value();
3650template<
typename Type
3657template<
typename MT >
3668 for(
size_t j=0UL; j<n_; ++j )
3669 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
3670 v_[element->index()*NN+j] = tmp.
v_[element->index()*NN+j] * element->value();
3695template<
typename Type
3702 :
public DenseMatrix< HybridMatrix<Type,M,N,true,AF,PF,Tag>, true >
3736 template<
typename NewType >
3745 template<
size_t NewM
3748 using Other = HybridMatrix<Type,NewM,NewN,true,AF,PF,Tag>;
3758 static constexpr bool simdEnabled = IsVectorizable_v<Type>;
3772 inline HybridMatrix(
size_t m,
size_t n,
const Type& init );
3775 template<
typename Other >
3776 inline HybridMatrix(
size_t m,
size_t n,
const Other* array );
3778 template<
typename Other,
size_t Rows,
size_t Cols >
3779 inline HybridMatrix(
const Other (&array)[Rows][Cols] );
3781 template<
typename Other,
size_t Rows,
size_t Cols >
3782 inline HybridMatrix(
const std::array<std::array<Other,Cols>,Rows>& array );
3786 template<
typename MT,
bool SO >
3794 ~HybridMatrix() =
default;
3824 template< typename Other,
size_t Rows,
size_t Cols >
3825 constexpr
HybridMatrix& operator=( const Other (&array)[Rows][Cols] ) &;
3827 template< typename Other,
size_t Rows,
size_t Cols >
3828 constexpr
HybridMatrix& operator=( const std::array<std::array<Other,Cols>,Rows>& array ) &;
3832 template< typename MT,
bool SO > inline
HybridMatrix& operator= ( const Matrix<MT,SO>& rhs ) &;
3833 template< typename MT,
bool SO > inline
HybridMatrix& operator+=( const Matrix<MT,SO>& rhs ) &;
3834 template< typename MT,
bool SO > inline
HybridMatrix& operator-=( const Matrix<MT,SO>& rhs ) &;
3835 template< typename MT,
bool SO > inline
HybridMatrix& operator%=( const Matrix<MT,SO>& rhs ) &;
3842 constexpr
size_t rows() const noexcept;
3843 constexpr
size_t columns() const noexcept;
3844 static constexpr
size_t spacing() noexcept;
3845 static constexpr
size_t capacity() noexcept;
3846 constexpr
size_t capacity(
size_t j ) const noexcept;
3848 inline
size_t nonZeros(
size_t j ) const;
3849 constexpr
void reset();
3850 constexpr
void reset(
size_t i );
3851 constexpr
void clear();
3852 constexpr
void resize (
size_t m,
size_t n,
bool preserve=true );
3853 constexpr
void extend (
size_t m,
size_t n,
bool preserve=true );
3864 template< typename Other > inline
HybridMatrix& scale( const Other& scalar );
3871 static inline
void* operator new ( std::
size_t size );
3872 static inline
void* operator new[]( std::
size_t size );
3873 static inline
void* operator new ( std::
size_t size, const std::nothrow_t& );
3874 static inline
void* operator new[]( std::
size_t size, const std::nothrow_t& );
3876 static inline
void operator delete (
void* ptr );
3877 static inline
void operator delete[](
void* ptr );
3878 static inline
void operator delete (
void* ptr, const std::nothrow_t& );
3879 static inline
void operator delete[](
void* ptr, const std::nothrow_t& );
3886 static constexpr
size_t SIMDSIZE = SIMDTrait<Type>::
size;
3894 template< typename MT >
3895 static constexpr
bool VectorizedAssign_v =
3896 ( useOptimizedKernels &&
3905 template< typename MT >
3906 static constexpr
bool VectorizedAddAssign_v =
3907 ( VectorizedAssign_v<MT> &&
3914 template< typename MT >
3915 static constexpr
bool VectorizedSubAssign_v =
3916 ( VectorizedAssign_v<MT> &&
3923 template< typename MT >
3924 static constexpr
bool VectorizedSchurAssign_v =
3925 ( VectorizedAssign_v<MT> &&
3933 constexpr
bool isIntact() const noexcept;
3940 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
3941 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
3943 static constexpr
bool isAligned() noexcept;
3954 template< typename MT,
bool SO >
3955 inline auto
assign( const DenseMatrix<MT,SO>& rhs ) ->
DisableIf_t< VectorizedAssign_v<MT> >;
3957 template< typename MT,
bool SO >
3958 inline auto
assign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedAssign_v<MT> >;
3960 template< typename MT > inline
void assign( const SparseMatrix<MT,true>& rhs );
3961 template< typename MT > inline
void assign( const SparseMatrix<MT,false>& rhs );
3963 template< typename MT,
bool SO >
3964 inline auto
addAssign( const DenseMatrix<MT,SO>& rhs ) ->
DisableIf_t< VectorizedAddAssign_v<MT> >;
3966 template< typename MT,
bool SO >
3967 inline auto
addAssign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedAddAssign_v<MT> >;
3969 template< typename MT > inline
void addAssign( const SparseMatrix<MT,true>& rhs );
3970 template< typename MT > inline
void addAssign( const SparseMatrix<MT,false>& rhs );
3972 template< typename MT,
bool SO >
3973 inline auto
subAssign( const DenseMatrix<MT,SO>& rhs ) ->
DisableIf_t< VectorizedSubAssign_v<MT> >;
3975 template< typename MT,
bool SO >
3976 inline auto
subAssign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedSubAssign_v<MT> >;
3978 template< typename MT > inline
void subAssign( const SparseMatrix<MT,true>& rhs );
3979 template< typename MT > inline
void subAssign( const SparseMatrix<MT,false>& rhs );
3981 template< typename MT,
bool SO >
3984 template< typename MT,
bool SO >
3985 inline auto
schurAssign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedSchurAssign_v<MT> >;
3987 template< typename MT > inline
void schurAssign( const SparseMatrix<MT,true>& rhs );
3988 template< typename MT > inline
void schurAssign( const SparseMatrix<MT,false>& rhs );
4041template< typename Type
4072template<
typename Type
4112template<
typename Type
4133 for(
size_t j=0UL; j<n; ++j ) {
4134 for(
size_t i=0UL; i<m; ++i )
4137 if( IsNumeric_v<Type> ) {
4138 for(
size_t i=m; i<MM; ++i )
4143 if( IsNumeric_v<Type> ) {
4144 for(
size_t j=n; j<N; ++j )
4145 for(
size_t i=0UL; i<MM; ++i )
4180template<
typename Type
4201 for(
const auto& rowList : list ) {
4203 for(
const auto& element : rowList ) {
4204 v_[i+j*MM] = element;
4244template<
typename Type
4250template<
typename Other >
4266 for(
size_t j=0UL; j<n; ++j ) {
4267 for(
size_t i=0UL; i<m; ++i )
4268 v_[i+j*MM] = array[i+j*m];
4270 if( IsNumeric_v<Type> ) {
4271 for(
size_t i=m; i<MM; ++i )
4276 if( IsNumeric_v<Type> ) {
4277 for(
size_t j=n; j<N; ++j )
4278 for(
size_t i=0UL; i<MM; ++i )
4310template<
typename Type
4316template<
typename Other
4329 for(
size_t j=0UL; j<Cols; ++j ) {
4330 for(
size_t i=0UL; i<Rows; ++i )
4331 v_[i+j*MM] = array[i][j];
4333 if( IsNumeric_v<Type> ) {
4334 for(
size_t i=Rows; i<MM; ++i )
4339 if( IsNumeric_v<Type> ) {
4340 for(
size_t j=Cols; j<N; ++j )
4341 for(
size_t i=0UL; i<MM; ++i )
4373template<
typename Type
4379template<
typename Other
4392 for(
size_t j=0UL; j<Cols; ++j ) {
4393 for(
size_t i=0UL; i<Rows; ++i )
4394 v_[i+j*MM] = array[i][j];
4396 if( IsNumeric_v<Type> ) {
4397 for(
size_t i=Rows; i<MM; ++i )
4402 if( IsNumeric_v<Type> ) {
4403 for(
size_t j=Cols; j<N; ++j )
4404 for(
size_t i=0UL; i<MM; ++i )
4423template<
typename Type
4448template<
typename Type
4454template<
typename MT
4461 using blaze::assign;
4466 if( (*m).rows() > M || (*m).columns() > N ) {
4470 for(
size_t j=0UL; j<
n_; ++j ) {
4471 for(
size_t i=( IsSparseMatrix_v<MT> ? 0UL :
m_ );
4472 i<( IsNumeric_v<Type> ? MM :
m_ );
4478 if( IsNumeric_v<Type> ) {
4479 for(
size_t j=
n_; j<N; ++j )
4480 for(
size_t i=0UL; i<MM; ++i )
4511template<
typename Type
4539template<
typename Type
4568template<
typename Type
4583 return (*
this)(i,j);
4601template<
typename Type
4616 return (*
this)(i,j);
4634template<
typename Type
4661template<
typename Type
4685template<
typename Type
4710template<
typename Type
4733template<
typename Type
4743 return Iterator( v_ + j*MM );
4756template<
typename Type
4766 return ConstIterator( v_ + j*MM );
4779template<
typename Type
4789 return ConstIterator( v_ + j*MM );
4802template<
typename Type
4812 return Iterator( v_ + j*MM + M );
4825template<
typename Type
4835 return ConstIterator( v_ + j*MM + M );
4848template<
typename Type
4858 return ConstIterator( v_ + j*MM + M );
4879template<
typename Type
4885constexpr HybridMatrix<Type,M,N,true,AF,PF,Tag>&
4891 for(
size_t j=0UL; j<n_; ++j )
4892 for(
size_t i=0UL; i<m_; ++i )
4927template<
typename Type
4933constexpr HybridMatrix<Type,M,N,true,AF,PF,Tag>&
4938 const size_t m( list.size() );
4953 for(
const auto& rowList : list ) {
4955 for(
const auto& element : rowList ) {
4956 v_[i+j*MM] = element;
4959 for( ; j<n_; ++j ) {
4960 clear( v_[i+j*MM] );
4993template<
typename Type
4999template<
typename Other
5002constexpr HybridMatrix<Type,M,N,true,AF,PF,Tag>&
5010 for(
size_t j=0UL; j<Cols; ++j )
5011 for(
size_t i=0UL; i<Rows; ++i )
5012 v_[i+j*MM] = array[i][j];
5042template<
typename Type
5048template<
typename Other
5051constexpr HybridMatrix<Type,M,N,true,AF,PF,Tag>&
5059 for(
size_t j=0UL; j<Cols; ++j )
5060 for(
size_t i=0UL; i<Rows; ++i )
5061 v_[i+j*MM] = array[i][j];
5078template<
typename Type
5084constexpr HybridMatrix<Type,M,N,true,AF,PF,Tag>&
5087 using blaze::assign;
5092 resize( rhs.rows(), rhs.columns() );
5093 assign( *
this, *rhs );
5115template<
typename Type
5121template<
typename MT
5123inline HybridMatrix<Type,M,N,true,AF,PF,Tag>&
5126 using blaze::assign;
5128 using TT =
decltype(
trans( *
this ) );
5129 using CT =
decltype(
ctrans( *
this ) );
5130 using IT =
decltype(
inv( *
this ) );
5134 if( (*rhs).rows() > M || (*rhs).columns() > N ) {
5138 if( IsSame_v<MT,TT> && (*rhs).isAliased(
this ) ) {
5141 else if( IsSame_v<MT,CT> && (*rhs).isAliased(
this ) ) {
5144 else if( !IsSame_v<MT,IT> && (*rhs).canAlias(
this ) ) {
5145 HybridMatrix tmp( *rhs );
5146 resize( tmp.rows(), tmp.columns() );
5147 assign( *
this, tmp );
5150 resize( (*rhs).rows(), (*rhs).columns() );
5151 if( IsSparseMatrix_v<MT> )
5153 assign( *
this, *rhs );
5175template<
typename Type
5181template<
typename MT
5183inline HybridMatrix<Type,M,N,true,AF,PF,Tag>&
5184 HybridMatrix<Type,M,N,true,AF,PF,Tag>::operator+=(
const Matrix<MT,SO>& rhs ) &
5186 using blaze::addAssign;
5190 if( (*rhs).rows() != m_ || (*rhs).columns() != n_ ) {
5194 if( (*rhs).canAlias(
this ) ) {
5195 const ResultType_t<MT> tmp( *rhs );
5196 addAssign( *
this, tmp );
5199 addAssign( *
this, *rhs );
5221template<
typename Type
5227template<
typename MT
5229inline HybridMatrix<Type,M,N,true,AF,PF,Tag>&
5230 HybridMatrix<Type,M,N,true,AF,PF,Tag>::operator-=(
const Matrix<MT,SO>& rhs ) &
5232 using blaze::subAssign;
5236 if( (*rhs).rows() != m_ || (*rhs).columns() != n_ ) {
5240 if( (*rhs).canAlias(
this ) ) {
5241 const ResultType_t<MT> tmp( *rhs );
5242 subAssign( *
this, tmp );
5245 subAssign( *
this, *rhs );
5267template<
typename Type
5273template<
typename MT
5275inline HybridMatrix<Type,M,N,true,AF,PF,Tag>&
5276 HybridMatrix<Type,M,N,true,AF,PF,Tag>::operator%=(
const Matrix<MT,SO>& rhs ) &
5278 using blaze::schurAssign;
5282 if( (*rhs).rows() != m_ || (*rhs).columns() != n_ ) {
5286 if( (*rhs).canAlias(
this ) ) {
5287 const ResultType_t<MT> tmp( *rhs );
5288 schurAssign( *
this, tmp );
5291 schurAssign( *
this, *rhs );
5316template<
typename Type
5336template<
typename Type
5359template<
typename Type
5379template<
typename Type
5400template<
typename Type
5428template<
typename Type
5436 size_t nonzeros( 0UL );
5438 for(
size_t j=0UL; j<n_; ++j )
5439 for(
size_t i=0UL; i<m_; ++i )
5440 if( !isDefault<strict>( v_[i+j*MM] ) )
5459template<
typename Type
5469 const size_t iend( j*MM + m_ );
5470 size_t nonzeros( 0UL );
5472 for(
size_t i=j*MM; i<iend; ++i )
5473 if( !isDefault<strict>( v_[i] ) )
5488template<
typename Type
5498 for(
size_t j=0UL; j<n_; ++j )
5499 for(
size_t i=0UL; i<m_; ++i )
5500 clear( v_[i+j*MM] );
5516template<
typename Type
5527 for(
size_t i=0UL; i<m_; ++i )
5528 clear( v_[i+j*MM] );
5542template<
typename Type
5593template<
typename Type
5613 if( IsVectorizable_v<Type> && m < m_ ) {
5614 for(
size_t j=0UL; j<n; ++j )
5615 for(
size_t i=m; i<m_; ++i )
5616 clear( v_[i+j*MM] );
5619 if( IsVectorizable_v<Type> && n < n_ ) {
5620 for(
size_t j=n; j<n_; ++j )
5621 for(
size_t i=0UL; i<m_; ++i )
5622 clear( v_[i+j*MM] );
5648template<
typename Type
5670template<
typename Type
5680 const size_t maxrows(
max( m_, m.m_ ) );
5681 const size_t maxcols(
max( n_, m.n_ ) );
5683 for(
size_t j=0UL; j<maxcols; ++j ) {
5684 for(
size_t i=0UL; i<maxrows; ++i ) {
5685 swap( v_[i+j*MM], m(i,j) );
5716template<
typename Type
5722inline HybridMatrix<Type,M,N,true,AF,PF,Tag>&
HybridMatrix<Type,M,N,true,AF,PF,Tag>::transpose()
5727 if( m_ > N || n_ > M ) {
5731 const size_t maxsize(
max( m_, n_ ) );
5732 for(
size_t j=1UL; j<maxsize; ++j ) {
5733 for(
size_t i=0UL; i<j; ++i ) {
5734 swap( v_[i+j*MM], v_[j+i*MM] );
5738 if( IsVectorizable_v<Type> && n_ < m_ ) {
5739 for(
size_t j=0UL; j<n_; ++j ) {
5740 for(
size_t i=n_; i<m_; ++i ) {
5741 clear( v_[i+j*MM] );
5746 if( IsVectorizable_v<Type> && n_ > m_ ) {
5747 for(
size_t j=m_; j<n_; ++j ) {
5748 for(
size_t i=0UL; i<m_; ++i ) {
5749 clear( v_[i+j*MM] );
5776template<
typename Type
5782inline HybridMatrix<Type,M,N,true,AF,PF,Tag>&
HybridMatrix<Type,M,N,true,AF,PF,Tag>::ctranspose()
5787 if( m_ > N || n_ > M ) {
5791 const size_t maxsize(
max( m_, n_ ) );
5792 for(
size_t j=0UL; j<maxsize; ++j ) {
5793 for(
size_t i=0UL; i<j; ++i ) {
5794 cswap( v_[i+j*MM], v_[j+i*MM] );
5799 if( IsVectorizable_v<Type> && n_ < m_ ) {
5800 for(
size_t j=0UL; j<n_; ++j ) {
5801 for(
size_t i=n_; i<m_; ++i ) {
5802 clear( v_[i+j*MM] );
5807 if( IsVectorizable_v<Type> && n_ > m_ ) {
5808 for(
size_t j=m_; j<n_; ++j ) {
5809 for(
size_t i=0UL; i<m_; ++i ) {
5810 clear( v_[i+j*MM] );
5843template<
typename Type
5849template<
typename Other >
5850inline HybridMatrix<Type,M,N,true,AF,PF,Tag>&
5851 HybridMatrix<Type,M,N,true,AF,PF,Tag>::scale(
const Other& scalar )
5853 for(
size_t j=0UL; j<n_; ++j )
5854 for(
size_t i=0UL; i<m_; ++i )
5855 v_[i+j*MM] *= scalar;
5882template<
typename Type
5888inline void* HybridMatrix<Type,M,N,true,AF,PF,Tag>::operator
new( std::size_t
size )
5894 return allocate<HybridMatrix>( 1UL );
5911template<
typename Type
5917inline void* HybridMatrix<Type,M,N,true,AF,PF,Tag>::operator
new[]( std::size_t
size )
5922 return allocate<HybridMatrix>(
size/
sizeof(HybridMatrix) );
5939template<
typename Type
5945inline void* HybridMatrix<Type,M,N,true,AF,PF,Tag>::operator
new( std::size_t
size,
const std::nothrow_t& )
5951 return allocate<HybridMatrix>( 1UL );
5968template<
typename Type
5974inline void* HybridMatrix<Type,M,N,true,AF,PF,Tag>::operator
new[]( std::size_t
size,
const std::nothrow_t& )
5979 return allocate<HybridMatrix>(
size/
sizeof(HybridMatrix) );
5992template<
typename Type
5998inline void HybridMatrix<Type,M,N,true,AF,PF,Tag>::operator
delete(
void* ptr )
6000 deallocate(
static_cast<HybridMatrix*
>( ptr ) );
6013template<
typename Type
6019inline void HybridMatrix<Type,M,N,true,AF,PF,Tag>::operator
delete[](
void* ptr )
6021 deallocate(
static_cast<HybridMatrix*
>( ptr ) );
6034template<
typename Type
6040inline void HybridMatrix<Type,M,N,true,AF,PF,Tag>::operator
delete(
void* ptr,
const std::nothrow_t& )
6042 deallocate(
static_cast<HybridMatrix*
>( ptr ) );
6055template<
typename Type
6061inline void HybridMatrix<Type,M,N,true,AF,PF,Tag>::operator
delete[](
void* ptr,
const std::nothrow_t& )
6063 deallocate(
static_cast<HybridMatrix*
>( ptr ) );
6087template<
typename Type
6095 if( m_ > M || n_ > N )
6098 if( IsVectorizable_v<Type> )
6100 for(
size_t j=0UL; j<n_; ++j ) {
6101 for(
size_t i=m_; i<MM; ++i ) {
6102 if( !isDefault<strict>( v_[i+j*MM] ) )
6107 for(
size_t j=n_; j<N; ++j ) {
6108 for(
size_t i=0UL; i<MM; ++i ) {
6109 if( !isDefault<strict>( v_[i+j*MM] ) )
6140template<
typename Type
6146template<
typename Other >
6149 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
6166template<
typename Type
6172template<
typename Other >
6175 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
6191template<
typename Type
6220template<
typename Type
6230 return loada( i, j );
6232 return loadu( i, j );
6253template<
typename Type
6272 return loada( &v_[i+j*MM] );
6293template<
typename Type
6310 return loadu( &v_[i+j*MM] );
6332template<
typename Type
6366template<
typename Type
6385 storea( &v_[i+j*MM], value );
6407template<
typename Type
6424 storeu( &v_[i+j*MM], value );
6447template<
typename Type
6466 stream( &v_[i+j*MM], value );
6484template<
typename Type
6490template<
typename MT
6493 -> DisableIf_t< VectorizedAssign_v<MT> >
6497 for(
size_t j=0UL; j<n_; ++j ) {
6498 for(
size_t i=0UL; i<m_; ++i ) {
6499 v_[i+j*MM] = (*rhs)(i,j);
6519template<
typename Type
6525template<
typename MT
6528 -> EnableIf_t< VectorizedAssign_v<MT> >
6534 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<MT> );
6536 const size_t ipos( remainder ?
prevMultiple( m_, SIMDSIZE ) : m_ );
6539 for(
size_t j=0UL; j<n_; ++j )
6543 for( ; i<ipos; i+=SIMDSIZE ) {
6544 store( i, j, (*rhs).load(i,j) );
6546 for( ; remainder && i<m_; ++i ) {
6547 v_[i+j*MM] = (*rhs)(i,j);
6567template<
typename Type
6573template<
typename MT >
6578 for(
size_t j=0UL; j<n_; ++j )
6579 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
6580 v_[element->index()+j*MM] = element->value();
6598template<
typename Type
6604template<
typename MT >
6611 for(
size_t i=0UL; i<m_; ++i )
6612 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
6613 v_[i+element->index()*MM] = element->value();
6631template<
typename Type
6637template<
typename MT
6640 -> DisableIf_t< VectorizedAddAssign_v<MT> >
6644 for(
size_t j=0UL; j<n_; ++j )
6646 if( IsDiagonal_v<MT> )
6648 v_[j+j*MM] += (*rhs)(j,j);
6652 const size_t ibegin( ( IsLower_v<MT> )
6653 ?( IsStrictlyLower_v<MT> ? j+1UL : j )
6655 const size_t iend ( ( IsUpper_v<MT> )
6656 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
6660 for(
size_t i=ibegin; i<iend; ++i ) {
6661 v_[i+j*MM] += (*rhs)(i,j);
6682template<
typename Type
6688template<
typename MT
6691 -> EnableIf_t< VectorizedAddAssign_v<MT> >
6698 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<MT> );
6700 for(
size_t j=0UL; j<n_; ++j )
6702 const size_t ibegin( ( IsLower_v<MT> )
6703 ?(
prevMultiple( ( IsStrictlyLower_v<MT> ? j+1UL : j ), SIMDSIZE ) )
6705 const size_t iend ( ( IsUpper_v<MT> )
6706 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
6710 const size_t ipos( remainder ?
prevMultiple( iend, SIMDSIZE ) : iend );
6715 for( ; i<ipos; i+=SIMDSIZE ) {
6716 store( i, j, load(i,j) + (*rhs).load(i,j) );
6718 for( ; remainder && i<iend; ++i ) {
6719 v_[i+j*MM] += (*rhs)(i,j);
6739template<
typename Type
6745template<
typename MT >
6750 for(
size_t j=0UL; j<n_; ++j )
6751 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
6752 v_[element->index()+j*MM] += element->value();
6770template<
typename Type
6776template<
typename MT >
6783 for(
size_t i=0UL; i<m_; ++i )
6784 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
6785 v_[i+element->index()*MM] += element->value();
6803template<
typename Type
6809template<
typename MT
6812 -> DisableIf_t< VectorizedSubAssign_v<MT> >
6816 for(
size_t j=0UL; j<n_; ++j )
6818 if( IsDiagonal_v<MT> )
6820 v_[j+j*MM] -= (*rhs)(j,j);
6824 const size_t ibegin( ( IsLower_v<MT> )
6825 ?( IsStrictlyLower_v<MT> ? j+1UL : j )
6827 const size_t iend ( ( IsUpper_v<MT> )
6828 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
6832 for(
size_t i=ibegin; i<iend; ++i ) {
6833 v_[i+j*MM] -= (*rhs)(i,j);
6854template<
typename Type
6860template<
typename MT
6863 -> EnableIf_t< VectorizedSubAssign_v<MT> >
6870 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<MT> );
6872 for(
size_t j=0UL; j<n_; ++j )
6874 const size_t ibegin( ( IsLower_v<MT> )
6875 ?(
prevMultiple( ( IsStrictlyLower_v<MT> ? j+1UL : j ), SIMDSIZE ) )
6877 const size_t iend ( ( IsUpper_v<MT> )
6878 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
6882 const size_t ipos( remainder ?
prevMultiple( iend, SIMDSIZE ) : iend );
6887 for( ; i<ipos; i+=SIMDSIZE ) {
6888 store( i, j, load(i,j) - (*rhs).load(i,j) );
6890 for( ; remainder && i<iend; ++i ) {
6891 v_[i+j*MM] -= (*rhs)(i,j);
6911template<
typename Type
6917template<
typename MT >
6922 for(
size_t j=0UL; j<n_; ++j )
6923 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
6924 v_[element->index()+j*MM] -= element->value();
6942template<
typename Type
6948template<
typename MT >
6955 for(
size_t i=0UL; i<m_; ++i )
6956 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
6957 v_[i+element->index()*MM] -= element->value();
6975template<
typename Type
6981template<
typename MT
6984 -> DisableIf_t< VectorizedSchurAssign_v<MT> >
6988 for(
size_t j=0UL; j<n_; ++j ) {
6989 for(
size_t i=0UL; i<m_; ++i ) {
6990 v_[i+j*MM] *= (*rhs)(i,j);
7010template<
typename Type
7016template<
typename MT
7019 -> EnableIf_t< VectorizedSchurAssign_v<MT> >
7025 constexpr bool remainder( PF ==
unpadded || !IsPadded_v<MT> );
7027 for(
size_t j=0UL; j<n_; ++j )
7029 const size_t ipos( remainder ?
prevMultiple( m_, SIMDSIZE ) : m_ );
7034 for( ; i<ipos; i+=SIMDSIZE ) {
7035 store( i, j, load(i,j) * (*rhs).load(i,j) );
7037 for( ; remainder && i<m_; ++i ) {
7038 v_[i+j*MM] *= (*rhs)(i,j);
7058template<
typename Type
7064template<
typename MT >
7069 const HybridMatrix tmp(
serial( *
this ) );
7073 for(
size_t j=0UL; j<n_; ++j )
7074 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
7075 v_[element->index()+j*MM] = tmp.v_[element->index()+j*MM] * element->value();
7093template<
typename Type
7099template<
typename MT >
7106 const HybridMatrix tmp(
serial( *
this ) );
7110 for(
size_t i=0UL; i<m_; ++i )
7111 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
7112 v_[i+element->index()*MM] = tmp.v_[i+element->index()*MM] * element->value();
7133template< RelaxationFlag RF,
typename Type,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7134bool isDefault(
const HybridMatrix<Type,M,N,SO,AF,PF,Tag>& m );
7136template<
typename Type,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7137bool isIntact(
const HybridMatrix<Type,M,N,SO,AF,PF,Tag>& m )
noexcept;
7139template<
typename Type,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7140void swap( HybridMatrix<Type,M,N,SO,AF,PF,Tag>& a, HybridMatrix<Type,M,N,SO,AF,PF,Tag>& b )
noexcept;
7203template<
typename Type
7212 return m.isIntact();
7225template<
typename Type
7232inline void swap(
HybridMatrix<Type,M,N,SO,AF,PF,Tag>& a,
HybridMatrix<Type,M,N,SO,AF,PF,Tag>& b )
noexcept
7249template<
typename T,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7250struct MaxSize< HybridMatrix<T,M,N,SO,AF,PF,Tag>, 0UL >
7251 :
public Ptrdiff_t< static_cast<ptrdiff_t>(M) >
7254template<
typename T,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7255struct MaxSize< HybridMatrix<T,M,N,SO,AF,PF,Tag>, 1UL >
7256 :
public Ptrdiff_t< static_cast<ptrdiff_t>(N) >
7272template<
typename T,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7273struct HasConstDataAccess< HybridMatrix<T,M,N,SO,AF,PF,Tag> >
7290template<
typename T,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7291struct HasMutableDataAccess< HybridMatrix<T,M,N,SO,AF,PF,Tag> >
7308template<
typename T,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7309struct IsAligned< HybridMatrix<T,M,N,SO,AF,PF,Tag> >
7326template<
typename T,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7327struct IsContiguous< HybridMatrix<T,M,N,SO,AF,PF,Tag> >
7344template<
typename T,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7345struct IsPadded< HybridMatrix<T,M,N,SO,AF,PF,Tag> >
7362template<
typename T1,
typename T2 >
7363struct AddTraitEval2< T1, T2
7375 static constexpr bool SO1 = StorageOrder_v<T1>;
7376 static constexpr bool SO2 = StorageOrder_v<T2>;
7378 static constexpr bool SO = ( IsDenseMatrix_v<T1> && IsDenseMatrix_v<T2>
7379 ? ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
7380 ? ( IsSymmetric_v<T1>
7388 using Type = HybridMatrix< AddTrait_t< ElementType_t<T1>, ElementType_t<T2> >
7389 ,
min(
size_t( MaxSize_v<T1,0UL> ),
size_t( MaxSize_v<T2,0UL> ) )
7390 ,
min(
size_t( MaxSize_v<T1,1UL> ),
size_t( MaxSize_v<T2,1UL> ) )
7394 , AddTrait_t< TagType_t<T1>, TagType_t<T2> > >;
7410template<
typename T1,
typename T2 >
7411struct SubTraitEval2< T1, T2
7423 static constexpr bool SO1 = StorageOrder_v<T1>;
7424 static constexpr bool SO2 = StorageOrder_v<T2>;
7426 static constexpr bool SO = ( IsDenseMatrix_v<T1> && IsDenseMatrix_v<T2>
7427 ? ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
7428 ? ( IsSymmetric_v<T1>
7436 using Type = HybridMatrix< SubTrait_t< ElementType_t<T1>, ElementType_t<T2> >
7437 ,
min(
size_t( MaxSize_v<T1,0UL> ),
size_t( MaxSize_v<T2,0UL> ) )
7438 ,
min(
size_t( MaxSize_v<T1,1UL> ),
size_t( MaxSize_v<T2,1UL> ) )
7442 , SubTrait_t< TagType_t<T1>, TagType_t<T2> > >;
7458template<
typename T1,
typename T2 >
7459struct SchurTraitEval2< T1, T2
7461 IsDenseMatrix_v<T2> &&
7471 static constexpr bool SO1 = StorageOrder_v<T1>;
7472 static constexpr bool SO2 = StorageOrder_v<T2>;
7474 static constexpr bool SO = ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
7475 ? ( IsSymmetric_v<T1>
7480 using Type = HybridMatrix< MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >
7481 ,
min(
size_t( MaxSize_v<T1,0UL> ),
size_t( MaxSize_v<T2,0UL> ) )
7482 ,
min(
size_t( MaxSize_v<T1,1UL> ),
size_t( MaxSize_v<T2,1UL> ) )
7486 , MultTrait_t< TagType_t<T1>, TagType_t<T2> > >;
7502template<
typename T1,
typename T2 >
7503struct MultTraitEval2< T1, T2
7511 using Type = HybridMatrix< MultTrait_t< ElementType_t<T1>, T2 >
7514 , StorageOrder_v<T1>
7517 , MultTrait_t< TagType_t<T1>, T2 > >;
7520template<
typename T1,
typename T2 >
7521struct MultTraitEval2< T1, T2
7529 using Type = HybridMatrix< MultTrait_t< T1, ElementType_t<T2> >
7532 , StorageOrder_v<T2>
7535 , MultTrait_t< T1, TagType_t<T2> > >;
7538template<
typename T1,
typename T2 >
7539struct MultTraitEval2< T1, T2
7541 IsRowVector_v<T2> &&
7547 using Type = HybridMatrix< MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >
7553 , MultTrait_t< TagType_t<T1>, TagType_t<T2> > >;
7556template<
typename T1,
typename T2 >
7557struct MultTraitEval2< T1, T2
7563 ( !IsSquare_v<T2> || Size_v<T1,1UL> ==
DefaultSize_v ) ) ) &&
7569 using MultType = MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >;
7570 using MultTag = MultTrait_t< TagType_t<T1>, TagType_t<T2> >;
7572 using Type = HybridMatrix< AddTrait_t<MultType,MultType>
7573 , ( MaxSize_v<T1,0UL> !=
DefaultMaxSize_v ? MaxSize_v<T1,0UL> : MaxSize_v<T2,0UL> )
7574 , ( MaxSize_v<T2,1UL> !=
DefaultMaxSize_v ? MaxSize_v<T2,1UL> : MaxSize_v<T1,1UL> )
7575 , ( IsSparseMatrix_v<T1> ? StorageOrder_v<T2> : StorageOrder_v<T1> )
7578 , AddTrait_t<MultTag,MultTag> >;
7594template<
typename T1,
typename T2 >
7595struct KronTraitEval2< T1, T2
7597 IsDenseMatrix_v<T2> &&
7607 using Type = HybridMatrix< MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >
7608 , MaxSize_v<T1,0UL> * MaxSize_v<T2,0UL>
7609 , MaxSize_v<T1,1UL> * MaxSize_v<T2,1UL>
7610 , StorageOrder_v<T2>
7613 , MultTrait_t< TagType_t<T1>, TagType_t<T2> > >;
7629template<
typename T1,
typename T2 >
7630struct DivTraitEval2< T1, T2
7638 using Type = HybridMatrix< DivTrait_t< ElementType_t<T1>, T2 >
7641 , StorageOrder_v<T1>
7644 , DivTrait_t< TagType_t<T1>, T2 > >;
7660template<
typename T,
typename OP >
7661struct UnaryMapTraitEval2< T, OP
7668 using ElementType =
decltype( std::declval<OP>()( std::declval< ElementType_t<T> >() ) );
7670 using Type = HybridMatrix< EvaluateTrait_t<ElementType>
7676 , MapTrait_t< TagType_t<T>, OP > >;
7684template<
typename T1,
typename T2,
typename OP >
7685struct BinaryMapTraitEval2< T1, T2, OP
7687 IsRowVector_v<T2> &&
7693 using ElementType =
decltype( std::declval<OP>()( std::declval< ElementType_t<T1> >()
7694 , std::declval< ElementType_t<T2> >() ) );
7696 using Type = HybridMatrix< EvaluateTrait_t<ElementType>
7702 , MapTrait_t< TagType_t<T1>, TagType_t<T2>, OP > >;
7705template<
typename T1,
typename T2,
typename OP >
7706struct BinaryMapTraitEval2< T1, T2, OP
7718 using ElementType =
decltype( std::declval<OP>()( std::declval< ElementType_t<T1> >()
7719 , std::declval< ElementType_t<T2> >() ) );
7721 static constexpr bool SO1 = StorageOrder_v<T1>;
7722 static constexpr bool SO2 = StorageOrder_v<T2>;
7724 static constexpr bool SO = ( IsDenseMatrix_v<T1> && IsDenseMatrix_v<T2>
7725 ? ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
7726 ? ( IsSymmetric_v<T1>
7734 using Type = HybridMatrix< EvaluateTrait_t<ElementType>
7735 ,
min(
size_t( MaxSize_v<T1,0UL> ),
size_t( MaxSize_v<T2,0UL> ) )
7736 ,
min(
size_t( MaxSize_v<T1,1UL> ),
size_t( MaxSize_v<T2,1UL> ) )
7740 , MapTrait_t< TagType_t<T1>, TagType_t<T2>, OP > >;
7756template<
typename T,
size_t E >
7757struct ExpandTraitEval2< T, E
7763 using Type = HybridMatrix< ElementType_t<T>
7764 , ( IsColumnVector_v<T> ? MaxSize_v<T,0UL> : E )
7765 , ( IsColumnVector_v<T> ? E : MaxSize_v<T,0UL> )
7785template<
typename T,
size_t R0,
size_t R1 >
7786struct RepeatTraitEval2< T, R0, R1,
inf
7795 using Type = HybridMatrix< ElementType_t<T>
7796 , R0*MaxSize_v<T,0UL>
7797 , R1*MaxSize_v<T,1UL>
7817template<
typename T1,
typename T2 >
7818struct SolveTraitEval2< T1, T2
7820 IsDenseMatrix_v<T2> &&
7833 ?
min( MaxSize_v<T1,0UL>, MaxSize_v<T1,1UL>, MaxSize_v<T2,0UL> )
7844 using Type = HybridMatrix< ElementType_t<T2>
7847 , StorageOrder_v<T2>
7866template<
typename T1,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag,
typename T2 >
7867struct HighType< HybridMatrix<T1,M,N,SO,AF,PF,Tag>, HybridMatrix<T2,M,N,SO,AF,PF,Tag> >
7869 using Type = HybridMatrix< typename HighType<T1,T2>::Type, M, N, SO, AF, PF, Tag >;
7885template<
typename T1,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag,
typename T2 >
7886struct LowType< HybridMatrix<T1,M,N,SO,AF,PF,Tag>, HybridMatrix<T2,M,N,SO,AF,PF,Tag> >
7888 using Type = HybridMatrix< typename LowType<T1,T2>::Type, M, N, SO, AF, PF, Tag >;
7904template<
typename MT >
7912 using Type = HybridMatrix< RemoveConst_t< ElementType_t<MT> >
7913 ,
max( Size_v<MT,0UL>, MaxSize_v<MT,0UL> )
7914 ,
max( Size_v<MT,1UL>, MaxSize_v<MT,1UL> )
7915 , StorageOrder_v<MT>
7934template<
typename MT,
size_t M >
7935struct RowsTraitEval2< MT, M
7937 IsDenseMatrix_v<MT> &&
7941 using Type = HybridMatrix< RemoveConst_t< ElementType_t<MT> >
7963template<
typename MT,
size_t N >
7964struct ColumnsTraitEval2< MT, N
7966 IsDenseMatrix_v<MT> &&
7970 using Type = HybridMatrix< RemoveConst_t< ElementType_t<MT> >
Header file for the addition trait.
Header file for auxiliary alias declarations.
typename ResultType_t< T >::TagType TagType_t
Alias declaration for nested TagType type definitions.
Definition: Aliases.h:530
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition: Aliases.h:450
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition: Aliases.h:190
Header file for the AlignedArray implementation.
Header file for the alignment check function.
Header file for the alignment flag enumeration.
Header file for the AlignmentOf type trait.
Header file for run time assertion macros.
Header file for the columns trait.
Header file for the conjugate shim.
Constraint on the data type.
Header file for the DenseIterator class template.
Constraint on the data type.
Header file for the division trait.
Header file for the EnableIf class template.
Header file for the EvaluateTrait class template.
Header file for the expand trait.
Constraint on the data type.
Header file for the HasConstDataAccess type trait.
Header file for the HasMutableDataAccess type trait.
Header file for the HasSIMDAdd type trait.
Header file for the HasSIMDMult type trait.
Header file for the HasSIMDSub type trait.
Header file for the HighType type trait.
Header file for the IntegralConstant class template.
Header file for the IsAligned type trait.
Header file for the IsColumnMajorMatrix type trait.
Header file for the IsColumnVector type trait.
Header file for the IsContiguous type trait.
Header file for the isDefault shim.
Header file for the IsDenseMatrix type trait.
Header file for the IsDenseVector type trait.
Header file for the IsDiagonal type trait.
Header file for the IsLower type trait.
Header file for the IsMatrix type trait.
Header file for the IsNumeric type trait.
Header file for the IsPadded type trait.
Header file for the IsRowMajorMatrix type trait.
Header file for the IsRowVector type trait.
Header file for the IsSIMDCombinable type trait.
Header file for the IsSame and IsStrictlySame type traits.
Header file for the IsScalar type trait.
Header file for the IsSparseMatrix type trait.
Header file for the IsSquare type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Header file for the IsUpper type trait.
Header file for the IsVectorizable type trait.
Header file for the Kron product trait.
Header file for the LowType type trait.
Header file for the map trait.
Header file for the MaxSize type trait.
Header file for the MAYBE_UNUSED function template.
Header file for memory allocation and deallocation functionality.
Header file for the multiplication trait.
Header file for the nextMultiple shim.
Header file for the padding flag enumeration.
Constraint on the data type.
Header file for the prevMultiple shim.
Constraint on the data type.
Header file for the relaxation flag enumeration.
Header file for the RemoveCV type trait.
Header file for the RemoveConst type trait.
Header file for the repeat trait.
Header file for the rows trait.
Header file for all SIMD functionality.
Header file for the Schur product trait.
Header file for the Solver trait.
Header file for the subtraction trait.
Header file for the submatrix trait.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Implementation of a generic iterator for dense vectors and matrices.
Definition: DenseIterator.h:60
Base class for dense matrices.
Definition: DenseMatrix.h:82
Efficient implementation of a dynamically sized matrix with static memory.
Definition: HybridMatrix.h:256
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t i, size_t j) const noexcept
Unaligned load of a SIMD element of the matrix.
Definition: HybridMatrix.h:2874
constexpr size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: HybridMatrix.h:1932
static constexpr bool simdEnabled
Compilation flag for SIMD optimization.
Definition: HybridMatrix.h:311
static constexpr size_t Alignment
Alignment of the data elements.
Definition: HybridMatrix.h:556
void swap(HybridMatrix &m) noexcept
Swapping the contents of two hybrid matrices.
Definition: HybridMatrix.h:2265
size_t m_
The current number of rows of the matrix.
Definition: HybridMatrix.h:576
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: HybridMatrix.h:317
HybridMatrix< Type, M, N,!SO, AF, PF, Tag > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: HybridMatrix.h:266
SIMDTrait_t< ElementType > SIMDType
SIMD type of the matrix elements.
Definition: HybridMatrix.h:272
BLAZE_ALWAYS_INLINE void store(size_t i, size_t j, const SIMDType &value) noexcept
Store of a SIMD element of the matrix.
Definition: HybridMatrix.h:2913
size_t n_
The current number of columns of the matrix.
Definition: HybridMatrix.h:577
constexpr void reset()
Reset to the default initial values.
Definition: HybridMatrix.h:2086
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: HybridMatrix.h:1155
static constexpr size_t NN
Alignment adjustment.
Definition: HybridMatrix.h:442
constexpr ConstIterator cbegin(size_t i) const noexcept
Returns an iterator to the first element of row/column i.
Definition: HybridMatrix.h:1375
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: HybridMatrix.h:280
static constexpr size_t capacity() noexcept
Returns the maximum capacity of the matrix.
Definition: HybridMatrix.h:1973
constexpr void resize(size_t m, size_t n, bool preserve=true)
Changing the size of the matrix.
Definition: HybridMatrix.h:2190
auto schurAssign(const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedSchurAssign_v< MT > >
Default implementation of the Schur product assignment of a dense matrix.
Definition: HybridMatrix.h:3544
BLAZE_ALWAYS_INLINE SIMDType load(size_t i, size_t j) const noexcept
Load of a SIMD element of the matrix.
Definition: HybridMatrix.h:2801
BLAZE_ALWAYS_INLINE void storeu(size_t i, size_t j, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the matrix.
Definition: HybridMatrix.h:2988
Type ElementType
Type of the matrix elements.
Definition: HybridMatrix.h:271
constexpr void extend(size_t m, size_t n, bool preserve=true)
Extending the size of the matrix.
Definition: HybridMatrix.h:2244
BLAZE_ALWAYS_INLINE SIMDType loada(size_t i, size_t j) const noexcept
Aligned load of a SIMD element of the matrix.
Definition: HybridMatrix.h:2834
auto assign(const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedAssign_v< MT > >
Default implementation of the assignment of a dense matrix.
Definition: HybridMatrix.h:3065
Type * Pointer
Pointer to a non-constant matrix value.
Definition: HybridMatrix.h:279
constexpr Iterator end(size_t i) noexcept
Returns an iterator just past the last element of row/column i.
Definition: HybridMatrix.h:1402
const This & CompositeType
Data type for composite expression templates.
Definition: HybridMatrix.h:275
constexpr ConstIterator cend(size_t i) const noexcept
Returns an iterator just past the last element of row/column i.
Definition: HybridMatrix.h:1456
HybridMatrix & transpose()
In-place transpose of the matrix.
Definition: HybridMatrix.h:2310
HybridMatrix< Type, M, N, SO, AF, PF, Tag > This
Type of this HybridMatrix instance.
Definition: HybridMatrix.h:260
constexpr Pointer data() noexcept
Low-level data access to the matrix elements.
Definition: HybridMatrix.h:1220
auto subAssign(const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedSubAssign_v< MT > >
Default implementation of the subtraction assignment of a dense matrix.
Definition: HybridMatrix.h:3376
constexpr Iterator begin(size_t i) noexcept
Returns an iterator to the first element of row/column i.
Definition: HybridMatrix.h:1321
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: HybridMatrix.h:439
constexpr void clear()
Clearing the hybrid matrix.
Definition: HybridMatrix.h:2140
AlignedArray< Type, M *NN, Alignment > AlignedStorage
Type of the aligned storage.
Definition: HybridMatrix.h:560
constexpr size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: HybridMatrix.h:1913
DenseIterator< Type, AF > Iterator
Iterator over non-constant elements.
Definition: HybridMatrix.h:282
constexpr Reference operator()(size_t i, size_t j) noexcept
2D-access to the matrix elements.
Definition: HybridMatrix.h:1100
constexpr HybridMatrix & operator=(const Type &set) &
Homogenous assignment to all matrix elements.
Definition: HybridMatrix.h:1486
DenseIterator< const Type, AF > ConstIterator
Iterator over constant elements.
Definition: HybridMatrix.h:283
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: HybridMatrix.h:2748
Type & Reference
Reference to a non-constant matrix value.
Definition: HybridMatrix.h:277
static constexpr bool isAligned() noexcept
Returns whether the matrix is properly aligned in memory.
Definition: HybridMatrix.h:2771
BLAZE_ALWAYS_INLINE void storea(size_t i, size_t j, const SIMDType &value) noexcept
Aligned store of a SIMD element of the matrix.
Definition: HybridMatrix.h:2947
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: HybridMatrix.h:2723
auto addAssign(const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedAddAssign_v< MT > >
Default implementation of the addition assignment of a row-major dense matrix.
Definition: HybridMatrix.h:3208
Tag TagType
Tag type of this StaticMatrix instance.
Definition: HybridMatrix.h:273
DenseMatrix< This, SO > BaseType
Base type of this HybridMatrix instance.
Definition: HybridMatrix.h:262
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: HybridMatrix.h:2025
This ResultType
Result type for expression template evaluations.
Definition: HybridMatrix.h:263
constexpr HybridMatrix()
The default constructor for HybridMatrix.
Definition: HybridMatrix.h:638
HybridMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: HybridMatrix.h:2369
AlignedStorage v_
The statically allocated matrix elements.
Definition: HybridMatrix.h:566
const Type & ConstReference
Reference to a constant matrix value.
Definition: HybridMatrix.h:278
BLAZE_ALWAYS_INLINE void stream(size_t i, size_t j, const SIMDType &value) noexcept
Aligned, non-temporal store of a SIMD element of the matrix.
Definition: HybridMatrix.h:3028
constexpr bool isIntact() const noexcept
Returns whether the invariants of the hybrid matrix are intact.
Definition: HybridMatrix.h:2670
HybridMatrix< Type, N, M,!SO, AF, PF, Tag > TransposeType
Transpose type for expression template evaluations.
Definition: HybridMatrix.h:269
const Type & ReturnType
Return type for expression template evaluations.
Definition: HybridMatrix.h:274
static constexpr size_t spacing() noexcept
Returns the spacing between the beginning of two rows.
Definition: HybridMatrix.h:1954
Base class for matrices.
Definition: Matrix.h:85
SIMD characteristics of data types.
Definition: SIMDTrait.h:297
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Initializer list type of the Blaze library.
Header file for the DenseMatrix base class.
Header file for the SparseMatrix base class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.
Definition: Volatile.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.
Definition: Pointer.h:79
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.
Definition: Vectorizable.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.
Definition: Const.h:79
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TAG(A, B)
Data type constraint.
Definition: SameTag.h:68
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.
Definition: Reference.h:79
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1339
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1375
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1501
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:812
decltype(auto) inv(const DenseMatrix< MT, SO > &dm)
Calculation of the inverse of the given dense matrix.
Definition: DMatInvExpr.h:405
bool isDefault(const HybridMatrix< Type, M, N, SO, AF, PF, Tag > &m)
Returns whether the given hybrid matrix is in default state.
Definition: HybridMatrix.h:7178
void swap(HybridMatrix< Type, M, N, SO, AF, PF, Tag > &a, HybridMatrix< Type, M, N, SO, AF, PF, Tag > &b) noexcept
Swapping the contents of two hybrid matrices.
Definition: HybridMatrix.h:7232
bool isIntact(const HybridMatrix< Type, M, N, SO, AF, PF, Tag > &m) noexcept
Returns whether the invariants of the given hybrid matrix are intact.
Definition: HybridMatrix.h:7210
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_DIAGONAL_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Diagonal.h:79
BLAZE_ALWAYS_INLINE void cswap(T &a, T &b) noexcept(IsNumeric_v< T >)
Swapping two conjugated values/objects.
Definition: Conjugate.h:193
BLAZE_ALWAYS_INLINE void conjugate(T &a) noexcept(IsNumeric_v< T >)
In-place conjugation of the given value/object.
Definition: Conjugate.h:118
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.
Definition: HasSIMDSub.h:187
constexpr ptrdiff_t DefaultMaxSize_v
Default size of the MaxSize type trait.
Definition: MaxSize.h:72
constexpr ptrdiff_t MaxSize_v
Auxiliary variable template for the MaxSize type trait.
Definition: MaxSize.h:175
constexpr bool IsScalar_v
Auxiliary variable template for the IsScalar type trait.
Definition: IsScalar.h:104
constexpr bool IsRowMajorMatrix_v
Auxiliary variable template for the IsRowMajorMatrix type trait.
Definition: IsRowMajorMatrix.h:129
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.
Definition: IsSIMDCombinable.h:137
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition: Size.h:72
constexpr bool IsDiagonal_v
Auxiliary variable template for the IsDiagonal type trait.
Definition: IsDiagonal.h:148
constexpr bool IsColumnMajorMatrix_v
Auxiliary variable template for the IsColumnMajorMatrix type trait.
Definition: IsColumnMajorMatrix.h:129
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.
Definition: IsMatrix.h:124
constexpr bool IsColumnVector_v
Auxiliary variable template for the IsColumnVector type trait.
Definition: IsColumnVector.h:126
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.
Definition: HasSIMDAdd.h:187
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.
Definition: HasSIMDMult.h:188
constexpr bool IsDenseMatrix_v
Auxiliary variable template for the IsDenseMatrix type trait.
Definition: IsDenseMatrix.h:124
constexpr bool IsDenseVector_v
Auxiliary variable template for the IsDenseVector type trait.
Definition: IsDenseVector.h:124
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition: RelaxationFlag.h:66
BLAZE_ALWAYS_INLINE constexpr auto prevMultiple(T1 value, T2 factor) noexcept
Rounds down an integral value to the previous multiple of a given factor.
Definition: PrevMultiple.h:68
constexpr Infinity inf
Global Infinity instance.
Definition: Infinity.h:1080
constexpr 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
BLAZE_ALWAYS_INLINE constexpr auto nextMultiple(T1 value, T2 factor) noexcept
Rounds up an integral value to the next multiple of a given factor.
Definition: NextMultiple.h:68
PaddingFlag
Padding flag for (un-)padded vectors and matrices.
Definition: PaddingFlag.h:77
AlignmentFlag
Alignment flag for (un-)aligned vectors and matrices.
Definition: AlignmentFlag.h:63
@ padded
Flag for padded vectors and matrices.
Definition: PaddingFlag.h:79
@ unpadded
Flag for unpadded vectors and matrices.
Definition: PaddingFlag.h:78
@ unaligned
Flag for unaligned vectors and matrices.
Definition: AlignmentFlag.h:64
@ aligned
Flag for aligned vectors and matrices.
Definition: AlignmentFlag.h:65
constexpr void clear(Matrix< MT, SO > &matrix)
Clearing the given matrix.
Definition: Matrix.h:960
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:644
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition: Matrix.h:806
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:660
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:1108
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:1221
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:676
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:1195
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition: Assert.h:117
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:75
typename SIMDTrait< T >::Type SIMDTrait_t
Auxiliary alias declaration for the SIMDTrait class template.
Definition: SIMDTrait.h:315
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:78
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:75
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:74
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition: StaticAssert.h:112
constexpr PaddingFlag defaultPaddingFlag
The default padding flag for all vectors and matrices of the Blaze library.
Definition: Padding.h:74
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
constexpr AlignmentFlag defaultAlignmentFlag
The default alignment for all vectors and matrices of the Blaze library.
Definition: Alignment.h:75
constexpr bool IsVectorizable_v
Auxiliary variable template for the IsVectorizable type trait.
Definition: IsVectorizable.h:157
constexpr size_t AlignmentOf_v
Auxiliary variable template for the AlignmentOf type trait.
Definition: AlignmentOf.h:239
BoolConstant< true > TrueType
Type traits base class.
Definition: IntegralConstant.h:132
void deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:230
IntegralConstant< ptrdiff_t, N > Ptrdiff_t
Compile time integral constant wrapper for ptrdiff_t.
Definition: IntegralConstant.h:237
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition: IntegralConstant.h:110
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition: Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
#define BLAZE_THROW_LOGIC_ERROR(MESSAGE)
Macro for the emission of a std::logic_error exception.
Definition: Exception.h:187
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:175
Header file for the exception macros of the math module.
Header file for all forward declarations of the math module.
Header file for the extended initializer_list functionality.
constexpr bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71
constexpr bool columnMajor
Storage order flag for column-major matrices.
Definition: StorageOrder.h:99
Header file for all forward declarations for dense vectors and matrices.
Header file for the Size type trait.
Header file for the StorageOrder type trait.
Header file for the clear shim.
Header file for the serial shim.
Rebind mechanism to obtain a HybridMatrix with different data/element type.
Definition: HybridMatrix.h:290
HybridMatrix< NewType, M, N, SO, AF, PF, Tag > Other
The type of the other HybridMatrix.
Definition: HybridMatrix.h:291
Resize mechanism to obtain a HybridMatrix with different fixed dimensions.
Definition: HybridMatrix.h:300
HybridMatrix< Type, NewM, NewN, SO, AF, PF, Tag > Other
The type of the other HybridMatrix.
Definition: HybridMatrix.h:301
Header file for the default alignment for all vectors and matrices of the Blaze library.
System settings for the inline keywords.
System settings for performance optimizations.
Header file for the default padding flag for all vectors and matrices of the Blaze library.
Header file for basic type definitions.
Header file for the generic max algorithm.
Header file for the generic min algorithm.