35 #ifndef _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_ 36 #define _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_ 219 template<
typename Type
222 ,
bool SO = defaultStorageOrder >
224 :
public DenseMatrix< HybridMatrix<Type,M,N,SO>, SO >
250 template<
typename NewType >
259 template<
size_t NewM
278 enum :
bool { smpAssignable =
false };
286 explicit inline HybridMatrix(
size_t m,
size_t n,
const Type& init );
289 template<
typename Other >
292 template<
typename Other,
size_t Rows,
size_t Cols >
327 inline HybridMatrix&
operator=(
const Type&
set );
330 template<
typename Other,
size_t Rows,
size_t Cols >
331 inline HybridMatrix&
operator=(
const Other (&array)[Rows][Cols] );
333 inline HybridMatrix&
operator= (
const HybridMatrix& rhs );
337 template<
typename MT,
bool SO2 >
inline HybridMatrix& operator%=(
const Matrix<MT,SO2>& rhs );
344 inline size_t rows()
const noexcept;
345 inline size_t columns()
const noexcept;
346 inline constexpr
size_t spacing()
const noexcept;
347 inline constexpr
size_t capacity()
const noexcept;
348 inline size_t capacity(
size_t i )
const noexcept;
350 inline size_t nonZeros(
size_t i )
const;
352 inline void reset(
size_t i );
354 void resize (
size_t m,
size_t n,
bool preserve=
true );
355 inline void extend (
size_t m,
size_t n,
bool preserve=
true );
356 inline void swap( HybridMatrix& m ) noexcept;
366 template<
typename Other >
inline HybridMatrix& scale(
const Other& scalar );
373 static inline void*
operator new ( std::size_t
size );
374 static inline void*
operator new[]( std::size_t
size );
375 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
376 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
378 static inline void operator delete (
void* ptr );
379 static inline void operator delete[](
void* ptr );
380 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
381 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
388 template<
typename MT >
390 struct VectorizedAssign {
391 enum :
bool { value = useOptimizedKernels &&
392 simdEnabled && MT::simdEnabled &&
401 template<
typename MT >
403 struct VectorizedAddAssign {
404 enum :
bool { value = useOptimizedKernels &&
405 simdEnabled && MT::simdEnabled &&
416 template<
typename MT >
418 struct VectorizedSubAssign {
419 enum :
bool { value = useOptimizedKernels &&
420 simdEnabled && MT::simdEnabled &&
431 template<
typename MT >
433 struct VectorizedSchurAssign {
434 enum :
bool { value = useOptimizedKernels &&
435 simdEnabled && MT::simdEnabled &&
452 inline bool isIntact()
const noexcept;
459 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
460 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
473 template<
typename MT,
bool SO2 >
476 template<
typename MT,
bool SO2 >
482 template<
typename MT,
bool SO2 >
485 template<
typename MT,
bool SO2 >
491 template<
typename MT,
bool SO2 >
494 template<
typename MT,
bool SO2 >
500 template<
typename MT,
bool SO2 >
503 template<
typename MT,
bool SO2 >
514 enum :
size_t { NN = ( usePadding )?(
nextMultiple( N, SIMDSIZE ) ):( N ) };
562 template<
typename Type
574 for(
size_t i=0UL; i<M*NN; ++i )
596 template<
typename Type
616 for(
size_t i=0UL; i<M*NN; ++i )
639 template<
typename Type
658 for(
size_t i=0UL; i<m; ++i ) {
659 for(
size_t j=0UL; j<n; ++j )
663 for(
size_t j=n; j<NN; ++j )
669 for(
size_t i=m; i<M; ++i )
670 for(
size_t j=0UL; j<NN; ++j )
703 template<
typename Type
724 for(
const auto& rowList : list ) {
725 std::fill( std::copy( rowList.begin(), rowList.end(),
v_+i*NN ),
v_+(i+1UL)*NN, Type() );
731 for(
size_t j=0UL; j<NN; ++j )
767 template<
typename Type
771 template<
typename Other >
787 for(
size_t i=0UL; i<m; ++i ) {
788 for(
size_t j=0UL; j<n; ++j )
789 v_[i*NN+j] = array[i*n+j];
792 for(
size_t j=n; j<NN; ++j )
798 for(
size_t i=m; i<M; ++i )
799 for(
size_t j=0UL; j<NN; ++j )
829 template<
typename Type
833 template<
typename Other
845 for(
size_t i=0UL; i<Rows; ++i ) {
846 for(
size_t j=0UL; j<Cols; ++j )
847 v_[i*NN+j] = array[i][j];
850 for(
size_t j=Cols; j<NN; ++j )
856 for(
size_t i=Rows; i<M; ++i )
857 for(
size_t j=0UL; j<NN; ++j )
874 template<
typename Type
885 for(
size_t i=0UL; i<
m_; ++i ) {
886 for(
size_t j=0UL; j<
n_; ++j )
887 v_[i*NN+j] = m.v_[i*NN+j];
890 for(
size_t j=n_; j<NN; ++j )
896 for(
size_t i=m_; i<M; ++i )
897 for(
size_t j=0UL; j<NN; ++j )
912 template<
typename Type
916 template<
typename MT
931 for(
size_t i=0UL; i<
m_; ++i ) {
933 j<( IsNumeric<Type>::value ? NN :
n_ );
940 for(
size_t i=m_; i<M; ++i )
941 for(
size_t j=0UL; j<NN; ++j )
970 template<
typename Type
994 template<
typename Type
1019 template<
typename Type
1032 return (*
this)(i,j);
1048 template<
typename Type
1061 return (*
this)(i,j);
1078 template<
typename Type
1102 template<
typename Type
1122 template<
typename Type
1143 template<
typename Type
1167 template<
typename Type
1191 template<
typename Type
1215 template<
typename Type
1239 template<
typename Type
1263 template<
typename Type
1287 template<
typename Type
1314 template<
typename Type
1323 for(
size_t i=0UL; i<
m_; ++i )
1324 for(
size_t j=0UL; j<
n_; ++j )
1357 template<
typename Type
1364 const size_t m( list.size() );
1379 for(
const auto& rowList : list ) {
1380 std::fill( std::copy( rowList.begin(), rowList.end(),
v_+i*NN ),
v_+(i+1UL)*NN, Type() );
1410 template<
typename Type
1414 template<
typename Other
1424 for(
size_t i=0UL; i<Rows; ++i )
1425 for(
size_t j=0UL; j<Cols; ++j )
1426 v_[i*NN+j] = array[i][j];
1441 template<
typename Type
1447 using blaze::assign;
1452 resize( rhs.rows(), rhs.columns() );
1453 assign( *
this, ~rhs );
1473 template<
typename Type
1477 template<
typename MT
1481 using blaze::assign;
1499 resize( tmp.rows(), tmp.columns() );
1500 assign( *
this, tmp );
1506 assign( *
this, ~rhs );
1526 template<
typename Type
1530 template<
typename MT
1534 using blaze::addAssign;
1542 addAssign( *
this, tmp );
1545 addAssign( *
this, ~rhs );
1565 template<
typename Type
1569 template<
typename MT
1573 using blaze::subAssign;
1581 subAssign( *
this, tmp );
1584 subAssign( *
this, ~rhs );
1604 template<
typename Type
1608 template<
typename MT
1612 using blaze::schurAssign;
1620 schurAssign( *
this, tmp );
1623 schurAssign( *
this, ~rhs );
1646 template<
typename Type
1662 template<
typename Type
1681 template<
typename Type
1697 template<
typename Type
1719 template<
typename Type
1739 template<
typename Type
1745 size_t nonzeros( 0UL );
1747 for(
size_t i=0UL; i<
m_; ++i )
1748 for(
size_t j=0UL; j<
n_; ++j )
1768 template<
typename Type
1776 const size_t jend( i*NN +
n_ );
1777 size_t nonzeros( 0UL );
1779 for(
size_t j=i*NN; j<jend; ++j )
1793 template<
typename Type
1801 for(
size_t i=0UL; i<
m_; ++i )
1802 for(
size_t j=0UL; j<
n_; ++j )
1819 template<
typename Type
1828 for(
size_t j=0UL; j<
n_; ++j )
1841 template<
typename Type
1888 template<
typename Type
1905 for(
size_t i=0UL; i<m; ++i )
1906 for(
size_t j=n; j<
n_; ++j )
1907 v_[i*NN+j] = Type();
1911 for(
size_t i=m; i<
m_; ++i )
1912 for(
size_t j=0UL; j<
n_; ++j )
1913 v_[i*NN+j] = Type();
1937 template<
typename Type
1955 template<
typename Type
1963 const size_t maxrows(
max(
m_, m.m_ ) );
1964 const size_t maxcols(
max(
n_, m.n_ ) );
1966 for(
size_t i=0UL; i<maxrows; ++i ) {
1967 for(
size_t j=0UL; j<maxcols; ++j ) {
1968 swap(
v_[i*NN+j], m(i,j) );
1997 template<
typename Type
2005 if(
m_ > N ||
n_ > M ) {
2009 const size_t maxsize(
max(
m_,
n_ ) );
2010 for(
size_t i=1UL; i<maxsize; ++i ) {
2011 for(
size_t j=0UL; j<i; ++j ) {
2017 for(
size_t i=0UL; i<
m_; ++i ) {
2018 for(
size_t j=m_; j<
n_; ++j ) {
2019 v_[i*NN+j] = Type();
2025 for(
size_t i=
n_; i<
m_; ++i ) {
2026 for(
size_t j=0UL; j<
n_; ++j ) {
2027 v_[i*NN+j] = Type();
2052 template<
typename Type
2060 if(
m_ > N ||
n_ > M ) {
2064 const size_t maxsize(
max(
m_,
n_ ) );
2065 for(
size_t i=0UL; i<maxsize; ++i ) {
2066 for(
size_t j=0UL; j<i; ++j ) {
2073 for(
size_t i=0UL; i<
m_; ++i ) {
2074 for(
size_t j=m_; j<
n_; ++j ) {
2075 v_[i*NN+j] = Type();
2081 for(
size_t i=
n_; i<
m_; ++i ) {
2082 for(
size_t j=0UL; j<
n_; ++j ) {
2083 v_[i*NN+j] = Type();
2114 template<
typename Type
2118 template<
typename Other >
2121 for(
size_t i=0UL; i<
m_; ++i )
2122 for(
size_t j=0UL; j<
n_; ++j )
2123 v_[i*NN+j] *= scalar;
2148 template<
typename Type
2158 return allocate<HybridMatrix>( 1UL );
2173 template<
typename Type
2197 template<
typename Type
2207 return allocate<HybridMatrix>( 1UL );
2222 template<
typename Type
2231 return allocate<HybridMatrix>( size/
sizeof(
HybridMatrix) );
2242 template<
typename Type
2248 deallocate( static_cast<HybridMatrix*>( ptr ) );
2259 template<
typename Type
2265 deallocate( static_cast<HybridMatrix*>( ptr ) );
2276 template<
typename Type
2282 deallocate( static_cast<HybridMatrix*>( ptr ) );
2293 template<
typename Type
2299 deallocate( static_cast<HybridMatrix*>( ptr ) );
2321 template<
typename Type
2327 if(
m_ > M ||
n_ > N )
2332 for(
size_t i=0UL; i<
m_; ++i ) {
2333 for(
size_t j=
n_; j<NN; ++j ) {
2334 if(
v_[i*NN+j] != Type() )
2339 for(
size_t i=m_; i<M; ++i ) {
2340 for(
size_t j=0UL; j<NN; ++j ) {
2341 if(
v_[i*NN+j] != Type() )
2370 template<
typename Type
2374 template<
typename Other >
2377 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2392 template<
typename Type
2396 template<
typename Other >
2399 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2413 template<
typename Type
2419 return ( usePadding ||
columns() % SIMDSIZE == 0UL );
2439 template<
typename Type
2447 return loada( i, j );
2449 return loadu( i, j );
2469 template<
typename Type
2506 template<
typename Type
2542 template<
typename Type
2573 template<
typename Type
2611 template<
typename Type
2648 template<
typename Type
2681 template<
typename Type
2685 template<
typename MT
2692 for(
size_t i=0UL; i<
m_; ++i ) {
2693 for(
size_t j=0UL; j<
n_; ++j ) {
2694 v_[i*NN+j] = (~rhs)(i,j);
2712 template<
typename Type
2716 template<
typename MT
2727 const size_t jpos( ( remainder )?(
n_ &
size_t(-SIMDSIZE) ):(
n_ ) );
2730 for(
size_t i=0UL; i<
m_; ++i )
2734 for( ; j<jpos; j+=SIMDSIZE ) {
2737 for( ; remainder && j<
n_; ++j ) {
2738 v_[i*NN+j] = (~rhs)(i,j);
2756 template<
typename Type
2760 template<
typename MT >
2765 for(
size_t i=0UL; i<
m_; ++i )
2767 v_[i*NN+element->index()] = element->value();
2783 template<
typename Type
2787 template<
typename MT >
2794 for(
size_t j=0UL; j<
n_; ++j )
2796 v_[element->index()*NN+j] = element->value();
2812 template<
typename Type
2816 template<
typename MT
2823 for(
size_t i=0UL; i<
m_; ++i )
2827 v_[i*NN+i] += (~rhs)(i,i);
2839 for(
size_t j=jbegin; j<jend; ++j ) {
2840 v_[i*NN+j] += (~rhs)(i,j);
2859 template<
typename Type
2863 template<
typename MT
2875 for(
size_t i=0UL; i<
m_; ++i )
2885 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
2886 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2890 for( ; j<jpos; j+=SIMDSIZE ) {
2893 for( ; remainder && j<jend; ++j ) {
2894 v_[i*NN+j] += (~rhs)(i,j);
2912 template<
typename Type
2916 template<
typename MT >
2921 for(
size_t i=0UL; i<
m_; ++i )
2923 v_[i*NN+element->index()] += element->value();
2939 template<
typename Type
2943 template<
typename MT >
2950 for(
size_t j=0UL; j<
n_; ++j )
2952 v_[element->index()*NN+j] += element->value();
2968 template<
typename Type
2972 template<
typename MT
2979 for(
size_t i=0UL; i<
m_; ++i )
2983 v_[i*NN+i] -= (~rhs)(i,i);
2995 for(
size_t j=jbegin; j<jend; ++j ) {
2996 v_[i*NN+j] -= (~rhs)(i,j);
3015 template<
typename Type
3019 template<
typename MT
3031 for(
size_t i=0UL; i<
m_; ++i )
3041 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
3042 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
3046 for( ; j<jpos; j+=SIMDSIZE ) {
3049 for( ; remainder && j<jend; ++j ) {
3050 v_[i*NN+j] -= (~rhs)(i,j);
3068 template<
typename Type
3072 template<
typename MT >
3077 for(
size_t i=0UL; i<
m_; ++i )
3079 v_[i*NN+element->index()] -= element->value();
3095 template<
typename Type
3099 template<
typename MT >
3106 for(
size_t j=0UL; j<
n_; ++j )
3108 v_[element->index()*NN+j] -= element->value();
3124 template<
typename Type
3128 template<
typename MT
3135 for(
size_t i=0UL; i<
m_; ++i ) {
3136 for(
size_t j=0UL; j<
n_; ++j ) {
3137 v_[i*NN+j] *= (~rhs)(i,j);
3155 template<
typename Type
3159 template<
typename MT
3170 for(
size_t i=0UL; i<
m_; ++i )
3172 const size_t jpos( ( remainder )?(
n_ &
size_t(-SIMDSIZE) ):(
n_ ) );
3177 for( ; j<jpos; j+=SIMDSIZE ) {
3180 for( ; remainder && j<
n_; ++j ) {
3181 v_[i*NN+j] *= (~rhs)(i,j);
3199 template<
typename Type
3203 template<
typename MT >
3212 for(
size_t i=0UL; i<
m_; ++i )
3214 v_[i*NN+element->index()] = tmp.v_[i*NN+element->index()] * element->value();
3230 template<
typename Type
3234 template<
typename MT >
3245 for(
size_t j=0UL; j<
n_; ++j )
3247 v_[element->index()*NN+j] = tmp.v_[element->index()*NN+j] * element->value();
3272 template<
typename Type
3276 :
public DenseMatrix< HybridMatrix<Type,M,N,true>, true >
3302 template<
typename NewType >
3311 template<
size_t NewM
3330 enum :
bool { smpAssignable =
false };
3338 explicit inline HybridMatrix(
size_t m,
size_t n,
const Type& init );
3341 template<
typename Other >
3342 explicit inline HybridMatrix(
size_t m,
size_t n,
const Other* array );
3344 template<
typename Other,
size_t Rows,
size_t Cols >
3345 explicit inline HybridMatrix(
const Other (&array)[Rows][Cols] );
3379 inline HybridMatrix&
operator=(
const Type&
set );
3382 template<
typename Other,
size_t Rows,
size_t Cols >
3383 inline HybridMatrix&
operator=(
const Other (&array)[Rows][Cols] );
3385 inline HybridMatrix&
operator= (
const HybridMatrix& rhs );
3389 template<
typename MT,
bool SO >
inline HybridMatrix& operator%=(
const Matrix<MT,SO>& rhs );
3396 inline size_t rows()
const noexcept;
3397 inline size_t columns()
const noexcept;
3398 inline constexpr
size_t spacing()
const noexcept;
3399 inline constexpr
size_t capacity()
const noexcept;
3400 inline size_t capacity(
size_t j )
const noexcept;
3402 inline size_t nonZeros(
size_t j )
const;
3403 inline void reset();
3404 inline void reset(
size_t i );
3405 inline void clear();
3406 void resize (
size_t m,
size_t n,
bool preserve=
true );
3407 inline void extend (
size_t m,
size_t n,
bool preserve=
true );
3408 inline void swap( HybridMatrix& m ) noexcept;
3418 template<
typename Other >
inline HybridMatrix& scale(
const Other& scalar );
3425 static inline void*
operator new ( std::size_t
size );
3426 static inline void*
operator new[]( std::size_t
size );
3427 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
3428 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
3430 static inline void operator delete (
void* ptr );
3431 static inline void operator delete[](
void* ptr );
3432 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
3433 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
3440 template<
typename MT >
3441 struct VectorizedAssign {
3442 enum :
bool { value = useOptimizedKernels &&
3443 simdEnabled && MT::simdEnabled &&
3451 template<
typename MT >
3452 struct VectorizedAddAssign {
3453 enum :
bool { value = useOptimizedKernels &&
3454 simdEnabled && MT::simdEnabled &&
3464 template<
typename MT >
3465 struct VectorizedSubAssign {
3466 enum :
bool { value = useOptimizedKernels &&
3467 simdEnabled && MT::simdEnabled &&
3477 template<
typename MT >
3478 struct VectorizedSchurAssign {
3479 enum :
bool { value = useOptimizedKernels &&
3480 simdEnabled && MT::simdEnabled &&
3496 inline bool isIntact()
const noexcept;
3503 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
3504 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
3517 template<
typename MT,
bool SO >
3520 template<
typename MT,
bool SO >
3526 template<
typename MT,
bool SO >
3529 template<
typename MT,
bool SO >
3535 template<
typename MT,
bool SO >
3538 template<
typename MT,
bool SO >
3544 template<
typename MT,
bool SO >
3547 template<
typename MT,
bool SO >
3558 enum :
size_t { MM = ( usePadding )?(
nextMultiple( M, SIMDSIZE ) ):( M ) };
3599 template<
typename Type
3610 for(
size_t i=0UL; i<MM*N; ++i )
3634 template<
typename Type
3653 for(
size_t i=0UL; i<MM*N; ++i )
3678 template<
typename Type
3696 for(
size_t j=0UL; j<n; ++j ) {
3697 for(
size_t i=0UL; i<m; ++i )
3701 for(
size_t i=m; i<MM; ++i )
3702 v_[i+j*MM] = Type();
3707 for(
size_t j=n; j<N; ++j )
3708 for(
size_t i=0UL; i<MM; ++i )
3709 v_[i+j*MM] = Type();
3743 template<
typename Type
3763 for(
const auto& rowList : list ) {
3765 for(
const auto& element : rowList ) {
3766 v_[i+j*MM] = element;
3771 v_[i+j*MM] = Type();
3780 for( ; i<MM; ++i ) {
3781 for(
size_t j=0UL; j<N; ++j ) {
3782 v_[i+j*MM] = Type();
3821 template<
typename Type
3824 template<
typename Other >
3840 for(
size_t j=0UL; j<n; ++j ) {
3841 for(
size_t i=0UL; i<m; ++i )
3842 v_[i+j*MM] = array[i+j*m];
3845 for(
size_t i=m; i<MM; ++i )
3846 v_[i+j*MM] = Type();
3851 for(
size_t j=n; j<N; ++j )
3852 for(
size_t i=0UL; i<MM; ++i )
3853 v_[i+j*MM] = Type();
3884 template<
typename Type
3887 template<
typename Other
3899 for(
size_t j=0UL; j<Cols; ++j ) {
3900 for(
size_t i=0UL; i<Rows; ++i )
3901 v_[i+j*MM] = array[i][j];
3904 for(
size_t i=Rows; i<MM; ++i )
3905 v_[i+j*MM] = Type();
3910 for(
size_t j=Cols; j<N; ++j )
3911 for(
size_t i=0UL; i<MM; ++i )
3912 v_[i+j*MM] = Type();
3930 template<
typename Type
3940 for(
size_t j=0UL; j<
n_; ++j ) {
3941 for(
size_t i=0UL; i<
m_; ++i )
3942 v_[i+j*MM] = m.v_[i+j*MM];
3945 for(
size_t i=m_; i<MM; ++i )
3946 v_[i+j*MM] = Type();
3951 for(
size_t j=n_; j<N; ++j )
3952 for(
size_t i=0UL; i<MM; ++i )
3953 v_[i+j*MM] = Type();
3969 template<
typename Type
3972 template<
typename MT
3979 using blaze::assign;
3987 for(
size_t j=0UL; j<
n_; ++j ) {
3989 i<( IsNumeric<Type>::value ? MM :
m_ );
3991 v_[i+j*MM] = Type();
3996 for(
size_t j=n_; j<N; ++j )
3997 for(
size_t i=0UL; i<MM; ++i )
3998 v_[i+j*MM] = Type();
4001 assign( *
this, ~m );
4028 template<
typename Type
4053 template<
typename Type
4079 template<
typename Type
4091 return (*
this)(i,j);
4109 template<
typename Type
4121 return (*
this)(i,j);
4139 template<
typename Type
4163 template<
typename Type
4184 template<
typename Type
4206 template<
typename Type
4226 template<
typename Type
4246 template<
typename Type
4266 template<
typename Type
4286 template<
typename Type
4306 template<
typename Type
4326 template<
typename Type
4354 template<
typename Type
4363 for(
size_t j=0UL; j<
n_; ++j )
4364 for(
size_t i=0UL; i<
m_; ++i )
4399 template<
typename Type
4405 const size_t m( list.size() );
4420 for(
const auto& rowList : list ) {
4422 for(
const auto& element : rowList ) {
4423 v_[i+j*MM] = element;
4426 for( ; j<
n_; ++j ) {
4427 v_[i+j*MM] = Type();
4460 template<
typename Type
4463 template<
typename Other
4474 for(
size_t j=0UL; j<Cols; ++j )
4475 for(
size_t i=0UL; i<Rows; ++i )
4476 v_[i+j*MM] = array[i][j];
4493 template<
typename Type
4499 using blaze::assign;
4504 resize( rhs.rows(), rhs.columns() );
4505 assign( *
this, ~rhs );
4527 template<
typename Type
4530 template<
typename MT
4534 using blaze::assign;
4552 resize( tmp.rows(), tmp.columns() );
4553 assign( *
this, tmp );
4559 assign( *
this, ~rhs );
4581 template<
typename Type
4584 template<
typename MT
4588 using blaze::addAssign;
4596 addAssign( *
this, tmp );
4599 addAssign( *
this, ~rhs );
4621 template<
typename Type
4624 template<
typename MT
4628 using blaze::subAssign;
4636 subAssign( *
this, tmp );
4639 subAssign( *
this, ~rhs );
4661 template<
typename Type
4664 template<
typename MT
4668 using blaze::schurAssign;
4676 schurAssign( *
this, tmp );
4679 schurAssign( *
this, ~rhs );
4704 template<
typename Type
4721 template<
typename Type
4741 template<
typename Type
4758 template<
typename Type
4776 template<
typename Type
4797 template<
typename Type
4802 size_t nonzeros( 0UL );
4804 for(
size_t j=0UL; j<
n_; ++j )
4805 for(
size_t i=0UL; i<
m_; ++i )
4822 template<
typename Type
4829 const size_t iend( j*MM +
m_ );
4830 size_t nonzeros( 0UL );
4832 for(
size_t i=j*MM; i<iend; ++i )
4848 template<
typename Type
4855 for(
size_t j=0UL; j<
n_; ++j )
4856 for(
size_t i=0UL; i<
m_; ++i )
4873 template<
typename Type
4881 for(
size_t i=0UL; i<
m_; ++i )
4896 template<
typename Type
4944 template<
typename Type
4960 for(
size_t j=0UL; j<n; ++j )
4961 for(
size_t i=m; i<
m_; ++i )
4962 v_[i+j*MM] = Type();
4966 for(
size_t j=n; j<
n_; ++j )
4967 for(
size_t i=0UL; i<
m_; ++i )
4968 v_[i+j*MM] = Type();
4994 template<
typename Type
5013 template<
typename Type
5020 const size_t maxrows(
max(
m_, m.m_ ) );
5021 const size_t maxcols(
max(
n_, m.n_ ) );
5023 for(
size_t j=0UL; j<maxcols; ++j ) {
5024 for(
size_t i=0UL; i<maxrows; ++i ) {
5025 swap(
v_[i+j*MM], m(i,j) );
5056 template<
typename Type
5063 if(
m_ > N ||
n_ > M ) {
5067 const size_t maxsize(
max(
m_,
n_ ) );
5068 for(
size_t j=1UL; j<maxsize; ++j ) {
5069 for(
size_t i=0UL; i<j; ++i ) {
5075 for(
size_t j=0UL; j<
n_; ++j ) {
5076 for(
size_t i=n_; i<
m_; ++i ) {
5077 v_[i+j*MM] = Type();
5083 for(
size_t j=
m_; j<
n_; ++j ) {
5084 for(
size_t i=0UL; i<
m_; ++i ) {
5085 v_[i+j*MM] = Type();
5112 template<
typename Type
5119 if(
m_ > N ||
n_ > M ) {
5123 const size_t maxsize(
max(
m_,
n_ ) );
5124 for(
size_t j=0UL; j<maxsize; ++j ) {
5125 for(
size_t i=0UL; i<j; ++i ) {
5132 for(
size_t j=0UL; j<
n_; ++j ) {
5133 for(
size_t i=n_; i<
m_; ++i ) {
5134 v_[i+j*MM] = Type();
5140 for(
size_t j=
m_; j<
n_; ++j ) {
5141 for(
size_t i=0UL; i<
m_; ++i ) {
5142 v_[i+j*MM] = Type();
5175 template<
typename Type
5178 template<
typename Other >
5182 for(
size_t j=0UL; j<
n_; ++j )
5183 for(
size_t i=0UL; i<
m_; ++i )
5184 v_[i+j*MM] *= scalar;
5211 template<
typename Type
5220 return allocate<HybridMatrix>( 1UL );
5237 template<
typename Type
5245 return allocate<HybridMatrix>( size/
sizeof(
HybridMatrix) );
5262 template<
typename Type
5271 return allocate<HybridMatrix>( 1UL );
5288 template<
typename Type
5296 return allocate<HybridMatrix>( size/
sizeof(
HybridMatrix) );
5309 template<
typename Type
5314 deallocate( static_cast<HybridMatrix*>( ptr ) );
5327 template<
typename Type
5332 deallocate( static_cast<HybridMatrix*>( ptr ) );
5345 template<
typename Type
5350 deallocate( static_cast<HybridMatrix*>( ptr ) );
5363 template<
typename Type
5368 deallocate( static_cast<HybridMatrix*>( ptr ) );
5392 template<
typename Type
5397 if(
m_ > M ||
n_ > N )
5402 for(
size_t j=0UL; j<
n_; ++j ) {
5403 for(
size_t i=
m_; i<MM; ++i ) {
5404 if(
v_[i+j*MM] != Type() )
5409 for(
size_t j=n_; j<N; ++j ) {
5410 for(
size_t i=0UL; i<MM; ++i ) {
5411 if(
v_[i+j*MM] != Type() )
5442 template<
typename Type
5445 template<
typename Other >
5448 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5465 template<
typename Type
5468 template<
typename Other >
5471 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5487 template<
typename Type
5492 return ( usePadding ||
rows() % SIMDSIZE == 0UL );
5513 template<
typename Type
5520 return loada( i, j );
5522 return loadu( i, j );
5543 template<
typename Type
5580 template<
typename Type
5616 template<
typename Type
5647 template<
typename Type
5685 template<
typename Type
5722 template<
typename Type
5756 template<
typename Type
5759 template<
typename MT
5766 for(
size_t j=0UL; j<
n_; ++j ) {
5767 for(
size_t i=0UL; i<
m_; ++i ) {
5768 v_[i+j*MM] = (~rhs)(i,j);
5788 template<
typename Type
5791 template<
typename MT
5802 const size_t ipos( ( remainder )?(
m_ &
size_t(-SIMDSIZE) ):(
m_ ) );
5805 for(
size_t j=0UL; j<
n_; ++j )
5809 for( ; i<ipos; i+=SIMDSIZE ) {
5812 for( ; remainder && i<
m_; ++i ) {
5813 v_[i+j*MM] = (~rhs)(i,j);
5833 template<
typename Type
5836 template<
typename MT >
5841 for(
size_t j=0UL; j<
n_; ++j )
5843 v_[element->index()+j*MM] = element->value();
5861 template<
typename Type
5864 template<
typename MT >
5871 for(
size_t i=0UL; i<
m_; ++i )
5873 v_[i+element->index()*MM] = element->value();
5891 template<
typename Type
5894 template<
typename MT
5901 for(
size_t j=0UL; j<
n_; ++j )
5905 v_[j+j*MM] += (~rhs)(j,j);
5917 for(
size_t i=ibegin; i<iend; ++i ) {
5918 v_[i+j*MM] += (~rhs)(i,j);
5939 template<
typename Type
5942 template<
typename MT
5954 for(
size_t j=0UL; j<
n_; ++j )
5964 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5965 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5969 for( ; i<ipos; i+=SIMDSIZE ) {
5972 for( ; remainder && i<iend; ++i ) {
5973 v_[i+j*MM] += (~rhs)(i,j);
5993 template<
typename Type
5996 template<
typename MT >
6001 for(
size_t j=0UL; j<
n_; ++j )
6003 v_[element->index()+j*MM] += element->value();
6021 template<
typename Type
6024 template<
typename MT >
6031 for(
size_t i=0UL; i<
m_; ++i )
6033 v_[i+element->index()*MM] += element->value();
6051 template<
typename Type
6054 template<
typename MT
6061 for(
size_t j=0UL; j<
n_; ++j )
6065 v_[j+j*MM] -= (~rhs)(j,j);
6077 for(
size_t i=ibegin; i<iend; ++i ) {
6078 v_[i+j*MM] -= (~rhs)(i,j);
6099 template<
typename Type
6102 template<
typename MT
6114 for(
size_t j=0UL; j<
n_; ++j )
6124 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
6125 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
6129 for( ; i<ipos; i+=SIMDSIZE ) {
6132 for( ; remainder && i<iend; ++i ) {
6133 v_[i+j*MM] -= (~rhs)(i,j);
6153 template<
typename Type
6156 template<
typename MT >
6161 for(
size_t j=0UL; j<
n_; ++j )
6163 v_[element->index()+j*MM] -= element->value();
6181 template<
typename Type
6184 template<
typename MT >
6191 for(
size_t i=0UL; i<
m_; ++i )
6193 v_[i+element->index()*MM] -= element->value();
6211 template<
typename Type
6214 template<
typename MT
6221 for(
size_t j=0UL; j<
n_; ++j ) {
6222 for(
size_t i=0UL; i<
m_; ++i ) {
6223 v_[i+j*MM] *= (~rhs)(i,j);
6243 template<
typename Type
6246 template<
typename MT
6257 for(
size_t j=0UL; j<
n_; ++j )
6259 const size_t ipos( ( remainder )?(
m_ &
size_t(-SIMDSIZE) ):(
m_ ) );
6264 for( ; i<ipos; i+=SIMDSIZE ) {
6267 for( ; remainder && i<
m_; ++i ) {
6268 v_[i+j*MM] *= (~rhs)(i,j);
6288 template<
typename Type
6291 template<
typename MT >
6300 for(
size_t j=0UL; j<
n_; ++j )
6302 v_[element->index()+j*MM] = tmp.v_[element->index()+j*MM] * element->value();
6320 template<
typename Type
6323 template<
typename MT >
6334 for(
size_t i=0UL; i<
m_; ++i )
6336 v_[i+element->index()*MM] = tmp.v_[i+element->index()*MM] * element->value();
6357 template<
typename Type,
size_t M,
size_t N,
bool SO >
6360 template<
typename Type,
size_t M,
size_t N,
bool SO >
6363 template<
typename Type,
size_t M,
size_t N,
bool SO >
6366 template<
bool RF,
typename Type,
size_t M,
size_t N,
bool SO >
6369 template<
typename Type,
size_t M,
size_t N,
bool SO >
6372 template<
typename Type,
size_t M,
size_t N,
bool SO >
6385 template<
typename Type
6409 template<
typename Type
6427 template<
typename Type
6470 return ( m.rows() == 0UL && m.columns() == 0UL );
6493 template<
typename Type
6499 return m.isIntact();
6512 template<
typename Type
6533 template<
typename T,
size_t M,
size_t N,
bool SO >
6551 template<
typename T,
size_t M,
size_t N,
bool SO >
6569 template<
typename T,
size_t M,
size_t N,
bool SO >
6570 struct IsAligned< HybridMatrix<T,M,N,SO> >
6587 template<
typename T,
size_t M,
size_t N,
bool SO >
6605 template<
typename T,
size_t M,
size_t N,
bool SO >
6606 struct IsPadded< HybridMatrix<T,M,N,SO> >
6623 template<
typename T,
size_t M,
size_t N,
bool SO >
6641 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6642 struct AddTrait< HybridMatrix<T1,M1,N1,SO>, StaticMatrix<T2,M2,N2,SO> >
6647 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6648 struct AddTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
6653 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6654 struct AddTrait< StaticMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6659 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6660 struct AddTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6665 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6666 struct AddTrait< HybridMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6671 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6672 struct AddTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6690 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6691 struct SubTrait< HybridMatrix<T1,M1,N1,SO>, StaticMatrix<T2,M2,N2,SO> >
6696 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6697 struct SubTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
6702 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6703 struct SubTrait< StaticMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6708 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6709 struct SubTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6714 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6715 struct SubTrait< HybridMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6720 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6721 struct SubTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6739 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6740 struct SchurTrait< HybridMatrix<T1,M1,N1,SO>, StaticMatrix<T2,M2,N2,SO> >
6745 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6746 struct SchurTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
6751 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6752 struct SchurTrait< StaticMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6757 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6758 struct SchurTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6763 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6764 struct SchurTrait< HybridMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6769 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6770 struct SchurTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6788 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6789 struct MultTrait< HybridMatrix<T1,M,N,SO>, T2, EnableIf_<IsNumeric<T2> > >
6794 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6795 struct MultTrait< T1, HybridMatrix<T2,M,N,SO>, EnableIf_<IsNumeric<T1> > >
6800 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
size_t K >
6801 struct MultTrait< HybridMatrix<T1,M,N,SO>, StaticVector<T2,K,false> >
6806 template<
typename T1,
size_t K,
typename T2,
size_t M,
size_t N,
bool SO >
6807 struct MultTrait< StaticVector<T1,K,true>, HybridMatrix<T2,M,N,SO> >
6812 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
size_t K >
6813 struct MultTrait< HybridMatrix<T1,M,N,SO>, HybridVector<T2,K,false> >
6818 template<
typename T1,
size_t K,
typename T2,
size_t M,
size_t N,
bool SO >
6819 struct MultTrait< HybridVector<T1,K,true>, HybridMatrix<T2,M,N,SO> >
6824 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6825 struct MultTrait< HybridMatrix<T1,M,N,SO>, DynamicVector<T2,false> >
6830 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6831 struct MultTrait< DynamicVector<T1,true>, HybridMatrix<T2,M,N,SO> >
6836 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6837 struct MultTrait< HybridMatrix<T1,M,N,SO>, CustomVector<T2,AF,PF,false> >
6842 template<
typename T1,
bool AF,
bool PF,
typename T2,
size_t M,
size_t N,
bool SO >
6843 struct MultTrait< CustomVector<T1,AF,PF,true>, HybridMatrix<T2,M,N,SO> >
6848 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6849 struct MultTrait< HybridMatrix<T1,M,N,SO>, CompressedVector<T2,false> >
6854 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6855 struct MultTrait< CompressedVector<T1,true>, HybridMatrix<T2,M,N,SO> >
6860 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6861 struct MultTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
6866 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6867 struct MultTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6872 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6873 struct MultTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6891 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6892 struct DivTrait< HybridMatrix<T1,M,N,SO>, T2, EnableIf_<IsNumeric<T2> > >
6910 template<
typename T,
size_t M,
size_t N,
bool SO,
typename OP >
6929 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2,
typename OP >
6930 struct BinaryMapTrait< HybridMatrix<T1,M1,N1,SO>, StaticMatrix<T2,M2,N2,SO>, OP >
6935 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2,
typename OP >
6936 struct BinaryMapTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2>, OP >
6941 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2,
typename OP >
6942 struct BinaryMapTrait< StaticMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO>, OP >
6947 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2,
typename OP >
6948 struct BinaryMapTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2>, OP >
6953 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2,
typename OP >
6954 struct BinaryMapTrait< HybridMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO>, OP >
6959 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2,
typename OP >
6960 struct BinaryMapTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2>, OP >
6978 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6979 struct HighType< HybridMatrix<T1,M,N,SO>, HybridMatrix<T2,M,N,SO> >
6997 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6998 struct LowType< HybridMatrix<T1,M,N,SO>, HybridMatrix<T2,M,N,SO> >
7016 template<
typename T,
size_t M1,
size_t N1,
bool SO,
size_t I,
size_t J,
size_t M2,
size_t N2 >
7022 template<
typename T,
size_t M,
size_t N,
bool SO >
7041 template<
typename T,
size_t M,
size_t N,
bool SO,
size_t... CRAs >
7042 struct RowTrait< HybridMatrix<T,M,N,SO>, CRAs... >
7060 template<
typename T,
size_t M,
size_t N,
bool SO,
size_t... CRAs >
7061 struct RowsTrait< HybridMatrix<T,M,N,SO>, CRAs... >
7063 using Type = HybridMatrix<T,
sizeof...(CRAs),N,
false>;
7066 template<
typename T,
size_t M,
size_t N,
bool SO >
7067 struct RowsTrait< HybridMatrix<T,M,N,SO> >
7085 template<
typename T,
size_t M,
size_t N,
bool SO,
size_t... CCAs >
7086 struct ColumnTrait< HybridMatrix<T,M,N,SO>, CCAs... >
7104 template<
typename T,
size_t M,
size_t N,
bool SO,
size_t... CCAs >
7107 using Type = HybridMatrix<T,M,
sizeof...(CCAs),
true>;
7110 template<
typename T,
size_t M,
size_t N,
bool SO >
7129 template<
typename T,
size_t M,
size_t N,
bool SO >
7130 struct BandTrait< HybridMatrix<T,M,N,SO> >
7132 enum :
size_t {
Min =
min( M, N ) };
7136 template<
typename T,
size_t M,
size_t N,
bool SO, ptrdiff_t I >
7137 struct BandTrait< HybridMatrix<T,M,N,SO>, I >
7139 enum :
size_t {
Min =
min( M - ( I >= 0L ? 0UL : -I ), N - ( I >= 0L ? I : 0UL ) ) };
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.
Headerfile for the generic min algorithm.
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:1292
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:109
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:108
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:243
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
Header file for the IsSame and IsStrictlySame type traits.
Base template for the SchurTrait class.
Definition: SchurTrait.h:112
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:1172
Header file for the IsColumnMajorMatrix type trait.
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: HybridMatrix.h:1024
constexpr size_t spacing() const noexcept
Returns the spacing between the beginning of two rows.
Definition: HybridMatrix.h:1685
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1903
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:87
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:1244
#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:1650
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:87
Header file for memory allocation and deallocation functionality.
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:1220
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:1950
Base template for the RowsTrait class.
Definition: RowsTrait.h:109
Type ElementType
Type of the matrix elements.
Definition: HybridMatrix.h:233
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
Header file for the band trait.
Constraint on the data type.
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:2417
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:1892
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: HybridMatrix.h:1743
Base template for the RowTrait class.
Definition: RowTrait.h:109
Compile time check for the memory layout of data types.This type trait tests whether the given data t...
Definition: IsContiguous.h:86
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:58
#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:5908
HybridMatrix & operator=(const Type &set)
Homogenous assignment to all matrix elements.
Definition: HybridMatrix.h:1318
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:2616
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:2547
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:240
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:566
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:975
Header file for the IsLower type trait.
size_t m_
The current number of rows of the matrix.
Definition: HybridMatrix.h:530
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:89
Type & Reference
Reference to a non-constant matrix value.
Definition: HybridMatrix.h:238
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: HybridMatrix.h:241
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:1797
Header file for the exception macros of the math module.
HybridMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: HybridMatrix.h:2056
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:261
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
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:2653
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:1959
Header file for the IsSIMDCombinable type trait.
AlignedArray< Type, M *NN > v_
The statically allocated matrix elements.
Definition: HybridMatrix.h:520
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:2578
#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:1083
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
size_t determineColumns(initializer_list< initializer_list< Type > > list) noexcept
Determines the maximum number of columns specified by the given initializer list. ...
Definition: InitializerList.h:107
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:119
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:2001
Base template for the MultTrait class.
Definition: MultTrait.h:119
const Type & ConstReference
Reference to a constant matrix value.
Definition: HybridMatrix.h:239
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:2511
Header file for the division trait.
Header file for the InvExprTrait class template.
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:296
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: HybridMatrix.h:2375
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:228
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:816
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:2444
Base template for the DivTrait class.
Definition: DivTrait.h:120
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_< 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
Generic wrapper for the min() function.
Definition: Min.h:62
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:251
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:244
Header file for the IsRowMajorMatrix type trait.
Base template for the ColumnsTrait class.
Definition: ColumnsTrait.h:109
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.
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:2474
size_t n_
The current number of columns of the matrix.
Definition: HybridMatrix.h:531
Header file for the IntegralConstant class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: HybridMatrix.h:235
void clear()
Clearing the hybrid matrix.
Definition: HybridMatrix.h:1845
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:628
Base template for the SubTrait class.
Definition: SubTrait.h:119
#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:1941
#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:97
Header file for the IsResizable type trait.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: HybridMatrix.h:1666
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:95
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:1701
SIMDTrait_< ElementType > SIMDType
SIMD type of the matrix elements.
Definition: HybridMatrix.h:234
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: HybridMatrix.h:2397
bool isIntact() const noexcept
Returns whether the invariants of the hybrid matrix are intact.
Definition: HybridMatrix.h:2325
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.
Base template for the BandTrait class.
Definition: BandTrait.h:109