35 #ifndef _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_ 36 #define _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_ 208 template<
typename Type
212 class HybridMatrix :
public DenseMatrix< HybridMatrix<Type,M,N,SO>, SO >
238 template<
typename NewType >
247 template<
size_t NewM
266 enum :
bool { smpAssignable =
false };
274 explicit inline HybridMatrix(
size_t m,
size_t n,
const Type& init );
277 template<
typename Other >
280 template<
typename Other,
size_t M2,
size_t N2 >
295 inline Reference
operator()(
size_t i,
size_t j ) noexcept;
296 inline ConstReference
operator()(
size_t i,
size_t j )
const noexcept;
297 inline Reference
at(
size_t i,
size_t j );
298 inline ConstReference
at(
size_t i,
size_t j )
const;
299 inline Pointer
data () noexcept;
300 inline ConstPointer
data ()
const noexcept;
301 inline Pointer
data (
size_t i ) noexcept;
302 inline ConstPointer
data (
size_t i )
const noexcept;
303 inline Iterator
begin (
size_t i ) noexcept;
304 inline ConstIterator
begin (
size_t i )
const noexcept;
305 inline ConstIterator
cbegin(
size_t i )
const noexcept;
306 inline Iterator
end (
size_t i ) noexcept;
307 inline ConstIterator
end (
size_t i )
const noexcept;
308 inline ConstIterator
cend (
size_t i )
const noexcept;
315 inline HybridMatrix&
operator=(
const Type&
set );
318 template<
typename Other,
size_t M2,
size_t N2 >
321 inline HybridMatrix&
operator= (
const HybridMatrix& rhs );
327 template<
typename Other >
330 template<
typename Other >
338 inline size_t rows()
const noexcept;
339 inline size_t columns()
const noexcept;
340 inline constexpr
size_t spacing()
const noexcept;
341 inline constexpr
size_t capacity()
const noexcept;
342 inline size_t capacity(
size_t i )
const noexcept;
344 inline size_t nonZeros(
size_t i )
const;
346 inline void reset(
size_t i );
348 void resize (
size_t m,
size_t n,
bool preserve=
true );
349 inline void extend (
size_t m,
size_t n,
bool preserve=
true );
350 inline void swap( HybridMatrix& m ) noexcept;
360 template<
typename Other >
inline HybridMatrix& scale(
const Other& scalar );
367 static inline void*
operator new ( std::size_t
size );
368 static inline void*
operator new[]( std::size_t
size );
369 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
370 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
372 static inline void operator delete (
void* ptr );
373 static inline void operator delete[](
void* ptr );
374 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
375 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
382 template<
typename MT >
384 struct VectorizedAssign {
386 simdEnabled && MT::simdEnabled &&
395 template<
typename MT >
397 struct VectorizedAddAssign {
399 simdEnabled && MT::simdEnabled &&
410 template<
typename MT >
412 struct VectorizedSubAssign {
414 simdEnabled && MT::simdEnabled &&
432 inline bool isIntact()
const noexcept;
439 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
440 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
453 template<
typename MT,
bool SO2 >
456 template<
typename MT,
bool SO2 >
462 template<
typename MT,
bool SO2 >
465 template<
typename MT,
bool SO2 >
471 template<
typename MT,
bool SO2 >
474 template<
typename MT,
bool SO2 >
533 template<
typename Type
545 for(
size_t i=0UL; i<M*NN; ++i )
567 template<
typename Type
587 for(
size_t i=0UL; i<M*NN; ++i )
610 template<
typename Type
629 for(
size_t i=0UL; i<m; ++i ) {
630 for(
size_t j=0UL; j<n; ++j )
634 for(
size_t j=n; j<NN; ++j )
640 for(
size_t i=m; i<M; ++i )
641 for(
size_t j=0UL; j<NN; ++j )
674 template<
typename Type
695 for(
const auto& rowList : list ) {
696 std::fill( std::copy( rowList.begin(), rowList.end(),
v_+i*NN ),
v_+(i+1UL)*NN, Type() );
702 for(
size_t j=0UL; j<NN; ++j )
738 template<
typename Type
742 template<
typename Other >
758 for(
size_t i=0UL; i<m; ++i ) {
759 for(
size_t j=0UL; j<n; ++j )
760 v_[i*NN+j] = array[i*n+j];
763 for(
size_t j=n; j<NN; ++j )
769 for(
size_t i=m; i<M; ++i )
770 for(
size_t j=0UL; j<NN; ++j )
800 template<
typename Type
804 template<
typename Other
816 for(
size_t i=0UL; i<M2; ++i ) {
817 for(
size_t j=0UL; j<N2; ++j )
818 v_[i*NN+j] = array[i][j];
821 for(
size_t j=N2; j<NN; ++j )
827 for(
size_t i=M2; i<M; ++i )
828 for(
size_t j=0UL; j<NN; ++j )
845 template<
typename Type
856 for(
size_t i=0UL; i<
m_; ++i ) {
857 for(
size_t j=0UL; j<
n_; ++j )
858 v_[i*NN+j] = m.v_[i*NN+j];
861 for(
size_t j=n_; j<NN; ++j )
867 for(
size_t i=m_; i<M; ++i )
868 for(
size_t j=0UL; j<NN; ++j )
883 template<
typename Type
887 template<
typename MT
902 for(
size_t i=0UL; i<
m_; ++i ) {
904 j<( IsNumeric<Type>::value ? NN :
n_ );
911 for(
size_t i=m_; i<M; ++i )
912 for(
size_t j=0UL; j<NN; ++j )
941 template<
typename Type
965 template<
typename Type
990 template<
typename Type
1003 return (*
this)(i,j);
1019 template<
typename Type
1032 return (*
this)(i,j);
1049 template<
typename Type
1073 template<
typename Type
1093 template<
typename Type
1114 template<
typename Type
1138 template<
typename Type
1162 template<
typename Type
1186 template<
typename Type
1210 template<
typename Type
1234 template<
typename Type
1258 template<
typename Type
1285 template<
typename Type
1294 for(
size_t i=0UL; i<
m_; ++i )
1295 for(
size_t j=0UL; j<
n_; ++j )
1328 template<
typename Type
1335 const size_t m( list.size() );
1350 for(
const auto& rowList : list ) {
1351 std::fill( std::copy( rowList.begin(), rowList.end(),
v_+i*NN ),
v_+(i+1UL)*NN, Type() );
1381 template<
typename Type
1385 template<
typename Other
1395 for(
size_t i=0UL; i<M2; ++i )
1396 for(
size_t j=0UL; j<N2; ++j )
1397 v_[i*NN+j] = array[i][j];
1412 template<
typename Type
1418 using blaze::assign;
1423 resize( rhs.rows(), rhs.columns() );
1424 assign( *
this, ~rhs );
1444 template<
typename Type
1448 template<
typename MT
1452 using blaze::assign;
1470 resize( tmp.rows(), tmp.columns() );
1471 assign( *
this, tmp );
1477 assign( *
this, ~rhs );
1497 template<
typename Type
1501 template<
typename MT
1505 using blaze::addAssign;
1513 addAssign( *
this, tmp );
1516 addAssign( *
this, ~rhs );
1536 template<
typename Type
1540 template<
typename MT
1544 using blaze::subAssign;
1552 subAssign( *
this, tmp );
1555 subAssign( *
this, ~rhs );
1575 template<
typename Type
1579 template<
typename MT
1604 template<
typename Type
1608 template<
typename Other >
1612 using blaze::assign;
1614 assign( *
this, (*
this) * rhs );
1632 template<
typename Type
1636 template<
typename Other >
1640 using blaze::assign;
1644 assign( *
this, (*
this) / rhs );
1666 template<
typename Type
1682 template<
typename Type
1701 template<
typename Type
1717 template<
typename Type
1739 template<
typename Type
1759 template<
typename Type
1765 size_t nonzeros( 0UL );
1767 for(
size_t i=0UL; i<
m_; ++i )
1768 for(
size_t j=0UL; j<
n_; ++j )
1788 template<
typename Type
1796 const size_t jend( i*NN +
n_ );
1797 size_t nonzeros( 0UL );
1799 for(
size_t j=i*NN; j<jend; ++j )
1813 template<
typename Type
1821 for(
size_t i=0UL; i<
m_; ++i )
1822 for(
size_t j=0UL; j<
n_; ++j )
1839 template<
typename Type
1848 for(
size_t j=0UL; j<
n_; ++j )
1861 template<
typename Type
1908 template<
typename Type
1925 for(
size_t i=0UL; i<m; ++i )
1926 for(
size_t j=n; j<
n_; ++j )
1927 v_[i*NN+j] = Type();
1931 for(
size_t i=m; i<
m_; ++i )
1932 for(
size_t j=0UL; j<
n_; ++j )
1933 v_[i*NN+j] = Type();
1957 template<
typename Type
1975 template<
typename Type
1983 const size_t maxrows(
max(
m_, m.m_ ) );
1984 const size_t maxcols(
max(
n_, m.n_ ) );
1986 for(
size_t i=0UL; i<maxrows; ++i ) {
1987 for(
size_t j=0UL; j<maxcols; ++j ) {
1988 swap(
v_[i*NN+j], m(i,j) );
2017 template<
typename Type
2025 if(
m_ > N ||
n_ > M ) {
2029 const size_t maxsize(
max(
m_,
n_ ) );
2030 for(
size_t i=1UL; i<maxsize; ++i ) {
2031 for(
size_t j=0UL; j<i; ++j ) {
2037 for(
size_t i=0UL; i<
m_; ++i ) {
2038 for(
size_t j=m_; j<
n_; ++j ) {
2039 v_[i*NN+j] = Type();
2045 for(
size_t i=
n_; i<
m_; ++i ) {
2046 for(
size_t j=0UL; j<
n_; ++j ) {
2047 v_[i*NN+j] = Type();
2072 template<
typename Type
2080 if(
m_ > N ||
n_ > M ) {
2084 const size_t maxsize(
max(
m_,
n_ ) );
2085 for(
size_t i=0UL; i<maxsize; ++i ) {
2086 for(
size_t j=0UL; j<i; ++j ) {
2093 for(
size_t i=0UL; i<
m_; ++i ) {
2094 for(
size_t j=m_; j<
n_; ++j ) {
2095 v_[i*NN+j] = Type();
2101 for(
size_t i=
n_; i<
m_; ++i ) {
2102 for(
size_t j=0UL; j<
n_; ++j ) {
2103 v_[i*NN+j] = Type();
2123 template<
typename Type
2127 template<
typename Other >
2130 for(
size_t i=0UL; i<
m_; ++i )
2131 for(
size_t j=0UL; j<
n_; ++j )
2132 v_[i*NN+j] *= scalar;
2157 template<
typename Type
2167 return allocate<HybridMatrix>( 1UL );
2182 template<
typename Type
2206 template<
typename Type
2216 return allocate<HybridMatrix>( 1UL );
2231 template<
typename Type
2240 return allocate<HybridMatrix>( size/
sizeof(
HybridMatrix) );
2251 template<
typename Type
2257 deallocate( static_cast<HybridMatrix*>( ptr ) );
2268 template<
typename Type
2274 deallocate( static_cast<HybridMatrix*>( ptr ) );
2285 template<
typename Type
2291 deallocate( static_cast<HybridMatrix*>( ptr ) );
2302 template<
typename Type
2308 deallocate( static_cast<HybridMatrix*>( ptr ) );
2330 template<
typename Type
2336 if(
m_ > M ||
n_ > N )
2341 for(
size_t i=0UL; i<
m_; ++i ) {
2342 for(
size_t j=
n_; j<NN; ++j ) {
2343 if(
v_[i*NN+j] != Type() )
2348 for(
size_t i=m_; i<M; ++i ) {
2349 for(
size_t j=0UL; j<NN; ++j ) {
2350 if(
v_[i*NN+j] != Type() )
2379 template<
typename Type
2383 template<
typename Other >
2386 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2401 template<
typename Type
2405 template<
typename Other >
2408 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2422 template<
typename Type
2448 template<
typename Type
2456 return loada( i, j );
2458 return loadu( i, j );
2478 template<
typename Type
2515 template<
typename Type
2551 template<
typename Type
2582 template<
typename Type
2620 template<
typename Type
2657 template<
typename Type
2690 template<
typename Type
2694 template<
typename MT
2701 for(
size_t i=0UL; i<
m_; ++i ) {
2702 for(
size_t j=0UL; j<
n_; ++j ) {
2703 v_[i*NN+j] = (~rhs)(i,j);
2721 template<
typename Type
2725 template<
typename MT
2736 const size_t jpos( ( remainder )?(
n_ &
size_t(-SIMDSIZE) ):(
n_ ) );
2739 for(
size_t i=0UL; i<
m_; ++i )
2743 for( ; j<jpos; j+=SIMDSIZE ) {
2746 for( ; remainder && j<
n_; ++j ) {
2747 v_[i*NN+j] = (~rhs)(i,j);
2765 template<
typename Type
2769 template<
typename MT >
2774 for(
size_t i=0UL; i<
m_; ++i )
2776 v_[i*NN+element->index()] = element->value();
2792 template<
typename Type
2796 template<
typename MT >
2803 for(
size_t j=0UL; j<
n_; ++j )
2805 v_[element->index()*NN+j] = element->value();
2821 template<
typename Type
2825 template<
typename MT
2832 for(
size_t i=0UL; i<
m_; ++i )
2836 v_[i*NN+i] += (~rhs)(i,i);
2848 for(
size_t j=jbegin; j<jend; ++j ) {
2849 v_[i*NN+j] += (~rhs)(i,j);
2868 template<
typename Type
2872 template<
typename MT
2884 for(
size_t i=0UL; i<
m_; ++i )
2894 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
2895 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2899 for( ; j<jpos; j+=SIMDSIZE ) {
2902 for( ; remainder && j<jend; ++j ) {
2903 v_[i*NN+j] += (~rhs)(i,j);
2921 template<
typename Type
2925 template<
typename MT >
2930 for(
size_t i=0UL; i<
m_; ++i )
2932 v_[i*NN+element->index()] += element->value();
2948 template<
typename Type
2952 template<
typename MT >
2959 for(
size_t j=0UL; j<
n_; ++j )
2961 v_[element->index()*NN+j] += element->value();
2977 template<
typename Type
2981 template<
typename MT
2988 for(
size_t i=0UL; i<
m_; ++i )
2992 v_[i*NN+i] -= (~rhs)(i,i);
3004 for(
size_t j=jbegin; j<jend; ++j ) {
3005 v_[i*NN+j] -= (~rhs)(i,j);
3024 template<
typename Type
3028 template<
typename MT
3040 for(
size_t i=0UL; i<
m_; ++i )
3050 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
3051 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
3055 for( ; j<jpos; j+=SIMDSIZE ) {
3058 for( ; remainder && j<jend; ++j ) {
3059 v_[i*NN+j] -= (~rhs)(i,j);
3077 template<
typename Type
3081 template<
typename MT >
3086 for(
size_t i=0UL; i<
m_; ++i )
3088 v_[i*NN+element->index()] -= element->value();
3104 template<
typename Type
3108 template<
typename MT >
3115 for(
size_t j=0UL; j<
n_; ++j )
3117 v_[element->index()*NN+j] -= element->value();
3142 template<
typename Type
3171 template<
typename NewType >
3180 template<
size_t NewM
3199 enum :
bool { smpAssignable =
false };
3207 explicit inline HybridMatrix(
size_t m,
size_t n,
const Type& init );
3210 template<
typename Other >
3211 explicit inline HybridMatrix(
size_t m,
size_t n,
const Other* array );
3213 template<
typename Other,
size_t M2,
size_t N2 >
3214 explicit inline HybridMatrix(
const Other (&array)[M2][N2] );
3228 inline Reference
operator()(
size_t i,
size_t j ) noexcept;
3229 inline ConstReference
operator()(
size_t i,
size_t j )
const noexcept;
3230 inline Reference
at(
size_t i,
size_t j );
3231 inline ConstReference
at(
size_t i,
size_t j )
const;
3232 inline Pointer
data () noexcept;
3233 inline ConstPointer
data ()
const noexcept;
3234 inline Pointer
data (
size_t j ) noexcept;
3235 inline ConstPointer
data (
size_t j )
const noexcept;
3236 inline Iterator
begin (
size_t j ) noexcept;
3237 inline ConstIterator
begin (
size_t j )
const noexcept;
3238 inline ConstIterator
cbegin(
size_t j )
const noexcept;
3239 inline Iterator
end (
size_t j ) noexcept;
3240 inline ConstIterator
end (
size_t j )
const noexcept;
3241 inline ConstIterator
cend (
size_t j )
const noexcept;
3248 inline HybridMatrix&
operator=(
const Type&
set );
3251 template<
typename Other,
size_t M2,
size_t N2 >
3252 inline HybridMatrix&
operator=(
const Other (&array)[M2][N2] );
3254 inline HybridMatrix&
operator= (
const HybridMatrix& rhs );
3260 template<
typename Other >
3261 inline EnableIf_<IsNumeric<Other>, HybridMatrix >& operator*=( Other rhs );
3263 template<
typename Other >
3264 inline EnableIf_<IsNumeric<Other>, HybridMatrix >&
operator/=( Other rhs );
3271 inline size_t rows()
const noexcept;
3272 inline size_t columns()
const noexcept;
3273 inline constexpr
size_t spacing()
const noexcept;
3274 inline constexpr
size_t capacity()
const noexcept;
3275 inline size_t capacity(
size_t j )
const noexcept;
3277 inline size_t nonZeros(
size_t j )
const;
3278 inline void reset();
3279 inline void reset(
size_t i );
3280 inline void clear();
3281 void resize (
size_t m,
size_t n,
bool preserve=
true );
3282 inline void extend (
size_t m,
size_t n,
bool preserve=
true );
3283 inline void swap( HybridMatrix& m ) noexcept;
3293 template<
typename Other >
inline HybridMatrix& scale(
const Other& scalar );
3300 static inline void*
operator new ( std::size_t
size );
3301 static inline void*
operator new[]( std::size_t
size );
3302 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
3303 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
3305 static inline void operator delete (
void* ptr );
3306 static inline void operator delete[](
void* ptr );
3307 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
3308 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
3315 template<
typename MT >
3316 struct VectorizedAssign {
3318 simdEnabled && MT::simdEnabled &&
3326 template<
typename MT >
3327 struct VectorizedAddAssign {
3329 simdEnabled && MT::simdEnabled &&
3339 template<
typename MT >
3340 struct VectorizedSubAssign {
3342 simdEnabled && MT::simdEnabled &&
3359 inline bool isIntact()
const noexcept;
3366 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
3367 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
3380 template<
typename MT,
bool SO >
3383 template<
typename MT,
bool SO >
3389 template<
typename MT,
bool SO >
3392 template<
typename MT,
bool SO >
3398 template<
typename MT,
bool SO >
3401 template<
typename MT,
bool SO >
3453 template<
typename Type
3464 for(
size_t i=0UL; i<MM*N; ++i )
3488 template<
typename Type
3507 for(
size_t i=0UL; i<MM*N; ++i )
3532 template<
typename Type
3550 for(
size_t j=0UL; j<n; ++j ) {
3551 for(
size_t i=0UL; i<m; ++i )
3555 for(
size_t i=m; i<MM; ++i )
3556 v_[i+j*MM] = Type();
3561 for(
size_t j=n; j<N; ++j )
3562 for(
size_t i=0UL; i<MM; ++i )
3563 v_[i+j*MM] = Type();
3597 template<
typename Type
3617 for(
const auto& rowList : list ) {
3619 for(
const auto& element : rowList ) {
3620 v_[i+j*MM] = element;
3625 v_[i+j*MM] = Type();
3634 for( ; i<MM; ++i ) {
3635 for(
size_t j=0UL; j<N; ++j ) {
3636 v_[i+j*MM] = Type();
3675 template<
typename Type
3678 template<
typename Other >
3694 for(
size_t j=0UL; j<n; ++j ) {
3695 for(
size_t i=0UL; i<m; ++i )
3696 v_[i+j*MM] = array[i+j*m];
3699 for(
size_t i=m; i<MM; ++i )
3700 v_[i+j*MM] = Type();
3705 for(
size_t j=n; j<N; ++j )
3706 for(
size_t i=0UL; i<MM; ++i )
3707 v_[i+j*MM] = Type();
3738 template<
typename Type
3741 template<
typename Other
3753 for(
size_t j=0UL; j<N2; ++j ) {
3754 for(
size_t i=0UL; i<M2; ++i )
3755 v_[i+j*MM] = array[i][j];
3758 for(
size_t i=M2; i<MM; ++i )
3759 v_[i+j*MM] = Type();
3764 for(
size_t j=N2; j<N; ++j )
3765 for(
size_t i=0UL; i<MM; ++i )
3766 v_[i+j*MM] = Type();
3784 template<
typename Type
3794 for(
size_t j=0UL; j<
n_; ++j ) {
3795 for(
size_t i=0UL; i<
m_; ++i )
3796 v_[i+j*MM] = m.v_[i+j*MM];
3799 for(
size_t i=m_; i<MM; ++i )
3800 v_[i+j*MM] = Type();
3805 for(
size_t j=n_; j<N; ++j )
3806 for(
size_t i=0UL; i<MM; ++i )
3807 v_[i+j*MM] = Type();
3823 template<
typename Type
3826 template<
typename MT
3833 using blaze::assign;
3841 for(
size_t j=0UL; j<
n_; ++j ) {
3843 i<( IsNumeric<Type>::value ? MM :
m_ );
3845 v_[i+j*MM] = Type();
3850 for(
size_t j=n_; j<N; ++j )
3851 for(
size_t i=0UL; i<MM; ++i )
3852 v_[i+j*MM] = Type();
3855 assign( *
this, ~m );
3882 template<
typename Type
3907 template<
typename Type
3933 template<
typename Type
3945 return (*
this)(i,j);
3963 template<
typename Type
3975 return (*
this)(i,j);
3993 template<
typename Type
4017 template<
typename Type
4038 template<
typename Type
4060 template<
typename Type
4080 template<
typename Type
4100 template<
typename Type
4120 template<
typename Type
4140 template<
typename Type
4160 template<
typename Type
4180 template<
typename Type
4208 template<
typename Type
4217 for(
size_t j=0UL; j<
n_; ++j )
4218 for(
size_t i=0UL; i<
m_; ++i )
4253 template<
typename Type
4259 const size_t m( list.size() );
4274 for(
const auto& rowList : list ) {
4276 for(
const auto& element : rowList ) {
4277 v_[i+j*MM] = element;
4280 for( ; j<
n_; ++j ) {
4281 v_[i+j*MM] = Type();
4314 template<
typename Type
4317 template<
typename Other
4328 for(
size_t j=0UL; j<N2; ++j )
4329 for(
size_t i=0UL; i<M2; ++i )
4330 v_[i+j*MM] = array[i][j];
4347 template<
typename Type
4353 using blaze::assign;
4358 resize( rhs.rows(), rhs.columns() );
4359 assign( *
this, ~rhs );
4381 template<
typename Type
4384 template<
typename MT
4388 using blaze::assign;
4406 resize( tmp.rows(), tmp.columns() );
4407 assign( *
this, tmp );
4413 assign( *
this, ~rhs );
4435 template<
typename Type
4438 template<
typename MT
4442 using blaze::addAssign;
4450 addAssign( *
this, tmp );
4453 addAssign( *
this, ~rhs );
4475 template<
typename Type
4478 template<
typename MT
4482 using blaze::subAssign;
4490 subAssign( *
this, tmp );
4493 subAssign( *
this, ~rhs );
4515 template<
typename Type
4518 template<
typename MT
4545 template<
typename Type
4548 template<
typename Other >
4552 using blaze::assign;
4554 assign( *
this, (*
this) * rhs );
4574 template<
typename Type
4577 template<
typename Other >
4581 using blaze::assign;
4585 assign( *
this, (*
this) / rhs );
4609 template<
typename Type
4626 template<
typename Type
4646 template<
typename Type
4663 template<
typename Type
4681 template<
typename Type
4702 template<
typename Type
4707 size_t nonzeros( 0UL );
4709 for(
size_t j=0UL; j<
n_; ++j )
4710 for(
size_t i=0UL; i<
m_; ++i )
4727 template<
typename Type
4734 const size_t iend( j*MM +
m_ );
4735 size_t nonzeros( 0UL );
4737 for(
size_t i=j*MM; i<iend; ++i )
4753 template<
typename Type
4760 for(
size_t j=0UL; j<
n_; ++j )
4761 for(
size_t i=0UL; i<
m_; ++i )
4778 template<
typename Type
4786 for(
size_t i=0UL; i<
m_; ++i )
4801 template<
typename Type
4849 template<
typename Type
4865 for(
size_t j=0UL; j<n; ++j )
4866 for(
size_t i=m; i<
m_; ++i )
4867 v_[i+j*MM] = Type();
4871 for(
size_t j=n; j<
n_; ++j )
4872 for(
size_t i=0UL; i<
m_; ++i )
4873 v_[i+j*MM] = Type();
4899 template<
typename Type
4918 template<
typename Type
4925 const size_t maxrows(
max(
m_, m.m_ ) );
4926 const size_t maxcols(
max(
n_, m.n_ ) );
4928 for(
size_t j=0UL; j<maxcols; ++j ) {
4929 for(
size_t i=0UL; i<maxrows; ++i ) {
4930 swap(
v_[i+j*MM], m(i,j) );
4961 template<
typename Type
4968 if(
m_ > N ||
n_ > M ) {
4972 const size_t maxsize(
max(
m_,
n_ ) );
4973 for(
size_t j=1UL; j<maxsize; ++j ) {
4974 for(
size_t i=0UL; i<j; ++i ) {
4980 for(
size_t j=0UL; j<
n_; ++j ) {
4981 for(
size_t i=n_; i<
m_; ++i ) {
4982 v_[i+j*MM] = Type();
4988 for(
size_t j=
m_; j<
n_; ++j ) {
4989 for(
size_t i=0UL; i<
m_; ++i ) {
4990 v_[i+j*MM] = Type();
5017 template<
typename Type
5024 if(
m_ > N ||
n_ > M ) {
5028 const size_t maxsize(
max(
m_,
n_ ) );
5029 for(
size_t j=0UL; j<maxsize; ++j ) {
5030 for(
size_t i=0UL; i<j; ++i ) {
5037 for(
size_t j=0UL; j<
n_; ++j ) {
5038 for(
size_t i=n_; i<
m_; ++i ) {
5039 v_[i+j*MM] = Type();
5045 for(
size_t j=
m_; j<
n_; ++j ) {
5046 for(
size_t i=0UL; i<
m_; ++i ) {
5047 v_[i+j*MM] = Type();
5069 template<
typename Type
5072 template<
typename Other >
5076 for(
size_t j=0UL; j<
n_; ++j )
5077 for(
size_t i=0UL; i<
m_; ++i )
5078 v_[i+j*MM] *= scalar;
5105 template<
typename Type
5114 return allocate<HybridMatrix>( 1UL );
5131 template<
typename Type
5139 return allocate<HybridMatrix>( size/
sizeof(
HybridMatrix) );
5156 template<
typename Type
5165 return allocate<HybridMatrix>( 1UL );
5182 template<
typename Type
5190 return allocate<HybridMatrix>( size/
sizeof(
HybridMatrix) );
5203 template<
typename Type
5208 deallocate( static_cast<HybridMatrix*>( ptr ) );
5221 template<
typename Type
5226 deallocate( static_cast<HybridMatrix*>( ptr ) );
5239 template<
typename Type
5244 deallocate( static_cast<HybridMatrix*>( ptr ) );
5257 template<
typename Type
5262 deallocate( static_cast<HybridMatrix*>( ptr ) );
5286 template<
typename Type
5291 if(
m_ > M ||
n_ > N )
5296 for(
size_t j=0UL; j<
n_; ++j ) {
5297 for(
size_t i=
m_; i<MM; ++i ) {
5298 if(
v_[i+j*MM] != Type() )
5303 for(
size_t j=n_; j<N; ++j ) {
5304 for(
size_t i=0UL; i<MM; ++i ) {
5305 if(
v_[i+j*MM] != Type() )
5336 template<
typename Type
5339 template<
typename Other >
5342 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5359 template<
typename Type
5362 template<
typename Other >
5365 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5381 template<
typename Type
5407 template<
typename Type
5414 return loada( i, j );
5416 return loadu( i, j );
5437 template<
typename Type
5474 template<
typename Type
5510 template<
typename Type
5541 template<
typename Type
5579 template<
typename Type
5616 template<
typename Type
5650 template<
typename Type
5653 template<
typename MT
5660 for(
size_t j=0UL; j<
n_; ++j ) {
5661 for(
size_t i=0UL; i<
m_; ++i ) {
5662 v_[i+j*MM] = (~rhs)(i,j);
5682 template<
typename Type
5685 template<
typename MT
5696 const size_t ipos( ( remainder )?(
m_ &
size_t(-SIMDSIZE) ):(
m_ ) );
5699 for(
size_t j=0UL; j<
n_; ++j )
5703 for( ; i<ipos; i+=SIMDSIZE ) {
5706 for( ; remainder && i<
m_; ++i ) {
5707 v_[i+j*MM] = (~rhs)(i,j);
5727 template<
typename Type
5730 template<
typename MT >
5735 for(
size_t j=0UL; j<
n_; ++j )
5737 v_[element->index()+j*MM] = element->value();
5755 template<
typename Type
5758 template<
typename MT >
5765 for(
size_t i=0UL; i<
m_; ++i )
5767 v_[i+element->index()*MM] = element->value();
5785 template<
typename Type
5788 template<
typename MT
5795 for(
size_t j=0UL; j<
n_; ++j )
5799 v_[j+j*MM] += (~rhs)(j,j);
5811 for(
size_t i=ibegin; i<iend; ++i ) {
5812 v_[i+j*MM] += (~rhs)(i,j);
5833 template<
typename Type
5836 template<
typename MT
5848 for(
size_t j=0UL; j<
n_; ++j )
5858 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5859 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5863 for( ; i<ipos; i+=SIMDSIZE ) {
5866 for( ; remainder && i<iend; ++i ) {
5867 v_[i+j*MM] += (~rhs)(i,j);
5887 template<
typename Type
5890 template<
typename MT >
5895 for(
size_t j=0UL; j<
n_; ++j )
5897 v_[element->index()+j*MM] += element->value();
5915 template<
typename Type
5918 template<
typename MT >
5925 for(
size_t i=0UL; i<
m_; ++i )
5927 v_[i+element->index()*MM] += element->value();
5945 template<
typename Type
5948 template<
typename MT
5955 for(
size_t j=0UL; j<
n_; ++j )
5959 v_[j+j*MM] -= (~rhs)(j,j);
5971 for(
size_t i=ibegin; i<iend; ++i ) {
5972 v_[i+j*MM] -= (~rhs)(i,j);
5993 template<
typename Type
5996 template<
typename MT
6008 for(
size_t j=0UL; j<
n_; ++j )
6018 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
6019 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
6023 for( ; i<ipos; i+=SIMDSIZE ) {
6026 for( ; remainder && i<iend; ++i ) {
6027 v_[i+j*MM] -= (~rhs)(i,j);
6047 template<
typename Type
6050 template<
typename MT >
6057 for(
size_t j=0UL; j<
n_; ++j )
6058 for( RhsConstIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
6059 v_[element->index()+j*MM] -= element->value();
6077 template<
typename Type
6080 template<
typename MT >
6089 for(
size_t i=0UL; i<
m_; ++i )
6090 for( RhsConstIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
6091 v_[i+element->index()*MM] -= element->value();
6117 template<
typename Type
6133 template<
typename Type
6149 template<
typename Type
6171 template<
typename Type,
size_t M,
size_t N,
bool SO >
6174 template<
typename Type,
size_t M,
size_t N,
bool SO >
6177 template<
typename Type,
size_t M,
size_t N,
bool SO >
6180 template<
bool RF,
typename Type,
size_t M,
size_t N,
bool SO >
6183 template<
typename Type,
size_t M,
size_t N,
bool SO >
6186 template<
typename Type,
size_t M,
size_t N,
bool SO >
6199 template<
typename Type
6223 template<
typename Type
6241 template<
typename Type
6284 return ( m.rows() == 0UL && m.columns() == 0UL );
6307 template<
typename Type
6313 return m.isIntact();
6326 template<
typename Type
6347 template<
typename T,
size_t M,
size_t N,
bool SO >
6364 template<
typename T,
size_t M,
size_t N,
bool SO >
6381 template<
typename T,
size_t M,
size_t N,
bool SO >
6398 template<
typename T,
size_t M,
size_t N,
bool SO >
6415 template<
typename T,
size_t M,
size_t N,
bool SO >
6432 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6433 struct AddTrait< HybridMatrix<T1,M1,N1,SO>, StaticMatrix<T2,M2,N2,SO> >
6438 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6439 struct AddTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
6444 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6445 struct AddTrait< StaticMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6450 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6451 struct AddTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6456 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6457 struct AddTrait< HybridMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6462 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6463 struct AddTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6481 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6482 struct SubTrait< HybridMatrix<T1,M1,N1,SO>, StaticMatrix<T2,M2,N2,SO> >
6487 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6488 struct SubTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
6493 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6494 struct SubTrait< StaticMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6499 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6500 struct SubTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6505 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6506 struct SubTrait< HybridMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6511 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6512 struct SubTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6530 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6531 struct MultTrait< HybridMatrix<T1,M,N,SO>, T2, EnableIf_<IsNumeric<T2> > >
6536 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6537 struct MultTrait< T1, HybridMatrix<T2,M,N,SO>, EnableIf_<IsNumeric<T1> > >
6542 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
size_t K >
6543 struct MultTrait< HybridMatrix<T1,M,N,SO>, StaticVector<T2,K,false> >
6548 template<
typename T1,
size_t K,
typename T2,
size_t M,
size_t N,
bool SO >
6549 struct MultTrait< StaticVector<T1,K,true>, HybridMatrix<T2,M,N,SO> >
6554 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
size_t K >
6555 struct MultTrait< HybridMatrix<T1,M,N,SO>, HybridVector<T2,K,false> >
6560 template<
typename T1,
size_t K,
typename T2,
size_t M,
size_t N,
bool SO >
6561 struct MultTrait< HybridVector<T1,K,true>, HybridMatrix<T2,M,N,SO> >
6566 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6567 struct MultTrait< HybridMatrix<T1,M,N,SO>, DynamicVector<T2,false> >
6572 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6573 struct MultTrait< DynamicVector<T1,true>, HybridMatrix<T2,M,N,SO> >
6578 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6579 struct MultTrait< HybridMatrix<T1,M,N,SO>, CustomVector<T2,AF,PF,false> >
6584 template<
typename T1,
bool AF,
bool PF,
typename T2,
size_t M,
size_t N,
bool SO >
6585 struct MultTrait< CustomVector<T1,AF,PF,true>, HybridMatrix<T2,M,N,SO> >
6590 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6591 struct MultTrait< HybridMatrix<T1,M,N,SO>, CompressedVector<T2,false> >
6596 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6597 struct MultTrait< CompressedVector<T1,true>, HybridMatrix<T2,M,N,SO> >
6602 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6603 struct MultTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
6608 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6609 struct MultTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6614 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6615 struct MultTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6633 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6634 struct DivTrait< HybridMatrix<T1,M,N,SO>, T2, EnableIf_<IsNumeric<T2> > >
6652 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6653 struct HighType< HybridMatrix<T1,M,N,SO>, HybridMatrix<T2,M,N,SO> >
6671 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6672 struct LowType< HybridMatrix<T1,M,N,SO>, HybridMatrix<T2,M,N,SO> >
6690 template<
typename T1,
size_t M,
size_t N,
bool SO >
6709 template<
typename T1,
size_t M,
size_t N,
bool SO >
6710 struct RowTrait< HybridMatrix<T1,M,N,SO> >
6728 template<
typename T1,
size_t M,
size_t N,
bool SO >
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:133
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:163
Header file for mathematical functions.
constexpr bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
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:1263
Header file for the subtraction trait.
Type ElementType
Type of the matrix elements.
Definition: HybridMatrix.h:221
Header file for basic type definitions.
Header file for the row trait.
Base template for the SubmatrixTrait class.
Definition: SubmatrixTrait.h:118
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:117
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.
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:261
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:1339
Header file for the IsSame and IsStrictlySame type traits.
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:315
Iterator begin(size_t i) noexcept
Returns an iterator to the first element of row/column i.
Definition: HybridMatrix.h:1143
Header file for the IsColumnMajorMatrix type trait.
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: HybridMatrix.h:995
constexpr size_t spacing() const noexcept
Returns the spacing between the beginning of two rows.
Definition: HybridMatrix.h:1705
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: HybridMatrix.h:229
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:163
Iterator end(size_t i) noexcept
Returns an iterator just past the last element of row/column i.
Definition: HybridMatrix.h:1215
#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
const Type & ConstReference
Reference to a constant matrix value.
Definition: HybridMatrix.h:227
SIMDTrait_< ElementType > SIMDType
SIMD type of the matrix elements.
Definition: HybridMatrix.h:222
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:138
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: HybridMatrix.h:1670
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.
HybridMatrix< Type, N, M,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: HybridMatrix.h:220
ConstIterator cbegin(size_t i) const noexcept
Returns an iterator to the first element of row/column i.
Definition: HybridMatrix.h:1191
Type & Reference
Reference to a non-constant matrix value.
Definition: HybridMatrix.h:226
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:1321
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:323
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1802
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:71
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:119
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:2426
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
const This & CompositeType
Data type for composite expression templates.
Definition: HybridMatrix.h:224
void resize(size_t m, size_t n, bool preserve=true)
Changing the size of the matrix.
Definition: HybridMatrix.h:1912
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: HybridMatrix.h:1763
Base template for the RowTrait class.
Definition: RowTrait.h:117
typename TransExprTrait< T >::Type TransExprTrait_
Auxiliary alias declaration for the TransExprTrait class template.The TransExprTrait_ alias declarati...
Definition: TransExprTrait.h:143
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.
typename CTransExprTrait< T >::Type CTransExprTrait_
Auxiliary alias declaration for the CTransExprTrait class template.The CTransExprTrait_ alias declara...
Definition: CTransExprTrait.h:143
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:5635
HybridMatrix & operator=(const Type &set)
Homogenous assignment to all matrix elements.
Definition: HybridMatrix.h:1289
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:2625
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:83
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:2556
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
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:537
Type * Pointer
Pointer to a non-constant matrix value.
Definition: HybridMatrix.h:228
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:946
const Type & ReturnType
Return type for expression template evaluations.
Definition: HybridMatrix.h:223
Header file for the IsLower type trait.
size_t m_
The current number of rows of the matrix.
Definition: HybridMatrix.h:501
Header file for the IsAligned type trait.
HybridMatrix< Type, M, N, SO > This
Type of this HybridMatrix instance.
Definition: HybridMatrix.h:216
Compile time check for diagonal matrices.This type trait tests whether or not the given template para...
Definition: IsDiagonal.h:90
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:1817
Header file for the exception macros of the math module.
HybridMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: HybridMatrix.h:2076
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:249
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:553
Header file for the IsPadded type trait.
Header file for the IsVectorizable type trait.
HybridMatrix< Type, M, N,!SO > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: HybridMatrix.h:219
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:2662
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:1979
Header file for the IsSIMDCombinable type trait.
AlignedArray< Type, M *NN > v_
The statically allocated matrix elements.
Definition: HybridMatrix.h:491
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:2587
#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
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:261
HybridMatrix< NewType, M, N, SO > Other
The type of the other HybridMatrix.
Definition: HybridMatrix.h:240
Pointer data() noexcept
Low-level data access to the matrix elements.
Definition: HybridMatrix.h:1054
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:1285
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
DenseMatrix< This, SO > BaseType
Base type of this HybridMatrix instance.
Definition: HybridMatrix.h:217
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:143
Compile time check for column-major matrix types.This type trait tests whether or not the given templ...
Definition: IsColumnMajorMatrix.h:83
HybridMatrix & transpose()
In-place transpose of the matrix.
Definition: HybridMatrix.h:2021
Base template for the MultTrait class.
Definition: MultTrait.h:143
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:2520
Header file for the division trait.
Header file for the InvExprTrait class template.
Header file for the submatrix trait.
Constraint on the data type.
This ResultType
Result type for expression template evaluations.
Definition: HybridMatrix.h:218
Constraint on the data type.
DenseIterator< Type, usePadding > Iterator
Iterator over non-constant elements.
Definition: HybridMatrix.h:231
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:2384
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:94
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
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:225
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
BLAZE_ALWAYS_INLINE SIMDType load(size_t i, size_t j) const noexcept
Load of a SIMD element of the matrix.
Definition: HybridMatrix.h:2453
Base template for the DivTrait class.
Definition: DivTrait.h:143
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:239
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
DenseIterator< const Type, usePadding > ConstIterator
Iterator over constant elements.
Definition: HybridMatrix.h:232
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
constexpr bool usePadding
Configuration of the padding of dense vectors and matrices.This configuration switch enables/disables...
Definition: Optimizations.h:52
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:134
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:2483
size_t n_
The current number of columns of the matrix.
Definition: HybridMatrix.h:502
Header file for the IntegralConstant class template.
void clear()
Clearing the hybrid matrix.
Definition: HybridMatrix.h:1865
Compile time check for sparse matrix types.This type trait tests whether or not the given template pa...
Definition: IsSparseMatrix.h:78
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Base template for the SubTrait class.
Definition: SubTrait.h:143
#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:1303
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:1961
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
Header file for the IsResizable type trait.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: HybridMatrix.h:1686
System settings for the inline keywords.
HybridMatrix< Type, NewM, NewN, SO > Other
The type of the other HybridMatrix.
Definition: HybridMatrix.h:250
#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:1721
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: HybridMatrix.h:2406
bool isIntact() const noexcept
Returns whether the invariants of the hybrid matrix are intact.
Definition: HybridMatrix.h:2334
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.
constexpr bool defaultStorageOrder
The default storage order for all matrices of the Blaze library.This value specifies the default stor...
Definition: StorageOrder.h:56