35 #ifndef _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_ 36 #define _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_ 213 template<
typename Type
216 ,
bool SO = defaultStorageOrder >
218 :
public DenseMatrix< HybridMatrix<Type,M,N,SO>, SO >
244 template<
typename NewType >
253 template<
size_t NewM
272 enum :
bool { smpAssignable =
false };
280 explicit inline HybridMatrix(
size_t m,
size_t n,
const Type& init );
283 template<
typename Other >
286 template<
typename Other,
size_t Rows,
size_t Cols >
321 inline HybridMatrix&
operator=(
const Type&
set );
324 template<
typename Other,
size_t Rows,
size_t Cols >
327 inline HybridMatrix&
operator= (
const HybridMatrix& rhs );
331 template<
typename MT,
bool SO2 >
inline HybridMatrix& operator%=(
const Matrix<MT,SO2>& rhs );
334 template<
typename Other >
337 template<
typename Other >
345 inline size_t rows()
const noexcept;
346 inline size_t columns()
const noexcept;
347 inline constexpr
size_t spacing()
const noexcept;
348 inline constexpr
size_t capacity()
const noexcept;
349 inline size_t capacity(
size_t i )
const noexcept;
351 inline size_t nonZeros(
size_t i )
const;
353 inline void reset(
size_t i );
355 void resize (
size_t m,
size_t n,
bool preserve=
true );
356 inline void extend (
size_t m,
size_t n,
bool preserve=
true );
357 inline void swap( HybridMatrix& m ) noexcept;
367 template<
typename Other >
inline HybridMatrix& scale(
const Other& scalar );
374 static inline void*
operator new ( std::size_t
size );
375 static inline void*
operator new[]( std::size_t
size );
376 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
377 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
379 static inline void operator delete (
void* ptr );
380 static inline void operator delete[](
void* ptr );
381 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
382 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
389 template<
typename MT >
391 struct VectorizedAssign {
392 enum :
bool { value = useOptimizedKernels &&
393 simdEnabled && MT::simdEnabled &&
402 template<
typename MT >
404 struct VectorizedAddAssign {
405 enum :
bool { value = useOptimizedKernels &&
406 simdEnabled && MT::simdEnabled &&
417 template<
typename MT >
419 struct VectorizedSubAssign {
420 enum :
bool { value = useOptimizedKernels &&
421 simdEnabled && MT::simdEnabled &&
432 template<
typename MT >
434 struct VectorizedSchurAssign {
435 enum :
bool { value = useOptimizedKernels &&
436 simdEnabled && MT::simdEnabled &&
453 inline bool isIntact()
const noexcept;
460 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
461 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
474 template<
typename MT,
bool SO2 >
477 template<
typename MT,
bool SO2 >
483 template<
typename MT,
bool SO2 >
486 template<
typename MT,
bool SO2 >
492 template<
typename MT,
bool SO2 >
495 template<
typename MT,
bool SO2 >
501 template<
typename MT,
bool SO2 >
504 template<
typename MT,
bool SO2 >
515 enum :
size_t { NN = ( usePadding )?(
nextMultiple( N, SIMDSIZE ) ):( N ) };
563 template<
typename Type
575 for(
size_t i=0UL; i<M*NN; ++i )
597 template<
typename Type
617 for(
size_t i=0UL; i<M*NN; ++i )
640 template<
typename Type
659 for(
size_t i=0UL; i<m; ++i ) {
660 for(
size_t j=0UL; j<n; ++j )
664 for(
size_t j=n; j<NN; ++j )
670 for(
size_t i=m; i<M; ++i )
671 for(
size_t j=0UL; j<NN; ++j )
704 template<
typename Type
725 for(
const auto& rowList : list ) {
726 std::fill( std::copy( rowList.begin(), rowList.end(),
v_+i*NN ),
v_+(i+1UL)*NN, Type() );
732 for(
size_t j=0UL; j<NN; ++j )
768 template<
typename Type
772 template<
typename Other >
788 for(
size_t i=0UL; i<m; ++i ) {
789 for(
size_t j=0UL; j<n; ++j )
790 v_[i*NN+j] = array[i*n+j];
793 for(
size_t j=n; j<NN; ++j )
799 for(
size_t i=m; i<M; ++i )
800 for(
size_t j=0UL; j<NN; ++j )
830 template<
typename Type
834 template<
typename Other
846 for(
size_t i=0UL; i<Rows; ++i ) {
847 for(
size_t j=0UL; j<Cols; ++j )
848 v_[i*NN+j] = array[i][j];
851 for(
size_t j=Cols; j<NN; ++j )
857 for(
size_t i=Rows; i<M; ++i )
858 for(
size_t j=0UL; j<NN; ++j )
875 template<
typename Type
886 for(
size_t i=0UL; i<
m_; ++i ) {
887 for(
size_t j=0UL; j<
n_; ++j )
888 v_[i*NN+j] = m.v_[i*NN+j];
891 for(
size_t j=n_; j<NN; ++j )
897 for(
size_t i=m_; i<M; ++i )
898 for(
size_t j=0UL; j<NN; ++j )
913 template<
typename Type
917 template<
typename MT
932 for(
size_t i=0UL; i<
m_; ++i ) {
934 j<( IsNumeric<Type>::value ? NN :
n_ );
941 for(
size_t i=m_; i<M; ++i )
942 for(
size_t j=0UL; j<NN; ++j )
971 template<
typename Type
995 template<
typename Type
1020 template<
typename Type
1033 return (*
this)(i,j);
1049 template<
typename Type
1062 return (*
this)(i,j);
1079 template<
typename Type
1103 template<
typename Type
1123 template<
typename Type
1144 template<
typename Type
1168 template<
typename Type
1192 template<
typename Type
1216 template<
typename Type
1240 template<
typename Type
1264 template<
typename Type
1288 template<
typename Type
1315 template<
typename Type
1324 for(
size_t i=0UL; i<
m_; ++i )
1325 for(
size_t j=0UL; j<
n_; ++j )
1358 template<
typename Type
1365 const size_t m( list.size() );
1380 for(
const auto& rowList : list ) {
1381 std::fill( std::copy( rowList.begin(), rowList.end(),
v_+i*NN ),
v_+(i+1UL)*NN, Type() );
1411 template<
typename Type
1415 template<
typename Other
1425 for(
size_t i=0UL; i<Rows; ++i )
1426 for(
size_t j=0UL; j<Cols; ++j )
1427 v_[i*NN+j] = array[i][j];
1442 template<
typename Type
1448 using blaze::assign;
1453 resize( rhs.rows(), rhs.columns() );
1454 assign( *
this, ~rhs );
1474 template<
typename Type
1478 template<
typename MT
1482 using blaze::assign;
1500 resize( tmp.rows(), tmp.columns() );
1501 assign( *
this, tmp );
1507 assign( *
this, ~rhs );
1527 template<
typename Type
1531 template<
typename MT
1535 using blaze::addAssign;
1543 addAssign( *
this, tmp );
1546 addAssign( *
this, ~rhs );
1566 template<
typename Type
1570 template<
typename MT
1574 using blaze::subAssign;
1582 subAssign( *
this, tmp );
1585 subAssign( *
this, ~rhs );
1605 template<
typename Type
1609 template<
typename MT
1613 using blaze::schurAssign;
1621 schurAssign( *
this, tmp );
1624 schurAssign( *
this, ~rhs );
1644 template<
typename Type
1648 template<
typename MT
1652 using blaze::assign;
1659 resize( tmp.rows(), tmp.columns() );
1660 assign( *
this, tmp );
1676 template<
typename Type
1680 template<
typename Other >
1684 using blaze::assign;
1686 assign( *
this, (*
this) * rhs );
1704 template<
typename Type
1708 template<
typename Other >
1712 using blaze::assign;
1716 assign( *
this, (*
this) / rhs );
1738 template<
typename Type
1754 template<
typename Type
1773 template<
typename Type
1789 template<
typename Type
1811 template<
typename Type
1831 template<
typename Type
1837 size_t nonzeros( 0UL );
1839 for(
size_t i=0UL; i<
m_; ++i )
1840 for(
size_t j=0UL; j<
n_; ++j )
1860 template<
typename Type
1868 const size_t jend( i*NN +
n_ );
1869 size_t nonzeros( 0UL );
1871 for(
size_t j=i*NN; j<jend; ++j )
1885 template<
typename Type
1893 for(
size_t i=0UL; i<
m_; ++i )
1894 for(
size_t j=0UL; j<
n_; ++j )
1911 template<
typename Type
1920 for(
size_t j=0UL; j<
n_; ++j )
1933 template<
typename Type
1980 template<
typename Type
1997 for(
size_t i=0UL; i<m; ++i )
1998 for(
size_t j=n; j<
n_; ++j )
1999 v_[i*NN+j] = Type();
2003 for(
size_t i=m; i<
m_; ++i )
2004 for(
size_t j=0UL; j<
n_; ++j )
2005 v_[i*NN+j] = Type();
2029 template<
typename Type
2047 template<
typename Type
2055 const size_t maxrows(
max(
m_, m.m_ ) );
2056 const size_t maxcols(
max(
n_, m.n_ ) );
2058 for(
size_t i=0UL; i<maxrows; ++i ) {
2059 for(
size_t j=0UL; j<maxcols; ++j ) {
2060 swap(
v_[i*NN+j], m(i,j) );
2089 template<
typename Type
2097 if(
m_ > N ||
n_ > M ) {
2101 const size_t maxsize(
max(
m_,
n_ ) );
2102 for(
size_t i=1UL; i<maxsize; ++i ) {
2103 for(
size_t j=0UL; j<i; ++j ) {
2109 for(
size_t i=0UL; i<
m_; ++i ) {
2110 for(
size_t j=m_; j<
n_; ++j ) {
2111 v_[i*NN+j] = Type();
2117 for(
size_t i=
n_; i<
m_; ++i ) {
2118 for(
size_t j=0UL; j<
n_; ++j ) {
2119 v_[i*NN+j] = Type();
2144 template<
typename Type
2152 if(
m_ > N ||
n_ > M ) {
2156 const size_t maxsize(
max(
m_,
n_ ) );
2157 for(
size_t i=0UL; i<maxsize; ++i ) {
2158 for(
size_t j=0UL; j<i; ++j ) {
2165 for(
size_t i=0UL; i<
m_; ++i ) {
2166 for(
size_t j=m_; j<
n_; ++j ) {
2167 v_[i*NN+j] = Type();
2173 for(
size_t i=
n_; i<
m_; ++i ) {
2174 for(
size_t j=0UL; j<
n_; ++j ) {
2175 v_[i*NN+j] = Type();
2206 template<
typename Type
2210 template<
typename Other >
2213 for(
size_t i=0UL; i<
m_; ++i )
2214 for(
size_t j=0UL; j<
n_; ++j )
2215 v_[i*NN+j] *= scalar;
2240 template<
typename Type
2250 return allocate<HybridMatrix>( 1UL );
2265 template<
typename Type
2289 template<
typename Type
2299 return allocate<HybridMatrix>( 1UL );
2314 template<
typename Type
2323 return allocate<HybridMatrix>( size/
sizeof(
HybridMatrix) );
2334 template<
typename Type
2340 deallocate( static_cast<HybridMatrix*>( ptr ) );
2351 template<
typename Type
2357 deallocate( static_cast<HybridMatrix*>( ptr ) );
2368 template<
typename Type
2374 deallocate( static_cast<HybridMatrix*>( ptr ) );
2385 template<
typename Type
2391 deallocate( static_cast<HybridMatrix*>( ptr ) );
2413 template<
typename Type
2419 if(
m_ > M ||
n_ > N )
2424 for(
size_t i=0UL; i<
m_; ++i ) {
2425 for(
size_t j=
n_; j<NN; ++j ) {
2426 if(
v_[i*NN+j] != Type() )
2431 for(
size_t i=m_; i<M; ++i ) {
2432 for(
size_t j=0UL; j<NN; ++j ) {
2433 if(
v_[i*NN+j] != Type() )
2462 template<
typename Type
2466 template<
typename Other >
2469 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2484 template<
typename Type
2488 template<
typename Other >
2491 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2505 template<
typename Type
2511 return ( usePadding ||
columns() % SIMDSIZE == 0UL );
2531 template<
typename Type
2539 return loada( i, j );
2541 return loadu( i, j );
2561 template<
typename Type
2598 template<
typename Type
2634 template<
typename Type
2665 template<
typename Type
2703 template<
typename Type
2740 template<
typename Type
2773 template<
typename Type
2777 template<
typename MT
2784 for(
size_t i=0UL; i<
m_; ++i ) {
2785 for(
size_t j=0UL; j<
n_; ++j ) {
2786 v_[i*NN+j] = (~rhs)(i,j);
2804 template<
typename Type
2808 template<
typename MT
2819 const size_t jpos( ( remainder )?(
n_ &
size_t(-SIMDSIZE) ):(
n_ ) );
2822 for(
size_t i=0UL; i<
m_; ++i )
2826 for( ; j<jpos; j+=SIMDSIZE ) {
2829 for( ; remainder && j<
n_; ++j ) {
2830 v_[i*NN+j] = (~rhs)(i,j);
2848 template<
typename Type
2852 template<
typename MT >
2857 for(
size_t i=0UL; i<
m_; ++i )
2859 v_[i*NN+element->index()] = element->value();
2875 template<
typename Type
2879 template<
typename MT >
2886 for(
size_t j=0UL; j<
n_; ++j )
2888 v_[element->index()*NN+j] = element->value();
2904 template<
typename Type
2908 template<
typename MT
2915 for(
size_t i=0UL; i<
m_; ++i )
2919 v_[i*NN+i] += (~rhs)(i,i);
2931 for(
size_t j=jbegin; j<jend; ++j ) {
2932 v_[i*NN+j] += (~rhs)(i,j);
2951 template<
typename Type
2955 template<
typename MT
2967 for(
size_t i=0UL; i<
m_; ++i )
2977 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
2978 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2982 for( ; j<jpos; j+=SIMDSIZE ) {
2985 for( ; remainder && j<jend; ++j ) {
2986 v_[i*NN+j] += (~rhs)(i,j);
3004 template<
typename Type
3008 template<
typename MT >
3013 for(
size_t i=0UL; i<
m_; ++i )
3015 v_[i*NN+element->index()] += element->value();
3031 template<
typename Type
3035 template<
typename MT >
3042 for(
size_t j=0UL; j<
n_; ++j )
3044 v_[element->index()*NN+j] += element->value();
3060 template<
typename Type
3064 template<
typename MT
3071 for(
size_t i=0UL; i<
m_; ++i )
3075 v_[i*NN+i] -= (~rhs)(i,i);
3087 for(
size_t j=jbegin; j<jend; ++j ) {
3088 v_[i*NN+j] -= (~rhs)(i,j);
3107 template<
typename Type
3111 template<
typename MT
3123 for(
size_t i=0UL; i<
m_; ++i )
3133 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
3134 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
3138 for( ; j<jpos; j+=SIMDSIZE ) {
3141 for( ; remainder && j<jend; ++j ) {
3142 v_[i*NN+j] -= (~rhs)(i,j);
3160 template<
typename Type
3164 template<
typename MT >
3169 for(
size_t i=0UL; i<
m_; ++i )
3171 v_[i*NN+element->index()] -= element->value();
3187 template<
typename Type
3191 template<
typename MT >
3198 for(
size_t j=0UL; j<
n_; ++j )
3200 v_[element->index()*NN+j] -= element->value();
3216 template<
typename Type
3220 template<
typename MT
3227 for(
size_t i=0UL; i<
m_; ++i ) {
3228 for(
size_t j=0UL; j<
n_; ++j ) {
3229 v_[i*NN+j] *= (~rhs)(i,j);
3247 template<
typename Type
3251 template<
typename MT
3262 for(
size_t i=0UL; i<
m_; ++i )
3264 const size_t jpos( ( remainder )?(
n_ &
size_t(-SIMDSIZE) ):(
n_ ) );
3269 for( ; j<jpos; j+=SIMDSIZE ) {
3272 for( ; remainder && j<
n_; ++j ) {
3273 v_[i*NN+j] *= (~rhs)(i,j);
3291 template<
typename Type
3295 template<
typename MT >
3304 for(
size_t i=0UL; i<
m_; ++i )
3306 v_[i*NN+element->index()] = tmp.v_[i*NN+element->index()] * element->value();
3322 template<
typename Type
3326 template<
typename MT >
3337 for(
size_t j=0UL; j<
n_; ++j )
3339 v_[element->index()*NN+j] = tmp.v_[element->index()*NN+j] * element->value();
3364 template<
typename Type
3368 :
public DenseMatrix< HybridMatrix<Type,M,N,true>, true >
3394 template<
typename NewType >
3403 template<
size_t NewM
3422 enum :
bool { smpAssignable =
false };
3430 explicit inline HybridMatrix(
size_t m,
size_t n,
const Type& init );
3433 template<
typename Other >
3434 explicit inline HybridMatrix(
size_t m,
size_t n,
const Other* array );
3436 template<
typename Other,
size_t Rows,
size_t Cols >
3437 explicit inline HybridMatrix(
const Other (&array)[Rows][Cols] );
3471 inline HybridMatrix&
operator=(
const Type&
set );
3474 template<
typename Other,
size_t Rows,
size_t Cols >
3475 inline HybridMatrix&
operator=(
const Other (&array)[Rows][Cols] );
3477 inline HybridMatrix&
operator= (
const HybridMatrix& rhs );
3481 template<
typename MT,
bool SO >
inline HybridMatrix& operator%=(
const Matrix<MT,SO>& rhs );
3484 template<
typename Other >
3485 inline EnableIf_<IsNumeric<Other>, HybridMatrix >& operator*=( Other rhs );
3487 template<
typename Other >
3488 inline EnableIf_<IsNumeric<Other>, HybridMatrix >&
operator/=( Other rhs );
3495 inline size_t rows()
const noexcept;
3496 inline size_t columns()
const noexcept;
3497 inline constexpr
size_t spacing()
const noexcept;
3498 inline constexpr
size_t capacity()
const noexcept;
3499 inline size_t capacity(
size_t j )
const noexcept;
3501 inline size_t nonZeros(
size_t j )
const;
3502 inline void reset();
3503 inline void reset(
size_t i );
3504 inline void clear();
3505 void resize (
size_t m,
size_t n,
bool preserve=
true );
3506 inline void extend (
size_t m,
size_t n,
bool preserve=
true );
3507 inline void swap( HybridMatrix& m ) noexcept;
3517 template<
typename Other >
inline HybridMatrix& scale(
const Other& scalar );
3524 static inline void*
operator new ( std::size_t
size );
3525 static inline void*
operator new[]( std::size_t
size );
3526 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
3527 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
3529 static inline void operator delete (
void* ptr );
3530 static inline void operator delete[](
void* ptr );
3531 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
3532 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
3539 template<
typename MT >
3540 struct VectorizedAssign {
3541 enum :
bool { value = useOptimizedKernels &&
3542 simdEnabled && MT::simdEnabled &&
3550 template<
typename MT >
3551 struct VectorizedAddAssign {
3552 enum :
bool { value = useOptimizedKernels &&
3553 simdEnabled && MT::simdEnabled &&
3563 template<
typename MT >
3564 struct VectorizedSubAssign {
3565 enum :
bool { value = useOptimizedKernels &&
3566 simdEnabled && MT::simdEnabled &&
3576 template<
typename MT >
3577 struct VectorizedSchurAssign {
3578 enum :
bool { value = useOptimizedKernels &&
3579 simdEnabled && MT::simdEnabled &&
3595 inline bool isIntact()
const noexcept;
3602 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
3603 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
3616 template<
typename MT,
bool SO >
3619 template<
typename MT,
bool SO >
3625 template<
typename MT,
bool SO >
3628 template<
typename MT,
bool SO >
3634 template<
typename MT,
bool SO >
3637 template<
typename MT,
bool SO >
3643 template<
typename MT,
bool SO >
3646 template<
typename MT,
bool SO >
3657 enum :
size_t { MM = ( usePadding )?(
nextMultiple( M, SIMDSIZE ) ):( M ) };
3698 template<
typename Type
3709 for(
size_t i=0UL; i<MM*N; ++i )
3733 template<
typename Type
3752 for(
size_t i=0UL; i<MM*N; ++i )
3777 template<
typename Type
3795 for(
size_t j=0UL; j<n; ++j ) {
3796 for(
size_t i=0UL; i<m; ++i )
3800 for(
size_t i=m; i<MM; ++i )
3801 v_[i+j*MM] = Type();
3806 for(
size_t j=n; j<N; ++j )
3807 for(
size_t i=0UL; i<MM; ++i )
3808 v_[i+j*MM] = Type();
3842 template<
typename Type
3862 for(
const auto& rowList : list ) {
3864 for(
const auto& element : rowList ) {
3865 v_[i+j*MM] = element;
3870 v_[i+j*MM] = Type();
3879 for( ; i<MM; ++i ) {
3880 for(
size_t j=0UL; j<N; ++j ) {
3881 v_[i+j*MM] = Type();
3920 template<
typename Type
3923 template<
typename Other >
3939 for(
size_t j=0UL; j<n; ++j ) {
3940 for(
size_t i=0UL; i<m; ++i )
3941 v_[i+j*MM] = array[i+j*m];
3944 for(
size_t i=m; i<MM; ++i )
3945 v_[i+j*MM] = Type();
3950 for(
size_t j=n; j<N; ++j )
3951 for(
size_t i=0UL; i<MM; ++i )
3952 v_[i+j*MM] = Type();
3983 template<
typename Type
3986 template<
typename Other
3998 for(
size_t j=0UL; j<Cols; ++j ) {
3999 for(
size_t i=0UL; i<Rows; ++i )
4000 v_[i+j*MM] = array[i][j];
4003 for(
size_t i=Rows; i<MM; ++i )
4004 v_[i+j*MM] = Type();
4009 for(
size_t j=Cols; j<N; ++j )
4010 for(
size_t i=0UL; i<MM; ++i )
4011 v_[i+j*MM] = Type();
4029 template<
typename Type
4039 for(
size_t j=0UL; j<
n_; ++j ) {
4040 for(
size_t i=0UL; i<
m_; ++i )
4041 v_[i+j*MM] = m.v_[i+j*MM];
4044 for(
size_t i=m_; i<MM; ++i )
4045 v_[i+j*MM] = Type();
4050 for(
size_t j=n_; j<N; ++j )
4051 for(
size_t i=0UL; i<MM; ++i )
4052 v_[i+j*MM] = Type();
4068 template<
typename Type
4071 template<
typename MT
4078 using blaze::assign;
4086 for(
size_t j=0UL; j<
n_; ++j ) {
4088 i<( IsNumeric<Type>::value ? MM :
m_ );
4090 v_[i+j*MM] = Type();
4095 for(
size_t j=n_; j<N; ++j )
4096 for(
size_t i=0UL; i<MM; ++i )
4097 v_[i+j*MM] = Type();
4100 assign( *
this, ~m );
4127 template<
typename Type
4152 template<
typename Type
4178 template<
typename Type
4190 return (*
this)(i,j);
4208 template<
typename Type
4220 return (*
this)(i,j);
4238 template<
typename Type
4262 template<
typename Type
4283 template<
typename Type
4305 template<
typename Type
4325 template<
typename Type
4345 template<
typename Type
4365 template<
typename Type
4385 template<
typename Type
4405 template<
typename Type
4425 template<
typename Type
4453 template<
typename Type
4462 for(
size_t j=0UL; j<
n_; ++j )
4463 for(
size_t i=0UL; i<
m_; ++i )
4498 template<
typename Type
4504 const size_t m( list.size() );
4519 for(
const auto& rowList : list ) {
4521 for(
const auto& element : rowList ) {
4522 v_[i+j*MM] = element;
4525 for( ; j<
n_; ++j ) {
4526 v_[i+j*MM] = Type();
4559 template<
typename Type
4562 template<
typename Other
4573 for(
size_t j=0UL; j<Cols; ++j )
4574 for(
size_t i=0UL; i<Rows; ++i )
4575 v_[i+j*MM] = array[i][j];
4592 template<
typename Type
4598 using blaze::assign;
4603 resize( rhs.rows(), rhs.columns() );
4604 assign( *
this, ~rhs );
4626 template<
typename Type
4629 template<
typename MT
4633 using blaze::assign;
4651 resize( tmp.rows(), tmp.columns() );
4652 assign( *
this, tmp );
4658 assign( *
this, ~rhs );
4680 template<
typename Type
4683 template<
typename MT
4687 using blaze::addAssign;
4695 addAssign( *
this, tmp );
4698 addAssign( *
this, ~rhs );
4720 template<
typename Type
4723 template<
typename MT
4727 using blaze::subAssign;
4735 subAssign( *
this, tmp );
4738 subAssign( *
this, ~rhs );
4760 template<
typename Type
4763 template<
typename MT
4767 using blaze::schurAssign;
4775 schurAssign( *
this, tmp );
4778 schurAssign( *
this, ~rhs );
4800 template<
typename Type
4803 template<
typename MT
4807 using blaze::assign;
4814 resize( tmp.rows(), tmp.columns() );
4815 assign( *
this, tmp );
4833 template<
typename Type
4836 template<
typename Other >
4840 using blaze::assign;
4842 assign( *
this, (*
this) * rhs );
4862 template<
typename Type
4865 template<
typename Other >
4869 using blaze::assign;
4873 assign( *
this, (*
this) / rhs );
4897 template<
typename Type
4914 template<
typename Type
4934 template<
typename Type
4951 template<
typename Type
4969 template<
typename Type
4990 template<
typename Type
4995 size_t nonzeros( 0UL );
4997 for(
size_t j=0UL; j<
n_; ++j )
4998 for(
size_t i=0UL; i<
m_; ++i )
5015 template<
typename Type
5022 const size_t iend( j*MM +
m_ );
5023 size_t nonzeros( 0UL );
5025 for(
size_t i=j*MM; i<iend; ++i )
5041 template<
typename Type
5048 for(
size_t j=0UL; j<
n_; ++j )
5049 for(
size_t i=0UL; i<
m_; ++i )
5066 template<
typename Type
5074 for(
size_t i=0UL; i<
m_; ++i )
5089 template<
typename Type
5137 template<
typename Type
5153 for(
size_t j=0UL; j<n; ++j )
5154 for(
size_t i=m; i<
m_; ++i )
5155 v_[i+j*MM] = Type();
5159 for(
size_t j=n; j<
n_; ++j )
5160 for(
size_t i=0UL; i<
m_; ++i )
5161 v_[i+j*MM] = Type();
5187 template<
typename Type
5206 template<
typename Type
5213 const size_t maxrows(
max(
m_, m.m_ ) );
5214 const size_t maxcols(
max(
n_, m.n_ ) );
5216 for(
size_t j=0UL; j<maxcols; ++j ) {
5217 for(
size_t i=0UL; i<maxrows; ++i ) {
5218 swap(
v_[i+j*MM], m(i,j) );
5249 template<
typename Type
5256 if(
m_ > N ||
n_ > M ) {
5260 const size_t maxsize(
max(
m_,
n_ ) );
5261 for(
size_t j=1UL; j<maxsize; ++j ) {
5262 for(
size_t i=0UL; i<j; ++i ) {
5268 for(
size_t j=0UL; j<
n_; ++j ) {
5269 for(
size_t i=n_; i<
m_; ++i ) {
5270 v_[i+j*MM] = Type();
5276 for(
size_t j=
m_; j<
n_; ++j ) {
5277 for(
size_t i=0UL; i<
m_; ++i ) {
5278 v_[i+j*MM] = Type();
5305 template<
typename Type
5312 if(
m_ > N ||
n_ > M ) {
5316 const size_t maxsize(
max(
m_,
n_ ) );
5317 for(
size_t j=0UL; j<maxsize; ++j ) {
5318 for(
size_t i=0UL; i<j; ++i ) {
5325 for(
size_t j=0UL; j<
n_; ++j ) {
5326 for(
size_t i=n_; i<
m_; ++i ) {
5327 v_[i+j*MM] = Type();
5333 for(
size_t j=
m_; j<
n_; ++j ) {
5334 for(
size_t i=0UL; i<
m_; ++i ) {
5335 v_[i+j*MM] = Type();
5368 template<
typename Type
5371 template<
typename Other >
5375 for(
size_t j=0UL; j<
n_; ++j )
5376 for(
size_t i=0UL; i<
m_; ++i )
5377 v_[i+j*MM] *= scalar;
5404 template<
typename Type
5413 return allocate<HybridMatrix>( 1UL );
5430 template<
typename Type
5438 return allocate<HybridMatrix>( size/
sizeof(
HybridMatrix) );
5455 template<
typename Type
5464 return allocate<HybridMatrix>( 1UL );
5481 template<
typename Type
5489 return allocate<HybridMatrix>( size/
sizeof(
HybridMatrix) );
5502 template<
typename Type
5507 deallocate( static_cast<HybridMatrix*>( ptr ) );
5520 template<
typename Type
5525 deallocate( static_cast<HybridMatrix*>( ptr ) );
5538 template<
typename Type
5543 deallocate( static_cast<HybridMatrix*>( ptr ) );
5556 template<
typename Type
5561 deallocate( static_cast<HybridMatrix*>( ptr ) );
5585 template<
typename Type
5590 if(
m_ > M ||
n_ > N )
5595 for(
size_t j=0UL; j<
n_; ++j ) {
5596 for(
size_t i=
m_; i<MM; ++i ) {
5597 if(
v_[i+j*MM] != Type() )
5602 for(
size_t j=n_; j<N; ++j ) {
5603 for(
size_t i=0UL; i<MM; ++i ) {
5604 if(
v_[i+j*MM] != Type() )
5635 template<
typename Type
5638 template<
typename Other >
5641 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5658 template<
typename Type
5661 template<
typename Other >
5664 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5680 template<
typename Type
5685 return ( usePadding ||
rows() % SIMDSIZE == 0UL );
5706 template<
typename Type
5713 return loada( i, j );
5715 return loadu( i, j );
5736 template<
typename Type
5773 template<
typename Type
5809 template<
typename Type
5840 template<
typename Type
5878 template<
typename Type
5915 template<
typename Type
5949 template<
typename Type
5952 template<
typename MT
5959 for(
size_t j=0UL; j<
n_; ++j ) {
5960 for(
size_t i=0UL; i<
m_; ++i ) {
5961 v_[i+j*MM] = (~rhs)(i,j);
5981 template<
typename Type
5984 template<
typename MT
5995 const size_t ipos( ( remainder )?(
m_ &
size_t(-SIMDSIZE) ):(
m_ ) );
5998 for(
size_t j=0UL; j<
n_; ++j )
6002 for( ; i<ipos; i+=SIMDSIZE ) {
6005 for( ; remainder && i<
m_; ++i ) {
6006 v_[i+j*MM] = (~rhs)(i,j);
6026 template<
typename Type
6029 template<
typename MT >
6034 for(
size_t j=0UL; j<
n_; ++j )
6036 v_[element->index()+j*MM] = element->value();
6054 template<
typename Type
6057 template<
typename MT >
6064 for(
size_t i=0UL; i<
m_; ++i )
6066 v_[i+element->index()*MM] = element->value();
6084 template<
typename Type
6087 template<
typename MT
6094 for(
size_t j=0UL; j<
n_; ++j )
6098 v_[j+j*MM] += (~rhs)(j,j);
6110 for(
size_t i=ibegin; i<iend; ++i ) {
6111 v_[i+j*MM] += (~rhs)(i,j);
6132 template<
typename Type
6135 template<
typename MT
6147 for(
size_t j=0UL; j<
n_; ++j )
6157 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
6158 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
6162 for( ; i<ipos; i+=SIMDSIZE ) {
6165 for( ; remainder && i<iend; ++i ) {
6166 v_[i+j*MM] += (~rhs)(i,j);
6186 template<
typename Type
6189 template<
typename MT >
6194 for(
size_t j=0UL; j<
n_; ++j )
6196 v_[element->index()+j*MM] += element->value();
6214 template<
typename Type
6217 template<
typename MT >
6224 for(
size_t i=0UL; i<
m_; ++i )
6226 v_[i+element->index()*MM] += element->value();
6244 template<
typename Type
6247 template<
typename MT
6254 for(
size_t j=0UL; j<
n_; ++j )
6258 v_[j+j*MM] -= (~rhs)(j,j);
6270 for(
size_t i=ibegin; i<iend; ++i ) {
6271 v_[i+j*MM] -= (~rhs)(i,j);
6292 template<
typename Type
6295 template<
typename MT
6307 for(
size_t j=0UL; j<
n_; ++j )
6317 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
6318 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
6322 for( ; i<ipos; i+=SIMDSIZE ) {
6325 for( ; remainder && i<iend; ++i ) {
6326 v_[i+j*MM] -= (~rhs)(i,j);
6346 template<
typename Type
6349 template<
typename MT >
6354 for(
size_t j=0UL; j<
n_; ++j )
6356 v_[element->index()+j*MM] -= element->value();
6374 template<
typename Type
6377 template<
typename MT >
6384 for(
size_t i=0UL; i<
m_; ++i )
6386 v_[i+element->index()*MM] -= element->value();
6404 template<
typename Type
6407 template<
typename MT
6414 for(
size_t j=0UL; j<
n_; ++j ) {
6415 for(
size_t i=0UL; i<
m_; ++i ) {
6416 v_[i+j*MM] *= (~rhs)(i,j);
6436 template<
typename Type
6439 template<
typename MT
6450 for(
size_t j=0UL; j<
n_; ++j )
6452 const size_t ipos( ( remainder )?(
m_ &
size_t(-SIMDSIZE) ):(
m_ ) );
6457 for( ; i<ipos; i+=SIMDSIZE ) {
6460 for( ; remainder && i<
m_; ++i ) {
6461 v_[i+j*MM] *= (~rhs)(i,j);
6481 template<
typename Type
6484 template<
typename MT >
6493 for(
size_t j=0UL; j<
n_; ++j )
6495 v_[element->index()+j*MM] = tmp.v_[element->index()+j*MM] * element->value();
6513 template<
typename Type
6516 template<
typename MT >
6527 for(
size_t i=0UL; i<
m_; ++i )
6529 v_[i+element->index()*MM] = tmp.v_[i+element->index()*MM] * element->value();
6550 template<
typename Type,
size_t M,
size_t N,
bool SO >
6553 template<
typename Type,
size_t M,
size_t N,
bool SO >
6556 template<
typename Type,
size_t M,
size_t N,
bool SO >
6559 template<
bool RF,
typename Type,
size_t M,
size_t N,
bool SO >
6562 template<
typename Type,
size_t M,
size_t N,
bool SO >
6565 template<
typename Type,
size_t M,
size_t N,
bool SO >
6578 template<
typename Type
6602 template<
typename Type
6620 template<
typename Type
6663 return ( m.rows() == 0UL && m.columns() == 0UL );
6686 template<
typename Type
6692 return m.isIntact();
6705 template<
typename Type
6726 template<
typename T,
size_t M,
size_t N,
bool SO >
6744 template<
typename T,
size_t M,
size_t N,
bool SO >
6762 template<
typename T,
size_t M,
size_t N,
bool SO >
6763 struct IsAligned< HybridMatrix<T,M,N,SO> >
6780 template<
typename T,
size_t M,
size_t N,
bool SO >
6781 struct IsPadded< HybridMatrix<T,M,N,SO> >
6798 template<
typename T,
size_t M,
size_t N,
bool SO >
6816 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6817 struct AddTrait< HybridMatrix<T1,M1,N1,SO>, StaticMatrix<T2,M2,N2,SO> >
6822 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6823 struct AddTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
6828 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6829 struct AddTrait< StaticMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6834 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6835 struct AddTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6840 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6841 struct AddTrait< HybridMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6846 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6847 struct AddTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6865 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6866 struct SubTrait< HybridMatrix<T1,M1,N1,SO>, StaticMatrix<T2,M2,N2,SO> >
6871 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6872 struct SubTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
6877 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6878 struct SubTrait< StaticMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6883 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6884 struct SubTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6889 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6890 struct SubTrait< HybridMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6895 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6896 struct SubTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6914 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6915 struct SchurTrait< HybridMatrix<T1,M1,N1,SO>, StaticMatrix<T2,M2,N2,SO> >
6920 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6921 struct SchurTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
6926 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6927 struct SchurTrait< StaticMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6932 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6933 struct SchurTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6938 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6939 struct SchurTrait< HybridMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6944 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6945 struct SchurTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6963 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6964 struct MultTrait< HybridMatrix<T1,M,N,SO>, T2, EnableIf_<IsNumeric<T2> > >
6969 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6970 struct MultTrait< T1, HybridMatrix<T2,M,N,SO>, EnableIf_<IsNumeric<T1> > >
6975 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
size_t K >
6976 struct MultTrait< HybridMatrix<T1,M,N,SO>, StaticVector<T2,K,false> >
6981 template<
typename T1,
size_t K,
typename T2,
size_t M,
size_t N,
bool SO >
6982 struct MultTrait< StaticVector<T1,K,true>, HybridMatrix<T2,M,N,SO> >
6987 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
size_t K >
6988 struct MultTrait< HybridMatrix<T1,M,N,SO>, HybridVector<T2,K,false> >
6993 template<
typename T1,
size_t K,
typename T2,
size_t M,
size_t N,
bool SO >
6994 struct MultTrait< HybridVector<T1,K,true>, HybridMatrix<T2,M,N,SO> >
6999 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
7000 struct MultTrait< HybridMatrix<T1,M,N,SO>, DynamicVector<T2,false> >
7005 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
7006 struct MultTrait< DynamicVector<T1,true>, HybridMatrix<T2,M,N,SO> >
7011 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
7012 struct MultTrait< HybridMatrix<T1,M,N,SO>, CustomVector<T2,AF,PF,false> >
7017 template<
typename T1,
bool AF,
bool PF,
typename T2,
size_t M,
size_t N,
bool SO >
7018 struct MultTrait< CustomVector<T1,AF,PF,true>, HybridMatrix<T2,M,N,SO> >
7023 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
7024 struct MultTrait< HybridMatrix<T1,M,N,SO>, CompressedVector<T2,false> >
7029 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
7030 struct MultTrait< CompressedVector<T1,true>, HybridMatrix<T2,M,N,SO> >
7035 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
7036 struct MultTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
7041 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
7042 struct MultTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
7047 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
7048 struct MultTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
7066 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
7067 struct DivTrait< HybridMatrix<T1,M,N,SO>, T2, EnableIf_<IsNumeric<T2> > >
7085 template<
typename T,
size_t M,
size_t N,
bool SO,
typename OP >
7104 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2,
typename OP >
7105 struct BinaryMapTrait< HybridMatrix<T1,M1,N1,SO>, StaticMatrix<T2,M2,N2,SO>, OP >
7110 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2,
typename OP >
7111 struct BinaryMapTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2>, OP >
7116 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2,
typename OP >
7117 struct BinaryMapTrait< StaticMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO>, OP >
7122 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2,
typename OP >
7123 struct BinaryMapTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2>, OP >
7128 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2,
typename OP >
7129 struct BinaryMapTrait< HybridMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO>, OP >
7134 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2,
typename OP >
7135 struct BinaryMapTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2>, OP >
7153 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
7154 struct HighType< HybridMatrix<T1,M,N,SO>, HybridMatrix<T2,M,N,SO> >
7172 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
7173 struct LowType< HybridMatrix<T1,M,N,SO>, HybridMatrix<T2,M,N,SO> >
7191 template<
typename T,
size_t M,
size_t N,
bool SO >
7210 template<
typename T,
size_t M,
size_t N,
bool SO >
7211 struct RowTrait< HybridMatrix<T,M,N,SO> >
7229 template<
typename T,
size_t M,
size_t N,
bool SO >
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:135
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.
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:79
Availability of a SIMD subtraction for the given data types.Depending on the available instruction se...
Definition: HasSIMDSub.h:171
Header file for mathematical functions.
Header file for the Schur product trait.
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
#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 alignment flag values.
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:1293
Header file for the subtraction trait.
Header file for basic type definitions.
Header file for the row trait.
Base template for the SubmatrixTrait class.
Definition: SubmatrixTrait.h:128
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:127
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:79
Header file for the IsSparseMatrix type trait.
DenseIterator< Type, usePadding > Iterator
Iterator over non-constant elements.
Definition: HybridMatrix.h:237
Header file for the IsDiagonal type trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1411
Header file for the IsSame and IsStrictlySame type traits.
Base template for the SchurTrait class.
Definition: SchurTrait.h:124
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:172
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:316
Iterator begin(size_t i) noexcept
Returns an iterator to the first element of row/column i.
Definition: HybridMatrix.h:1173
Header file for the IsColumnMajorMatrix type trait.
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: HybridMatrix.h:1025
constexpr size_t spacing() const noexcept
Returns the spacing between the beginning of two rows.
Definition: HybridMatrix.h:1777
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
Availability of a SIMD addition for the given data types.Depending on the available instruction set (...
Definition: HasSIMDAdd.h:171
Iterator end(size_t i) noexcept
Returns an iterator just past the last element of row/column i.
Definition: HybridMatrix.h:1245
#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
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member constant is set to true, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to false, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:140
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: HybridMatrix.h:1742
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
Header file for memory allocation and deallocation 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:1221
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1393
Compile time check for data types.This type trait tests whether or not the given types can be combine...
Definition: IsSIMDCombinable.h:120
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1809
Type ElementType
Type of the matrix elements.
Definition: HybridMatrix.h:227
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:78
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
Constraint on the data type.
Header file for the std::initializer_list aliases.
Header file for the SparseMatrix base class.
Efficient implementation of a dynamically sized vector with static memory.The HybridVector class temp...
Definition: Forward.h:59
Compile time check for low-level access to mutable data.This type trait tests whether the given data ...
Definition: HasMutableDataAccess.h:75
bool isAligned() const noexcept
Returns whether the matrix is properly aligned in memory.
Definition: HybridMatrix.h:2509
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
void resize(size_t m, size_t n, bool preserve=true)
Changing the size of the matrix.
Definition: HybridMatrix.h:1984
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: HybridMatrix.h:1835
Base template for the RowTrait class.
Definition: RowTrait.h:127
Headerfile for the generic max algorithm.
typename TransExprTrait< T >::Type TransExprTrait_
Auxiliary alias declaration for the TransExprTrait class template.The TransExprTrait_ alias declarati...
Definition: TransExprTrait.h:112
Header file for the DisableIf class template.
Header file for the LowType type trait.
Base template for the HighType type trait.
Definition: HighType.h:133
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Header file for the unary map trait.
typename CTransExprTrait< T >::Type CTransExprTrait_
Auxiliary alias declaration for the CTransExprTrait class template.The CTransExprTrait_ alias declara...
Definition: CTransExprTrait.h:112
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for nested template disabiguation.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5924
HybridMatrix & operator=(const Type &set)
Homogenous assignment to all matrix elements.
Definition: HybridMatrix.h:1319
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:2708
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:110
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:2639
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
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
#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:234
Header file for the HasSIMDAdd type trait.
Efficient implementation of a fixed-sized matrix.The StaticMatrix class template is the representatio...
Definition: Forward.h:60
Header file for the DenseMatrix base class.
Header file for the DenseIterator class template.
Header file for all SIMD functionality.
HybridMatrix()
The default constructor for HybridMatrix.
Definition: HybridMatrix.h:567
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:976
Header file for the IsLower type trait.
size_t m_
The current number of rows of the matrix.
Definition: HybridMatrix.h:531
Header file for the IsAligned type trait.
Compile time check for diagonal matrices.This type trait tests whether or not the given template para...
Definition: IsDiagonal.h:90
Type & Reference
Reference to a non-constant matrix value.
Definition: HybridMatrix.h:232
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: HybridMatrix.h:235
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:80
Header file for the default storage order for all vectors of the Blaze library.
#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:1889
Header file for the exception macros of the math module.
HybridMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: HybridMatrix.h:2148
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Resize mechanism to obtain a HybridMatrix with different fixed dimensions.
Definition: HybridMatrix.h:255
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:580
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:2745
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
Base template for the LowType type trait.
Definition: LowType.h:133
Header file for the HasConstDataAccess type trait.
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< 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:75
void swap(HybridMatrix &m) noexcept
Swapping the contents of two hybrid matrices.
Definition: HybridMatrix.h:2051
Header file for the IsSIMDCombinable type trait.
AlignedArray< Type, M *NN > v_
The statically allocated matrix elements.
Definition: HybridMatrix.h:521
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:2670
#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.
Header file for the binary map 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: Functions.h:156
Pointer data() noexcept
Low-level data access to the matrix elements.
Definition: HybridMatrix.h:1084
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
size_t determineColumns(initializer_list< initializer_list< Type > > list) noexcept
Determine the maximum number of columns specified by the given initializer list.
Definition: InitializerList.h:80
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:139
Compile time check for column-major matrix types.This type trait tests whether or not the given templ...
Definition: IsColumnMajorMatrix.h:110
HybridMatrix & transpose()
In-place transpose of the matrix.
Definition: HybridMatrix.h:2093
Base template for the MultTrait class.
Definition: MultTrait.h:139
const Type & ConstReference
Reference to a constant matrix value.
Definition: HybridMatrix.h:233
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:2603
Header file for the division trait.
Header file for the InvExprTrait class template.
Header file for the submatrix trait.
Constraint on the data type.
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:296
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: HybridMatrix.h:2467
Efficient implementation of a dynamically sized matrix with static memory.The HybridMatrix class temp...
Definition: Forward.h:58
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
Header file for the column trait.
Header file for the isDefault shim.
Header file for the TransExprTrait class template.
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:101
HybridMatrix< Type, M, N, SO > This
Type of this HybridMatrix instance.
Definition: HybridMatrix.h:222
Constraint on the data type.
Constraint on the data type.
Header file for the HasSIMDSub type trait.
BLAZE_ALWAYS_INLINE void conjugate(T &a) noexcept(IsNumeric< T >::value)
In-place conjugation of the given value/object.
Definition: Conjugate.h:120
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:819
Header file for the HasMutableDataAccess type trait.
EnableIf_< IsBuiltin< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:230
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
BLAZE_ALWAYS_INLINE SIMDType load(size_t i, size_t j) const noexcept
Load of a SIMD element of the matrix.
Definition: HybridMatrix.h:2536
Base template for the DivTrait class.
Definition: DivTrait.h:139
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:76
BLAZE_ALWAYS_INLINE void cswap(T &a, T &b) noexcept(IsNumeric< T >::value)
Swapping two conjugated values/objects.
Definition: Conjugate.h:195
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:245
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
DenseIterator< const Type, usePadding > ConstIterator
Iterator over constant elements.
Definition: HybridMatrix.h:238
Header file for the IsRowMajorMatrix type trait.
Initializer list type of the Blaze library.
Header file for the alignment check function.
typename InvExprTrait< T >::Type InvExprTrait_
Auxiliary alias declaration for the InvExprTrait class template.The InvExprTrait_ alias declaration p...
Definition: InvExprTrait.h:123
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:2566
size_t n_
The current number of columns of the matrix.
Definition: HybridMatrix.h:532
Header file for the IntegralConstant class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: HybridMatrix.h:229
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:75
void clear()
Clearing the hybrid matrix.
Definition: HybridMatrix.h:1937
Compile time check for sparse matrix types.This type trait tests whether or not the given template pa...
Definition: IsSparseMatrix.h:103
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:600
Base template for the SubTrait class.
Definition: SubTrait.h:139
#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
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
Header file for the IsUpper type trait.
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the CTransExprTrait class template.
void extend(size_t m, size_t n, bool preserve=true)
Extending the size of the matrix.
Definition: HybridMatrix.h:2033
#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
Base template for the BinaryMapTrait class.
Definition: BinaryMapTrait.h:119
Header file for the IsResizable type trait.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: HybridMatrix.h:1758
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:117
System settings for the inline keywords.
#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
constexpr size_t capacity() const noexcept
Returns the maximum capacity of the matrix.
Definition: HybridMatrix.h:1793
SIMDTrait_< ElementType > SIMDType
SIMD type of the matrix elements.
Definition: HybridMatrix.h:228
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: HybridMatrix.h:2489
bool isIntact() const noexcept
Returns whether the invariants of the hybrid matrix are intact.
Definition: HybridMatrix.h:2417
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.