35 #ifndef _BLAZE_MATH_DENSE_CUSTOMMATRIX_H_
36 #define _BLAZE_MATH_DENSE_CUSTOMMATRIX_H_
45 #include <boost/smart_ptr/shared_array.hpp>
432 template<
typename Type
462 template<
typename ET >
487 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n );
488 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n,
size_t nn );
490 template<
typename Deleter,
typename = EnableIf_< IsClass<Deleter> > >
491 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n, Deleter D );
493 template<
typename Deleter >
494 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n,
size_t nn, Deleter D );
508 inline Reference operator()(
size_t i,
size_t j ) noexcept;
509 inline ConstReference operator()(
size_t i,
size_t j ) const noexcept;
510 inline Reference
at(
size_t i,
size_t j );
511 inline ConstReference
at(
size_t i,
size_t j ) const;
512 inline Pointer
data () noexcept;
513 inline ConstPointer
data () const noexcept;
514 inline Pointer
data (
size_t i ) noexcept;
515 inline ConstPointer
data (
size_t i ) const noexcept;
516 inline Iterator
begin (
size_t i ) noexcept;
517 inline ConstIterator
begin (
size_t i ) const noexcept;
518 inline ConstIterator
cbegin(
size_t i ) const noexcept;
519 inline Iterator
end (
size_t i ) noexcept;
520 inline ConstIterator
end (
size_t i ) const noexcept;
521 inline ConstIterator
cend (
size_t i ) const noexcept;
529 inline
CustomMatrix& operator=( initializer_list< initializer_list<Type> > list );
531 template< typename Other,
size_t M,
size_t N >
532 inline
CustomMatrix& operator=( const Other (&array)[M][N] );
537 template< typename MT,
bool SO2 > inline
CustomMatrix& operator= ( const Matrix<MT,SO2>& rhs );
538 template< typename MT,
bool SO2 > inline
CustomMatrix& operator+=( const Matrix<MT,SO2>& rhs );
539 template< typename MT,
bool SO2 > inline
CustomMatrix& operator-=( const Matrix<MT,SO2>& rhs );
540 template< typename MT,
bool SO2 > inline
CustomMatrix& operator*=( const Matrix<MT,SO2>& rhs );
542 template< typename Other >
545 template< typename Other >
553 inline
size_t rows() const noexcept;
554 inline
size_t columns() const noexcept;
555 inline
size_t spacing() const noexcept;
556 inline
size_t capacity() const noexcept;
557 inline
size_t capacity(
size_t i ) const noexcept;
559 inline
size_t nonZeros(
size_t i ) const;
561 inline
void reset(
size_t i );
565 template< typename Other > inline
CustomMatrix& scale( const Other& scalar );
573 inline
void reset( Type* ptr,
size_t m,
size_t n );
574 inline
void reset( Type* ptr,
size_t m,
size_t n,
size_t nn );
576 template< typename Deleter, typename =
EnableIf_< IsClass<Deleter> > >
577 inline
void reset( Type* ptr,
size_t m,
size_t n, Deleter d );
579 template< typename Deleter >
580 inline
void reset( Type* ptr,
size_t m,
size_t n,
size_t nn, Deleter d );
587 template< typename MT >
589 struct VectorizedAssign {
591 simdEnabled && MT::simdEnabled &&
592 AreSIMDCombinable< Type, ElementType_<MT> >::value };
599 template<
typename MT >
601 struct VectorizedAddAssign {
603 simdEnabled && MT::simdEnabled &&
604 AreSIMDCombinable< Type, ElementType_<MT> >::value &&
605 HasSIMDAdd< Type, ElementType_<MT> >::value &&
606 !IsDiagonal<MT>::value };
613 template<
typename MT >
615 struct VectorizedSubAssign {
617 simdEnabled && MT::simdEnabled &&
618 AreSIMDCombinable< Type, ElementType_<MT> >::value &&
619 HasSIMDSub< Type, ElementType_<MT> >::value &&
620 !IsDiagonal<MT>::value };
634 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
635 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
649 template< typename MT >
650 inline
DisableIf_<VectorizedAssign<MT> > assign( const DenseMatrix<MT,SO>& rhs );
652 template< typename MT >
653 inline
EnableIf_<VectorizedAssign<MT> > assign( const DenseMatrix<MT,SO>& rhs );
655 template< typename MT > inline
void assign( const DenseMatrix<MT,!SO>& rhs );
656 template< typename MT > inline
void assign( const SparseMatrix<MT,SO>& rhs );
657 template< typename MT > inline
void assign( const SparseMatrix<MT,!SO>& rhs );
659 template< typename MT >
660 inline
DisableIf_<VectorizedAddAssign<MT> > addAssign( const DenseMatrix<MT,SO>& rhs );
662 template< typename MT >
663 inline
EnableIf_<VectorizedAddAssign<MT> > addAssign( const DenseMatrix<MT,SO>& rhs );
665 template< typename MT > inline
void addAssign( const DenseMatrix<MT,!SO>& rhs );
666 template< typename MT > inline
void addAssign( const SparseMatrix<MT,SO>& rhs );
667 template< typename MT > inline
void addAssign( const SparseMatrix<MT,!SO>& rhs );
669 template< typename MT >
670 inline
DisableIf_<VectorizedSubAssign<MT> > subAssign( const DenseMatrix<MT,SO>& rhs );
672 template< typename MT >
673 inline
EnableIf_<VectorizedSubAssign<MT> > subAssign( const DenseMatrix<MT,SO>& rhs );
675 template< typename MT > inline
void subAssign( const DenseMatrix<MT,!SO>& rhs );
676 template< typename MT > inline
void subAssign( const SparseMatrix<MT,SO>& rhs );
677 template< typename MT > inline
void subAssign( const SparseMatrix<MT,!SO>& rhs );
688 boost::shared_array<Type>
v_;
724 template< typename Type
757 template<
typename Type
769 if( ptr ==
nullptr ) {
804 template<
typename Type
814 if( ptr ==
nullptr ) {
829 for(
size_t i=0UL; i<
m_; ++i ) {
830 for(
size_t j=
n_; j<
nn_; ++j )
831 v_[i*nn_+j] = Type();
858 template<
typename Type
862 template<
typename Deleter
872 if( ptr ==
nullptr ) {
906 template<
typename Type
910 template<
typename Deleter >
917 if( ptr ==
nullptr ) {
932 for(
size_t i=0UL; i<
m_; ++i ) {
933 for(
size_t j=
n_; j<
nn_; ++j )
934 v_[i*nn_+j] = Type();
948 template<
typename Type
966 template<
typename Type
974 , v_ (
std::move( m.v_ ) )
1003 template<
typename Type
1027 template<
typename Type
1052 template<
typename Type
1065 return (*
this)(i,j);
1081 template<
typename Type
1094 return (*
this)(i,j);
1111 template<
typename Type
1135 template<
typename Type
1155 template<
typename Type
1163 return v_.get() + i*nn_;
1176 template<
typename Type
1184 return v_.get() + i*nn_;
1200 template<
typename Type
1208 return Iterator( v_.get() + i*nn_ );
1224 template<
typename Type
1248 template<
typename Type
1272 template<
typename Type
1296 template<
typename Type
1320 template<
typename Type
1347 template<
typename Type
1353 for(
size_t i=0UL; i<
m_; ++i )
1354 for(
size_t j=0UL; j<
n_; ++j )
1390 template<
typename Type
1403 for(
const auto& rowList : list ) {
1404 std::fill( std::copy( rowList.begin(), rowList.end(), v_.get()+i*nn_ ),
1405 v_.get()+i*nn_+( PF ? nn_ :
n_ ), Type() );
1443 template<
typename Type
1447 template<
typename Other
1452 if(
m_ != M ||
n_ != N ) {
1456 for(
size_t i=0UL; i<M; ++i )
1457 for(
size_t j=0UL; j<N; ++j )
1458 v_[i*nn_+j] = array[i][j];
1475 template<
typename Type
1498 template<
typename Type
1508 v_ = std::move( rhs.v_ );
1531 template<
typename Type
1535 template<
typename MT
1578 template<
typename Type
1582 template<
typename MT
1590 if( (~rhs).canAlias(
this ) ) {
1613 template<
typename Type
1617 template<
typename MT
1625 if( (~rhs).canAlias(
this ) ) {
1648 template<
typename Type
1652 template<
typename MT
1675 template<
typename Type
1679 template<
typename Other >
1696 template<
typename Type
1700 template<
typename Other >
1725 template<
typename Type
1741 template<
typename Type
1762 template<
typename Type
1778 template<
typename Type
1800 template<
typename Type
1818 template<
typename Type
1824 size_t nonzeros( 0UL );
1826 for(
size_t i=0UL; i<
m_; ++i )
1827 for(
size_t j=0UL; j<
n_; ++j )
1847 template<
typename Type
1855 const size_t jend( i*nn_ +
n_ );
1856 size_t nonzeros( 0UL );
1858 for(
size_t j=i*nn_; j<jend; ++j )
1872 template<
typename Type
1880 for(
size_t i=0UL; i<
m_; ++i )
1881 for(
size_t j=0UL; j<
n_; ++j )
1882 clear( v_[i*nn_+j] );
1898 template<
typename Type
1907 for(
size_t j=0UL; j<
n_; ++j )
1908 clear( v_[i*nn_+j] );
1920 template<
typename Type
1942 template<
typename Type
1954 for(
size_t i=1UL; i<
m_; ++i )
1955 for(
size_t j=0UL; j<i; ++j )
1956 swap( v_[i*nn_+j], v_[j*nn_+i] );
1971 template<
typename Type
1981 for(
size_t i=0UL; i<
m_; ++i ) {
1982 for(
size_t j=0UL; j<i; ++j ) {
1983 cswap( v_[i*nn_+j], v_[j*nn_+i] );
1999 template<
typename Type
2003 template<
typename Other >
2006 for(
size_t i=0UL; i<
m_; ++i )
2007 for(
size_t j=0UL; j<
n_; ++j )
2008 v_[i*nn_+j] *= scalar;
2021 template<
typename Type
2068 template<
typename Type
2105 template<
typename Type
2140 template<
typename Type
2144 template<
typename Deleter
2179 template<
typename Type
2183 template<
typename Deleter >
2210 template<
typename Type
2214 template<
typename Other >
2217 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2232 template<
typename Type
2236 template<
typename Other >
2239 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2253 template<
typename Type
2274 template<
typename Type
2280 return (
rows() *
columns() >= SMP_DMATASSIGN_THRESHOLD );
2300 template<
typename Type
2308 return loada( i, j );
2310 return loadu( i, j );
2330 template<
typename Type
2347 return loada( v_.get()+i*nn_+j );
2367 template<
typename Type
2382 return loadu( v_.get()+i*nn_+j );
2403 template<
typename Type
2434 template<
typename Type
2451 storea( v_.get()+i*nn_+j, value );
2472 template<
typename Type
2487 storeu( v_.get()+i*nn_+j, value );
2509 template<
typename Type
2526 stream( v_.get()+i*nn_+j, value );
2542 template<
typename Type
2546 template<
typename MT >
2553 const size_t jpos(
n_ &
size_t(-2) );
2556 for(
size_t i=0UL; i<
m_; ++i ) {
2557 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2558 v_[i*nn_+j ] = (~rhs)(i,j );
2559 v_[i*nn_+j+1UL] = (~rhs)(i,j+1UL);
2562 v_[i*nn_+jpos] = (~rhs)(i,jpos);
2580 template<
typename Type
2584 template<
typename MT >
2595 const size_t jpos( ( remainder )?(
n_ &
size_t(-SIMDSIZE) ):(
n_ ) );
2599 (
m_*
n_ > (
cacheSize / (
sizeof(Type) * 3UL ) ) ) && !(~rhs).isAliased(
this ) )
2601 for(
size_t i=0UL; i<
m_; ++i )
2605 for( ; j<jpos; j+=SIMDSIZE ) {
2606 stream( i, j, (~rhs).load(i,j) );
2608 for( ; remainder && j<
n_; ++j ) {
2609 v_[i*nn_+j] = (~rhs)(i,j);
2615 for(
size_t i=0UL; i<
m_; ++i )
2620 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2621 store( i, j , it.load() ); it += SIMDSIZE;
2622 store( i, j+SIMDSIZE , it.load() ); it += SIMDSIZE;
2623 store( i, j+SIMDSIZE*2UL, it.load() ); it += SIMDSIZE;
2624 store( i, j+SIMDSIZE*3UL, it.load() ); it += SIMDSIZE;
2626 for( ; j<jpos; j+=SIMDSIZE, it+=SIMDSIZE ) {
2627 store( i, j, it.load() );
2629 for( ; remainder && j<
n_; ++j, ++it ) {
2649 template<
typename Type
2653 template<
typename MT >
2661 const size_t block( BLOCK_SIZE );
2663 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
2664 const size_t iend(
min( m_, ii+block ) );
2665 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
2666 const size_t jend(
min( n_, jj+block ) );
2667 for(
size_t i=ii; i<iend; ++i ) {
2668 for(
size_t j=jj; j<jend; ++j ) {
2669 v_[i*nn_+j] = (~rhs)(i,j);
2689 template<
typename Type
2693 template<
typename MT >
2699 for(
size_t i=0UL; i<
m_; ++i )
2701 v_[i*nn_+element->index()] = element->value();
2717 template<
typename Type
2721 template<
typename MT >
2729 for(
size_t j=0UL; j<
n_; ++j )
2731 v_[element->index()*nn_+j] = element->value();
2747 template<
typename Type
2751 template<
typename MT >
2758 for(
size_t i=0UL; i<
m_; ++i )
2762 v_[i*nn_+i] += (~rhs)(i,i);
2776 for( ; (j+2UL) <= jend; j+=2UL ) {
2777 v_[i*nn_+j ] += (~rhs)(i,j );
2778 v_[i*nn_+j+1UL] += (~rhs)(i,j+1UL);
2781 v_[i*nn_+j] += (~rhs)(i,j);
2800 template<
typename Type
2804 template<
typename MT >
2816 for(
size_t i=0UL; i<
m_; ++i )
2826 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
2827 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2832 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2833 store( i, j , load(i,j ) + it.load() ); it += SIMDSIZE;
2834 store( i, j+SIMDSIZE , load(i,j+SIMDSIZE ) + it.load() ); it += SIMDSIZE;
2835 store( i, j+SIMDSIZE*2UL, load(i,j+SIMDSIZE*2UL) + it.load() ); it += SIMDSIZE;
2836 store( i, j+SIMDSIZE*3UL, load(i,j+SIMDSIZE*3UL) + it.load() ); it += SIMDSIZE;
2838 for( ; j<jpos; j+=SIMDSIZE, it+=SIMDSIZE ) {
2839 store( i, j, load(i,j) + it.load() );
2841 for( ; remainder && j<jend; ++j, ++it ) {
2860 template<
typename Type
2864 template<
typename MT >
2872 const size_t block( BLOCK_SIZE );
2874 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
2875 const size_t iend(
min( m_, ii+block ) );
2876 for(
size_t jj=0UL; jj<
n_; jj+=block )
2881 for(
size_t i=ii; i<iend; ++i )
2888 :(
min( n_, jj+block ) ) );
2891 for(
size_t j=jbegin; j<jend; ++j ) {
2892 v_[i*nn_+j] += (~rhs)(i,j);
2912 template<
typename Type
2916 template<
typename MT >
2922 for(
size_t i=0UL; i<
m_; ++i )
2924 v_[i*nn_+element->index()] += element->value();
2940 template<
typename Type
2944 template<
typename MT >
2952 for(
size_t j=0UL; j<
n_; ++j )
2954 v_[element->index()*nn_+j] += element->value();
2970 template<
typename Type
2974 template<
typename MT >
2981 for(
size_t i=0UL; i<
m_; ++i )
2985 v_[i*nn_+i] -= (~rhs)(i,i);
2999 for( ; (j+2UL) <= jend; j+=2UL ) {
3000 v_[i*nn_+j ] -= (~rhs)(i,j );
3001 v_[i*nn_+j+1UL] -= (~rhs)(i,j+1UL);
3004 v_[i*nn_+j] -= (~rhs)(i,j);
3023 template<
typename Type
3027 template<
typename MT >
3039 for(
size_t i=0UL; i<
m_; ++i )
3049 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
3050 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
3055 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
3056 store( i, j , load(i,j ) - it.load() ); it += SIMDSIZE;
3057 store( i, j+SIMDSIZE , load(i,j+SIMDSIZE ) - it.load() ); it += SIMDSIZE;
3058 store( i, j+SIMDSIZE*2UL, load(i,j+SIMDSIZE*2UL) - it.load() ); it += SIMDSIZE;
3059 store( i, j+SIMDSIZE*3UL, load(i,j+SIMDSIZE*3UL) - it.load() ); it += SIMDSIZE;
3061 for( ; j<jpos; j+=SIMDSIZE, it+=SIMDSIZE ) {
3062 store( i, j, load(i,j) - it.load() );
3064 for( ; remainder && j<jend; ++j, ++it ) {
3083 template<
typename Type
3087 template<
typename MT >
3095 const size_t block( BLOCK_SIZE );
3097 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
3098 const size_t iend(
min( m_, ii+block ) );
3099 for(
size_t jj=0UL; jj<
n_; jj+=block )
3104 for(
size_t i=ii; i<iend; ++i )
3111 :(
min( n_, jj+block ) ) );
3114 for(
size_t j=jbegin; j<jend; ++j ) {
3115 v_[i*nn_+j] -= (~rhs)(i,j);
3135 template<
typename Type
3139 template<
typename MT >
3145 for(
size_t i=0UL; i<
m_; ++i )
3147 v_[i*nn_+element->index()] -= element->value();
3163 template<
typename Type
3167 template<
typename MT >
3175 for(
size_t j=0UL; j<
n_; ++j )
3177 v_[element->index()*nn_+j] -= element->value();
3202 template<
typename Type
3231 template<
typename ET >
3243 enum :
bool { simdEnabled = IsVectorizable<Type>::value };
3249 enum :
bool { smpAssignable = !IsSMPAssignable<Type>::value };
3256 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n );
3257 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n,
size_t mm );
3259 template<
typename Deleter,
typename = EnableIf_< IsClass<Deleter> > >
3260 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n, Deleter d );
3262 template<
typename Deleter >
3263 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n,
size_t mm, Deleter d );
3277 inline Reference operator()(
size_t i,
size_t j ) noexcept;
3278 inline ConstReference operator()(
size_t i,
size_t j ) const noexcept;
3279 inline Reference
at(
size_t i,
size_t j );
3280 inline ConstReference
at(
size_t i,
size_t j ) const;
3281 inline Pointer
data () noexcept;
3282 inline ConstPointer
data () const noexcept;
3283 inline Pointer
data (
size_t j ) noexcept;
3284 inline ConstPointer
data (
size_t j ) const noexcept;
3285 inline Iterator
begin (
size_t j ) noexcept;
3286 inline ConstIterator
begin (
size_t j ) const noexcept;
3287 inline ConstIterator
cbegin(
size_t j ) const noexcept;
3288 inline Iterator
end (
size_t j ) noexcept;
3289 inline ConstIterator
end (
size_t j ) const noexcept;
3290 inline ConstIterator
cend (
size_t j ) const noexcept;
3298 inline
CustomMatrix& operator=( initializer_list< initializer_list<Type> > list );
3300 template< typename Other,
size_t M,
size_t N >
3301 inline
CustomMatrix& operator=( const Other (&array)[M][N] );
3306 template< typename MT,
bool SO > inline
CustomMatrix& operator= ( const Matrix<MT,SO>& rhs );
3307 template< typename MT,
bool SO > inline
CustomMatrix& operator+=( const Matrix<MT,SO>& rhs );
3308 template< typename MT,
bool SO > inline
CustomMatrix& operator-=( const Matrix<MT,SO>& rhs );
3309 template< typename MT,
bool SO > inline
CustomMatrix& operator*=( const Matrix<MT,SO>& rhs );
3311 template< typename Other >
3314 template< typename Other >
3322 inline
size_t rows() const noexcept;
3323 inline
size_t columns() const noexcept;
3324 inline
size_t spacing() const noexcept;
3325 inline
size_t capacity() const noexcept;
3326 inline
size_t capacity(
size_t j ) const noexcept;
3328 inline
size_t nonZeros(
size_t j ) const;
3329 inline
void reset();
3330 inline
void reset(
size_t j );
3331 inline
void clear();
3334 template< typename Other > inline
CustomMatrix& scale( const Other& scalar );
3342 inline
void reset( Type* ptr,
size_t m,
size_t n );
3343 inline
void reset( Type* ptr,
size_t m,
size_t n,
size_t mm );
3345 template< typename Deleter, typename =
EnableIf_< IsClass<Deleter> > >
3346 inline
void reset( Type* ptr,
size_t m,
size_t n, Deleter d );
3348 template< typename Deleter >
3349 inline
void reset( Type* ptr,
size_t m,
size_t n,
size_t mm, Deleter d );
3356 template< typename MT >
3357 struct VectorizedAssign {
3359 simdEnabled && MT::simdEnabled &&
3360 AreSIMDCombinable< Type, ElementType_<MT> >::value };
3366 template<
typename MT >
3367 struct VectorizedAddAssign {
3369 simdEnabled && MT::simdEnabled &&
3370 AreSIMDCombinable< Type, ElementType_<MT> >::value &&
3371 HasSIMDAdd< Type, ElementType_<MT> >::value &&
3372 !IsDiagonal<MT>::value };
3378 template<
typename MT >
3379 struct VectorizedSubAssign {
3381 simdEnabled && MT::simdEnabled &&
3382 AreSIMDCombinable< Type, ElementType_<MT> >::value &&
3383 HasSIMDSub< Type, ElementType_<MT> >::value &&
3384 !IsDiagonal<MT>::value };
3397 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
3398 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
3400 inline bool isAligned () const noexcept;
3412 template< typename MT >
3413 inline
DisableIf_<VectorizedAssign<MT> > assign( const DenseMatrix<MT,true>& rhs );
3415 template< typename MT >
3416 inline
EnableIf_<VectorizedAssign<MT> > assign( const DenseMatrix<MT,true>& rhs );
3418 template< typename MT > inline
void assign( const DenseMatrix<MT,false>& rhs );
3419 template< typename MT > inline
void assign( const SparseMatrix<MT,true>& rhs );
3420 template< typename MT > inline
void assign( const SparseMatrix<MT,false>& rhs );
3422 template< typename MT >
3423 inline
DisableIf_<VectorizedAddAssign<MT> > addAssign( const DenseMatrix<MT,true>& rhs );
3425 template< typename MT >
3426 inline
EnableIf_<VectorizedAddAssign<MT> > addAssign( const DenseMatrix<MT,true>& rhs );
3428 template< typename MT > inline
void addAssign( const DenseMatrix<MT,false>& rhs );
3429 template< typename MT > inline
void addAssign( const SparseMatrix<MT,true>& rhs );
3430 template< typename MT > inline
void addAssign( const SparseMatrix<MT,false>& rhs );
3432 template< typename MT >
3433 inline
DisableIf_<VectorizedSubAssign<MT> > subAssign ( const DenseMatrix<MT,true>& rhs );
3435 template< typename MT >
3436 inline
EnableIf_<VectorizedSubAssign<MT> > subAssign ( const DenseMatrix<MT,true>& rhs );
3438 template< typename MT > inline
void subAssign( const DenseMatrix<MT,false>& rhs );
3439 template< typename MT > inline
void subAssign( const SparseMatrix<MT,true>& rhs );
3440 template< typename MT > inline
void subAssign( const SparseMatrix<MT,false>& rhs );
3451 boost::shared_array<Type>
v_;
3480 template< typename Type
3514 template<
typename Type
3525 if( ptr ==
nullptr ) {
3529 if( AF && ( !
checkAlignment( ptr ) || mm_ % SIMDSIZE != 0UL ) ) {
3533 v_.reset( ptr, NoDelete() );
3562 template<
typename Type
3571 if( ptr ==
nullptr ) {
3575 if( AF && ( !
checkAlignment( ptr ) || mm_ % SIMDSIZE != 0UL ) ) {
3579 if( PF && IsVectorizable<Type>::value && ( mm_ < nextMultiple<size_t>(
m_, SIMDSIZE ) ) ) {
3583 v_.reset( ptr, NoDelete() );
3585 if( PF && IsVectorizable<Type>::value ) {
3586 for(
size_t j=0UL; j<
n_; ++j )
3587 for(
size_t i=
m_; i<mm_; ++i ) {
3588 v_[i+j*mm_] = Type();
3617 template<
typename Type
3620 template<
typename Deleter
3630 if( ptr ==
nullptr ) {
3634 if( AF && ( !
checkAlignment( ptr ) || mm_ % SIMDSIZE != 0UL ) ) {
3666 template<
typename Type
3669 template<
typename Deleter >
3676 if( ptr ==
nullptr ) {
3680 if( AF && ( !
checkAlignment( ptr ) || mm_ % SIMDSIZE != 0UL ) ) {
3684 if( PF && IsVectorizable<Type>::value && ( mm_ < nextMultiple<size_t>(
m_, SIMDSIZE ) ) ) {
3690 if( PF && IsVectorizable<Type>::value ) {
3691 for(
size_t j=0UL; j<
n_; ++j )
3692 for(
size_t i=
m_; i<mm_; ++i ) {
3693 v_[i+j*mm_] = Type();
3710 template<
typename Type
3729 template<
typename Type
3736 , v_ (
std::move( m.v_ ) )
3767 template<
typename Type
3792 template<
typename Type
3818 template<
typename Type
3830 return (*
this)(i,j);
3848 template<
typename Type
3860 return (*
this)(i,j);
3878 template<
typename Type
3881 inline typename CustomMatrix<Type,AF,PF,true>::Pointer
3902 template<
typename Type
3905 inline typename CustomMatrix<Type,AF,PF,true>::ConstPointer
3923 template<
typename Type
3926 inline typename CustomMatrix<Type,AF,PF,true>::Pointer
3930 return v_.get() + j*mm_;
3945 template<
typename Type
3948 inline typename CustomMatrix<Type,AF,PF,true>::ConstPointer
3952 return v_.get() + j*mm_;
3965 template<
typename Type
3972 return Iterator( v_.get() + j*mm_ );
3985 template<
typename Type
4005 template<
typename Type
4025 template<
typename Type
4045 template<
typename Type
4065 template<
typename Type
4093 template<
typename Type
4098 for(
size_t j=0UL; j<
n_; ++j )
4099 for(
size_t i=0UL; i<
m_; ++i )
4137 template<
typename Type
4140 inline CustomMatrix<Type,AF,PF,true>&
4149 for(
const auto& rowList : list ) {
4151 for(
const auto& element : rowList ) {
4152 v_[i+j*mm_] = element;
4155 for( ; j<
n_; ++j ) {
4156 v_[i+j*mm_] = Type();
4197 template<
typename Type
4200 template<
typename Other
4203 inline CustomMatrix<Type,AF,PF,true>&
4206 if( m_ != M || n_ != N ) {
4210 for(
size_t j=0UL; j<N; ++j )
4211 for(
size_t i=0UL; i<M; ++i )
4212 v_[i+j*mm_] = array[i][j];
4231 template<
typename Type
4234 inline CustomMatrix<Type,AF,PF,true>&
4237 if( rhs.rows() != m_ || rhs.columns() !=
n_ ) {
4256 template<
typename Type
4259 inline CustomMatrix<Type,AF,PF,true>&
4265 v_ = std::move( rhs.v_ );
4290 template<
typename Type
4293 template<
typename MT
4295 inline CustomMatrix<Type,AF,PF,true>&
4298 typedef TransExprTrait_<This> TT;
4299 typedef CTransExprTrait_<This> CT;
4300 typedef InvExprTrait_<This> IT;
4302 if( (~rhs).
rows() != m_ || (~rhs).
columns() != n_ ) {
4306 if( IsSame<MT,TT>::value && (~rhs).isAliased(
this ) ) {
4309 else if( IsSame<MT,CT>::value && (~rhs).isAliased(
this ) ) {
4312 else if( !IsSame<MT,IT>::value && (~rhs).canAlias(
this ) ) {
4313 const ResultType_<MT> tmp( ~rhs );
4317 if( IsSparseMatrix<MT>::value )
4339 template<
typename Type
4342 template<
typename MT
4344 inline CustomMatrix<Type,AF,PF,true>&
4347 if( (~rhs).
rows() != m_ || (~rhs).
columns() != n_ ) {
4351 if( (~rhs).canAlias(
this ) ) {
4352 const ResultType_<MT> tmp( ~rhs );
4376 template<
typename Type
4379 template<
typename MT
4381 inline CustomMatrix<Type,AF,PF,true>&
4384 if( (~rhs).
rows() != m_ || (~rhs).
columns() != n_ ) {
4388 if( (~rhs).canAlias(
this ) ) {
4389 const ResultType_<MT> tmp( ~rhs );
4413 template<
typename Type
4416 template<
typename MT
4418 inline CustomMatrix<Type,AF,PF,true>&
4421 if( m_ != n_ || (~rhs).
rows() != m_ || (~rhs).
columns() != n_ ) {
4425 const MultTrait_< ResultType, ResultType_<MT> > tmp( *
this * (~rhs) );
4442 template<
typename Type
4445 template<
typename Other >
4446 inline EnableIf_<IsNumeric<Other>, CustomMatrix<Type,AF,PF,true> >&
4464 template<
typename Type
4467 template<
typename Other >
4468 inline EnableIf_<IsNumeric<Other>, CustomMatrix<Type,AF,PF,true> >&
4494 template<
typename Type
4511 template<
typename Type
4531 template<
typename Type
4548 template<
typename Type
4566 template<
typename Type
4585 template<
typename Type
4590 size_t nonzeros( 0UL );
4592 for(
size_t j=0UL; j<
n_; ++j )
4593 for(
size_t i=0UL; i<
m_; ++i )
4610 template<
typename Type
4617 const size_t iend( j*mm_ + m_ );
4618 size_t nonzeros( 0UL );
4620 for(
size_t i=j*mm_; i<iend; ++i )
4636 template<
typename Type
4643 for(
size_t j=0UL; j<
n_; ++j )
4644 for(
size_t i=0UL; i<
m_; ++i )
4645 clear( v_[i+j*mm_] );
4661 template<
typename Type
4669 for(
size_t i=0UL; i<
m_; ++i )
4670 clear( v_[i+j*mm_] );
4684 template<
typename Type
4707 template<
typename Type
4718 for(
size_t j=1UL; j<
n_; ++j )
4719 for(
size_t i=0UL; i<j; ++i )
4720 swap( v_[i+j*mm_], v_[j+i*mm_] );
4737 template<
typename Type
4746 for(
size_t j=0UL; j<
n_; ++j ) {
4747 for(
size_t i=0UL; i<j; ++i ) {
4748 cswap( v_[i+j*mm_], v_[j+i*mm_] );
4766 template<
typename Type
4769 template<
typename Other >
4770 inline CustomMatrix<Type,AF,PF,true>& CustomMatrix<Type,AF,PF,true>::scale(
const Other& scalar )
4772 for(
size_t j=0UL; j<
n_; ++j )
4773 for(
size_t i=0UL; i<
m_; ++i )
4774 v_[i+j*mm_] *= scalar;
4789 template<
typename Type
4837 template<
typename Type
4844 CustomMatrix tmp( ptr, m, n );
4875 template<
typename Type
4880 CustomMatrix tmp( ptr, m, n, mm );
4911 template<
typename Type
4914 template<
typename Deleter
4920 CustomMatrix tmp( ptr, m, n, d );
4951 template<
typename Type
4954 template<
typename Deleter >
4957 CustomMatrix tmp( ptr, m, n, mm, d );
4983 template<
typename Type
4986 template<
typename Other >
4989 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5006 template<
typename Type
5009 template<
typename Other >
5012 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5028 template<
typename Type
5050 template<
typename Type
5055 return (
rows() *
columns() >= SMP_DMATASSIGN_THRESHOLD );
5076 template<
typename Type
5083 return loada( i, j );
5085 return loadu( i, j );
5106 template<
typename Type
5122 return loada( v_.get()+i+j*mm_ );
5143 template<
typename Type
5157 return loadu( v_.get()+i+j*mm_ );
5179 template<
typename Type
5210 template<
typename Type
5226 storea( v_.get()+i+j*mm_, value );
5248 template<
typename Type
5262 storeu( v_.get()+i+j*mm_, value );
5285 template<
typename Type
5301 stream( v_.get()+i+j*mm_, value );
5319 template<
typename Type
5322 template<
typename MT >
5323 inline DisableIf_<typename CustomMatrix<Type,AF,PF,true>::BLAZE_TEMPLATE VectorizedAssign<MT> >
5324 CustomMatrix<Type,AF,PF,true>::assign(
const DenseMatrix<MT,true>& rhs )
5329 const size_t ipos( m_ &
size_t(-2) );
5332 for(
size_t j=0UL; j<
n_; ++j ) {
5333 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5334 v_[i +j*mm_] = (~rhs)(i ,j);
5335 v_[i+1UL+j*mm_] = (~rhs)(i+1UL,j);
5338 v_[ipos+j*mm_] = (~rhs)(ipos,j);
5358 template<
typename Type
5361 template<
typename MT >
5362 inline EnableIf_<typename CustomMatrix<Type,AF,PF,true>::BLAZE_TEMPLATE VectorizedAssign<MT> >
5363 CustomMatrix<Type,AF,PF,true>::assign(
const DenseMatrix<MT,true>& rhs )
5370 const bool remainder( !PF || !IsPadded<MT>::value );
5372 const size_t ipos( ( remainder )?( m_ &
size_t(-SIMDSIZE) ):( m_ ) );
5373 BLAZE_INTERNAL_ASSERT( !remainder || ( m_ - ( m_ % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5376 ( m_*n_ > (
cacheSize / (
sizeof(Type) * 3UL ) ) ) && !(~rhs).isAliased(
this ) )
5378 for(
size_t j=0UL; j<
n_; ++j )
5382 for( ; i<ipos; i+=SIMDSIZE ) {
5383 stream( i, j, (~rhs).load(i,j) );
5385 for( ; remainder && i<
m_; ++i ) {
5386 v_[i+j*mm_] = (~rhs)(i,j);
5392 for(
size_t j=0UL; j<
n_; ++j )
5395 ConstIterator_<MT> it( (~rhs).
begin(j) );
5397 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
5398 store( i , j, it.load() ); it += SIMDSIZE;
5399 store( i+SIMDSIZE , j, it.load() ); it += SIMDSIZE;
5400 store( i+SIMDSIZE*2UL, j, it.load() ); it += SIMDSIZE;
5401 store( i+SIMDSIZE*3UL, j, it.load() ); it += SIMDSIZE;
5403 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
5404 store( i, j, it.load() );
5406 for( ; remainder && i<
m_; ++i, ++it ) {
5428 template<
typename Type
5431 template<
typename MT >
5432 inline void CustomMatrix<Type,AF,PF,true>::assign(
const DenseMatrix<MT,false>& rhs )
5439 const size_t block( BLOCK_SIZE );
5441 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
5442 const size_t jend(
min( n_, jj+block ) );
5443 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
5444 const size_t iend(
min( m_, ii+block ) );
5445 for(
size_t j=jj; j<jend; ++j ) {
5446 for(
size_t i=ii; i<iend; ++i ) {
5447 v_[i+j*mm_] = (~rhs)(i,j);
5469 template<
typename Type
5472 template<
typename MT >
5473 inline void CustomMatrix<Type,AF,PF,true>::assign(
const SparseMatrix<MT,true>& rhs )
5478 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
5479 for( ConstIterator_<MT> element=(~rhs).begin(j); element!=(~rhs).
end(j); ++element )
5480 v_[element->index()+j*mm_] = element->value();
5498 template<
typename Type
5501 template<
typename MT >
5502 inline void CustomMatrix<Type,AF,PF,true>::assign(
const SparseMatrix<MT,false>& rhs )
5509 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
5510 for( ConstIterator_<MT> element=(~rhs).begin(i); element!=(~rhs).
end(i); ++element )
5511 v_[i+element->index()*mm_] = element->value();
5529 template<
typename Type
5532 template<
typename MT >
5533 inline DisableIf_<typename CustomMatrix<Type,AF,PF,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >
5534 CustomMatrix<Type,AF,PF,true>::addAssign(
const DenseMatrix<MT,true>& rhs )
5539 for(
size_t j=0UL; j<
n_; ++j )
5541 if( IsDiagonal<MT>::value )
5543 v_[j+j*mm_] += (~rhs)(j,j);
5547 const size_t ibegin( ( IsLower<MT>::value )
5548 ?( IsStrictlyLower<MT>::value ? j+1UL : j )
5550 const size_t iend ( ( IsUpper<MT>::value )
5551 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5557 for( ; (i+2UL) <= iend; i+=2UL ) {
5558 v_[i +j*mm_] += (~rhs)(i ,j);
5559 v_[i+1UL+j*mm_] += (~rhs)(i+1UL,j);
5562 v_[i+j*mm_] += (~rhs)(i,j);
5583 template<
typename Type
5586 template<
typename MT >
5587 inline EnableIf_<typename CustomMatrix<Type,AF,PF,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >
5588 CustomMatrix<Type,AF,PF,true>::addAssign(
const DenseMatrix<MT,true>& rhs )
5596 const bool remainder( !PF || !IsPadded<MT>::value );
5598 for(
size_t j=0UL; j<
n_; ++j )
5600 const size_t ibegin( ( IsLower<MT>::value )
5601 ?( ( IsStrictlyLower<MT>::value ? j+1UL : j ) &
size_t(-SIMDSIZE) )
5603 const size_t iend ( ( IsUpper<MT>::value )
5604 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5608 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5609 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5612 ConstIterator_<MT> it( (~rhs).
begin(j) + ibegin );
5614 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
5615 store( i , j, load(i ,j) + it.load() ); it += SIMDSIZE;
5616 store( i+SIMDSIZE , j, load(i+SIMDSIZE ,j) + it.load() ); it += SIMDSIZE;
5617 store( i+SIMDSIZE*2UL, j, load(i+SIMDSIZE*2UL,j) + it.load() ); it += SIMDSIZE;
5618 store( i+SIMDSIZE*3UL, j, load(i+SIMDSIZE*3UL,j) + it.load() ); it += SIMDSIZE;
5620 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
5621 store( i, j, load(i,j) + it.load() );
5623 for( ; remainder && i<iend; ++i, ++it ) {
5644 template<
typename Type
5647 template<
typename MT >
5648 inline void CustomMatrix<Type,AF,PF,true>::addAssign(
const DenseMatrix<MT,false>& rhs )
5655 const size_t block( BLOCK_SIZE );
5657 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
5658 const size_t jend(
min( n_, jj+block ) );
5659 for(
size_t ii=0UL; ii<
m_; ii+=block )
5661 if( IsLower<MT>::value && ii < jj )
continue;
5662 if( IsUpper<MT>::value && ii > jj )
break;
5664 for(
size_t j=jj; j<jend; ++j )
5666 const size_t ibegin( ( IsLower<MT>::value )
5667 ?(
max( ( IsStrictlyLower<MT>::value ? j+1UL : j ), ii ) )
5669 const size_t iend ( ( IsUpper<MT>::value )
5670 ?(
min( ( IsStrictlyUpper<MT>::value ? j : j+1UL ), m_, ii+block ) )
5671 :(
min( m_, ii+block ) ) );
5674 for(
size_t i=ibegin; i<iend; ++i ) {
5675 v_[i+j*mm_] += (~rhs)(i,j);
5697 template<
typename Type
5700 template<
typename MT >
5701 inline void CustomMatrix<Type,AF,PF,true>::addAssign(
const SparseMatrix<MT,true>& rhs )
5706 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
5707 for( ConstIterator_<MT> element=(~rhs).begin(j); element!=(~rhs).
end(j); ++element )
5708 v_[element->index()+j*mm_] += element->value();
5726 template<
typename Type
5729 template<
typename MT >
5730 inline void CustomMatrix<Type,AF,PF,true>::addAssign(
const SparseMatrix<MT,false>& rhs )
5737 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
5738 for( ConstIterator_<MT> element=(~rhs).begin(i); element!=(~rhs).
end(i); ++element )
5739 v_[i+element->index()*mm_] += element->value();
5757 template<
typename Type
5760 template<
typename MT >
5761 inline DisableIf_<typename CustomMatrix<Type,AF,PF,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >
5762 CustomMatrix<Type,AF,PF,true>::subAssign(
const DenseMatrix<MT,true>& rhs )
5767 for(
size_t j=0UL; j<
n_; ++j )
5769 if( IsDiagonal<MT>::value )
5771 v_[j+j*mm_] -= (~rhs)(j,j);
5775 const size_t ibegin( ( IsLower<MT>::value )
5776 ?( IsStrictlyLower<MT>::value ? j+1UL : j )
5778 const size_t iend ( ( IsUpper<MT>::value )
5779 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5785 for( ; (i+2UL) <= iend; i+=2UL ) {
5786 v_[i +j*mm_] -= (~rhs)(i ,j);
5787 v_[i+1+j*mm_] -= (~rhs)(i+1,j);
5790 v_[i+j*mm_] -= (~rhs)(i,j);
5812 template<
typename Type
5815 template<
typename MT >
5816 inline EnableIf_<typename CustomMatrix<Type,AF,PF,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >
5817 CustomMatrix<Type,AF,PF,true>::subAssign(
const DenseMatrix<MT,true>& rhs )
5825 const bool remainder( !PF || !IsPadded<MT>::value );
5827 for(
size_t j=0UL; j<
n_; ++j )
5829 const size_t ibegin( ( IsLower<MT>::value )
5830 ?( ( IsStrictlyLower<MT>::value ? j+1UL : j ) &
size_t(-SIMDSIZE) )
5832 const size_t iend ( ( IsUpper<MT>::value )
5833 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5837 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5838 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5841 ConstIterator_<MT> it( (~rhs).
begin(j) + ibegin );
5843 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
5844 store( i , j, load(i ,j) - it.load() ); it += SIMDSIZE;
5845 store( i+SIMDSIZE , j, load(i+SIMDSIZE ,j) - it.load() ); it += SIMDSIZE;
5846 store( i+SIMDSIZE*2UL, j, load(i+SIMDSIZE*2UL,j) - it.load() ); it += SIMDSIZE;
5847 store( i+SIMDSIZE*3UL, j, load(i+SIMDSIZE*3UL,j) - it.load() ); it += SIMDSIZE;
5849 for( ; i<ipos; i+=SIMDSIZE, it+=SIMDSIZE ) {
5850 store( i, j, load(i,j) - it.load() );
5852 for( ; remainder && i<iend; ++i, ++it ) {
5873 template<
typename Type
5876 template<
typename MT >
5877 inline void CustomMatrix<Type,AF,PF,true>::subAssign(
const DenseMatrix<MT,false>& rhs )
5884 const size_t block( BLOCK_SIZE );
5886 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
5887 const size_t jend(
min( n_, jj+block ) );
5888 for(
size_t ii=0UL; ii<
m_; ii+=block )
5890 if( IsLower<MT>::value && ii < jj )
continue;
5891 if( IsUpper<MT>::value && ii > jj )
break;
5893 for(
size_t j=jj; j<jend; ++j )
5895 const size_t ibegin( ( IsLower<MT>::value )
5896 ?(
max( ( IsStrictlyLower<MT>::value ? j+1UL : j ), ii ) )
5898 const size_t iend ( ( IsUpper<MT>::value )
5899 ?(
min( ( IsStrictlyUpper<MT>::value ? j : j+1UL ), m_, ii+block ) )
5900 :(
min( m_, ii+block ) ) );
5903 for(
size_t i=ibegin; i<iend; ++i ) {
5904 v_[i+j*mm_] -= (~rhs)(i,j);
5926 template<
typename Type
5929 template<
typename MT >
5930 inline void CustomMatrix<Type,AF,PF,true>::subAssign(
const SparseMatrix<MT,true>& rhs )
5935 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
5936 for( ConstIterator_<MT> element=(~rhs).begin(j); element!=(~rhs).
end(j); ++element )
5937 v_[element->index()+j*mm_] -= element->value();
5955 template<
typename Type
5958 template<
typename MT >
5959 inline void CustomMatrix<Type,AF,PF,true>::subAssign(
const SparseMatrix<MT,false>& rhs )
5966 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
5967 for( ConstIterator_<MT> element=(~rhs).begin(i); element!=(~rhs).
end(i); ++element )
5968 v_[i+element->index()*mm_] -= element->value();
5989 template<
typename Type,
bool AF,
bool PF,
bool SO >
5990 inline void reset( CustomMatrix<Type,AF,PF,SO>& m );
5992 template<
typename Type,
bool AF,
bool PF,
bool SO >
5993 inline void reset( CustomMatrix<Type,AF,PF,SO>& m,
size_t i );
5995 template<
typename Type,
bool AF,
bool PF,
bool SO >
5996 inline void clear( CustomMatrix<Type,AF,PF,SO>& m );
5998 template<
typename Type,
bool AF,
bool PF,
bool SO >
5999 inline bool isDefault(
const CustomMatrix<Type,AF,PF,SO>& m );
6001 template<
typename Type,
bool AF,
bool PF,
bool SO >
6002 inline bool isIntact(
const CustomMatrix<Type,AF,PF,SO>& m );
6004 template<
typename Type,
bool AF,
bool PF,
bool SO >
6005 inline void swap( CustomMatrix<Type,AF,PF,SO>& a, CustomMatrix<Type,AF,PF,SO>& b ) noexcept;
6017 template<
typename Type
6041 template<
typename Type
6059 template<
typename Type
6091 template<
typename Type
6123 template<
typename Type
6142 template<
typename Type
6163 template<
typename T,
bool AF,
bool PF,
bool SO >
6164 struct HasConstDataAccess< CustomMatrix<T,AF,PF,SO> > :
public TrueType
6180 template<
typename T,
bool AF,
bool PF,
bool SO >
6181 struct HasMutableDataAccess< CustomMatrix<T,AF,PF,SO> > :
public TrueType
6197 template<
typename T,
bool AF,
bool PF,
bool SO >
6198 struct IsCustom< CustomMatrix<T,AF,PF,SO> > :
public TrueType
6214 template<
typename T,
bool PF,
bool SO >
6231 template<
typename T,
bool AF,
bool SO >
6232 struct IsPadded< CustomMatrix<T,AF,
padded,SO> > :
public TrueType
6248 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t M,
size_t N >
6249 struct AddTrait< CustomMatrix<T1,AF,PF,SO>, StaticMatrix<T2,M,N,SO> >
6251 using Type = StaticMatrix< AddTrait_<T1,T2>, M, N, SO >;
6254 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6255 struct AddTrait< CustomMatrix<T1,AF,PF,SO1>, StaticMatrix<T2,M,N,SO2> >
6257 using Type = StaticMatrix< AddTrait_<T1,T2>, M, N,
false >;
6260 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6261 struct AddTrait< StaticMatrix<T1,M,N,SO>, CustomMatrix<T2,AF,PF,SO> >
6263 using Type = StaticMatrix< AddTrait_<T1,T2>, M, N, SO >;
6266 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6267 struct AddTrait< StaticMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6269 using Type = StaticMatrix< AddTrait_<T1,T2>, M, N,
false >;
6272 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t M,
size_t N >
6273 struct AddTrait< CustomMatrix<T1,AF,PF,SO>, HybridMatrix<T2,M,N,SO> >
6275 using Type = HybridMatrix< AddTrait_<T1,T2>, M, N, SO >;
6278 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6279 struct AddTrait< CustomMatrix<T1,AF,PF,SO1>, HybridMatrix<T2,M,N,SO2> >
6281 using Type = HybridMatrix< AddTrait_<T1,T2>, M, N,
false >;
6284 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6285 struct AddTrait< HybridMatrix<T1,M,N,SO>, CustomMatrix<T2,AF,PF,SO> >
6287 using Type = HybridMatrix< AddTrait_<T1,T2>, M, N, SO >;
6290 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6291 struct AddTrait< HybridMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6293 using Type = HybridMatrix< AddTrait_<T1,T2>, M, N,
false >;
6296 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6297 struct AddTrait< CustomMatrix<T1,AF,PF,SO>, DynamicMatrix<T2,SO> >
6299 using Type = DynamicMatrix< AddTrait_<T1,T2>, SO >;
6302 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
bool SO2 >
6303 struct AddTrait< CustomMatrix<T1,AF,PF,SO1>, DynamicMatrix<T2,SO2> >
6305 using Type = DynamicMatrix< AddTrait_<T1,T2>,
false >;
6308 template<
typename T1,
bool SO,
typename T2,
bool AF,
bool PF >
6309 struct AddTrait< DynamicMatrix<T1,SO>, CustomMatrix<T2,AF,PF,SO> >
6311 using Type = DynamicMatrix< AddTrait_<T1,T2>, SO >;
6314 template<
typename T1,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6315 struct AddTrait< DynamicMatrix<T1,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6317 using Type = DynamicMatrix< AddTrait_<T1,T2>,
false >;
6320 template<
typename T1,
bool AF1,
bool PF1,
bool SO,
typename T2,
bool AF2,
bool PF2 >
6321 struct AddTrait< CustomMatrix<T1,AF1,PF1,SO>, CustomMatrix<T2,AF2,PF2,SO> >
6323 using Type = DynamicMatrix< AddTrait_<T1,T2>, SO >;
6326 template<
typename T1,
bool AF1,
bool PF1,
bool SO1,
typename T2,
bool AF2,
bool PF2,
bool SO2 >
6327 struct AddTrait< CustomMatrix<T1,AF1,PF1,SO1>, CustomMatrix<T2,AF2,PF2,SO2> >
6329 using Type = DynamicMatrix< AddTrait_<T1,T2>,
false >;
6345 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t M,
size_t N >
6346 struct SubTrait< CustomMatrix<T1,AF,PF,SO>, StaticMatrix<T2,M,N,SO> >
6348 using Type = StaticMatrix< SubTrait_<T1,T2>, M, N, SO >;
6351 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6352 struct SubTrait< CustomMatrix<T1,AF,PF,SO1>, StaticMatrix<T2,M,N,SO2> >
6354 using Type = StaticMatrix< SubTrait_<T1,T2>, M, N,
false >;
6357 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6358 struct SubTrait< StaticMatrix<T1,M,N,SO>, CustomMatrix<T2,AF,PF,SO> >
6360 using Type = StaticMatrix< SubTrait_<T1,T2>, M, N, SO >;
6363 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6364 struct SubTrait< StaticMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6366 using Type = StaticMatrix< SubTrait_<T1,T2>, M, N,
false >;
6369 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t M,
size_t N >
6370 struct SubTrait< CustomMatrix<T1,AF,PF,SO>, HybridMatrix<T2,M,N,SO> >
6372 using Type = HybridMatrix< SubTrait_<T1,T2>, M, N, SO >;
6375 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6376 struct SubTrait< CustomMatrix<T1,AF,PF,SO1>, HybridMatrix<T2,M,N,SO2> >
6378 using Type = HybridMatrix< SubTrait_<T1,T2>, M, N,
false >;
6381 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6382 struct SubTrait< HybridMatrix<T1,M,N,SO>, CustomMatrix<T2,AF,PF,SO> >
6384 using Type = HybridMatrix< SubTrait_<T1,T2>, M, N, SO >;
6387 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6388 struct SubTrait< HybridMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6390 using Type = HybridMatrix< SubTrait_<T1,T2>, M, N,
false >;
6393 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6394 struct SubTrait< CustomMatrix<T1,AF,PF,SO>, DynamicMatrix<T2,SO> >
6396 using Type = DynamicMatrix< SubTrait_<T1,T2>, SO >;
6399 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
bool SO2 >
6400 struct SubTrait< CustomMatrix<T1,AF,PF,SO1>, DynamicMatrix<T2,SO2> >
6402 using Type = DynamicMatrix< SubTrait_<T1,T2>,
false >;
6405 template<
typename T1,
bool SO,
typename T2,
bool AF,
bool PF >
6406 struct SubTrait< DynamicMatrix<T1,SO>, CustomMatrix<T2,AF,PF,SO> >
6408 using Type = DynamicMatrix< SubTrait_<T1,T2>, SO >;
6411 template<
typename T1,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6412 struct SubTrait< DynamicMatrix<T1,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6414 using Type = DynamicMatrix< SubTrait_<T1,T2>,
false >;
6417 template<
typename T1,
bool AF1,
bool PF1,
bool SO,
typename T2,
bool AF2,
bool PF2 >
6418 struct SubTrait< CustomMatrix<T1,AF1,PF1,SO>, CustomMatrix<T2,AF2,PF2,SO> >
6420 using Type = DynamicMatrix< SubTrait_<T1,T2>, SO >;
6423 template<
typename T1,
bool AF1,
bool PF1,
bool SO1,
typename T2,
bool AF2,
bool PF2,
bool SO2 >
6424 struct SubTrait< CustomMatrix<T1,AF1,PF1,SO1>, CustomMatrix<T2,AF2,PF2,SO2> >
6426 using Type = DynamicMatrix< SubTrait_<T1,T2>,
false >;
6442 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6443 struct MultTrait< CustomMatrix<T1,AF,PF,SO>, T2,
EnableIf_<IsNumeric<T2> > >
6445 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO >;
6448 template<
typename T1,
typename T2,
bool AF,
bool PF,
bool SO >
6449 struct MultTrait< T1, CustomMatrix<T2,AF,PF,SO>,
EnableIf_<IsNumeric<T1> > >
6451 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO >;
6454 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t N >
6455 struct MultTrait< CustomMatrix<T1,AF,PF,SO>, StaticVector<T2,N,false> >
6457 using Type = DynamicVector< MultTrait_<T1,T2>,
false >;
6460 template<
typename T1,
size_t N,
typename T2,
bool AF,
bool PF,
bool SO >
6461 struct MultTrait< StaticVector<T1,N,true>, CustomMatrix<T2,AF,PF,SO> >
6463 using Type = DynamicVector< MultTrait_<T1,T2>,
true >;
6466 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t N >
6467 struct MultTrait< CustomMatrix<T1,AF,PF,SO>, HybridVector<T2,N,false> >
6469 using Type = DynamicVector< MultTrait_<T1,T2>,
false >;
6472 template<
typename T1,
size_t N,
typename T2,
bool AF,
bool PF,
bool SO >
6473 struct MultTrait< HybridVector<T1,N,true>, CustomMatrix<T2,AF,PF,SO> >
6475 using Type = DynamicVector< MultTrait_<T1,T2>,
true >;
6478 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6479 struct MultTrait< CustomMatrix<T1,AF,PF,SO>, DynamicVector<T2,false> >
6481 using Type = DynamicVector< MultTrait_<T1,T2>,
false >;
6484 template<
typename T1,
typename T2,
bool AF,
bool PF,
bool SO >
6485 struct MultTrait< DynamicVector<T1,true>, CustomMatrix<T2,AF,PF,SO> >
6487 using Type = DynamicVector< MultTrait_<T1,T2>,
true >;
6490 template<
typename T1,
bool AF1,
bool PF1,
bool SO,
typename T2,
bool AF2,
bool PF2 >
6491 struct MultTrait< CustomMatrix<T1,AF1,PF1,SO>, CustomVector<T2,AF2,PF2,false> >
6493 using Type = DynamicVector< MultTrait_<T1,T2>,
false >;
6496 template<
typename T1,
bool AF1,
bool PF1,
typename T2,
bool AF2,
bool PF2,
bool SO >
6497 struct MultTrait< CustomVector<T1,AF1,PF1,true>, CustomMatrix<T2,AF2,PF2,SO> >
6499 using Type = DynamicVector< MultTrait_<T1,T2>,
true >;
6502 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6503 struct MultTrait< CustomMatrix<T1,AF,PF,SO>, CompressedVector<T2,false> >
6505 using Type = DynamicVector< MultTrait_<T1,T2>,
false >;
6508 template<
typename T1,
typename T2,
bool AF,
bool PF,
bool SO >
6509 struct MultTrait< CompressedVector<T1,true>, CustomMatrix<T2,AF,PF,SO> >
6511 using Type = DynamicVector< MultTrait_<T1,T2>,
true >;
6514 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6515 struct MultTrait< CustomMatrix<T1,AF,PF,SO1>, StaticMatrix<T2,M,N,SO2> >
6517 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO1 >;
6520 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6521 struct MultTrait< StaticMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6523 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO1 >;
6526 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6527 struct MultTrait< CustomMatrix<T1,AF,PF,SO1>, HybridMatrix<T2,M,N,SO2> >
6529 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO1 >;
6532 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6533 struct MultTrait< HybridMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6535 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO1 >;
6538 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
bool SO2 >
6539 struct MultTrait< CustomMatrix<T1,AF,PF,SO1>, DynamicMatrix<T2,SO2> >
6541 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO1 >;
6544 template<
typename T1,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6545 struct MultTrait< DynamicMatrix<T1,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6547 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO1 >;
6550 template<
typename T1,
bool AF1,
bool PF1,
bool SO1,
typename T2,
bool AF2,
bool PF2,
bool SO2 >
6551 struct MultTrait< CustomMatrix<T1,AF1,PF1,SO1>, CustomMatrix<T2,AF2,PF2,SO2> >
6553 using Type = DynamicMatrix< MultTrait_<T1,T2>, SO1 >;
6569 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6570 struct DivTrait< CustomMatrix<T1,AF,PF,SO>, T2,
EnableIf_<IsNumeric<T2> > >
6572 using Type = DynamicMatrix< DivTrait_<T1,T2>, SO >;
6588 template<
typename T1,
bool AF,
bool PF,
bool SO >
6589 struct SubmatrixTrait< CustomMatrix<T1,AF,PF,SO> >
6591 using Type = DynamicMatrix<T1,SO>;
6607 template<
typename T1,
bool AF,
bool PF,
bool SO >
6608 struct RowTrait< CustomMatrix<T1,AF,PF,SO> >
6610 using Type = DynamicVector<T1,true>;
6626 template<
typename T1,
bool AF,
bool PF,
bool SO >
6627 struct ColumnTrait< CustomMatrix<T1,AF,PF,SO> >
6629 using Type = DynamicVector<T1,false>;
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:685
CustomMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: CustomMatrix.h:1975
Header file for auxiliary alias declarations.
DenseMatrix< This, SO > BaseType
Base type of this CustomMatrix instance.
Definition: CustomMatrix.h:441
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:2408
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
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the AlignmentOf type trait.
Header file for the alignment flag values.
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
size_t spacing() const noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: CustomMatrix.h:1766
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:442
Header file for the row trait.
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
Header file for the IsSparseMatrix type trait.
Header file for the IsDiagonal type trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
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
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
const bool aligned
Alignment flag for aligned vectors and matrices.Via this flag it is possible to specify subvectors...
Definition: AlignmentFlag.h:85
Header file for the IsSame and IsStrictlySame type traits.
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:188
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:1351
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
size_t m_
The current number of rows of the sparse matrix.
Definition: CompressedMatrix.h:2805
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: CustomMatrix.h:1822
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1669
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:590
Reference operator()(size_t i, size_t j) noexcept
2D-access to the matrix elements.
Definition: CustomMatrix.h:1008
CustomMatrix & transpose()
In-place transpose of the matrix.
Definition: CustomMatrix.h:1946
#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:687
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
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
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:2335
System settings for performance optimizations.
Efficient implementation of a dynamic matrix.The DynamicMatrix class template is the representation ...
Definition: DynamicMatrix.h:203
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
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: CustomMatrix.h:2215
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:1716
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:2025
DynamicMatrix< Type,!SO > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CustomMatrix.h:443
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:109
Header file for the NoDelete policy classes.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Constraint on the data type.
bool isAligned() const noexcept
Returns whether the matrix is properly aligned in memory.
Definition: CustomMatrix.h:2257
Header file for the std::initializer_list aliases.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CustomMatrix.h:451
Header file for the SparseMatrix base class.
Type * Pointer
Pointer to a non-constant matrix value.
Definition: CustomMatrix.h:452
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:2514
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:1876
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:5148
constexpr bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Optimizations.h:68
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: CustomMatrix.h:1729
Pointer data() noexcept
Low-level data access to the matrix elements.
Definition: CustomMatrix.h:1116
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
#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
const bool padded
Padding flag for padded vectors and matrices.Via this flag it is possible to specify custom vectors a...
Definition: PaddingFlag.h:86
#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.
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:1057
Iterator end(size_t i) noexcept
Returns an iterator just past the last element of row/column i.
Definition: CustomMatrix.h:1277
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 size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:330
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:80
Header file for the default storage order for all vectors of the Blaze library.
size_t n_
The current number of columns of the matrix.
Definition: CustomMatrix.h:686
#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
Compile time type check.The IsClass type trait tests whether or not the given template parameter is a...
Definition: IsClass.h:77
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:254
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2645
Rebind mechanism to obtain a CustomMatrix with different data/element type.
Definition: CustomMatrix.h:463
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:446
DenseIterator< Type, AF > Iterator
Iterator over non-constant elements.
Definition: CustomMatrix.h:455
Header file for the IsVectorizable type trait.
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: CustomMatrix.h:2237
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:76
Header file for the HasConstDataAccess type trait.
CustomMatrix< Type, AF, PF, SO > This
Type of this CustomMatrix instance.
Definition: CustomMatrix.h:440
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
BLAZE_ALWAYS_INLINE SIMDType load(size_t i, size_t j) const noexcept
Load of a SIMD element of the matrix.
Definition: CustomMatrix.h:2305
#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:688
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.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CustomMatrix.h:447
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:2439
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:1924
Type & Reference
Reference to a non-constant matrix value.
Definition: CustomMatrix.h:450
const This & CompositeType
Data type for composite expression templates.
Definition: CustomMatrix.h:448
Header file for the cache size of the target architecture.
size_t capacity() const noexcept
Returns the maximum capacity of the matrix.
Definition: CustomMatrix.h:1782
#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
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2646
Header file for the column trait.
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:258
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:89
Constraint on the data type.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: CustomMatrix.h:1745
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< ET, AF, PF, SO > Other
The type of the other CustomMatrix.
Definition: CustomMatrix.h:464
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
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
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:314
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
size_t n_
The current number of columns of the sparse matrix.
Definition: CompressedMatrix.h:2806
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:2372
Header file for the AreSIMDCombinable type trait.
CustomMatrix()
The default constructor for CustomMatrix.
Definition: CustomMatrix.h:728
DynamicMatrix< Type,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: CustomMatrix.h:444
bool canSMPAssign() const noexcept
Returns whether the matrix can be used in SMP assignments.
Definition: CustomMatrix.h:2278
Initializer list type of the Blaze library.
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: CustomMatrix.h:453
Efficient implementation of a customizable matrix.The CustomMatrix class template provides the functi...
Definition: CustomMatrix.h:436
Header file for the alignment check function.
DenseIterator< const Type, AF > ConstIterator
Iterator over constant elements.
Definition: CustomMatrix.h:456
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:2477
ConstIterator cbegin(size_t i) const noexcept
Returns an iterator to the first element of row/column i.
Definition: CustomMatrix.h:1253
Iterator begin(size_t i) noexcept
Returns an iterator to the first element of row/column i.
Definition: CustomMatrix.h:1205
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
Compile time check for sparse matrix types.This type trait tests whether or not the given template pa...
Definition: IsSparseMatrix.h:78
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2644
#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
Rebind mechanism to obtain a CompressedMatrix with different data/element type.
Definition: CompressedMatrix.h:2654
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:445
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.
Header file for the IsClass type trait.
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:564
ConstIterator cend(size_t i) const noexcept
Returns an iterator just past the last element of row/column i.
Definition: CustomMatrix.h:1325
constexpr bool defaultStorageOrder
The default storage order for all matrices of the Blaze library.This value specifies the default stor...
Definition: StorageOrder.h:56