35 #ifndef _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_ 36 #define _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_ 224 template<
typename Type
227 ,
bool SO = defaultStorageOrder >
229 :
public DenseMatrix< HybridMatrix<Type,M,N,SO>, SO >
267 template<
typename NewType >
276 template<
size_t NewM
303 explicit inline HybridMatrix(
size_t m,
size_t n,
const Type& init );
306 template<
typename Other >
307 explicit inline HybridMatrix(
size_t m,
size_t n,
const Other* array );
309 template<
typename Other,
size_t Rows,
size_t Cols >
310 explicit inline HybridMatrix(
const Other (&array)[Rows][Cols] );
350 template< typename Other,
size_t Rows,
size_t Cols >
351 inline
HybridMatrix& operator=( const Other (&array)[Rows][Cols] );
354 template< typename MT,
bool SO2 > inline
HybridMatrix& operator= ( const
Matrix<MT,SO2>& rhs );
355 template< typename MT,
bool SO2 > inline
HybridMatrix& operator+=( const
Matrix<MT,SO2>& rhs );
356 template< typename MT,
bool SO2 > inline
HybridMatrix& operator-=( const
Matrix<MT,SO2>& rhs );
357 template< typename MT,
bool SO2 > inline
HybridMatrix& operator%=( const
Matrix<MT,SO2>& rhs );
364 inline
size_t rows() const noexcept;
365 inline
size_t columns() const noexcept;
366 static inline constexpr
size_t spacing() noexcept;
367 static inline constexpr
size_t capacity() noexcept;
368 inline
size_t capacity(
size_t i ) const noexcept;
370 inline
size_t nonZeros(
size_t i ) const;
372 inline
void reset(
size_t i );
374 void resize (
size_t m,
size_t n,
bool preserve=true );
375 inline
void extend (
size_t m,
size_t n,
bool preserve=true );
386 template< typename Other > inline
HybridMatrix& scale( const Other& scalar );
393 static inline
void* operator new (
std::
size_t size );
394 static inline
void* operator new[](
std::
size_t size );
395 static inline
void* operator new (
std::
size_t size, const
std::nothrow_t& );
396 static inline
void* operator new[](
std::
size_t size, const
std::nothrow_t& );
398 static inline
void operator delete (
void* ptr );
399 static inline
void operator delete[](
void* ptr );
400 static inline
void operator delete (
void* ptr, const
std::nothrow_t& );
401 static inline
void operator delete[](
void* ptr, const
std::nothrow_t& );
408 template< typename MT >
410 static constexpr
bool VectorizedAssign_v =
411 ( useOptimizedKernels &&
420 template< typename MT >
422 static constexpr
bool VectorizedAddAssign_v =
423 ( useOptimizedKernels &&
434 template< typename MT >
436 static constexpr
bool VectorizedSubAssign_v =
437 ( useOptimizedKernels &&
448 template< typename MT >
450 static constexpr
bool VectorizedSchurAssign_v =
451 ( useOptimizedKernels &&
463 inline
bool isIntact() const noexcept;
470 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
471 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
473 static inline constexpr
bool isAligned() noexcept;
484 template< typename MT,
bool SO2 >
487 template< typename MT,
bool SO2 >
493 template< typename MT,
bool SO2 >
496 template< typename MT,
bool SO2 >
502 template< typename MT,
bool SO2 >
505 template< typename MT,
bool SO2 >
511 template< typename MT,
bool SO2 >
514 template< typename MT,
bool SO2 >
577 template< typename Type
588 if( IsNumeric_v<Type> ) {
589 for(
size_t i=0UL; i<M*
NN; ++i )
611 template<
typename Type
630 if( IsNumeric_v<Type> ) {
631 for(
size_t i=0UL; i<M*
NN; ++i )
654 template<
typename Type
673 for(
size_t i=0UL; i<m; ++i ) {
674 for(
size_t j=0UL; j<n; ++j )
677 if( IsNumeric_v<Type> ) {
678 for(
size_t j=n; j<
NN; ++j )
683 if( IsNumeric_v<Type> ) {
684 for(
size_t i=m; i<M; ++i )
685 for(
size_t j=0UL; j<
NN; ++j )
718 template<
typename Type
739 for(
const auto& rowList : list ) {
740 std::fill( std::copy( rowList.begin(), rowList.end(),
v_+i*
NN ),
v_+(i+1UL)*
NN, Type() );
744 if( IsNumeric_v<Type> ) {
746 for(
size_t j=0UL; j<
NN; ++j )
782 template<
typename Type
786 template<
typename Other >
802 for(
size_t i=0UL; i<m; ++i ) {
803 for(
size_t j=0UL; j<n; ++j )
804 v_[i*
NN+j] = array[i*n+j];
806 if( IsNumeric_v<Type> ) {
807 for(
size_t j=n; j<
NN; ++j )
812 if( IsNumeric_v<Type> ) {
813 for(
size_t i=m; i<M; ++i )
814 for(
size_t j=0UL; j<
NN; ++j )
844 template<
typename Type
848 template<
typename Other
860 for(
size_t i=0UL; i<Rows; ++i ) {
861 for(
size_t j=0UL; j<Cols; ++j )
862 v_[i*
NN+j] = array[i][j];
864 if( IsNumeric_v<Type> ) {
865 for(
size_t j=Cols; j<
NN; ++j )
870 if( IsNumeric_v<Type> ) {
871 for(
size_t i=Rows; i<M; ++i )
872 for(
size_t j=0UL; j<
NN; ++j )
889 template<
typename Type
900 for(
size_t i=0UL; i<
m_; ++i ) {
901 for(
size_t j=0UL; j<
n_; ++j )
902 v_[i*
NN+j] = m.v_[i*
NN+j];
904 if( IsNumeric_v<Type> ) {
905 for(
size_t j=
n_; j<
NN; ++j )
910 if( IsNumeric_v<Type> ) {
911 for(
size_t i=
m_; i<M; ++i )
912 for(
size_t j=0UL; j<
NN; ++j )
927 template<
typename Type
931 template<
typename MT
946 for(
size_t i=0UL; i<
m_; ++i ) {
947 for(
size_t j=( IsSparseMatrix_v<MT> ? 0UL :
n_ );
948 j<( IsNumeric_v<Type> ?
NN :
n_ );
954 if( IsNumeric_v<Type> ) {
955 for(
size_t i=
m_; i<M; ++i )
956 for(
size_t j=0UL; j<
NN; ++j )
985 template<
typename Type
1009 template<
typename Type
1034 template<
typename Type
1047 return (*
this)(i,j);
1063 template<
typename Type
1076 return (*
this)(i,j);
1093 template<
typename Type
1117 template<
typename Type
1137 template<
typename Type
1158 template<
typename Type
1182 template<
typename Type
1206 template<
typename Type
1230 template<
typename Type
1254 template<
typename Type
1278 template<
typename Type
1302 template<
typename Type
1329 template<
typename Type
1338 for(
size_t i=0UL; i<
m_; ++i )
1339 for(
size_t j=0UL; j<
n_; ++j )
1372 template<
typename Type
1379 const size_t m( list.size() );
1394 for(
const auto& rowList : list ) {
1395 std::fill( std::copy( rowList.begin(), rowList.end(), v_+i*NN ), v_+(i+1UL)*NN, Type() );
1425 template<
typename Type
1429 template<
typename Other
1439 for(
size_t i=0UL; i<Rows; ++i )
1440 for(
size_t j=0UL; j<Cols; ++j )
1441 v_[i*NN+j] = array[i][j];
1456 template<
typename Type
1462 using blaze::assign;
1467 resize( rhs.rows(), rhs.columns() );
1468 assign( *
this, ~rhs );
1488 template<
typename Type
1492 template<
typename MT
1496 using blaze::assign;
1498 using TT = decltype(
trans( *
this ) );
1499 using CT = decltype(
ctrans( *
this ) );
1500 using IT = decltype(
inv( *
this ) );
1506 if( IsSame_v<MT,TT> && (~rhs).isAliased(
this ) ) {
1509 else if( IsSame_v<MT,CT> && (~rhs).isAliased(
this ) ) {
1512 else if( !IsSame_v<MT,IT> && (~rhs).canAlias(
this ) ) {
1514 resize( tmp.rows(), tmp.columns() );
1515 assign( *
this, tmp );
1519 if( IsSparseMatrix_v<MT> )
1521 assign( *
this, ~rhs );
1541 template<
typename Type
1545 template<
typename MT
1549 using blaze::addAssign;
1555 if( (~rhs).canAlias(
this ) ) {
1557 addAssign( *
this, tmp );
1560 addAssign( *
this, ~rhs );
1580 template<
typename Type
1584 template<
typename MT
1588 using blaze::subAssign;
1594 if( (~rhs).canAlias(
this ) ) {
1596 subAssign( *
this, tmp );
1599 subAssign( *
this, ~rhs );
1619 template<
typename Type
1623 template<
typename MT
1627 using blaze::schurAssign;
1633 if( (~rhs).canAlias(
this ) ) {
1635 schurAssign( *
this, tmp );
1638 schurAssign( *
this, ~rhs );
1661 template<
typename Type
1677 template<
typename Type
1696 template<
typename Type
1712 template<
typename Type
1734 template<
typename Type
1754 template<
typename Type
1760 size_t nonzeros( 0UL );
1762 for(
size_t i=0UL; i<
m_; ++i )
1763 for(
size_t j=0UL; j<
n_; ++j )
1783 template<
typename Type
1791 const size_t jend( i*NN +
n_ );
1792 size_t nonzeros( 0UL );
1794 for(
size_t j=i*NN; j<jend; ++j )
1808 template<
typename Type
1816 for(
size_t i=0UL; i<
m_; ++i )
1817 for(
size_t j=0UL; j<
n_; ++j )
1818 clear( v_[i*NN+j] );
1834 template<
typename Type
1843 for(
size_t j=0UL; j<
n_; ++j )
1844 clear( v_[i*NN+j] );
1856 template<
typename Type
1903 template<
typename Type
1919 if( IsVectorizable_v<Type> && n <
n_ ) {
1920 for(
size_t i=0UL; i<m; ++i )
1921 for(
size_t j=n; j<
n_; ++j )
1922 v_[i*NN+j] = Type();
1925 if( IsVectorizable_v<Type> && m <
m_ ) {
1926 for(
size_t i=m; i<
m_; ++i )
1927 for(
size_t j=0UL; j<
n_; ++j )
1928 v_[i*NN+j] = Type();
1952 template<
typename Type
1970 template<
typename Type
1978 const size_t maxrows(
max(
m_, m.m_ ) );
1979 const size_t maxcols(
max(
n_, m.n_ ) );
1981 for(
size_t i=0UL; i<maxrows; ++i ) {
1982 for(
size_t j=0UL; j<maxcols; ++j ) {
1983 swap( v_[i*NN+j], m(i,j) );
2012 template<
typename Type
2020 if(
m_ > N ||
n_ > M ) {
2024 const size_t maxsize(
max(
m_,
n_ ) );
2025 for(
size_t i=1UL; i<maxsize; ++i ) {
2026 for(
size_t j=0UL; j<i; ++j ) {
2027 swap( v_[i*NN+j], v_[j*NN+i] );
2031 if( IsVectorizable_v<Type> &&
m_ <
n_ ) {
2032 for(
size_t i=0UL; i<
m_; ++i ) {
2033 for(
size_t j=
m_; j<
n_; ++j ) {
2034 v_[i*NN+j] = Type();
2039 if( IsVectorizable_v<Type> &&
m_ >
n_ ) {
2040 for(
size_t i=
n_; i<
m_; ++i ) {
2041 for(
size_t j=0UL; j<
n_; ++j ) {
2042 v_[i*NN+j] = Type();
2067 template<
typename Type
2075 if(
m_ > N ||
n_ > M ) {
2079 const size_t maxsize(
max(
m_,
n_ ) );
2080 for(
size_t i=0UL; i<maxsize; ++i ) {
2081 for(
size_t j=0UL; j<i; ++j ) {
2082 cswap( v_[i*NN+j], v_[j*NN+i] );
2087 if( IsVectorizable_v<Type> &&
m_ <
n_ ) {
2088 for(
size_t i=0UL; i<
m_; ++i ) {
2089 for(
size_t j=
m_; j<
n_; ++j ) {
2090 v_[i*NN+j] = Type();
2095 if( IsVectorizable_v<Type> &&
m_ >
n_ ) {
2096 for(
size_t i=
n_; i<
m_; ++i ) {
2097 for(
size_t j=0UL; j<
n_; ++j ) {
2098 v_[i*NN+j] = Type();
2129 template<
typename Type
2133 template<
typename Other >
2136 for(
size_t i=0UL; i<
m_; ++i )
2137 for(
size_t j=0UL; j<
n_; ++j )
2138 v_[i*NN+j] *= scalar;
2163 template<
typename Type
2173 return allocate<HybridMatrix>( 1UL );
2188 template<
typename Type
2212 template<
typename Type
2222 return allocate<HybridMatrix>( 1UL );
2237 template<
typename Type
2257 template<
typename Type
2263 deallocate( static_cast<HybridMatrix*>( ptr ) );
2274 template<
typename Type
2280 deallocate( static_cast<HybridMatrix*>( ptr ) );
2291 template<
typename Type
2297 deallocate( static_cast<HybridMatrix*>( ptr ) );
2308 template<
typename Type
2314 deallocate( static_cast<HybridMatrix*>( ptr ) );
2336 template<
typename Type
2342 if(
m_ > M ||
n_ > N )
2345 if( IsVectorizable_v<Type> )
2347 for(
size_t i=0UL; i<
m_; ++i ) {
2348 for(
size_t j=
n_; j<NN; ++j ) {
2349 if( v_[i*NN+j] != Type() )
2354 for(
size_t i=
m_; i<M; ++i ) {
2355 for(
size_t j=0UL; j<NN; ++j ) {
2356 if( v_[i*NN+j] != Type() )
2385 template<
typename Type
2389 template<
typename Other >
2392 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2407 template<
typename Type
2411 template<
typename Other >
2414 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2428 template<
typename Type
2454 template<
typename Type
2462 return loada( i, j );
2464 return loadu( i, j );
2484 template<
typename Type
2501 return loada( &v_[i*NN+j] );
2521 template<
typename Type
2536 return loadu( &v_[i*NN+j] );
2557 template<
typename Type
2588 template<
typename Type
2605 storea( &v_[i*NN+j], value );
2626 template<
typename Type
2641 storeu( &v_[i*NN+j], value );
2663 template<
typename Type
2680 stream( &v_[i*NN+j], value );
2696 template<
typename Type
2700 template<
typename MT
2707 for(
size_t i=0UL; i<
m_; ++i ) {
2708 for(
size_t j=0UL; j<
n_; ++j ) {
2709 v_[i*NN+j] = (~rhs)(i,j);
2727 template<
typename Type
2731 template<
typename MT
2740 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
2742 const size_t jpos( ( remainder )?(
n_ &
size_t(-SIMDSIZE) ):(
n_ ) );
2745 for(
size_t i=0UL; i<
m_; ++i )
2749 for( ; j<jpos; j+=SIMDSIZE ) {
2750 store( i, j, (~rhs).load(i,j) );
2752 for( ; remainder && j<
n_; ++j ) {
2753 v_[i*NN+j] = (~rhs)(i,j);
2771 template<
typename Type
2775 template<
typename MT >
2780 for(
size_t i=0UL; i<
m_; ++i )
2781 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2782 v_[i*NN+element->index()] = element->value();
2798 template<
typename Type
2802 template<
typename MT >
2809 for(
size_t j=0UL; j<
n_; ++j )
2810 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2811 v_[element->index()*NN+j] = element->value();
2827 template<
typename Type
2831 template<
typename MT
2838 for(
size_t i=0UL; i<
m_; ++i )
2840 if( IsDiagonal_v<MT> )
2842 v_[i*NN+i] += (~rhs)(i,i);
2846 const size_t jbegin( ( IsUpper_v<MT> )
2847 ?( IsStrictlyUpper_v<MT> ? i+1UL : i )
2849 const size_t jend ( ( IsLower_v<MT> )
2850 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
2854 for(
size_t j=jbegin; j<jend; ++j ) {
2855 v_[i*NN+j] += (~rhs)(i,j);
2874 template<
typename Type
2878 template<
typename MT
2888 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
2890 for(
size_t i=0UL; i<
m_; ++i )
2892 const size_t jbegin( ( IsUpper_v<MT> )
2893 ?( ( IsStrictlyUpper_v<MT> ? i+1UL : i ) &
size_t(-SIMDSIZE) )
2895 const size_t jend ( ( IsLower_v<MT> )
2896 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
2900 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
2901 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2905 for( ; j<jpos; j+=SIMDSIZE ) {
2906 store( i, j, load(i,j) + (~rhs).load(i,j) );
2908 for( ; remainder && j<jend; ++j ) {
2909 v_[i*NN+j] += (~rhs)(i,j);
2927 template<
typename Type
2931 template<
typename MT >
2936 for(
size_t i=0UL; i<
m_; ++i )
2937 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2938 v_[i*NN+element->index()] += element->value();
2954 template<
typename Type
2958 template<
typename MT >
2965 for(
size_t j=0UL; j<
n_; ++j )
2966 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2967 v_[element->index()*NN+j] += element->value();
2983 template<
typename Type
2987 template<
typename MT
2994 for(
size_t i=0UL; i<
m_; ++i )
2996 if( IsDiagonal_v<MT> )
2998 v_[i*NN+i] -= (~rhs)(i,i);
3002 const size_t jbegin( ( IsUpper_v<MT> )
3003 ?( IsStrictlyUpper_v<MT> ? i+1UL : i )
3005 const size_t jend ( ( IsLower_v<MT> )
3006 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
3010 for(
size_t j=jbegin; j<jend; ++j ) {
3011 v_[i*NN+j] -= (~rhs)(i,j);
3030 template<
typename Type
3034 template<
typename MT
3044 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
3046 for(
size_t i=0UL; i<
m_; ++i )
3048 const size_t jbegin( ( IsUpper_v<MT> )
3049 ?( ( IsStrictlyUpper_v<MT> ? i+1UL : i ) &
size_t(-SIMDSIZE) )
3051 const size_t jend ( ( IsLower_v<MT> )
3052 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
3056 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
3057 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
3061 for( ; j<jpos; j+=SIMDSIZE ) {
3062 store( i, j, load(i,j) - (~rhs).load(i,j) );
3064 for( ; remainder && j<jend; ++j ) {
3065 v_[i*NN+j] -= (~rhs)(i,j);
3083 template<
typename Type
3087 template<
typename MT >
3092 for(
size_t i=0UL; i<
m_; ++i )
3093 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
3094 v_[i*NN+element->index()] -= element->value();
3110 template<
typename Type
3114 template<
typename MT >
3121 for(
size_t j=0UL; j<
n_; ++j )
3122 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
3123 v_[element->index()*NN+j] -= element->value();
3139 template<
typename Type
3143 template<
typename MT
3150 for(
size_t i=0UL; i<
m_; ++i ) {
3151 for(
size_t j=0UL; j<
n_; ++j ) {
3152 v_[i*NN+j] *= (~rhs)(i,j);
3170 template<
typename Type
3174 template<
typename MT
3183 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
3185 for(
size_t i=0UL; i<
m_; ++i )
3187 const size_t jpos( ( remainder )?(
n_ &
size_t(-SIMDSIZE) ):(
n_ ) );
3192 for( ; j<jpos; j+=SIMDSIZE ) {
3193 store( i, j, load(i,j) * (~rhs).load(i,j) );
3195 for( ; remainder && j<
n_; ++j ) {
3196 v_[i*NN+j] *= (~rhs)(i,j);
3214 template<
typename Type
3218 template<
typename MT >
3227 for(
size_t i=0UL; i<
m_; ++i )
3228 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
3229 v_[i*NN+element->index()] = tmp.v_[i*NN+element->index()] * element->value();
3245 template<
typename Type
3249 template<
typename MT >
3260 for(
size_t j=0UL; j<
n_; ++j )
3261 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
3262 v_[element->index()*NN+j] = tmp.v_[element->index()*NN+j] * element->value();
3287 template<
typename Type
3291 :
public DenseMatrix< HybridMatrix<Type,M,N,true>, true >
3302 static constexpr
bool align = ( usePadding || MM %
SIMDSIZE == 0UL );
3329 template<
typename NewType >
3338 template<
size_t NewM
3341 using Other = HybridMatrix<Type,NewM,NewN,true>;
3351 static constexpr
bool simdEnabled = IsVectorizable_v<Type>;
3365 explicit inline HybridMatrix(
size_t m,
size_t n,
const Type& init );
3366 explicit inline HybridMatrix( initializer_list< initializer_list<Type> > list );
3368 template<
typename Other >
3369 explicit inline HybridMatrix(
size_t m,
size_t n,
const Other* array );
3371 template<
typename Other,
size_t Rows,
size_t Cols >
3372 explicit inline HybridMatrix(
const Other (&array)[Rows][Cols] );
3375 template<
typename MT,
bool SO >
inline HybridMatrix(
const Matrix<MT,SO>& m );
3410 inline
HybridMatrix& operator=( initializer_list< initializer_list<Type> > list );
3412 template< typename Other,
size_t Rows,
size_t Cols >
3413 inline
HybridMatrix& operator=( const Other (&array)[Rows][Cols] );
3416 template< typename MT,
bool SO > inline
HybridMatrix& operator= ( const Matrix<MT,SO>& rhs );
3417 template< typename MT,
bool SO > inline
HybridMatrix& operator+=( const Matrix<MT,SO>& rhs );
3418 template< typename MT,
bool SO > inline
HybridMatrix& operator-=( const Matrix<MT,SO>& rhs );
3419 template< typename MT,
bool SO > inline
HybridMatrix& operator%=( const Matrix<MT,SO>& rhs );
3426 inline
size_t rows() const noexcept;
3427 inline
size_t columns() const noexcept;
3428 static inline constexpr
size_t spacing() noexcept;
3429 static inline constexpr
size_t capacity() noexcept;
3430 inline
size_t capacity(
size_t j ) const noexcept;
3432 inline
size_t nonZeros(
size_t j ) const;
3433 inline
void reset();
3434 inline
void reset(
size_t i );
3435 inline
void clear();
3436 void resize (
size_t m,
size_t n,
bool preserve=true );
3437 inline
void extend (
size_t m,
size_t n,
bool preserve=true );
3448 template< typename Other > inline
HybridMatrix& scale( const Other& scalar );
3455 static inline
void* operator new (
std::
size_t size );
3456 static inline
void* operator new[](
std::
size_t size );
3457 static inline
void* operator new (
std::
size_t size, const
std::nothrow_t& );
3458 static inline
void* operator new[](
std::
size_t size, const
std::nothrow_t& );
3460 static inline
void operator delete (
void* ptr );
3461 static inline
void operator delete[](
void* ptr );
3462 static inline
void operator delete (
void* ptr, const
std::nothrow_t& );
3463 static inline
void operator delete[](
void* ptr, const
std::nothrow_t& );
3470 template< typename MT >
3471 static constexpr
bool VectorizedAssign_v =
3472 ( useOptimizedKernels &&
3480 template< typename MT >
3481 static constexpr
bool VectorizedAddAssign_v =
3482 ( useOptimizedKernels &&
3492 template< typename MT >
3493 static constexpr
bool VectorizedSubAssign_v =
3494 ( useOptimizedKernels &&
3504 template< typename MT >
3505 static constexpr
bool VectorizedSchurAssign_v =
3506 ( useOptimizedKernels &&
3517 inline
bool isIntact() const noexcept;
3524 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
3525 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
3527 static inline constexpr
bool isAligned() noexcept;
3538 template< typename MT,
bool SO >
3539 inline auto
assign( const DenseMatrix<MT,SO>& rhs ) ->
DisableIf_t< VectorizedAssign_v<MT> >;
3541 template< typename MT,
bool SO >
3542 inline auto
assign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedAssign_v<MT> >;
3544 template< typename MT > inline
void assign( const SparseMatrix<MT,true>& rhs );
3545 template< typename MT > inline
void assign( const SparseMatrix<MT,false>& rhs );
3547 template< typename MT,
bool SO >
3548 inline auto
addAssign( const DenseMatrix<MT,SO>& rhs ) ->
DisableIf_t< VectorizedAddAssign_v<MT> >;
3550 template< typename MT,
bool SO >
3551 inline auto
addAssign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedAddAssign_v<MT> >;
3553 template< typename MT > inline
void addAssign( const SparseMatrix<MT,true>& rhs );
3554 template< typename MT > inline
void addAssign( const SparseMatrix<MT,false>& rhs );
3556 template< typename MT,
bool SO >
3557 inline auto
subAssign( const DenseMatrix<MT,SO>& rhs ) ->
DisableIf_t< VectorizedSubAssign_v<MT> >;
3559 template< typename MT,
bool SO >
3560 inline auto
subAssign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedSubAssign_v<MT> >;
3562 template< typename MT > inline
void subAssign( const SparseMatrix<MT,true>& rhs );
3563 template< typename MT > inline
void subAssign( const SparseMatrix<MT,false>& rhs );
3565 template< typename MT,
bool SO >
3568 template< typename MT,
bool SO >
3569 inline auto
schurAssign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedSchurAssign_v<MT> >;
3571 template< typename MT > inline
void schurAssign( const SparseMatrix<MT,true>& rhs );
3572 template< typename MT > inline
void schurAssign( const SparseMatrix<MT,false>& rhs );
3623 template< typename Type
3633 if( IsNumeric_v<Type> ) {
3634 for(
size_t i=0UL; i<MM*N; ++i )
3658 template<
typename Type
3676 if( IsNumeric_v<Type> ) {
3677 for(
size_t i=0UL; i<MM*N; ++i )
3702 template<
typename Type
3720 for(
size_t j=0UL; j<n; ++j ) {
3721 for(
size_t i=0UL; i<m; ++i )
3724 if( IsNumeric_v<Type> ) {
3725 for(
size_t i=m; i<MM; ++i )
3726 v_[i+j*MM] = Type();
3730 if( IsNumeric_v<Type> ) {
3731 for(
size_t j=n; j<N; ++j )
3732 for(
size_t i=0UL; i<MM; ++i )
3733 v_[i+j*MM] = Type();
3767 template<
typename Type
3787 for(
const auto& rowList : list ) {
3789 for(
const auto& element : rowList ) {
3790 v_[i+j*MM] = element;
3793 if( IsNumeric_v<Type> ) {
3795 v_[i+j*MM] = Type();
3803 if( IsNumeric_v<Type> ) {
3804 for( ; i<MM; ++i ) {
3805 for(
size_t j=0UL; j<N; ++j ) {
3806 v_[i+j*MM] = Type();
3845 template<
typename Type
3848 template<
typename Other >
3864 for(
size_t j=0UL; j<n; ++j ) {
3865 for(
size_t i=0UL; i<m; ++i )
3866 v_[i+j*MM] = array[i+j*m];
3868 if( IsNumeric_v<Type> ) {
3869 for(
size_t i=m; i<MM; ++i )
3870 v_[i+j*MM] = Type();
3874 if( IsNumeric_v<Type> ) {
3875 for(
size_t j=n; j<N; ++j )
3876 for(
size_t i=0UL; i<MM; ++i )
3877 v_[i+j*MM] = Type();
3908 template<
typename Type
3911 template<
typename Other
3923 for(
size_t j=0UL; j<Cols; ++j ) {
3924 for(
size_t i=0UL; i<Rows; ++i )
3925 v_[i+j*MM] = array[i][j];
3927 if( IsNumeric_v<Type> ) {
3928 for(
size_t i=Rows; i<MM; ++i )
3929 v_[i+j*MM] = Type();
3933 if( IsNumeric_v<Type> ) {
3934 for(
size_t j=Cols; j<N; ++j )
3935 for(
size_t i=0UL; i<MM; ++i )
3936 v_[i+j*MM] = Type();
3954 template<
typename Type
3964 for(
size_t j=0UL; j<
n_; ++j ) {
3965 for(
size_t i=0UL; i<
m_; ++i )
3966 v_[i+j*MM] = m.v_[i+j*MM];
3968 if( IsNumeric_v<Type> ) {
3969 for(
size_t i=
m_; i<MM; ++i )
3970 v_[i+j*MM] = Type();
3974 if( IsNumeric_v<Type> ) {
3975 for(
size_t j=
n_; j<N; ++j )
3976 for(
size_t i=0UL; i<MM; ++i )
3977 v_[i+j*MM] = Type();
3993 template<
typename Type
3996 template<
typename MT
4003 using blaze::assign;
4011 for(
size_t j=0UL; j<
n_; ++j ) {
4012 for(
size_t i=( IsSparseMatrix_v<MT> ? 0UL :
m_ );
4013 i<( IsNumeric_v<Type> ? MM :
m_ );
4015 v_[i+j*MM] = Type();
4019 if( IsNumeric_v<Type> ) {
4020 for(
size_t j=
n_; j<N; ++j )
4021 for(
size_t i=0UL; i<MM; ++i )
4022 v_[i+j*MM] = Type();
4052 template<
typename Type
4077 template<
typename Type
4103 template<
typename Type
4115 return (*
this)(i,j);
4133 template<
typename Type
4145 return (*
this)(i,j);
4163 template<
typename Type
4187 template<
typename Type
4208 template<
typename Type
4230 template<
typename Type
4250 template<
typename Type
4270 template<
typename Type
4290 template<
typename Type
4310 template<
typename Type
4330 template<
typename Type
4350 template<
typename Type
4378 template<
typename Type
4381 inline HybridMatrix<Type,M,N,true>&
4387 for(
size_t j=0UL; j<
n_; ++j )
4388 for(
size_t i=0UL; i<
m_; ++i )
4423 template<
typename Type
4426 inline HybridMatrix<Type,M,N,true>&
4429 const size_t m( list.size() );
4444 for(
const auto& rowList : list ) {
4446 for(
const auto& element : rowList ) {
4447 v_[i+j*MM] = element;
4450 for( ; j<
n_; ++j ) {
4451 v_[i+j*MM] = Type();
4484 template<
typename Type
4487 template<
typename Other
4490 inline HybridMatrix<Type,M,N,true>&
4498 for(
size_t j=0UL; j<Cols; ++j )
4499 for(
size_t i=0UL; i<Rows; ++i )
4500 v_[i+j*MM] = array[i][j];
4517 template<
typename Type
4520 inline HybridMatrix<Type,M,N,true>&
4523 using blaze::assign;
4528 resize( rhs.rows(), rhs.columns() );
4529 assign( *
this, ~rhs );
4551 template<
typename Type
4554 template<
typename MT
4558 using blaze::assign;
4560 using TT = decltype(
trans( *
this ) );
4561 using CT = decltype(
ctrans( *
this ) );
4562 using IT = decltype(
inv( *
this ) );
4568 if( IsSame_v<MT,TT> && (~rhs).isAliased(
this ) ) {
4571 else if( IsSame_v<MT,CT> && (~rhs).isAliased(
this ) ) {
4574 else if( !IsSame_v<MT,IT> && (~rhs).canAlias(
this ) ) {
4575 HybridMatrix tmp( ~rhs );
4576 resize( tmp.rows(), tmp.columns() );
4577 assign( *
this, tmp );
4581 if( IsSparseMatrix_v<MT> )
4583 assign( *
this, ~rhs );
4605 template<
typename Type
4608 template<
typename MT
4610 inline HybridMatrix<Type,M,N,true>& HybridMatrix<Type,M,N,true>::operator+=(
const Matrix<MT,SO>& rhs )
4612 using blaze::addAssign;
4618 if( (~rhs).canAlias(
this ) ) {
4619 const ResultType_t<MT> tmp( ~rhs );
4620 addAssign( *
this, tmp );
4623 addAssign( *
this, ~rhs );
4645 template<
typename Type
4648 template<
typename MT
4650 inline HybridMatrix<Type,M,N,true>& HybridMatrix<Type,M,N,true>::operator-=(
const Matrix<MT,SO>& rhs )
4652 using blaze::subAssign;
4658 if( (~rhs).canAlias(
this ) ) {
4659 const ResultType_t<MT> tmp( ~rhs );
4660 subAssign( *
this, tmp );
4663 subAssign( *
this, ~rhs );
4685 template<
typename Type
4688 template<
typename MT
4690 inline HybridMatrix<Type,M,N,true>& HybridMatrix<Type,M,N,true>::operator%=(
const Matrix<MT,SO>& rhs )
4692 using blaze::schurAssign;
4698 if( (~rhs).canAlias(
this ) ) {
4699 const ResultType_t<MT> tmp( ~rhs );
4700 schurAssign( *
this, tmp );
4703 schurAssign( *
this, ~rhs );
4728 template<
typename Type
4745 template<
typename Type
4765 template<
typename Type
4782 template<
typename Type
4800 template<
typename Type
4821 template<
typename Type
4826 size_t nonzeros( 0UL );
4828 for(
size_t j=0UL; j<
n_; ++j )
4829 for(
size_t i=0UL; i<
m_; ++i )
4846 template<
typename Type
4853 const size_t iend( j*MM +
m_ );
4854 size_t nonzeros( 0UL );
4856 for(
size_t i=j*MM; i<iend; ++i )
4872 template<
typename Type
4879 for(
size_t j=0UL; j<
n_; ++j )
4880 for(
size_t i=0UL; i<
m_; ++i )
4881 clear( v_[i+j*MM] );
4897 template<
typename Type
4905 for(
size_t i=0UL; i<
m_; ++i )
4906 clear( v_[i+j*MM] );
4920 template<
typename Type
4968 template<
typename Type
4983 if( IsVectorizable_v<Type> && m <
m_ ) {
4984 for(
size_t j=0UL; j<n; ++j )
4985 for(
size_t i=m; i<
m_; ++i )
4986 v_[i+j*MM] = Type();
4989 if( IsVectorizable_v<Type> && n <
n_ ) {
4990 for(
size_t j=n; j<
n_; ++j )
4991 for(
size_t i=0UL; i<
m_; ++i )
4992 v_[i+j*MM] = Type();
5018 template<
typename Type
5037 template<
typename Type
5044 const size_t maxrows(
max(
m_, m.m_ ) );
5045 const size_t maxcols(
max(
n_, m.n_ ) );
5047 for(
size_t j=0UL; j<maxcols; ++j ) {
5048 for(
size_t i=0UL; i<maxrows; ++i ) {
5049 swap( v_[i+j*MM], m(i,j) );
5080 template<
typename Type
5087 if(
m_ > N ||
n_ > M ) {
5091 const size_t maxsize(
max(
m_,
n_ ) );
5092 for(
size_t j=1UL; j<maxsize; ++j ) {
5093 for(
size_t i=0UL; i<j; ++i ) {
5094 swap( v_[i+j*MM], v_[j+i*MM] );
5098 if( IsVectorizable_v<Type> &&
n_ <
m_ ) {
5099 for(
size_t j=0UL; j<
n_; ++j ) {
5100 for(
size_t i=
n_; i<
m_; ++i ) {
5101 v_[i+j*MM] = Type();
5106 if( IsVectorizable_v<Type> &&
n_ >
m_ ) {
5107 for(
size_t j=
m_; j<
n_; ++j ) {
5108 for(
size_t i=0UL; i<
m_; ++i ) {
5109 v_[i+j*MM] = Type();
5136 template<
typename Type
5143 if(
m_ > N ||
n_ > M ) {
5147 const size_t maxsize(
max(
m_,
n_ ) );
5148 for(
size_t j=0UL; j<maxsize; ++j ) {
5149 for(
size_t i=0UL; i<j; ++i ) {
5150 cswap( v_[i+j*MM], v_[j+i*MM] );
5155 if( IsVectorizable_v<Type> &&
n_ <
m_ ) {
5156 for(
size_t j=0UL; j<
n_; ++j ) {
5157 for(
size_t i=
n_; i<
m_; ++i ) {
5158 v_[i+j*MM] = Type();
5163 if( IsVectorizable_v<Type> &&
n_ >
m_ ) {
5164 for(
size_t j=
m_; j<
n_; ++j ) {
5165 for(
size_t i=0UL; i<
m_; ++i ) {
5166 v_[i+j*MM] = Type();
5199 template<
typename Type
5202 template<
typename Other >
5203 inline HybridMatrix<Type,M,N,true>&
5204 HybridMatrix<Type,M,N,true>::scale(
const Other& scalar )
5206 for(
size_t j=0UL; j<
n_; ++j )
5207 for(
size_t i=0UL; i<
m_; ++i )
5208 v_[i+j*MM] *= scalar;
5235 template<
typename Type
5238 inline void* HybridMatrix<Type,M,N,true>::operator
new( std::size_t
size )
5244 return allocate<HybridMatrix>( 1UL );
5261 template<
typename Type
5264 inline void* HybridMatrix<Type,M,N,true>::operator
new[]( std::size_t
size )
5269 return allocate<HybridMatrix>(
size/
sizeof(HybridMatrix) );
5286 template<
typename Type
5289 inline void* HybridMatrix<Type,M,N,true>::operator
new( std::size_t
size,
const std::nothrow_t& )
5295 return allocate<HybridMatrix>( 1UL );
5312 template<
typename Type
5315 inline void* HybridMatrix<Type,M,N,true>::operator
new[]( std::size_t
size,
const std::nothrow_t& )
5320 return allocate<HybridMatrix>(
size/
sizeof(HybridMatrix) );
5333 template<
typename Type
5336 inline void HybridMatrix<Type,M,N,true>::operator
delete(
void* ptr )
5338 deallocate( static_cast<HybridMatrix*>( ptr ) );
5351 template<
typename Type
5354 inline void HybridMatrix<Type,M,N,true>::operator
delete[](
void* ptr )
5356 deallocate( static_cast<HybridMatrix*>( ptr ) );
5369 template<
typename Type
5372 inline void HybridMatrix<Type,M,N,true>::operator
delete(
void* ptr,
const std::nothrow_t& )
5374 deallocate( static_cast<HybridMatrix*>( ptr ) );
5387 template<
typename Type
5390 inline void HybridMatrix<Type,M,N,true>::operator
delete[](
void* ptr,
const std::nothrow_t& )
5392 deallocate( static_cast<HybridMatrix*>( ptr ) );
5416 template<
typename Type
5421 if(
m_ > M ||
n_ > N )
5424 if( IsVectorizable_v<Type> )
5426 for(
size_t j=0UL; j<
n_; ++j ) {
5427 for(
size_t i=
m_; i<MM; ++i ) {
5428 if( v_[i+j*MM] != Type() )
5433 for(
size_t j=
n_; j<N; ++j ) {
5434 for(
size_t i=0UL; i<MM; ++i ) {
5435 if( v_[i+j*MM] != Type() )
5466 template<
typename Type
5469 template<
typename Other >
5472 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5489 template<
typename Type
5492 template<
typename Other >
5495 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5511 template<
typename Type
5537 template<
typename Type
5544 return loada( i, j );
5546 return loadu( i, j );
5567 template<
typename Type
5583 return loada( &v_[i+j*MM] );
5604 template<
typename Type
5618 return loadu( &v_[i+j*MM] );
5640 template<
typename Type
5671 template<
typename Type
5687 storea( &v_[i+j*MM], value );
5709 template<
typename Type
5723 storeu( &v_[i+j*MM], value );
5746 template<
typename Type
5762 stream( &v_[i+j*MM], value );
5780 template<
typename Type
5783 template<
typename MT
5786 -> DisableIf_t< VectorizedAssign_v<MT> >
5790 for(
size_t j=0UL; j<
n_; ++j ) {
5791 for(
size_t i=0UL; i<
m_; ++i ) {
5792 v_[i+j*MM] = (~rhs)(i,j);
5812 template<
typename Type
5815 template<
typename MT
5818 -> EnableIf_t< VectorizedAssign_v<MT> >
5824 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
5826 const size_t ipos( ( remainder )?(
m_ &
size_t(-SIMDSIZE) ):(
m_ ) );
5829 for(
size_t j=0UL; j<
n_; ++j )
5833 for( ; i<ipos; i+=SIMDSIZE ) {
5834 store( i, j, (~rhs).load(i,j) );
5836 for( ; remainder && i<
m_; ++i ) {
5837 v_[i+j*MM] = (~rhs)(i,j);
5857 template<
typename Type
5860 template<
typename MT >
5865 for(
size_t j=0UL; j<
n_; ++j )
5866 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5867 v_[element->index()+j*MM] = element->value();
5885 template<
typename Type
5888 template<
typename MT >
5895 for(
size_t i=0UL; i<
m_; ++i )
5896 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5897 v_[i+element->index()*MM] = element->value();
5915 template<
typename Type
5918 template<
typename MT
5921 -> DisableIf_t< VectorizedAddAssign_v<MT> >
5925 for(
size_t j=0UL; j<
n_; ++j )
5927 if( IsDiagonal_v<MT> )
5929 v_[j+j*MM] += (~rhs)(j,j);
5933 const size_t ibegin( ( IsLower_v<MT> )
5934 ?( IsStrictlyLower_v<MT> ? j+1UL : j )
5936 const size_t iend ( ( IsUpper_v<MT> )
5937 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
5941 for(
size_t i=ibegin; i<iend; ++i ) {
5942 v_[i+j*MM] += (~rhs)(i,j);
5963 template<
typename Type
5966 template<
typename MT
5969 -> EnableIf_t< VectorizedAddAssign_v<MT> >
5976 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
5978 for(
size_t j=0UL; j<
n_; ++j )
5980 const size_t ibegin( ( IsLower_v<MT> )
5981 ?( ( IsStrictlyLower_v<MT> ? j+1UL : j ) &
size_t(-SIMDSIZE) )
5983 const size_t iend ( ( IsUpper_v<MT> )
5984 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
5988 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5989 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5993 for( ; i<ipos; i+=SIMDSIZE ) {
5994 store( i, j, load(i,j) + (~rhs).load(i,j) );
5996 for( ; remainder && i<iend; ++i ) {
5997 v_[i+j*MM] += (~rhs)(i,j);
6017 template<
typename Type
6020 template<
typename MT >
6025 for(
size_t j=0UL; j<
n_; ++j )
6026 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
6027 v_[element->index()+j*MM] += element->value();
6045 template<
typename Type
6048 template<
typename MT >
6055 for(
size_t i=0UL; i<
m_; ++i )
6056 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
6057 v_[i+element->index()*MM] += element->value();
6075 template<
typename Type
6078 template<
typename MT
6081 -> DisableIf_t< VectorizedSubAssign_v<MT> >
6085 for(
size_t j=0UL; j<
n_; ++j )
6087 if( IsDiagonal_v<MT> )
6089 v_[j+j*MM] -= (~rhs)(j,j);
6093 const size_t ibegin( ( IsLower_v<MT> )
6094 ?( IsStrictlyLower_v<MT> ? j+1UL : j )
6096 const size_t iend ( ( IsUpper_v<MT> )
6097 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
6101 for(
size_t i=ibegin; i<iend; ++i ) {
6102 v_[i+j*MM] -= (~rhs)(i,j);
6123 template<
typename Type
6126 template<
typename MT
6129 -> EnableIf_t< VectorizedSubAssign_v<MT> >
6136 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
6138 for(
size_t j=0UL; j<
n_; ++j )
6140 const size_t ibegin( ( IsLower_v<MT> )
6141 ?( ( IsStrictlyLower_v<MT> ? j+1UL : j ) &
size_t(-SIMDSIZE) )
6143 const size_t iend ( ( IsUpper_v<MT> )
6144 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
6148 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
6149 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
6153 for( ; i<ipos; i+=SIMDSIZE ) {
6154 store( i, j, load(i,j) - (~rhs).load(i,j) );
6156 for( ; remainder && i<iend; ++i ) {
6157 v_[i+j*MM] -= (~rhs)(i,j);
6177 template<
typename Type
6180 template<
typename MT >
6185 for(
size_t j=0UL; j<
n_; ++j )
6186 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
6187 v_[element->index()+j*MM] -= element->value();
6205 template<
typename Type
6208 template<
typename MT >
6215 for(
size_t i=0UL; i<
m_; ++i )
6216 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
6217 v_[i+element->index()*MM] -= element->value();
6235 template<
typename Type
6238 template<
typename MT
6241 -> DisableIf_t< VectorizedSchurAssign_v<MT> >
6245 for(
size_t j=0UL; j<
n_; ++j ) {
6246 for(
size_t i=0UL; i<
m_; ++i ) {
6247 v_[i+j*MM] *= (~rhs)(i,j);
6267 template<
typename Type
6270 template<
typename MT
6273 -> EnableIf_t< VectorizedSchurAssign_v<MT> >
6279 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
6281 for(
size_t j=0UL; j<
n_; ++j )
6283 const size_t ipos( ( remainder )?(
m_ &
size_t(-SIMDSIZE) ):(
m_ ) );
6288 for( ; i<ipos; i+=SIMDSIZE ) {
6289 store( i, j, load(i,j) * (~rhs).load(i,j) );
6291 for( ; remainder && i<
m_; ++i ) {
6292 v_[i+j*MM] *= (~rhs)(i,j);
6312 template<
typename Type
6315 template<
typename MT >
6320 const HybridMatrix tmp(
serial( *
this ) );
6324 for(
size_t j=0UL; j<
n_; ++j )
6325 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
6326 v_[element->index()+j*MM] = tmp.v_[element->index()+j*MM] * element->value();
6344 template<
typename Type
6347 template<
typename MT >
6354 const HybridMatrix tmp(
serial( *
this ) );
6358 for(
size_t i=0UL; i<
m_; ++i )
6359 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
6360 v_[i+element->index()*MM] = tmp.v_[i+element->index()*MM] * element->value();
6381 template<
typename Type,
size_t M,
size_t N,
bool SO >
6382 void reset( HybridMatrix<Type,M,N,SO>& m );
6384 template<
typename Type,
size_t M,
size_t N,
bool SO >
6385 void reset( HybridMatrix<Type,M,N,SO>& m,
size_t i );
6387 template<
typename Type,
size_t M,
size_t N,
bool SO >
6388 void clear( HybridMatrix<Type,M,N,SO>& m );
6390 template<
bool RF,
typename Type,
size_t M,
size_t N,
bool SO >
6391 bool isDefault(
const HybridMatrix<Type,M,N,SO>& m );
6393 template<
typename Type,
size_t M,
size_t N,
bool SO >
6394 bool isIntact(
const HybridMatrix<Type,M,N,SO>& m ) noexcept;
6396 template<
typename Type,
size_t M,
size_t N,
bool SO >
6397 void swap( HybridMatrix<Type,M,N,SO>& a, HybridMatrix<Type,M,N,SO>& b ) noexcept;
6409 template<
typename Type
6433 template<
typename Type
6451 template<
typename Type
6494 return ( m.rows() == 0UL && m.columns() == 0UL );
6517 template<
typename Type
6523 return m.isIntact();
6536 template<
typename Type
6557 template<
typename T,
size_t M,
size_t N,
bool SO >
6558 struct MaxSize< HybridMatrix<T,M,N,SO>, 0UL >
6562 template<
typename T,
size_t M,
size_t N,
bool SO >
6563 struct MaxSize< HybridMatrix<T,M,N,SO>, 1UL >
6580 template<
typename T,
size_t M,
size_t N,
bool SO >
6581 struct HasConstDataAccess< HybridMatrix<T,M,N,SO> >
6598 template<
typename T,
size_t M,
size_t N,
bool SO >
6599 struct HasMutableDataAccess< HybridMatrix<T,M,N,SO> >
6616 template<
typename T,
size_t M,
size_t N,
bool SO >
6617 struct IsAligned< HybridMatrix<T,M,N,SO> >
6618 :
public BoolConstant< HybridMatrix<T,M,N,SO>::isAligned() >
6634 template<
typename T,
size_t M,
size_t N,
bool SO >
6635 struct IsContiguous< HybridMatrix<T,M,N,SO> >
6652 template<
typename T,
size_t M,
size_t N,
bool SO >
6653 struct IsPadded< HybridMatrix<T,M,N,SO> >
6670 template<
typename T,
size_t M,
size_t N,
bool SO >
6671 struct IsResizable< HybridMatrix<T,M,N,SO> >
6688 template<
typename T1,
typename T2 >
6689 struct AddTraitEval2< T1, T2
6701 using ET1 = ElementType_t<T1>;
6702 using ET2 = ElementType_t<T2>;
6704 static constexpr
size_t M =
min(
size_t( MaxSize_v<T1,0UL> ),
size_t( MaxSize_v<T2,0UL> ) );
6705 static constexpr
size_t N =
min(
size_t( MaxSize_v<T1,1UL> ),
size_t( MaxSize_v<T2,1UL> ) );
6707 static constexpr
bool SO1 = StorageOrder_v<T1>;
6708 static constexpr
bool SO2 = StorageOrder_v<T2>;
6710 static constexpr
bool SO = ( IsDenseMatrix_v<T1> && IsDenseMatrix_v<T2>
6711 ? ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
6712 ? ( IsSymmetric_v<T1>
6720 using Type = HybridMatrix< AddTrait_t<ET1,ET2>, M, N, SO >;
6736 template<
typename T1,
typename T2 >
6737 struct SubTraitEval2< T1, T2
6749 using ET1 = ElementType_t<T1>;
6750 using ET2 = ElementType_t<T2>;
6752 static constexpr
size_t M =
min(
size_t( MaxSize_v<T1,0UL> ),
size_t( MaxSize_v<T2,0UL> ) );
6753 static constexpr
size_t N =
min(
size_t( MaxSize_v<T1,1UL> ),
size_t( MaxSize_v<T2,1UL> ) );
6755 static constexpr
bool SO1 = StorageOrder_v<T1>;
6756 static constexpr
bool SO2 = StorageOrder_v<T2>;
6758 static constexpr
bool SO = ( IsDenseMatrix_v<T1> && IsDenseMatrix_v<T2>
6759 ? ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
6760 ? ( IsSymmetric_v<T1>
6768 using Type = HybridMatrix< SubTrait_t<ET1,ET2>, M, N, SO >;
6784 template<
typename T1,
typename T2 >
6785 struct SchurTraitEval2< T1, T2
6787 IsDenseMatrix_v<T2> &&
6797 using ET1 = ElementType_t<T1>;
6798 using ET2 = ElementType_t<T2>;
6800 static constexpr
size_t M =
min(
size_t( MaxSize_v<T1,0UL> ),
size_t( MaxSize_v<T2,0UL> ) );
6801 static constexpr
size_t N =
min(
size_t( MaxSize_v<T1,1UL> ),
size_t( MaxSize_v<T2,1UL> ) );
6803 static constexpr
bool SO1 = StorageOrder_v<T1>;
6804 static constexpr
bool SO2 = StorageOrder_v<T2>;
6806 static constexpr
bool SO = ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
6807 ? ( IsSymmetric_v<T1>
6812 using Type = HybridMatrix< MultTrait_t<ET1,ET2>, M, N, SO >;
6828 template<
typename T1,
typename T2 >
6829 struct MultTraitEval2< T1, T2
6837 using ET1 = ElementType_t<T1>;
6839 static constexpr
size_t M = MaxSize_v<T1,0UL>;
6840 static constexpr
size_t N = MaxSize_v<T1,1UL>;
6842 using Type = HybridMatrix< MultTrait_t<ET1,T2>, M, N, StorageOrder_v<T1> >;
6845 template<
typename T1,
typename T2 >
6846 struct MultTraitEval2< T1, T2
6854 using ET2 = ElementType_t<T2>;
6856 static constexpr
size_t M = MaxSize_v<T2,0UL>;
6857 static constexpr
size_t N = MaxSize_v<T2,1UL>;
6859 using Type = HybridMatrix< MultTrait_t<T1,ET2>, M, N, StorageOrder_v<T2> >;
6862 template<
typename T1,
typename T2 >
6863 struct MultTraitEval2< T1, T2
6865 IsRowVector_v<T2> &&
6871 using ET1 = ElementType_t<T1>;
6872 using ET2 = ElementType_t<T2>;
6874 static constexpr
size_t M = MaxSize_v<T1,0UL>;
6875 static constexpr
size_t N = MaxSize_v<T2,0UL>;
6877 using Type = HybridMatrix< MultTrait_t<ET1,ET2>, M, N,
false >;
6880 template<
typename T1,
typename T2 >
6881 struct MultTraitEval2< T1, T2
6887 ( !IsSquare_v<T2> || Size_v<T1,1UL> ==
DefaultSize_v ) ) ) &&
6893 using ET1 = ElementType_t<T1>;
6894 using ET2 = ElementType_t<T2>;
6896 static constexpr
size_t M = ( MaxSize_v<T1,0UL> !=
DefaultMaxSize_v ? MaxSize_v<T1,0UL> : MaxSize_v<T2,0UL> );
6897 static constexpr
size_t N = ( MaxSize_v<T2,1UL> !=
DefaultMaxSize_v ? MaxSize_v<T2,1UL> : MaxSize_v<T1,1UL> );
6899 static constexpr
bool SO = ( IsSparseMatrix_v<T1> ? StorageOrder_v<T2> : StorageOrder_v<T1> );
6901 using Type = HybridMatrix< MultTrait_t<ET1,ET2>, M, N, SO >;
6917 template<
typename T1,
typename T2 >
6918 struct DivTraitEval2< T1, T2
6926 using ET1 = ElementType_t<T1>;
6928 static constexpr
size_t M = MaxSize_v<T1,0UL>;
6929 static constexpr
size_t N = MaxSize_v<T1,1UL>;
6931 using Type = HybridMatrix< DivTrait_t<ET1,T2>, M, N, StorageOrder_v<T1> >;
6947 template<
typename T,
typename OP >
6948 struct UnaryMapTraitEval2< T, OP
6955 using ET = ElementType_t<T>;
6957 using Type = HybridMatrix< MapTrait_t<ET,OP>, MaxSize_v<T,0UL>, MaxSize_v<T,1UL>, StorageOrder_v<T> >;
6965 template<
typename T1,
typename T2,
typename OP >
6966 struct BinaryMapTraitEval2< T1, T2, OP
6978 using ET1 = ElementType_t<T1>;
6979 using ET2 = ElementType_t<T2>;
6981 static constexpr
size_t M =
min(
size_t( MaxSize_v<T1,0UL> ),
size_t( MaxSize_v<T2,0UL> ) );
6982 static constexpr
size_t N =
min(
size_t( MaxSize_v<T1,1UL> ),
size_t( MaxSize_v<T2,1UL> ) );
6984 static constexpr
bool SO1 = StorageOrder_v<T1>;
6985 static constexpr
bool SO2 = StorageOrder_v<T2>;
6987 static constexpr
bool SO = ( IsDenseMatrix_v<T1> && IsDenseMatrix_v<T2>
6988 ? ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
6989 ? ( IsSymmetric_v<T1>
6997 using Type = HybridMatrix< MapTrait_t<ET1,ET2,OP>, M, N, SO >;
7013 template<
typename T
7015 struct ExpandTraitEval2< T, E
7021 static constexpr
size_t M = ( IsColumnVector_v<T> ? MaxSize_v<T,0UL> : E );
7022 static constexpr
size_t N = ( IsColumnVector_v<T> ? E : MaxSize_v<T,0UL> );
7026 using Type = HybridMatrix< ElementType_t<T>, M, N, TF >;
7042 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
7043 struct HighType< HybridMatrix<T1,M,N,SO>, HybridMatrix<T2,M,N,SO> >
7045 using Type = HybridMatrix< typename HighType<T1,T2>::Type, M, N, SO >;
7061 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
7062 struct LowType< HybridMatrix<T1,M,N,SO>, HybridMatrix<T2,M,N,SO> >
7064 using Type = HybridMatrix< typename LowType<T1,T2>::Type, M, N, SO >;
7080 template<
typename MT >
7088 static constexpr
size_t M =
max( Size_v<MT,0UL>, MaxSize_v<MT,0UL> );
7089 static constexpr
size_t N =
max( Size_v<MT,1UL>, MaxSize_v<MT,1UL> );
7091 using Type = HybridMatrix< RemoveConst_t< ElementType_t<MT> >, M, N, StorageOrder_v<MT> >;
7107 template<
typename MT,
size_t M >
7108 struct RowsTraitEval2< MT, M
7110 IsDenseMatrix_v<MT> &&
7114 using Type = HybridMatrix< RemoveConst_t< ElementType_t<MT> >, M, MaxSize_v<MT,1UL>,
false >;
7130 template<
typename MT,
size_t N >
7131 struct ColumnsTraitEval2< MT, N
7133 IsDenseMatrix_v<MT> &&
7137 using Type = HybridMatrix< RemoveConst_t< ElementType_t<MT> >, MaxSize_v<MT,0UL>, N,
true >;
Constraint on the data type.
#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
Header file for auxiliary alias declarations.
Headerfile for the generic min algorithm.
Header file for the Schur product trait.
Header file for the nextMultiple shim.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the AlignmentOf type trait.
Header file for the UNUSED_PARAMETER function template.
ConstIterator cend(size_t i) const noexcept
Returns an iterator just past the last element of row/column i.
Definition: HybridMatrix.h:1307
Header file for the subtraction trait.
Header file for basic type definitions.
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: HybridMatrix.h:234
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.The HasSIMDSub_v variable template provides...
Definition: HasSIMDSub.h:188
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.The IsMatrix_v variable template provides a c...
Definition: IsMatrix.h:139
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
Header file for the IsSparseMatrix type trait.
Header file for the serial shim.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:224
Header file for the IsDiagonal type trait.
Header file for the IsSame and IsStrictlySame type traits.
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
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
Iterator begin(size_t i) noexcept
Returns an iterator to the first element of row/column i.
Definition: HybridMatrix.h:1187
Header file for the IsColumnMajorMatrix type trait.
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: HybridMatrix.h:1039
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
HybridMatrix< Type, NewM, NewN, SO > Other
The type of the other HybridMatrix.
Definition: HybridMatrix.h:279
size_t m_
The current number of rows of the compressed matrix.
Definition: CompressedMatrix.h:3289
Header file for the IsRowVector type trait.
typename SIMDTrait< T >::Type SIMDTrait_t
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_t alias declaration provid...
Definition: SIMDTrait.h:315
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:851
Iterator end(size_t i) noexcept
Returns an iterator just past the last element of row/column i.
Definition: HybridMatrix.h:1259
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
#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
Access proxy for sparse, matrices.The MatrixAccessProxy provides safe access to the elements of a no...
Definition: MatrixAccessProxy.h:101
DenseIterator< Type, align > Iterator
Iterator over non-constant elements.
Definition: HybridMatrix.h:260
BLAZE_ALWAYS_INLINE void cswap(T &a, T &b) noexcept(IsNumeric_v< T >)
Swapping two conjugated values/objects.
Definition: Conjugate.h:195
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: HybridMatrix.h:1665
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:3085
Header file for memory allocation and deallocation functionality.
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
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
ConstIterator cbegin(size_t i) const noexcept
Returns an iterator to the first element of row/column i.
Definition: HybridMatrix.h:1235
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
AlignedStorage v_
The statically allocated matrix elements.
Definition: HybridMatrix.h:535
Header file for the MaxSize type trait.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
constexpr bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71
Type ElementType
Type of the matrix elements.
Definition: HybridMatrix.h:250
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:137
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
Constraint on the data type.
HybridMatrix< NewType, M, N, SO > Other
The type of the other HybridMatrix.
Definition: HybridMatrix.h:269
Header file for the IsMatrix type trait.
SIMDTrait_t< ElementType > SIMDType
SIMD type of the matrix elements.
Definition: HybridMatrix.h:251
Header file for the SparseMatrix base class.
void resize(size_t m, size_t n, bool preserve=true)
Changing the size of the matrix.
Definition: HybridMatrix.h:1907
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: HybridMatrix.h:1758
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
constexpr bool columnMajor
Storage order flag for column-major matrices.
Definition: StorageOrder.h:99
Headerfile for the generic max algorithm.
Header file for the DisableIf class template.
Header file for the LowType type trait.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
constexpr ptrdiff_t DefaultMaxSize_v
Default size of the MaxSize type trait.
Definition: MaxSize.h:72
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.The IsSIMDCombinable_v variable templ...
Definition: IsSIMDCombinable.h:137
Header file for the IsSymmetric type trait.
static constexpr bool align
Compilation switch for the choice of alignment.
Definition: HybridMatrix.h:240
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1364
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5907
HybridMatrix & operator=(const Type &set)
Homogenous assignment to all matrix elements.
Definition: HybridMatrix.h:1333
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:2631
AlignedArray< Type, M *NN, Alignment > AlignedStorage
Type of the aligned storage.
Definition: HybridMatrix.h:529
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.The HasSIMDMult_v variable template provid...
Definition: HasSIMDMult.h:189
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:2562
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
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3080
Header file for the expand trait.
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:1147
constexpr bool IsColumnVector_v
Auxiliary variable template for the IsColumnVector type trait.The IsColumnVector_v variable template ...
Definition: IsColumnVector.h:143
#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
Type * Pointer
Pointer to a non-constant matrix value.
Definition: HybridMatrix.h:257
Header file for the HasSIMDAdd type trait.
Header file for the DenseMatrix base class.
constexpr bool IsColumnMajorMatrix_v
Auxiliary variable template for the IsColumnMajorMatrix type trait.The IsColumnMajorMatrix_v variable...
Definition: IsColumnMajorMatrix.h:146
Header file for the DenseIterator class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
decltype(auto) inv(const DenseMatrix< MT, SO > &dm)
Calculation of the inverse of the given dense matrix.
Definition: DMatInvExpr.h:423
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
static constexpr size_t capacity() noexcept
Returns the maximum capacity of the matrix.
Definition: HybridMatrix.h:1716
Header file for all SIMD functionality.
HybridMatrix()
The default constructor for HybridMatrix.
Definition: HybridMatrix.h:581
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_DIAGONAL_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a diagonal matrix type, a compilation error is created.
Definition: Diagonal.h:79
Reference operator()(size_t i, size_t j) noexcept
2D-access to the matrix elements.
Definition: HybridMatrix.h:990
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:3145
Header file for the IsLower type trait.
size_t m_
The current number of rows of the matrix.
Definition: HybridMatrix.h:545
Header file for the IsAligned type trait.
Type & Reference
Reference to a non-constant matrix value.
Definition: HybridMatrix.h:255
constexpr bool IsDenseVector_v
Auxiliary variable template for the IsDenseVector type trait.The IsDenseVector_v variable template pr...
Definition: IsDenseVector.h:139
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: HybridMatrix.h:258
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:2833
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
Header file for the default storage order for all vectors of the Blaze library.
constexpr bool IsRowMajorMatrix_v
Auxiliary variable template for the IsRowMajorMatrix type trait.The IsRowMajorMatrix_v variable templ...
Definition: IsRowMajorMatrix.h:146
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a vectorizable data type...
Definition: Vectorizable.h:61
void reset()
Reset to the default initial values.
Definition: HybridMatrix.h:1812
static constexpr size_t NN
Alignment adjustment.
Definition: HybridMatrix.h:237
Header file for the exception macros of the math module.
HybridMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: HybridMatrix.h:2071
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:1179
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
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:438
Resize mechanism to obtain a HybridMatrix with different fixed dimensions.
Definition: HybridMatrix.h:278
Header file for the IsDenseMatrix type trait.
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:611
Header file for the IsPadded type trait.
Header file for the IsVectorizable type trait.
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:2668
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
auto assign(const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedAssign_v< MT > >
Default implementation of the assignment of a dense matrix.
Definition: HybridMatrix.h:2702
IntegralConstant< ptrdiff_t, N > PtrdiffT
Compile time integral constant wrapper for ptrdiff_t.The PtrdiffT class template represents an integr...
Definition: PtrdiffT.h:72
void swap(HybridMatrix &m) noexcept
Swapping the contents of two hybrid matrices.
Definition: HybridMatrix.h:1974
static constexpr bool simdEnabled
Compilation flag for SIMD optimization.
Definition: HybridMatrix.h:289
Header file for the RemoveConst type trait.
Header file for the IsSIMDCombinable type trait.
Header file for the PtrdiffT class template.
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:2593
#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
Header file for the HasSIMDMult type trait.
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
static constexpr size_t Alignment
Alignment of the data elements.
Definition: HybridMatrix.h:525
Pointer data() noexcept
Low-level data access to the matrix elements.
Definition: HybridMatrix.h:1098
BLAZE_ALWAYS_INLINE void conjugate(T &a) noexcept(IsNumeric_v< T >)
In-place conjugation of the given value/object.
Definition: Conjugate.h:120
Header file for run time assertion macros.
HybridMatrix & transpose()
In-place transpose of the matrix.
Definition: HybridMatrix.h:2016
const Type & ConstReference
Reference to a constant matrix value.
Definition: HybridMatrix.h:256
Header file for the addition trait.
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:2526
Header file for the division trait.
Header file for the submatrix trait.
Constraint on the data type.
Header file for the IsContiguous type trait.
Header file for the columns trait.
Constraint on the data type.
Header file for the AlignedArray implementation.
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:295
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: HybridMatrix.h:2390
Efficient implementation of a dynamically sized matrix with static memory.The HybridMatrix class temp...
Definition: Forward.h:58
static constexpr bool isAligned() noexcept
Returns whether the matrix is properly aligned in memory.
Definition: HybridMatrix.h:2432
#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 isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:281
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
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
Constraint on the data type.
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:109
HybridMatrix< Type, M, N, SO > This
Type of this HybridMatrix instance.
Definition: HybridMatrix.h:245
Constraint on the data type.
Constraint on the data type.
Header file for the HasSIMDSub type trait.
constexpr bool IsDenseMatrix_v
Auxiliary variable template for the IsDenseMatrix type trait.The IsDenseMatrix_v variable template pr...
Definition: IsDenseMatrix.h:139
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
Header file for the HasMutableDataAccess type trait.
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition: Size.h:72
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:101
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
constexpr bool IsDiagonal_v
Auxiliary variable template for the IsDiagonal type trait.The IsDiagonal_v variable template provides...
Definition: IsDiagonal.h:148
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
BLAZE_ALWAYS_INLINE SIMDType load(size_t i, size_t j) const noexcept
Load of a SIMD element of the matrix.
Definition: HybridMatrix.h:2459
Header file for the IsDenseVector type trait.
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
Header file for the rows trait.
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 bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
Rebind mechanism to obtain a HybridMatrix with different data/element type.
Definition: HybridMatrix.h:268
DenseIterator< const Type, align > ConstIterator
Iterator over constant elements.
Definition: HybridMatrix.h:261
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
size_t n_
The current number of columns of the compressed matrix.
Definition: CompressedMatrix.h:3290
constexpr size_t AlignmentOf_v
Auxiliary variable template for the AlignmentOf type trait.The AlignmentOf_v variable template provid...
Definition: AlignmentOf.h:238
Header file for the IsRowMajorMatrix type trait.
EnableIf_t< IsBuiltin_v< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:224
Header file for the default transpose flag for all vectors of the Blaze library.
Initializer list type of the Blaze library.
Header file for the alignment check function.
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.The HasSIMDAdd_v variable template provides...
Definition: HasSIMDAdd.h:188
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:2489
size_t n_
The current number of columns of the matrix.
Definition: HybridMatrix.h:546
Header file for the StorageOrder type trait.
Header file for the IntegralConstant class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: HybridMatrix.h:252
constexpr Infinity inf
Global Infinity instance.The blaze::inf instance can be used wherever a built-in data type is expecte...
Definition: Infinity.h:1080
static constexpr size_t spacing() noexcept
Returns the spacing between the beginning of two rows.
Definition: HybridMatrix.h:1700
Header file for the map trait.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
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:2989
void clear()
Clearing the hybrid matrix.
Definition: HybridMatrix.h:1860
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
#define BLAZE_THROW_LOGIC_ERROR(MESSAGE)
Macro for the emission of a std::logic_error exception.This macro encapsulates the default way of Bla...
Definition: Exception.h:187
Rebind mechanism to obtain a CompressedMatrix with different data/element type.
Definition: CompressedMatrix.h:3093
Header file for the IsUpper type trait.
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
void extend(size_t m, size_t n, bool preserve=true)
Extending the size of the matrix.
Definition: HybridMatrix.h:1956
Header file for the IsColumnVector type trait.
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
Header file for the IsResizable type trait.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: HybridMatrix.h:1681
System settings for the inline keywords.
Header file for the Size type trait.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: HybridMatrix.h:2412
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:108
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: HybridMatrix.h:295
bool isIntact() const noexcept
Returns whether the invariants of the hybrid matrix are intact.
Definition: HybridMatrix.h:2340
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.
Header file for the clear shim.
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:825