35 #ifndef _BLAZE_MATH_DENSE_CUSTOMMATRIX_H_ 36 #define _BLAZE_MATH_DENSE_CUSTOMMATRIX_H_ 45 #include <boost/smart_ptr/shared_array.hpp> 431 template<
typename Type
461 template<
typename NewType >
470 template<
size_t NewM
496 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n );
497 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n,
size_t nn );
499 template<
typename Deleter,
typename = DisableIf_< IsIntegral<Deleter> > >
500 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n, Deleter D );
502 template<
typename Deleter >
503 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n,
size_t nn, Deleter D );
517 inline Reference
operator()(
size_t i,
size_t j ) noexcept;
518 inline ConstReference
operator()(
size_t i,
size_t j )
const noexcept;
519 inline Reference
at(
size_t i,
size_t j );
520 inline ConstReference
at(
size_t i,
size_t j )
const;
521 inline Pointer
data () noexcept;
522 inline ConstPointer
data ()
const noexcept;
523 inline Pointer
data (
size_t i ) noexcept;
524 inline ConstPointer
data (
size_t i )
const noexcept;
525 inline Iterator
begin (
size_t i ) noexcept;
526 inline ConstIterator
begin (
size_t i )
const noexcept;
527 inline ConstIterator
cbegin(
size_t i )
const noexcept;
528 inline Iterator
end (
size_t i ) noexcept;
529 inline ConstIterator
end (
size_t i )
const noexcept;
530 inline ConstIterator
cend (
size_t i )
const noexcept;
540 template<
typename Other,
size_t M,
size_t N >
551 template<
typename Other >
554 template<
typename Other >
562 inline size_t rows()
const noexcept;
563 inline size_t columns()
const noexcept;
564 inline size_t spacing()
const noexcept;
565 inline size_t capacity()
const noexcept;
566 inline size_t capacity(
size_t i )
const noexcept;
568 inline size_t nonZeros(
size_t i )
const;
570 inline void reset(
size_t i );
589 inline void reset( Type* ptr,
size_t m,
size_t n );
590 inline void reset( Type* ptr,
size_t m,
size_t n,
size_t nn );
592 template<
typename Deleter,
typename = DisableIf_< IsIntegral<Deleter> > >
593 inline void reset( Type* ptr,
size_t m,
size_t n, Deleter d );
595 template<
typename Deleter >
596 inline void reset( Type* ptr,
size_t m,
size_t n,
size_t nn, Deleter d );
603 template<
typename MT >
605 struct VectorizedAssign {
607 simdEnabled && MT::simdEnabled &&
615 template<
typename MT >
617 struct VectorizedAddAssign {
619 simdEnabled && MT::simdEnabled &&
629 template<
typename MT >
631 struct VectorizedSubAssign {
633 simdEnabled && MT::simdEnabled &&
650 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
651 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
665 template<
typename MT >
668 template<
typename MT >
675 template<
typename MT >
678 template<
typename MT >
685 template<
typename MT >
688 template<
typename MT >
704 boost::shared_array<Type>
v_;
740 template<
typename Type
773 template<
typename Type
785 if( ptr ==
nullptr ) {
820 template<
typename Type
830 if( ptr ==
nullptr ) {
845 for(
size_t i=0UL; i<
m_; ++i ) {
846 for(
size_t j=
n_; j<
nn_; ++j )
847 v_[i*nn_+j] = Type();
874 template<
typename Type
878 template<
typename Deleter
888 if( ptr ==
nullptr ) {
922 template<
typename Type
926 template<
typename Deleter >
933 if( ptr ==
nullptr ) {
948 for(
size_t i=0UL; i<
m_; ++i ) {
949 for(
size_t j=
n_; j<
nn_; ++j )
950 v_[i*nn_+j] = Type();
964 template<
typename Type
982 template<
typename Type
990 ,
v_ ( std::move( m.v_ ) )
1019 template<
typename Type
1043 template<
typename Type
1068 template<
typename Type
1081 return (*
this)(i,j);
1097 template<
typename Type
1110 return (*
this)(i,j);
1127 template<
typename Type
1151 template<
typename Type
1171 template<
typename Type
1179 return v_.get() + i*
nn_;
1192 template<
typename Type
1200 return v_.get() + i*
nn_;
1216 template<
typename Type
1240 template<
typename Type
1264 template<
typename Type
1288 template<
typename Type
1312 template<
typename Type
1336 template<
typename Type
1363 template<
typename Type
1369 for(
size_t i=0UL; i<
m_; ++i )
1370 for(
size_t j=0UL; j<
n_; ++j )
1406 template<
typename Type
1419 for(
const auto& rowList : list ) {
1420 std::fill( std::copy( rowList.begin(), rowList.end(),
v_.get()+i*
nn_ ),
1459 template<
typename Type
1463 template<
typename Other
1468 if(
m_ != M ||
n_ != N ) {
1472 for(
size_t i=0UL; i<M; ++i )
1473 for(
size_t j=0UL; j<N; ++j )
1474 v_[i*
nn_+j] = array[i][j];
1491 template<
typename Type
1514 template<
typename Type
1524 v_ = std::move( rhs.v_ );
1547 template<
typename Type
1551 template<
typename MT
1594 template<
typename Type
1598 template<
typename MT
1629 template<
typename Type
1633 template<
typename MT
1664 template<
typename Type
1668 template<
typename MT
1691 template<
typename Type
1695 template<
typename Other >
1712 template<
typename Type
1716 template<
typename Other >
1741 template<
typename Type
1757 template<
typename Type
1778 template<
typename Type
1794 template<
typename Type
1816 template<
typename Type
1834 template<
typename Type
1840 size_t nonzeros( 0UL );
1842 for(
size_t i=0UL; i<
m_; ++i )
1843 for(
size_t j=0UL; j<
n_; ++j )
1863 template<
typename Type
1871 const size_t jend( i*
nn_ +
n_ );
1872 size_t nonzeros( 0UL );
1874 for(
size_t j=i*
nn_; j<jend; ++j )
1888 template<
typename Type
1896 for(
size_t i=0UL; i<
m_; ++i )
1897 for(
size_t j=0UL; j<
n_; ++j )
1914 template<
typename Type
1923 for(
size_t j=0UL; j<
n_; ++j )
1936 template<
typename Type
1956 template<
typename Type
1988 template<
typename Type
2000 for(
size_t i=1UL; i<
m_; ++i )
2001 for(
size_t j=0UL; j<i; ++j )
2017 template<
typename Type
2027 for(
size_t i=0UL; i<
m_; ++i ) {
2028 for(
size_t j=0UL; j<i; ++j ) {
2045 template<
typename Type
2049 template<
typename Other >
2052 for(
size_t i=0UL; i<
m_; ++i )
2053 for(
size_t j=0UL; j<
n_; ++j )
2054 v_[i*
nn_+j] *= scalar;
2092 template<
typename Type
2129 template<
typename Type
2164 template<
typename Type
2168 template<
typename Deleter
2203 template<
typename Type
2207 template<
typename Deleter >
2234 template<
typename Type
2238 template<
typename Other >
2241 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2256 template<
typename Type
2260 template<
typename Other >
2263 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2277 template<
typename Type
2298 template<
typename Type
2304 return (
rows() *
columns() >= SMP_DMATASSIGN_THRESHOLD );
2324 template<
typename Type
2332 return loada( i, j );
2334 return loadu( i, j );
2354 template<
typename Type
2391 template<
typename Type
2427 template<
typename Type
2458 template<
typename Type
2496 template<
typename Type
2533 template<
typename Type
2566 template<
typename Type
2570 template<
typename MT >
2577 const size_t jpos(
n_ &
size_t(-2) );
2580 for(
size_t i=0UL; i<
m_; ++i ) {
2581 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2582 v_[i*
nn_+j ] = (~rhs)(i,j );
2583 v_[i*
nn_+j+1UL] = (~rhs)(i,j+1UL);
2586 v_[i*
nn_+jpos] = (~rhs)(i,jpos);
2604 template<
typename Type
2608 template<
typename MT >
2619 const size_t jpos( ( remainder )?(
n_ &
size_t(-SIMDSIZE) ):(
n_ ) );
2625 for(
size_t i=0UL; i<
m_; ++i )
2629 for( ; j<jpos; j+=SIMDSIZE ) {
2632 for( ; remainder && j<
n_; ++j ) {
2633 v_[i*
nn_+j] = (~rhs)(i,j);
2639 for(
size_t i=0UL; i<
m_; ++i )
2644 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2645 store( i, j , it.load() ); it += SIMDSIZE;
2646 store( i, j+SIMDSIZE , it.load() ); it += SIMDSIZE;
2647 store( i, j+SIMDSIZE*2UL, it.load() ); it += SIMDSIZE;
2648 store( i, j+SIMDSIZE*3UL, it.load() ); it += SIMDSIZE;
2650 for( ; j<jpos; j+=SIMDSIZE, it+=SIMDSIZE ) {
2651 store( i, j, it.load() );
2653 for( ; remainder && j<
n_; ++j, ++it ) {
2673 template<
typename Type
2677 template<
typename MT >
2685 constexpr
size_t block( BLOCK_SIZE );
2687 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
2688 const size_t iend(
min( m_, ii+block ) );
2689 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
2690 const size_t jend(
min( n_, jj+block ) );
2691 for(
size_t i=ii; i<iend; ++i ) {
2692 for(
size_t j=jj; j<jend; ++j ) {
2693 v_[i*
nn_+j] = (~rhs)(i,j);
2713 template<
typename Type
2717 template<
typename MT >
2723 for(
size_t i=0UL; i<
m_; ++i )
2725 v_[i*
nn_+element->index()] = element->value();
2741 template<
typename Type
2745 template<
typename MT >
2753 for(
size_t j=0UL; j<
n_; ++j )
2755 v_[element->index()*
nn_+j] = element->value();
2771 template<
typename Type
2775 template<
typename MT >
2782 for(
size_t i=0UL; i<
m_; ++i )
2786 v_[i*
nn_+i] += (~rhs)(i,i);
2800 for( ; (j+2UL) <= jend; j+=2UL ) {
2801 v_[i*
nn_+j ] += (~rhs)(i,j );
2802 v_[i*
nn_+j+1UL] += (~rhs)(i,j+1UL);
2805 v_[i*
nn_+j] += (~rhs)(i,j);
2824 template<
typename Type
2828 template<
typename MT >
2840 for(
size_t i=0UL; i<
m_; ++i )
2850 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
2851 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2856 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2857 store( i, j ,
load(i,j ) + it.load() ); it += SIMDSIZE;
2858 store( i, j+SIMDSIZE ,
load(i,j+SIMDSIZE ) + it.load() ); it += SIMDSIZE;
2859 store( i, j+SIMDSIZE*2UL,
load(i,j+SIMDSIZE*2UL) + it.load() ); it += SIMDSIZE;
2860 store( i, j+SIMDSIZE*3UL,
load(i,j+SIMDSIZE*3UL) + it.load() ); it += SIMDSIZE;
2862 for( ; j<jpos; j+=SIMDSIZE, it+=SIMDSIZE ) {
2865 for( ; remainder && j<jend; ++j, ++it ) {
2884 template<
typename Type
2888 template<
typename MT >
2896 constexpr
size_t block( BLOCK_SIZE );
2898 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
2899 const size_t iend(
min( m_, ii+block ) );
2900 for(
size_t jj=0UL; jj<
n_; jj+=block )
2905 for(
size_t i=ii; i<iend; ++i )
2912 :(
min( n_, jj+block ) ) );
2915 for(
size_t j=jbegin; j<jend; ++j ) {
2916 v_[i*
nn_+j] += (~rhs)(i,j);
2936 template<
typename Type
2940 template<
typename MT >
2946 for(
size_t i=0UL; i<
m_; ++i )
2948 v_[i*
nn_+element->index()] += element->value();
2964 template<
typename Type
2968 template<
typename MT >
2976 for(
size_t j=0UL; j<
n_; ++j )
2978 v_[element->index()*
nn_+j] += element->value();
2994 template<
typename Type
2998 template<
typename MT >
3005 for(
size_t i=0UL; i<
m_; ++i )
3009 v_[i*
nn_+i] -= (~rhs)(i,i);
3023 for( ; (j+2UL) <= jend; j+=2UL ) {
3024 v_[i*
nn_+j ] -= (~rhs)(i,j );
3025 v_[i*
nn_+j+1UL] -= (~rhs)(i,j+1UL);
3028 v_[i*
nn_+j] -= (~rhs)(i,j);
3047 template<
typename Type
3051 template<
typename MT >
3063 for(
size_t i=0UL; i<
m_; ++i )
3073 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
3074 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
3079 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
3080 store( i, j ,
load(i,j ) - it.load() ); it += SIMDSIZE;
3081 store( i, j+SIMDSIZE ,
load(i,j+SIMDSIZE ) - it.load() ); it += SIMDSIZE;
3082 store( i, j+SIMDSIZE*2UL,
load(i,j+SIMDSIZE*2UL) - it.load() ); it += SIMDSIZE;
3083 store( i, j+SIMDSIZE*3UL,
load(i,j+SIMDSIZE*3UL) - it.load() ); it += SIMDSIZE;
3085 for( ; j<jpos; j+=SIMDSIZE, it+=SIMDSIZE ) {
3088 for( ; remainder && j<jend; ++j, ++it ) {
3107 template<
typename Type
3111 template<
typename MT >
3119 constexpr
size_t block( BLOCK_SIZE );
3121 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
3122 const size_t iend(
min( m_, ii+block ) );
3123 for(
size_t jj=0UL; jj<
n_; jj+=block )
3128 for(
size_t i=ii; i<iend; ++i )
3135 :(
min( n_, jj+block ) ) );
3138 for(
size_t j=jbegin; j<jend; ++j ) {
3139 v_[i*
nn_+j] -= (~rhs)(i,j);
3159 template<
typename Type
3163 template<
typename MT >
3169 for(
size_t i=0UL; i<
m_; ++i )
3171 v_[i*
nn_+element->index()] -= element->value();
3187 template<
typename Type
3191 template<
typename MT >
3199 for(
size_t j=0UL; j<
n_; ++j )
3201 v_[element->index()*
nn_+j] -= element->value();
3226 template<
typename Type
3255 template<
typename NewType >
3264 template<
size_t NewM
3290 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n );
3291 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n,
size_t mm );
3293 template<
typename Deleter,
typename = DisableIf_< IsIntegral<Deleter> > >
3294 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n, Deleter d );
3296 template<
typename Deleter >
3297 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n,
size_t mm, Deleter d );
3311 inline Reference
operator()(
size_t i,
size_t j ) noexcept;
3312 inline ConstReference
operator()(
size_t i,
size_t j )
const noexcept;
3313 inline Reference
at(
size_t i,
size_t j );
3314 inline ConstReference
at(
size_t i,
size_t j )
const;
3315 inline Pointer
data () noexcept;
3316 inline ConstPointer
data ()
const noexcept;
3317 inline Pointer
data (
size_t j ) noexcept;
3318 inline ConstPointer
data (
size_t j )
const noexcept;
3319 inline Iterator
begin (
size_t j ) noexcept;
3320 inline ConstIterator
begin (
size_t j )
const noexcept;
3321 inline ConstIterator
cbegin(
size_t j )
const noexcept;
3322 inline Iterator
end (
size_t j ) noexcept;
3323 inline ConstIterator
end (
size_t j )
const noexcept;
3324 inline ConstIterator
cend (
size_t j )
const noexcept;
3334 template<
typename Other,
size_t M,
size_t N >
3345 template<
typename Other >
3346 inline EnableIf_<IsNumeric<Other>,
CustomMatrix >& operator*=( Other rhs );
3348 template<
typename Other >
3356 inline size_t rows()
const noexcept;
3357 inline size_t columns()
const noexcept;
3358 inline size_t spacing()
const noexcept;
3359 inline size_t capacity()
const noexcept;
3360 inline size_t capacity(
size_t j )
const noexcept;
3362 inline size_t nonZeros(
size_t j )
const;
3363 inline void reset();
3364 inline void reset(
size_t j );
3365 inline void clear();
3376 template<
typename Other >
inline CustomMatrix& scale(
const Other& scalar );
3383 inline void reset( Type* ptr,
size_t m,
size_t n );
3384 inline void reset( Type* ptr,
size_t m,
size_t n,
size_t mm );
3386 template<
typename Deleter,
typename = DisableIf_< IsIntegral<Deleter> > >
3387 inline void reset( Type* ptr,
size_t m,
size_t n, Deleter d );
3389 template<
typename Deleter >
3390 inline void reset( Type* ptr,
size_t m,
size_t n,
size_t mm, Deleter d );
3397 template<
typename MT >
3398 struct VectorizedAssign {
3400 simdEnabled && MT::simdEnabled &&
3407 template<
typename MT >
3408 struct VectorizedAddAssign {
3410 simdEnabled && MT::simdEnabled &&
3419 template<
typename MT >
3420 struct VectorizedSubAssign {
3422 simdEnabled && MT::simdEnabled &&
3438 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
3439 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
3441 inline bool isAligned ()
const noexcept;
3453 template<
typename MT >
3456 template<
typename MT >
3463 template<
typename MT >
3466 template<
typename MT >
3473 template<
typename MT >
3476 template<
typename MT >
3492 boost::shared_array<Type>
v_;
3521 template<
typename Type
3555 template<
typename Type
3566 if( ptr ==
nullptr ) {
3570 if( AF && ( !
checkAlignment( ptr ) || mm_ % SIMDSIZE != 0UL ) ) {
3603 template<
typename Type
3612 if( ptr ==
nullptr ) {
3616 if( AF && ( !
checkAlignment( ptr ) || mm_ % SIMDSIZE != 0UL ) ) {
3627 for(
size_t j=0UL; j<
n_; ++j )
3628 for(
size_t i=
m_; i<mm_; ++i ) {
3629 v_[i+j*mm_] = Type();
3658 template<
typename Type
3661 template<
typename Deleter
3671 if( ptr ==
nullptr ) {
3675 if( AF && ( !
checkAlignment( ptr ) || mm_ % SIMDSIZE != 0UL ) ) {
3707 template<
typename Type
3710 template<
typename Deleter >
3717 if( ptr ==
nullptr ) {
3721 if( AF && ( !
checkAlignment( ptr ) || mm_ % SIMDSIZE != 0UL ) ) {
3732 for(
size_t j=0UL; j<
n_; ++j )
3733 for(
size_t i=
m_; i<mm_; ++i ) {
3734 v_[i+j*mm_] = Type();
3751 template<
typename Type
3770 template<
typename Type
3777 ,
v_ ( std::move( m.
v_ ) )
3808 template<
typename Type
3833 template<
typename Type
3859 template<
typename Type
3871 return (*
this)(i,j);
3889 template<
typename Type
3901 return (*
this)(i,j);
3919 template<
typename Type
3943 template<
typename Type
3964 template<
typename Type
3971 return v_.get() + j*mm_;
3986 template<
typename Type
3993 return v_.get() + j*mm_;
4006 template<
typename Type
4026 template<
typename Type
4046 template<
typename Type
4066 template<
typename Type
4086 template<
typename Type
4106 template<
typename Type
4134 template<
typename Type
4139 for(
size_t j=0UL; j<
n_; ++j )
4140 for(
size_t i=0UL; i<
m_; ++i )
4178 template<
typename Type
4190 for(
const auto& rowList : list ) {
4192 for(
const auto& element : rowList ) {
4193 v_[i+j*mm_] = element;
4196 for( ; j<
n_; ++j ) {
4197 v_[i+j*mm_] = Type();
4238 template<
typename Type
4241 template<
typename Other
4247 if(
m_ != M ||
n_ != N ) {
4251 for(
size_t j=0UL; j<N; ++j )
4252 for(
size_t i=0UL; i<M; ++i )
4253 v_[i+j*mm_] = array[i][j];
4272 template<
typename Type
4297 template<
typename Type
4306 v_ = std::move( rhs.
v_ );
4331 template<
typename Type
4334 template<
typename MT
4380 template<
typename Type
4383 template<
typename MT
4417 template<
typename Type
4420 template<
typename MT
4454 template<
typename Type
4457 template<
typename MT
4483 template<
typename Type
4486 template<
typename Other >
4505 template<
typename Type
4508 template<
typename Other >
4535 template<
typename Type
4552 template<
typename Type
4572 template<
typename Type
4589 template<
typename Type
4607 template<
typename Type
4626 template<
typename Type
4631 size_t nonzeros( 0UL );
4633 for(
size_t j=0UL; j<
n_; ++j )
4634 for(
size_t i=0UL; i<
m_; ++i )
4651 template<
typename Type
4658 const size_t iend( j*mm_ +
m_ );
4659 size_t nonzeros( 0UL );
4661 for(
size_t i=j*mm_; i<iend; ++i )
4677 template<
typename Type
4684 for(
size_t j=0UL; j<
n_; ++j )
4685 for(
size_t i=0UL; i<
m_; ++i )
4702 template<
typename Type
4710 for(
size_t i=0UL; i<
m_; ++i )
4725 template<
typename Type
4746 template<
typename Type
4779 template<
typename Type
4790 for(
size_t j=1UL; j<
n_; ++j )
4791 for(
size_t i=0UL; i<j; ++i )
4809 template<
typename Type
4818 for(
size_t j=0UL; j<
n_; ++j ) {
4819 for(
size_t i=0UL; i<j; ++i ) {
4838 template<
typename Type
4841 template<
typename Other >
4844 for(
size_t j=0UL; j<
n_; ++j )
4845 for(
size_t i=0UL; i<
m_; ++i )
4846 v_[i+j*mm_] *= scalar;
4886 template<
typename Type
4924 template<
typename Type
4960 template<
typename Type
4963 template<
typename Deleter
5000 template<
typename Type
5003 template<
typename Deleter >
5032 template<
typename Type
5035 template<
typename Other >
5038 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5055 template<
typename Type
5058 template<
typename Other >
5061 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5077 template<
typename Type
5099 template<
typename Type
5104 return (
rows() *
columns() >= SMP_DMATASSIGN_THRESHOLD );
5125 template<
typename Type
5132 return loada( i, j );
5134 return loadu( i, j );
5155 template<
typename Type
5171 return loada(
v_.get()+i+j*mm_ );
5192 template<
typename Type
5206 return loadu(
v_.get()+i+j*mm_ );
5228 template<
typename Type
5259 template<
typename Type
5297 template<
typename Type
5334 template<
typename Type
5368 template<
typename Type
5371 template<
typename MT >
5378 const size_t ipos(
m_ &
size_t(-2) );
5381 for(
size_t j=0UL; j<
n_; ++j ) {
5382 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5383 v_[i +j*mm_] = (~rhs)(i ,j);
5384 v_[i+1UL+j*mm_] = (~rhs)(i+1UL,j);
5387 v_[ipos+j*mm_] = (~rhs)(ipos,j);
5407 template<
typename Type
5410 template<
typename MT >
5421 const size_t ipos( ( remainder )?(
m_ &
size_t(-SIMDSIZE) ):(
m_ ) );
5427 for(
size_t j=0UL; j<
n_; ++j )
5431 for( ; i<ipos; i+=SIMDSIZE ) {
5434 for( ; remainder && i<
m_; ++i ) {
5435 v_[i+j*mm_] = (~rhs)(i,j);
5441 for(
size_t j=0UL; j<
n_; ++j )
5446 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
5447 store( i , j, it.load() ); it += SIMDSIZE;
5448 store( i+SIMDSIZE , j, it.load() ); it += SIMDSIZE;
5449 store( i+SIMDSIZE*2UL, j, it.load() ); it += SIMDSIZE;
5450 store( i+SIMDSIZE*3UL, j, it.load() ); it += SIMDSIZE;
5452 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
5453 store( i, j, it.load() );
5455 for( ; remainder && i<
m_; ++i, ++it ) {
5477 template<
typename Type
5480 template<
typename MT >
5488 constexpr
size_t block( BLOCK_SIZE );
5490 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
5491 const size_t jend(
min( n_, jj+block ) );
5492 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
5493 const size_t iend(
min( m_, ii+block ) );
5494 for(
size_t j=jj; j<jend; ++j ) {
5495 for(
size_t i=ii; i<iend; ++i ) {
5496 v_[i+j*mm_] = (~rhs)(i,j);
5518 template<
typename Type
5521 template<
typename MT >
5527 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
5529 v_[element->index()+j*mm_] = element->value();
5547 template<
typename Type
5550 template<
typename MT >
5558 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
5560 v_[i+element->index()*mm_] = element->value();
5578 template<
typename Type
5581 template<
typename MT >
5588 for(
size_t j=0UL; j<
n_; ++j )
5592 v_[j+j*mm_] += (~rhs)(j,j);
5606 for( ; (i+2UL) <= iend; i+=2UL ) {
5607 v_[i +j*mm_] += (~rhs)(i ,j);
5608 v_[i+1UL+j*mm_] += (~rhs)(i+1UL,j);
5611 v_[i+j*mm_] += (~rhs)(i,j);
5632 template<
typename Type
5635 template<
typename MT >
5647 for(
size_t j=0UL; j<
n_; ++j )
5657 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5658 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5663 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
5664 store( i , j,
load(i ,j) + it.load() ); it += SIMDSIZE;
5665 store( i+SIMDSIZE , j,
load(i+SIMDSIZE ,j) + it.load() ); it += SIMDSIZE;
5666 store( i+SIMDSIZE*2UL, j,
load(i+SIMDSIZE*2UL,j) + it.load() ); it += SIMDSIZE;
5667 store( i+SIMDSIZE*3UL, j,
load(i+SIMDSIZE*3UL,j) + it.load() ); it += SIMDSIZE;
5669 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
5672 for( ; remainder && i<iend; ++i, ++it ) {
5693 template<
typename Type
5696 template<
typename MT >
5704 constexpr
size_t block( BLOCK_SIZE );
5706 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
5707 const size_t jend(
min( n_, jj+block ) );
5708 for(
size_t ii=0UL; ii<
m_; ii+=block )
5713 for(
size_t j=jj; j<jend; ++j )
5720 :(
min( m_, ii+block ) ) );
5723 for(
size_t i=ibegin; i<iend; ++i ) {
5724 v_[i+j*mm_] += (~rhs)(i,j);
5746 template<
typename Type
5749 template<
typename MT >
5755 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
5757 v_[element->index()+j*mm_] += element->value();
5775 template<
typename Type
5778 template<
typename MT >
5786 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
5788 v_[i+element->index()*mm_] += element->value();
5806 template<
typename Type
5809 template<
typename MT >
5816 for(
size_t j=0UL; j<
n_; ++j )
5820 v_[j+j*mm_] -= (~rhs)(j,j);
5834 for( ; (i+2UL) <= iend; i+=2UL ) {
5835 v_[i +j*mm_] -= (~rhs)(i ,j);
5836 v_[i+1+j*mm_] -= (~rhs)(i+1,j);
5839 v_[i+j*mm_] -= (~rhs)(i,j);
5861 template<
typename Type
5864 template<
typename MT >
5876 for(
size_t j=0UL; j<
n_; ++j )
5886 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5887 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5892 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
5893 store( i , j,
load(i ,j) - it.load() ); it += SIMDSIZE;
5894 store( i+SIMDSIZE , j,
load(i+SIMDSIZE ,j) - it.load() ); it += SIMDSIZE;
5895 store( i+SIMDSIZE*2UL, j,
load(i+SIMDSIZE*2UL,j) - it.load() ); it += SIMDSIZE;
5896 store( i+SIMDSIZE*3UL, j,
load(i+SIMDSIZE*3UL,j) - it.load() ); it += SIMDSIZE;
5898 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
5901 for( ; remainder && i<iend; ++i, ++it ) {
5922 template<
typename Type
5925 template<
typename MT >
5933 constexpr
size_t block( BLOCK_SIZE );
5935 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
5936 const size_t jend(
min( n_, jj+block ) );
5937 for(
size_t ii=0UL; ii<
m_; ii+=block )
5942 for(
size_t j=jj; j<jend; ++j )
5949 :(
min( m_, ii+block ) ) );
5952 for(
size_t i=ibegin; i<iend; ++i ) {
5953 v_[i+j*mm_] -= (~rhs)(i,j);
5975 template<
typename Type
5978 template<
typename MT >
5984 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
5986 v_[element->index()+j*mm_] -= element->value();
6004 template<
typename Type
6007 template<
typename MT >
6015 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
6017 v_[i+element->index()*mm_] -= element->value();
6038 template<
typename Type,
bool AF,
bool PF,
bool SO >
6041 template<
typename Type,
bool AF,
bool PF,
bool SO >
6044 template<
typename Type,
bool AF,
bool PF,
bool SO >
6047 template<
bool RF,
typename Type,
bool AF,
bool PF,
bool SO >
6050 template<
typename Type,
bool AF,
bool PF,
bool SO >
6053 template<
typename Type,
bool AF,
bool PF,
bool SO >
6066 template<
typename Type
6090 template<
typename Type
6108 template<
typename Type
6180 template<
typename Type
6199 template<
typename Type
6220 template<
typename T,
bool AF,
bool PF,
bool SO >
6237 template<
typename T,
bool AF,
bool PF,
bool SO >
6254 template<
typename T,
bool AF,
bool PF,
bool SO >
6271 template<
typename T,
bool PF,
bool SO >
6288 template<
typename T,
bool AF,
bool SO >
6305 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t M,
size_t N >
6306 struct AddTrait< CustomMatrix<T1,AF,PF,SO>, StaticMatrix<T2,M,N,SO> >
6311 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6312 struct AddTrait< CustomMatrix<T1,AF,PF,SO1>, StaticMatrix<T2,M,N,SO2> >
6317 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6318 struct AddTrait< StaticMatrix<T1,M,N,SO>, CustomMatrix<T2,AF,PF,SO> >
6323 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6324 struct AddTrait< StaticMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6329 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t M,
size_t N >
6330 struct AddTrait< CustomMatrix<T1,AF,PF,SO>, HybridMatrix<T2,M,N,SO> >
6335 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6336 struct AddTrait< CustomMatrix<T1,AF,PF,SO1>, HybridMatrix<T2,M,N,SO2> >
6341 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6342 struct AddTrait< HybridMatrix<T1,M,N,SO>, CustomMatrix<T2,AF,PF,SO> >
6347 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6348 struct AddTrait< HybridMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6353 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6354 struct AddTrait< CustomMatrix<T1,AF,PF,SO>, DynamicMatrix<T2,SO> >
6359 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
bool SO2 >
6360 struct AddTrait< CustomMatrix<T1,AF,PF,SO1>, DynamicMatrix<T2,SO2> >
6365 template<
typename T1,
bool SO,
typename T2,
bool AF,
bool PF >
6366 struct AddTrait< DynamicMatrix<T1,SO>, CustomMatrix<T2,AF,PF,SO> >
6371 template<
typename T1,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6372 struct AddTrait< DynamicMatrix<T1,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6377 template<
typename T1,
bool AF1,
bool PF1,
bool SO,
typename T2,
bool AF2,
bool PF2 >
6378 struct AddTrait< CustomMatrix<T1,AF1,PF1,SO>, CustomMatrix<T2,AF2,PF2,SO> >
6383 template<
typename T1,
bool AF1,
bool PF1,
bool SO1,
typename T2,
bool AF2,
bool PF2,
bool SO2 >
6384 struct AddTrait< CustomMatrix<T1,AF1,PF1,SO1>, CustomMatrix<T2,AF2,PF2,SO2> >
6402 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t M,
size_t N >
6403 struct SubTrait< CustomMatrix<T1,AF,PF,SO>, StaticMatrix<T2,M,N,SO> >
6408 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6409 struct SubTrait< CustomMatrix<T1,AF,PF,SO1>, StaticMatrix<T2,M,N,SO2> >
6414 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6415 struct SubTrait< StaticMatrix<T1,M,N,SO>, CustomMatrix<T2,AF,PF,SO> >
6420 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6421 struct SubTrait< StaticMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6426 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t M,
size_t N >
6427 struct SubTrait< CustomMatrix<T1,AF,PF,SO>, HybridMatrix<T2,M,N,SO> >
6432 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6433 struct SubTrait< CustomMatrix<T1,AF,PF,SO1>, HybridMatrix<T2,M,N,SO2> >
6438 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6439 struct SubTrait< HybridMatrix<T1,M,N,SO>, CustomMatrix<T2,AF,PF,SO> >
6444 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6445 struct SubTrait< HybridMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6450 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6451 struct SubTrait< CustomMatrix<T1,AF,PF,SO>, DynamicMatrix<T2,SO> >
6456 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
bool SO2 >
6457 struct SubTrait< CustomMatrix<T1,AF,PF,SO1>, DynamicMatrix<T2,SO2> >
6462 template<
typename T1,
bool SO,
typename T2,
bool AF,
bool PF >
6463 struct SubTrait< DynamicMatrix<T1,SO>, CustomMatrix<T2,AF,PF,SO> >
6468 template<
typename T1,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6469 struct SubTrait< DynamicMatrix<T1,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6474 template<
typename T1,
bool AF1,
bool PF1,
bool SO,
typename T2,
bool AF2,
bool PF2 >
6475 struct SubTrait< CustomMatrix<T1,AF1,PF1,SO>, CustomMatrix<T2,AF2,PF2,SO> >
6480 template<
typename T1,
bool AF1,
bool PF1,
bool SO1,
typename T2,
bool AF2,
bool PF2,
bool SO2 >
6481 struct SubTrait< CustomMatrix<T1,AF1,PF1,SO1>, CustomMatrix<T2,AF2,PF2,SO2> >
6499 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6500 struct MultTrait< CustomMatrix<T1,AF,PF,SO>, T2, EnableIf_<IsNumeric<T2> > >
6505 template<
typename T1,
typename T2,
bool AF,
bool PF,
bool SO >
6506 struct MultTrait< T1, CustomMatrix<T2,AF,PF,SO>, EnableIf_<IsNumeric<T1> > >
6511 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t N >
6512 struct MultTrait< CustomMatrix<T1,AF,PF,SO>, StaticVector<T2,N,false> >
6517 template<
typename T1,
size_t N,
typename T2,
bool AF,
bool PF,
bool SO >
6518 struct MultTrait< StaticVector<T1,N,true>, CustomMatrix<T2,AF,PF,SO> >
6523 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t N >
6524 struct MultTrait< CustomMatrix<T1,AF,PF,SO>, HybridVector<T2,N,false> >
6529 template<
typename T1,
size_t N,
typename T2,
bool AF,
bool PF,
bool SO >
6530 struct MultTrait< HybridVector<T1,N,true>, CustomMatrix<T2,AF,PF,SO> >
6535 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6536 struct MultTrait< CustomMatrix<T1,AF,PF,SO>, DynamicVector<T2,false> >
6541 template<
typename T1,
typename T2,
bool AF,
bool PF,
bool SO >
6542 struct MultTrait< DynamicVector<T1,true>, CustomMatrix<T2,AF,PF,SO> >
6547 template<
typename T1,
bool AF1,
bool PF1,
bool SO,
typename T2,
bool AF2,
bool PF2 >
6548 struct MultTrait< CustomMatrix<T1,AF1,PF1,SO>, CustomVector<T2,AF2,PF2,false> >
6553 template<
typename T1,
bool AF1,
bool PF1,
typename T2,
bool AF2,
bool PF2,
bool SO >
6554 struct MultTrait< CustomVector<T1,AF1,PF1,true>, CustomMatrix<T2,AF2,PF2,SO> >
6559 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6560 struct MultTrait< CustomMatrix<T1,AF,PF,SO>, CompressedVector<T2,false> >
6565 template<
typename T1,
typename T2,
bool AF,
bool PF,
bool SO >
6566 struct MultTrait< CompressedVector<T1,true>, CustomMatrix<T2,AF,PF,SO> >
6571 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6572 struct MultTrait< CustomMatrix<T1,AF,PF,SO1>, StaticMatrix<T2,M,N,SO2> >
6577 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6578 struct MultTrait< StaticMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6583 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6584 struct MultTrait< CustomMatrix<T1,AF,PF,SO1>, HybridMatrix<T2,M,N,SO2> >
6589 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6590 struct MultTrait< HybridMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6595 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
bool SO2 >
6596 struct MultTrait< CustomMatrix<T1,AF,PF,SO1>, DynamicMatrix<T2,SO2> >
6601 template<
typename T1,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6602 struct MultTrait< DynamicMatrix<T1,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6607 template<
typename T1,
bool AF1,
bool PF1,
bool SO1,
typename T2,
bool AF2,
bool PF2,
bool SO2 >
6608 struct MultTrait< CustomMatrix<T1,AF1,PF1,SO1>, CustomMatrix<T2,AF2,PF2,SO2> >
6626 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6627 struct DivTrait< CustomMatrix<T1,AF,PF,SO>, T2, EnableIf_<IsNumeric<T2> > >
6645 template<
typename T1,
bool AF,
bool PF,
bool SO >
6664 template<
typename T1,
bool AF,
bool PF,
bool SO >
6665 struct RowTrait< CustomMatrix<T1,AF,PF,SO> >
6683 template<
typename T1,
bool AF,
bool PF,
bool SO >
size_t spacing() const noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: CustomMatrix.h:1782
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
size_t m_
The current number of rows of the matrix.
Definition: CustomMatrix.h:701
CustomMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: CustomMatrix.h:2021
Header file for auxiliary alias declarations.
DenseMatrix< This, SO > BaseType
Base type of this CustomMatrix instance.
Definition: CustomMatrix.h:440
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: CustomMatrix.h:1761
Header file for kernel specific block sizes.
BLAZE_ALWAYS_INLINE void store(size_t i, size_t j, const SIMDType &value) noexcept
Store of a SIMD element of the matrix.
Definition: CustomMatrix.h:2432
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
const bool unpadded
Padding flag for unpadded vectors and matrices.Via this flag it is possible to specify custom vectors...
Definition: PaddingFlag.h:64
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
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: CustomMatrix.h:2239
bool canSMPAssign() const noexcept
Returns whether the matrix can be used in SMP assignments.
Definition: CustomMatrix.h:2302
Header file for the alignment flag values.
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
Header file for basic type definitions.
No-delete policy class.
Definition: NoDelete.h:51
DynamicMatrix< Type, SO > ResultType
Result type for expression template evaluations.
Definition: CustomMatrix.h:441
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
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
BLAZE_ALWAYS_INLINE SIMDType load(size_t i, size_t j) const noexcept
Load of a SIMD element of the matrix.
Definition: CustomMatrix.h:2329
Header file for the IsSparseMatrix type trait.
Header file for the IsDiagonal type trait.
constexpr size_t cacheSize
Cache size of the target architecture.This setting specifies the available cache size in Byte of the ...
Definition: CacheSize.h:48
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.
CustomMatrix< NewType, AF, PF, SO > Other
The type of the other CustomMatrix.
Definition: CustomMatrix.h:463
ConstIterator cbegin(size_t i) const noexcept
Returns an iterator to the first element of row/column i.
Definition: CustomMatrix.h:1269
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:315
CustomMatrix & operator=(const Type &set)
Homogenous assignment to all matrix elements.
Definition: CustomMatrix.h:1367
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
Header file for the IsIntegral type trait.
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1755
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
Reference operator()(size_t i, size_t j) noexcept
2D-access to the matrix elements.
Definition: CustomMatrix.h:1024
CustomMatrix & transpose()
In-place transpose of the matrix.
Definition: CustomMatrix.h:1992
#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
size_t nn_
The number of elements between two rows.
Definition: CustomMatrix.h:703
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
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
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
Efficient implementation of an arbitrary sized vector.The DynamicVector class template is the represe...
Definition: DynamicVector.h:177
System settings for performance optimizations.
Efficient implementation of a dynamic matrix.The DynamicMatrix class template is the representation ...
Definition: DynamicMatrix.h:204
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
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
void swap(CustomMatrix &m) noexcept
Swapping the contents of two matrices.
Definition: CustomMatrix.h:1960
DynamicMatrix< Type,!SO > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CustomMatrix.h:442
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
Header file for the NoDelete policy classes.
Constraint on the data type.
Header file for the std::initializer_list aliases.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CustomMatrix.h:450
Header file for the SparseMatrix base class.
Compile time check for low-level access to mutable data.This type trait tests whether the given data ...
Definition: HasMutableDataAccess.h:75
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
BLAZE_ALWAYS_INLINE SIMDType loada(size_t i, size_t j) const noexcept
Aligned load of a SIMD element of the matrix.
Definition: CustomMatrix.h:2359
Type * Pointer
Pointer to a non-constant matrix value.
Definition: CustomMatrix.h:451
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: CustomMatrix.h:2538
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 IsCustom type trait.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
void reset()
Reset to the default initial values.
Definition: CustomMatrix.h:1892
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
constexpr bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Optimizations.h:68
Pointer data() noexcept
Low-level data access to the matrix elements.
Definition: CustomMatrix.h:1132
Header file for all forward declarations of the math module.
size_t capacity() const noexcept
Returns the maximum capacity of the matrix.
Definition: CustomMatrix.h:1798
#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
Header file for the IsSMPAssignable type trait.
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
#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.
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: CustomMatrix.h:1073
Iterator end(size_t i) noexcept
Returns an iterator just past the last element of row/column i.
Definition: CustomMatrix.h:1293
Header file for all SIMD functionality.
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
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
Compile time check for diagonal matrices.This type trait tests whether or not the given template para...
Definition: IsDiagonal.h:90
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
Compile time check for custom data types.This type trait tests whether the given data type is a custo...
Definition: IsCustom.h:84
Header file for the default storage order for all vectors of the Blaze library.
size_t n_
The current number of columns of the matrix.
Definition: CustomMatrix.h:702
#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
Header file for the misalignment function.
Header file for the exception macros of the math module.
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Compile time check for data types.This type trait tests whether or not the given template parameter i...
Definition: IsSMPAssignable.h:119
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t i, size_t j) const noexcept
Unaligned load of a SIMD element of the matrix.
Definition: CustomMatrix.h:2396
Rebind mechanism to obtain a CustomMatrix with different data/element type.
Definition: CustomMatrix.h:462
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.
SIMDTrait_< ElementType > SIMDType
SIMD type of the matrix elements.
Definition: CustomMatrix.h:445
DenseIterator< Type, AF > Iterator
Iterator over non-constant elements.
Definition: CustomMatrix.h:454
Header file for the IsVectorizable type trait.
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
Resize mechanism to obtain a CustomMatrix with different fixed dimensions.
Definition: CustomMatrix.h:472
CustomMatrix< Type, AF, PF, SO > This
Type of this CustomMatrix instance.
Definition: CustomMatrix.h:439
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
Header file for the IsSIMDCombinable type trait.
#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
boost::shared_array< Type > v_
The dynamically allocated matrix elements.
Definition: CustomMatrix.h:704
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
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:143
Base template for the MultTrait class.
Definition: MultTrait.h:143
const Type & ReturnType
Return type for expression template evaluations.
Definition: CustomMatrix.h:446
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: CustomMatrix.h:1745
Header file for the addition trait.
Header file for the division trait.
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: CustomMatrix.h:2463
Header file for the InvExprTrait class template.
Header file for the submatrix trait.
Constraint on the data type.
void clear()
Clearing the matrix.
Definition: CustomMatrix.h:1940
Type & Reference
Reference to a non-constant matrix value.
Definition: CustomMatrix.h:449
const This & CompositeType
Data type for composite expression templates.
Definition: CustomMatrix.h:447
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
Header file for the cache size of the target architecture.
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.
Compile time check for integral data types.This type trait tests whether or not the given template pa...
Definition: IsIntegral.h:75
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.
CustomMatrix< Type, AF, PF, SO > Other
The type of the other CustomMatrix.
Definition: CustomMatrix.h:473
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
Base template for the DivTrait class.
Definition: DivTrait.h:143
Header file for the padding flag values.
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
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
CustomMatrix()
The default constructor for CustomMatrix.
Definition: CustomMatrix.h:744
DynamicMatrix< Type,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: CustomMatrix.h:443
Initializer list type of the Blaze library.
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: CustomMatrix.h:452
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: CustomMatrix.h:2261
Efficient implementation of a customizable matrix.The CustomMatrix class template provides the functi...
Definition: CustomMatrix.h:435
Header file for the alignment check function.
DenseIterator< const Type, AF > ConstIterator
Iterator over constant elements.
Definition: CustomMatrix.h:455
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 void storeu(size_t i, size_t j, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the matrix.
Definition: CustomMatrix.h:2501
ConstIterator cend(size_t i) const noexcept
Returns an iterator just past the last element of row/column i.
Definition: CustomMatrix.h:1341
Iterator begin(size_t i) noexcept
Returns an iterator to the first element of row/column i.
Definition: CustomMatrix.h:1221
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:249
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.
#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
Type ElementType
Type of the matrix elements.
Definition: CustomMatrix.h:444
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: CustomMatrix.h:1838
bool isAligned() const noexcept
Returns whether the matrix is properly aligned in memory.
Definition: CustomMatrix.h:2281
System settings for the inline keywords.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#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
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