35 #ifndef _BLAZE_MATH_DENSE_CUSTOMMATRIX_H_ 36 #define _BLAZE_MATH_DENSE_CUSTOMMATRIX_H_ 409 template<
typename Type
412 ,
bool SO = defaultStorageOrder >
414 :
public DenseMatrix< CustomMatrix<Type,AF,PF,SO>, SO >
447 template<
typename NewType >
456 template<
size_t NewM
482 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n );
483 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n,
size_t nn );
520 template<
typename Other,
size_t M,
size_t N >
536 inline size_t rows()
const noexcept;
537 inline size_t columns()
const noexcept;
538 inline size_t spacing()
const noexcept;
539 inline size_t capacity()
const noexcept;
540 inline size_t capacity(
size_t i )
const noexcept;
542 inline size_t nonZeros(
size_t i )
const;
544 inline void reset(
size_t i );
563 inline void reset( Type* ptr,
size_t m,
size_t n );
564 inline void reset( Type* ptr,
size_t m,
size_t n,
size_t nn );
571 template<
typename MT >
573 struct VectorizedAssign {
574 enum :
bool { value = useOptimizedKernels &&
575 simdEnabled && MT::simdEnabled &&
583 template<
typename MT >
585 struct VectorizedAddAssign {
586 enum :
bool { value = useOptimizedKernels &&
587 simdEnabled && MT::simdEnabled &&
597 template<
typename MT >
599 struct VectorizedSubAssign {
600 enum :
bool { value = useOptimizedKernels &&
601 simdEnabled && MT::simdEnabled &&
611 template<
typename MT >
613 struct VectorizedSchurAssign {
614 enum :
bool { value = useOptimizedKernels &&
615 simdEnabled && MT::simdEnabled &&
631 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
632 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
646 template<
typename MT >
649 template<
typename MT >
656 template<
typename MT >
659 template<
typename MT >
666 template<
typename MT >
669 template<
typename MT >
676 template<
typename MT >
679 template<
typename MT >
730 template<
typename Type
763 template<
typename Type
775 if( ptr ==
nullptr ) {
808 template<
typename Type
818 if( ptr ==
nullptr ) {
831 for(
size_t i=0UL; i<
m_; ++i ) {
832 for(
size_t j=
n_; j<
nn_; ++j )
833 v_[i*nn_+j] = Type();
847 template<
typename Type
865 template<
typename Type
903 template<
typename Type
927 template<
typename Type
952 template<
typename Type
981 template<
typename Type
1011 template<
typename Type
1035 template<
typename Type
1055 template<
typename Type
1076 template<
typename Type
1100 template<
typename Type
1124 template<
typename Type
1148 template<
typename Type
1172 template<
typename Type
1196 template<
typename Type
1220 template<
typename Type
1247 template<
typename Type
1253 for(
size_t i=0UL; i<
m_; ++i )
1254 for(
size_t j=0UL; j<
n_; ++j )
1290 template<
typename Type
1303 for(
const auto& rowList : list ) {
1304 std::fill( std::copy( rowList.begin(), rowList.end(),
v_+i*
nn_ ),
1343 template<
typename Type
1347 template<
typename Other
1352 if(
m_ != M ||
n_ != N ) {
1356 for(
size_t i=0UL; i<M; ++i )
1357 for(
size_t j=0UL; j<N; ++j )
1358 v_[i*
nn_+j] = array[i][j];
1375 template<
typename Type
1398 template<
typename Type
1432 template<
typename Type
1436 template<
typename MT
1479 template<
typename Type
1483 template<
typename MT
1514 template<
typename Type
1518 template<
typename MT
1549 template<
typename Type
1553 template<
typename MT
1587 template<
typename Type
1603 template<
typename Type
1624 template<
typename Type
1640 template<
typename Type
1662 template<
typename Type
1680 template<
typename Type
1686 size_t nonzeros( 0UL );
1688 for(
size_t i=0UL; i<
m_; ++i )
1689 for(
size_t j=0UL; j<
n_; ++j )
1709 template<
typename Type
1717 const size_t jend( i*
nn_ +
n_ );
1718 size_t nonzeros( 0UL );
1720 for(
size_t j=i*
nn_; j<jend; ++j )
1734 template<
typename Type
1742 for(
size_t i=0UL; i<
m_; ++i )
1743 for(
size_t j=0UL; j<
n_; ++j )
1760 template<
typename Type
1769 for(
size_t j=0UL; j<
n_; ++j )
1782 template<
typename Type
1802 template<
typename Type
1834 template<
typename Type
1846 for(
size_t i=1UL; i<
m_; ++i )
1847 for(
size_t j=0UL; j<i; ++j )
1863 template<
typename Type
1873 for(
size_t i=0UL; i<
m_; ++i ) {
1874 for(
size_t j=0UL; j<i; ++j ) {
1906 template<
typename Type
1910 template<
typename Other >
1913 for(
size_t i=0UL; i<
m_; ++i )
1914 for(
size_t j=0UL; j<
n_; ++j )
1915 v_[i*
nn_+j] *= scalar;
1953 template<
typename Type
1990 template<
typename Type
2020 template<
typename Type
2024 template<
typename Other >
2027 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2042 template<
typename Type
2046 template<
typename Other >
2049 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2063 template<
typename Type
2084 template<
typename Type
2090 return (
rows() *
columns() >= SMP_DMATASSIGN_THRESHOLD );
2110 template<
typename Type
2118 return loada( i, j );
2120 return loadu( i, j );
2140 template<
typename Type
2177 template<
typename Type
2213 template<
typename Type
2244 template<
typename Type
2282 template<
typename Type
2319 template<
typename Type
2352 template<
typename Type
2356 template<
typename MT >
2363 const size_t jpos(
n_ &
size_t(-2) );
2366 for(
size_t i=0UL; i<
m_; ++i ) {
2367 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2368 v_[i*
nn_+j ] = (~rhs)(i,j );
2369 v_[i*
nn_+j+1UL] = (~rhs)(i,j+1UL);
2372 v_[i*
nn_+jpos] = (~rhs)(i,jpos);
2390 template<
typename Type
2394 template<
typename MT >
2405 const size_t jpos( ( remainder )?(
n_ &
size_t(-SIMDSIZE) ):(
n_ ) );
2408 if( AF && PF && useStreaming &&
2409 (
m_*
n_ > ( cacheSize / (
sizeof(Type) * 3UL ) ) ) && !(~rhs).
isAliased(
this ) )
2411 for(
size_t i=0UL; i<
m_; ++i )
2417 for( ; j<jpos; j+=SIMDSIZE ) {
2418 left.
stream( right.load() ); left += SIMDSIZE, right += SIMDSIZE;
2420 for( ; remainder && j<
n_; ++j ) {
2421 *left = *right; ++left; ++right;
2427 for(
size_t i=0UL; i<
m_; ++i )
2433 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2434 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2435 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2436 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2437 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2439 for( ; j<jpos; j+=SIMDSIZE ) {
2440 left.
store( right.load() ); left+=SIMDSIZE, right+=SIMDSIZE;
2442 for( ; remainder && j<
n_; ++j ) {
2443 *left = *right; ++left; ++right;
2462 template<
typename Type
2466 template<
typename MT >
2474 constexpr
size_t block( BLOCK_SIZE );
2476 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
2477 const size_t iend(
min( m_, ii+block ) );
2478 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
2479 const size_t jend(
min( n_, jj+block ) );
2480 for(
size_t i=ii; i<iend; ++i ) {
2481 for(
size_t j=jj; j<jend; ++j ) {
2482 v_[i*
nn_+j] = (~rhs)(i,j);
2502 template<
typename Type
2506 template<
typename MT >
2512 for(
size_t i=0UL; i<
m_; ++i )
2514 v_[i*
nn_+element->index()] = element->value();
2530 template<
typename Type
2534 template<
typename MT >
2542 for(
size_t j=0UL; j<
n_; ++j )
2544 v_[element->index()*
nn_+j] = element->value();
2560 template<
typename Type
2564 template<
typename MT >
2571 for(
size_t i=0UL; i<
m_; ++i )
2575 v_[i*
nn_+i] += (~rhs)(i,i);
2589 for( ; (j+2UL) <= jend; j+=2UL ) {
2590 v_[i*
nn_+j ] += (~rhs)(i,j );
2591 v_[i*
nn_+j+1UL] += (~rhs)(i,j+1UL);
2594 v_[i*
nn_+j] += (~rhs)(i,j);
2613 template<
typename Type
2617 template<
typename MT >
2629 for(
size_t i=0UL; i<
m_; ++i )
2639 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
2640 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2646 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2647 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2648 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2649 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2650 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2652 for( ; j<jpos; j+=SIMDSIZE ) {
2653 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2655 for( ; remainder && j<jend; ++j ) {
2656 *left += *right; ++left; ++right;
2674 template<
typename Type
2678 template<
typename MT >
2686 constexpr
size_t block( BLOCK_SIZE );
2688 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
2689 const size_t iend(
min( m_, ii+block ) );
2690 for(
size_t jj=0UL; jj<
n_; jj+=block )
2695 for(
size_t i=ii; i<iend; ++i )
2702 :(
min( n_, jj+block ) ) );
2705 for(
size_t j=jbegin; j<jend; ++j ) {
2706 v_[i*
nn_+j] += (~rhs)(i,j);
2726 template<
typename Type
2730 template<
typename MT >
2736 for(
size_t i=0UL; i<
m_; ++i )
2738 v_[i*
nn_+element->index()] += element->value();
2754 template<
typename Type
2758 template<
typename MT >
2766 for(
size_t j=0UL; j<
n_; ++j )
2768 v_[element->index()*
nn_+j] += element->value();
2784 template<
typename Type
2788 template<
typename MT >
2795 for(
size_t i=0UL; i<
m_; ++i )
2799 v_[i*
nn_+i] -= (~rhs)(i,i);
2813 for( ; (j+2UL) <= jend; j+=2UL ) {
2814 v_[i*
nn_+j ] -= (~rhs)(i,j );
2815 v_[i*
nn_+j+1UL] -= (~rhs)(i,j+1UL);
2818 v_[i*
nn_+j] -= (~rhs)(i,j);
2837 template<
typename Type
2841 template<
typename MT >
2853 for(
size_t i=0UL; i<
m_; ++i )
2863 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
2864 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2870 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2871 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2872 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2873 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2874 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2876 for( ; j<jpos; j+=SIMDSIZE ) {
2877 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2879 for( ; remainder && j<jend; ++j ) {
2880 *left -= *right; ++left; ++right;
2898 template<
typename Type
2902 template<
typename MT >
2910 constexpr
size_t block( BLOCK_SIZE );
2912 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
2913 const size_t iend(
min( m_, ii+block ) );
2914 for(
size_t jj=0UL; jj<
n_; jj+=block )
2919 for(
size_t i=ii; i<iend; ++i )
2926 :(
min( n_, jj+block ) ) );
2929 for(
size_t j=jbegin; j<jend; ++j ) {
2930 v_[i*
nn_+j] -= (~rhs)(i,j);
2950 template<
typename Type
2954 template<
typename MT >
2960 for(
size_t i=0UL; i<
m_; ++i )
2962 v_[i*
nn_+element->index()] -= element->value();
2978 template<
typename Type
2982 template<
typename MT >
2990 for(
size_t j=0UL; j<
n_; ++j )
2992 v_[element->index()*
nn_+j] -= element->value();
3008 template<
typename Type
3012 template<
typename MT >
3019 const size_t jpos(
n_ &
size_t(-2) );
3022 for(
size_t i=0UL; i<
m_; ++i ) {
3023 for(
size_t j=0UL; j<jpos; j+=2UL ) {
3024 v_[i*
nn_+j ] *= (~rhs)(i,j );
3025 v_[i*
nn_+j+1UL] *= (~rhs)(i,j+1UL);
3028 v_[i*
nn_+jpos] *= (~rhs)(i,jpos);
3046 template<
typename Type
3050 template<
typename MT >
3061 for(
size_t i=0UL; i<
m_; ++i )
3063 const size_t jpos( ( remainder )?(
n_ &
size_t(-SIMDSIZE) ):(
n_ ) );
3070 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
3071 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3072 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3073 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3074 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3076 for( ; j<jpos; j+=SIMDSIZE ) {
3077 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3079 for( ; remainder && j<
n_; ++j ) {
3080 *left *= *right; ++left; ++right;
3098 template<
typename Type
3102 template<
typename MT >
3110 constexpr
size_t block( BLOCK_SIZE );
3112 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
3113 const size_t iend(
min( m_, ii+block ) );
3114 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
3115 const size_t jend(
min( n_, jj+block ) );
3116 for(
size_t i=ii; i<iend; ++i ) {
3117 for(
size_t j=jj; j<jend; ++j ) {
3118 v_[i*
nn_+j] *= (~rhs)(i,j);
3138 template<
typename Type
3142 template<
typename MT >
3152 for(
size_t i=0UL; i<
m_; ++i )
3154 v_[i*
nn_+element->index()] = tmp(i,element->index()) * element->value();
3170 template<
typename Type
3174 template<
typename MT >
3186 for(
size_t j=0UL; j<
n_; ++j )
3188 v_[element->index()*
nn_+j] = tmp(element->index(),j) * element->value();
3213 template<
typename Type
3217 :
public DenseMatrix< CustomMatrix<Type,AF,PF,true>, true >
3250 template<
typename NewType >
3259 template<
size_t NewM
3285 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n );
3286 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n,
size_t mm );
3323 template<
typename Other,
size_t M,
size_t N >
3339 inline size_t rows()
const noexcept;
3340 inline size_t columns()
const noexcept;
3341 inline size_t spacing()
const noexcept;
3342 inline size_t capacity()
const noexcept;
3343 inline size_t capacity(
size_t j )
const noexcept;
3345 inline size_t nonZeros(
size_t j )
const;
3346 inline void reset();
3347 inline void reset(
size_t j );
3348 inline void clear();
3359 template<
typename Other >
inline CustomMatrix& scale(
const Other& scalar );
3366 inline void reset( Type* ptr,
size_t m,
size_t n );
3367 inline void reset( Type* ptr,
size_t m,
size_t n,
size_t mm );
3374 template<
typename MT >
3375 struct VectorizedAssign {
3376 enum :
bool { value = useOptimizedKernels &&
3377 simdEnabled && MT::simdEnabled &&
3384 template<
typename MT >
3385 struct VectorizedAddAssign {
3386 enum :
bool { value = useOptimizedKernels &&
3387 simdEnabled && MT::simdEnabled &&
3396 template<
typename MT >
3397 struct VectorizedSubAssign {
3398 enum :
bool { value = useOptimizedKernels &&
3399 simdEnabled && MT::simdEnabled &&
3408 template<
typename MT >
3409 struct VectorizedSchurAssign {
3410 enum :
bool { value = useOptimizedKernels &&
3411 simdEnabled && MT::simdEnabled &&
3426 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
3427 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
3429 inline bool isAligned ()
const noexcept;
3441 template<
typename MT >
3444 template<
typename MT >
3451 template<
typename MT >
3454 template<
typename MT >
3461 template<
typename MT >
3464 template<
typename MT >
3471 template<
typename MT >
3474 template<
typename MT >
3518 template<
typename Type
3552 template<
typename Type
3563 if( ptr ==
nullptr ) {
3567 if( AF && ( !
checkAlignment( ptr ) || mm_ % SIMDSIZE != 0UL ) ) {
3598 template<
typename Type
3607 if( ptr ==
nullptr ) {
3611 if( AF && ( !
checkAlignment( ptr ) || mm_ % SIMDSIZE != 0UL ) ) {
3620 for(
size_t j=0UL; j<
n_; ++j )
3621 for(
size_t i=
m_; i<mm_; ++i ) {
3622 v_[i+j*mm_] = Type();
3639 template<
typename Type
3658 template<
typename Type
3697 template<
typename Type
3722 template<
typename Type
3748 template<
typename Type
3760 return (*
this)(i,j);
3778 template<
typename Type
3790 return (*
this)(i,j);
3808 template<
typename Type
3832 template<
typename Type
3853 template<
typename Type
3875 template<
typename Type
3895 template<
typename Type
3915 template<
typename Type
3935 template<
typename Type
3955 template<
typename Type
3975 template<
typename Type
3995 template<
typename Type
4023 template<
typename Type
4028 for(
size_t j=0UL; j<
n_; ++j )
4029 for(
size_t i=0UL; i<
m_; ++i )
4067 template<
typename Type
4079 for(
const auto& rowList : list ) {
4081 for(
const auto& element : rowList ) {
4082 v_[i+j*mm_] = element;
4085 for( ; j<
n_; ++j ) {
4086 v_[i+j*mm_] = Type();
4127 template<
typename Type
4130 template<
typename Other
4136 if(
m_ != M ||
n_ != N ) {
4140 for(
size_t j=0UL; j<N; ++j )
4141 for(
size_t i=0UL; i<M; ++i )
4142 v_[i+j*mm_] = array[i][j];
4161 template<
typename Type
4186 template<
typename Type
4221 template<
typename Type
4224 template<
typename MT
4270 template<
typename Type
4273 template<
typename MT
4307 template<
typename Type
4310 template<
typename MT
4344 template<
typename Type
4347 template<
typename MT
4384 template<
typename Type
4401 template<
typename Type
4421 template<
typename Type
4438 template<
typename Type
4456 template<
typename Type
4475 template<
typename Type
4480 size_t nonzeros( 0UL );
4482 for(
size_t j=0UL; j<
n_; ++j )
4483 for(
size_t i=0UL; i<
m_; ++i )
4500 template<
typename Type
4507 const size_t iend( j*mm_ +
m_ );
4508 size_t nonzeros( 0UL );
4510 for(
size_t i=j*mm_; i<iend; ++i )
4526 template<
typename Type
4533 for(
size_t j=0UL; j<
n_; ++j )
4534 for(
size_t i=0UL; i<
m_; ++i )
4551 template<
typename Type
4559 for(
size_t i=0UL; i<
m_; ++i )
4574 template<
typename Type
4595 template<
typename Type
4628 template<
typename Type
4639 for(
size_t j=1UL; j<
n_; ++j )
4640 for(
size_t i=0UL; i<j; ++i )
4658 template<
typename Type
4667 for(
size_t j=0UL; j<
n_; ++j ) {
4668 for(
size_t i=0UL; i<j; ++i ) {
4702 template<
typename Type
4705 template<
typename Other >
4708 for(
size_t j=0UL; j<
n_; ++j )
4709 for(
size_t i=0UL; i<
m_; ++i )
4710 v_[i+j*mm_] *= scalar;
4750 template<
typename Type
4788 template<
typename Type
4819 template<
typename Type
4822 template<
typename Other >
4825 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
4842 template<
typename Type
4845 template<
typename Other >
4848 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
4864 template<
typename Type
4886 template<
typename Type
4891 return (
rows() *
columns() >= SMP_DMATASSIGN_THRESHOLD );
4912 template<
typename Type
4919 return loada( i, j );
4921 return loadu( i, j );
4942 template<
typename Type
4979 template<
typename Type
5015 template<
typename Type
5046 template<
typename Type
5084 template<
typename Type
5121 template<
typename Type
5155 template<
typename Type
5158 template<
typename MT >
5165 const size_t ipos(
m_ &
size_t(-2) );
5168 for(
size_t j=0UL; j<
n_; ++j ) {
5169 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5170 v_[i +j*mm_] = (~rhs)(i ,j);
5171 v_[i+1UL+j*mm_] = (~rhs)(i+1UL,j);
5174 v_[ipos+j*mm_] = (~rhs)(ipos,j);
5194 template<
typename Type
5197 template<
typename MT >
5208 const size_t ipos( ( remainder )?(
m_ &
size_t(-SIMDSIZE) ):(
m_ ) );
5211 if( AF && PF && useStreaming &&
5212 (
m_*
n_ > ( cacheSize / (
sizeof(Type) * 3UL ) ) ) && !(~rhs).
isAliased(
this ) )
5214 for(
size_t j=0UL; j<
n_; ++j )
5220 for( ; i<ipos; i+=SIMDSIZE ) {
5221 left.
stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5223 for( ; remainder && i<
m_; ++i ) {
5224 *left = *right; ++left; ++right;
5230 for(
size_t j=0UL; j<
n_; ++j )
5236 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
5237 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5238 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5239 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5240 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5242 for( ; i<ipos; i+=SIMDSIZE ) {
5243 left.
store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5245 for( ; remainder && i<
m_; ++i ) {
5246 *left = *right; ++left; ++right;
5267 template<
typename Type
5270 template<
typename MT >
5278 constexpr
size_t block( BLOCK_SIZE );
5280 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
5281 const size_t jend(
min( n_, jj+block ) );
5282 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
5283 const size_t iend(
min( m_, ii+block ) );
5284 for(
size_t j=jj; j<jend; ++j ) {
5285 for(
size_t i=ii; i<iend; ++i ) {
5286 v_[i+j*mm_] = (~rhs)(i,j);
5308 template<
typename Type
5311 template<
typename MT >
5317 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
5319 v_[element->index()+j*mm_] = element->value();
5337 template<
typename Type
5340 template<
typename MT >
5348 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
5350 v_[i+element->index()*mm_] = element->value();
5368 template<
typename Type
5371 template<
typename MT >
5378 for(
size_t j=0UL; j<
n_; ++j )
5382 v_[j+j*mm_] += (~rhs)(j,j);
5396 for( ; (i+2UL) <= iend; i+=2UL ) {
5397 v_[i +j*mm_] += (~rhs)(i ,j);
5398 v_[i+1UL+j*mm_] += (~rhs)(i+1UL,j);
5401 v_[i+j*mm_] += (~rhs)(i,j);
5422 template<
typename Type
5425 template<
typename MT >
5437 for(
size_t j=0UL; j<
n_; ++j )
5447 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5448 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5454 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
5455 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5456 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5457 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5458 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5460 for( ; i<ipos; i+=SIMDSIZE ) {
5461 left.
store( left.
load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5463 for( ; remainder && i<iend; ++i ) {
5464 *left += *right; ++left; ++right;
5484 template<
typename Type
5487 template<
typename MT >
5495 constexpr
size_t block( BLOCK_SIZE );
5497 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
5498 const size_t jend(
min( n_, jj+block ) );
5499 for(
size_t ii=0UL; ii<
m_; ii+=block )
5504 for(
size_t j=jj; j<jend; ++j )
5511 :(
min( m_, ii+block ) ) );
5514 for(
size_t i=ibegin; i<iend; ++i ) {
5515 v_[i+j*mm_] += (~rhs)(i,j);
5537 template<
typename Type
5540 template<
typename MT >
5546 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
5548 v_[element->index()+j*mm_] += element->value();
5566 template<
typename Type
5569 template<
typename MT >
5577 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
5579 v_[i+element->index()*mm_] += element->value();
5597 template<
typename Type
5600 template<
typename MT >
5607 for(
size_t j=0UL; j<
n_; ++j )
5611 v_[j+j*mm_] -= (~rhs)(j,j);
5625 for( ; (i+2UL) <= iend; i+=2UL ) {
5626 v_[i +j*mm_] -= (~rhs)(i ,j);
5627 v_[i+1+j*mm_] -= (~rhs)(i+1,j);
5630 v_[i+j*mm_] -= (~rhs)(i,j);
5652 template<
typename Type
5655 template<
typename MT >
5667 for(
size_t j=0UL; j<
n_; ++j )
5677 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5678 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5684 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
5685 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5686 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5687 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5688 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5690 for( ; i<ipos; i+=SIMDSIZE ) {
5691 left.
store( left.
load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5693 for( ; remainder && i<iend; ++i ) {
5694 *left -= *right; ++left; ++right;
5714 template<
typename Type
5717 template<
typename MT >
5725 constexpr
size_t block( BLOCK_SIZE );
5727 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
5728 const size_t jend(
min( n_, jj+block ) );
5729 for(
size_t ii=0UL; ii<
m_; ii+=block )
5734 for(
size_t j=jj; j<jend; ++j )
5741 :(
min( m_, ii+block ) ) );
5744 for(
size_t i=ibegin; i<iend; ++i ) {
5745 v_[i+j*mm_] -= (~rhs)(i,j);
5767 template<
typename Type
5770 template<
typename MT >
5776 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
5778 v_[element->index()+j*mm_] -= element->value();
5796 template<
typename Type
5799 template<
typename MT >
5807 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
5809 v_[i+element->index()*mm_] -= element->value();
5827 template<
typename Type
5830 template<
typename MT >
5837 const size_t ipos(
m_ &
size_t(-2) );
5840 for(
size_t j=0UL; j<
n_; ++j ) {
5841 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5842 v_[i +j*mm_] *= (~rhs)(i ,j);
5843 v_[i+1UL+j*mm_] *= (~rhs)(i+1UL,j);
5846 v_[ipos+j*mm_] *= (~rhs)(ipos,j);
5867 template<
typename Type
5870 template<
typename MT >
5881 for(
size_t j=0UL; j<
n_; ++j )
5883 const size_t ipos( ( remainder )?(
m_ &
size_t(-SIMDSIZE) ):(
m_ ) );
5890 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
5891 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5892 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5893 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5894 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5896 for( ; i<ipos; i+=SIMDSIZE ) {
5897 left.
store( left.
load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5899 for( ; remainder && i<
m_; ++i ) {
5900 *left *= *right; ++left; ++right;
5920 template<
typename Type
5923 template<
typename MT >
5931 constexpr
size_t block( BLOCK_SIZE );
5933 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
5934 const size_t jend(
min( n_, jj+block ) );
5935 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
5936 const size_t iend(
min( m_, ii+block ) );
5937 for(
size_t j=jj; j<jend; ++j ) {
5938 for(
size_t i=ii; i<iend; ++i ) {
5939 v_[i+j*mm_] *= (~rhs)(i,j);
5961 template<
typename Type
5964 template<
typename MT >
5974 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
5976 v_[element->index()+j*mm_] = tmp(element->index(),j) * element->value();
5994 template<
typename Type
5997 template<
typename MT >
6009 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
6011 v_[i+element->index()*mm_] = tmp(i,element->index()) * element->value();
6032 template<
typename Type,
bool AF,
bool PF,
bool SO >
6035 template<
typename Type,
bool AF,
bool PF,
bool SO >
6038 template<
typename Type,
bool AF,
bool PF,
bool SO >
6041 template<
bool RF,
typename Type,
bool AF,
bool PF,
bool SO >
6044 template<
typename Type,
bool AF,
bool PF,
bool SO >
6047 template<
typename Type,
bool AF,
bool PF,
bool SO >
6060 template<
typename Type
6084 template<
typename Type
6102 template<
typename Type
6174 template<
typename Type
6193 template<
typename Type
6214 template<
typename T,
bool AF,
bool PF,
bool SO >
6232 template<
typename T,
bool AF,
bool PF,
bool SO >
6250 template<
typename T,
bool AF,
bool PF,
bool SO >
6251 struct IsCustom< CustomMatrix<T,AF,PF,SO> >
6268 template<
typename T,
bool PF,
bool SO >
6269 struct IsAligned< CustomMatrix<T,aligned,PF,SO> >
6286 template<
typename T,
bool AF,
bool PF,
bool SO >
6305 template<
typename T,
bool AF,
bool SO >
6306 struct IsPadded< CustomMatrix<T,AF,padded,SO> >
6323 template<
typename T,
bool AF,
bool PF,
bool SO,
typename OP >
6342 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t M,
size_t N,
typename OP >
6343 struct BinaryMapTrait< CustomMatrix<T1,AF,PF,SO>, StaticMatrix<T2,M,N,SO>, OP >
6348 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2,
typename OP >
6349 struct BinaryMapTrait< CustomMatrix<T1,AF,PF,SO1>, StaticMatrix<T2,M,N,SO2>, OP >
6354 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF,
typename OP >
6355 struct BinaryMapTrait< StaticMatrix<T1,M,N,SO>, CustomMatrix<T2,AF,PF,SO>, OP >
6360 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2,
typename OP >
6361 struct BinaryMapTrait< StaticMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2>, OP >
6366 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t M,
size_t N,
typename OP >
6367 struct BinaryMapTrait< CustomMatrix<T1,AF,PF,SO>, HybridMatrix<T2,M,N,SO>, OP >
6372 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2,
typename OP >
6373 struct BinaryMapTrait< CustomMatrix<T1,AF,PF,SO1>, HybridMatrix<T2,M,N,SO2>, OP >
6378 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF,
typename OP >
6379 struct BinaryMapTrait< HybridMatrix<T1,M,N,SO>, CustomMatrix<T2,AF,PF,SO>, OP >
6384 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2,
typename OP >
6385 struct BinaryMapTrait< HybridMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2>, OP >
6390 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
typename OP >
6391 struct BinaryMapTrait< CustomMatrix<T1,AF,PF,SO>, DynamicMatrix<T2,SO>, OP >
6396 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
bool SO2,
typename OP >
6397 struct BinaryMapTrait< CustomMatrix<T1,AF,PF,SO1>, DynamicMatrix<T2,SO2>, OP >
6402 template<
typename T1,
bool SO,
typename T2,
bool AF,
bool PF,
typename OP >
6403 struct BinaryMapTrait< DynamicMatrix<T1,SO>, CustomMatrix<T2,AF,PF,SO>, OP >
6408 template<
typename T1,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2,
typename OP >
6409 struct BinaryMapTrait< DynamicMatrix<T1,SO1>, CustomMatrix<T2,AF,PF,SO2>, OP >
6414 template<
typename T1,
bool AF1,
bool PF1,
bool SO,
typename T2,
bool AF2,
bool PF2,
typename OP >
6415 struct BinaryMapTrait< CustomMatrix<T1,AF1,PF1,SO>, CustomMatrix<T2,AF2,PF2,SO>, OP >
6420 template<
typename T1,
bool AF1,
bool PF1,
bool SO1,
typename T2,
bool AF2,
bool PF2,
bool SO2,
typename OP >
6421 struct BinaryMapTrait< CustomMatrix<T1,AF1,PF1,SO1>, CustomMatrix<T2,AF2,PF2,SO2>, OP >
6439 template<
typename T,
bool AF,
bool PF,
bool SO,
size_t I,
size_t J,
size_t M,
size_t N >
6445 template<
typename T,
bool AF,
bool PF,
bool SO >
6464 template<
typename T,
bool AF,
bool PF,
bool SO,
size_t... CRAs >
6465 struct RowTrait< CustomMatrix<T,AF,PF,SO>, CRAs... >
6483 template<
typename T,
bool AF,
bool PF,
bool SO,
size_t... CRAs >
6484 struct RowsTrait< CustomMatrix<T,AF,PF,SO>, CRAs... >
6502 template<
typename T,
bool AF,
bool PF,
bool SO,
size_t... CCAs >
6503 struct ColumnTrait< CustomMatrix<T,AF,PF,SO>, CCAs... >
6521 template<
typename T,
bool AF,
bool PF,
bool SO,
size_t... CCAs >
6522 struct ColumnsTrait< CustomMatrix<T,AF,PF,SO>, CCAs... >
6540 template<
typename T,
bool AF,
bool PF,
bool SO,
ptrdiff_t... CBAs >
6541 struct BandTrait< CustomMatrix<T,AF,PF,SO>, CBAs... >
size_t spacing() const noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: CustomMatrix.h:1628
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:135
Constraint on the data type.
#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:692
Pointer difference type of the Blaze library.
CustomMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: CustomMatrix.h:1867
Header file for auxiliary alias declarations.
Headerfile for the generic min algorithm.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: CustomMatrix.h:1607
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:2218
Availability of a SIMD subtraction for the given data types.Depending on the available instruction se...
Definition: HasSIMDSub.h:171
Header file for mathematical functions.
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:2025
bool canSMPAssign() const noexcept
Returns whether the matrix can be used in SMP assignments.
Definition: CustomMatrix.h:2088
Header file for the alignment flag values.
Header file for the UNUSED_PARAMETER function template.
EnableIf_< IsDenseMatrix< MT1 > > smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:196
Header file for basic type definitions.
const SIMDType load() const noexcept
Load of the SIMD element at the current iterator position.
Definition: DenseIterator.h:405
Header file for the row trait.
Base template for the SubmatrixTrait class.
Definition: SubmatrixTrait.h:109
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:108
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:79
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:164
BLAZE_ALWAYS_INLINE SIMDType load(size_t i, size_t j) const noexcept
Load of a SIMD element of the matrix.
Definition: CustomMatrix.h:2115
Header file for the IsSparseMatrix type trait.
Header file for the IsDiagonal type trait.
Type ElementType
Type of the matrix elements.
Definition: CustomMatrix.h:430
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
const Type & ReturnType
Return type for expression template evaluations.
Definition: CustomMatrix.h:432
Header file for the IsSame and IsStrictlySame type traits.
ConstIterator cbegin(size_t i) const noexcept
Returns an iterator to the first element of row/column i.
Definition: CustomMatrix.h:1153
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:172
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:316
CustomMatrix & operator=(const Type &set)
Homogenous assignment to all matrix elements.
Definition: CustomMatrix.h:1251
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
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:1903
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:87
Availability of a SIMD addition for the given data types.Depending on the available instruction set (...
Definition: HasSIMDAdd.h:171
const Type & ConstReference
Reference to a constant matrix value.
Definition: CustomMatrix.h:436
Reference operator()(size_t i, size_t j) noexcept
2D-access to the matrix elements.
Definition: CustomMatrix.h:908
CustomMatrix & transpose()
In-place transpose of the matrix.
Definition: CustomMatrix.h:1838
#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:694
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member constant is set to true, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to false, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:140
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:87
Efficient implementation of an arbitrary sized vector.The DynamicVector class template is the represe...
Definition: DynamicVector.h:185
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
Efficient implementation of a dynamic matrix.The DynamicMatrix class template is the representation ...
Definition: DynamicMatrix.h:217
Compile time check for data types.This type trait tests whether or not the given types can be combine...
Definition: IsSIMDCombinable.h:120
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1950
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:133
Base template for the RowsTrait class.
Definition: RowsTrait.h:109
void swap(CustomMatrix &m) noexcept
Swapping the contents of two matrices.
Definition: CustomMatrix.h:1806
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
Header file for the band trait.
Constraint on the data type.
constexpr bool unpadded
Padding flag for unpadded vectors and matrices.Via this flag it is possible to specify custom vectors...
Definition: PaddingFlag.h:64
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:2145
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:2324
Base template for the RowTrait class.
Definition: RowTrait.h:109
Compile time check for the memory layout of data types.This type trait tests whether the given data t...
Definition: IsContiguous.h:86
Headerfile for the generic max algorithm.
typename TransExprTrait< T >::Type TransExprTrait_
Auxiliary alias declaration for the TransExprTrait class template.The TransExprTrait_ alias declarati...
Definition: TransExprTrait.h:112
Header file for the DisableIf class template.
Header file for the IsCustom type trait.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Header file for the unary map trait.
void reset()
Reset to the default initial values.
Definition: CustomMatrix.h:1738
SIMDTrait_< ElementType > SIMDType
SIMD type of the matrix elements.
Definition: CustomMatrix.h:431
typename CTransExprTrait< T >::Type CTransExprTrait_
Auxiliary alias declaration for the CTransExprTrait class template.The CTransExprTrait_ alias declara...
Definition: CTransExprTrait.h:112
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for nested template disabiguation.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5908
Pointer data() noexcept
Low-level data access to the matrix elements.
Definition: CustomMatrix.h:1016
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:1644
#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:102
#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:957
void stream(const SIMDType &value) const noexcept
Aligned, non-temporal store of the SIMD element at the current iterator position. ...
Definition: DenseIterator.h:533
Iterator end(size_t i) noexcept
Returns an iterator just past the last element of row/column i.
Definition: CustomMatrix.h:1177
Header file for all SIMD functionality.
Constraint on the data type.
void store(const SIMDType &value) const noexcept
Store of the SIMD element at the current iterator position.
Definition: DenseIterator.h:470
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: CustomMatrix.h:438
#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:89
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:87
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:693
#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:123
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:2182
Rebind mechanism to obtain a CustomMatrix with different data/element type.
Definition: CustomMatrix.h:448
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
Header file for the IsPadded type trait.
Header file for the IsVectorizable type trait.
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:458
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 RemoveConst type trait.
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
Header file for the HasSIMDMult type trait.
Header file for the binary map trait.
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
size_t determineColumns(initializer_list< initializer_list< Type > > list) noexcept
Determines the maximum number of columns specified by the given initializer list. ...
Definition: InitializerList.h:107
Header file for run time assertion macros.
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: CustomMatrix.h:1591
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:2249
Header file for the InvExprTrait class template.
Header file for the submatrix trait.
void clear()
Clearing the matrix.
Definition: CustomMatrix.h:1786
Header file for the IsContiguous type trait.
Header file for the columns trait.
Type * Pointer
Pointer to a non-constant matrix value.
Definition: CustomMatrix.h:437
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.
Constraint on the data type.
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:101
Constraint on the data type.
Constraint on the data type.
Header file for the HasSIMDSub type trait.
BLAZE_ALWAYS_INLINE void conjugate(T &a) noexcept(IsNumeric< T >::value)
In-place conjugation of the given value/object.
Definition: Conjugate.h:120
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
Header file for the HasMutableDataAccess type trait.
Type & Reference
Reference to a non-constant matrix value.
Definition: CustomMatrix.h:435
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
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
Header file for the rows trait.
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:76
BLAZE_ALWAYS_INLINE void cswap(T &a, T &b) noexcept(IsNumeric< T >::value)
Swapping two conjugated values/objects.
Definition: Conjugate.h:195
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
DenseIterator< Type, AF > Iterator
Iterator over non-constant elements.
Definition: CustomMatrix.h:440
CustomMatrix()
The default constructor for CustomMatrix.
Definition: CustomMatrix.h:734
Base template for the ColumnsTrait class.
Definition: ColumnsTrait.h:109
Header file for the default transpose flag for all vectors of the Blaze library.
Initializer list type of the Blaze library.
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: CustomMatrix.h:2047
Efficient implementation of a customizable matrix.The CustomMatrix class template provides the functi...
Definition: CustomMatrix.h:413
Header file for the alignment check function.
typename InvExprTrait< T >::Type InvExprTrait_
Auxiliary alias declaration for the InvExprTrait class template.The InvExprTrait_ alias declaration p...
Definition: InvExprTrait.h:123
BLAZE_ALWAYS_INLINE void storeu(size_t i, size_t j, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the matrix.
Definition: CustomMatrix.h:2287
ConstIterator cend(size_t i) const noexcept
Returns an iterator just past the last element of row/column i.
Definition: CustomMatrix.h:1225
DenseIterator< const Type, AF > ConstIterator
Iterator over constant elements.
Definition: CustomMatrix.h:441
Iterator begin(size_t i) noexcept
Returns an iterator to the first element of row/column i.
Definition: CustomMatrix.h:1105
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
Compile time check for sparse matrix types.This type trait tests whether or not the given template pa...
Definition: IsSparseMatrix.h:103
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
#define BLAZE_THROW_LOGIC_ERROR(MESSAGE)
Macro for the emission of a std::logic_error exception.This macro encapsulates the default way of Bla...
Definition: Exception.h:187
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
Header file for the IsUpper type trait.
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the CTransExprTrait class template.
#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
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: CustomMatrix.h:1684
Base template for the BinaryMapTrait class.
Definition: BinaryMapTrait.h:97
bool isAligned() const noexcept
Returns whether the matrix is properly aligned in memory.
Definition: CustomMatrix.h:2067
Type * v_
The custom array of elements.
Definition: CustomMatrix.h:695
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:95
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.
Base template for the BandTrait class.
Definition: BandTrait.h:109