35 #ifndef _BLAZE_MATH_DENSE_CUSTOMMATRIX_H_
36 #define _BLAZE_MATH_DENSE_CUSTOMMATRIX_H_
44 #include <boost/smart_ptr/shared_array.hpp>
424 template<
typename Type
458 template<
typename ET >
483 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n );
484 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n,
size_t nn );
486 template<
typename Deleter >
487 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n, Deleter D );
489 template<
typename Deleter >
490 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n,
size_t nn, Deleter D );
503 inline Reference
operator()(
size_t i,
size_t j );
504 inline ConstReference
operator()(
size_t i,
size_t j )
const;
505 inline Reference
at(
size_t i,
size_t j );
506 inline ConstReference
at(
size_t i,
size_t j )
const;
507 inline Pointer
data ();
508 inline ConstPointer
data ()
const;
509 inline Pointer
data (
size_t i );
510 inline ConstPointer
data (
size_t i )
const;
511 inline Iterator
begin (
size_t i );
512 inline ConstIterator
begin (
size_t i )
const;
513 inline ConstIterator
cbegin(
size_t i )
const;
514 inline Iterator
end (
size_t i );
515 inline ConstIterator
end (
size_t i )
const;
516 inline ConstIterator
cend (
size_t i )
const;
523 template<
typename Other,
size_t M,
size_t N >
524 inline CustomMatrix& operator=(
const Other (&array)[M][N] );
528 template<
typename MT,
bool SO2 >
inline CustomMatrix& operator= (
const Matrix<MT,SO2>& rhs );
529 template<
typename MT,
bool SO2 >
inline CustomMatrix& operator+=(
const Matrix<MT,SO2>& rhs );
530 template<
typename MT,
bool SO2 >
inline CustomMatrix& operator-=(
const Matrix<MT,SO2>& rhs );
531 template<
typename MT,
bool SO2 >
inline CustomMatrix& operator*=(
const Matrix<MT,SO2>& rhs );
533 template<
typename Other >
534 inline typename EnableIf< IsNumeric<Other>,
CustomMatrix >::Type&
535 operator*=( Other rhs );
537 template<
typename Other >
538 inline typename EnableIf< IsNumeric<Other>,
CustomMatrix >::Type&
539 operator/=( Other rhs );
546 inline size_t rows()
const;
550 inline size_t capacity(
size_t i )
const;
552 inline size_t nonZeros(
size_t i )
const;
554 inline void reset(
size_t i );
558 template<
typename Other >
inline CustomMatrix& scale(
const Other& scalar );
566 inline void reset( Type* ptr,
size_t m,
size_t n );
567 inline void reset( Type* ptr,
size_t m,
size_t n,
size_t nn );
568 template<
typename Deleter >
inline void reset( Type* ptr,
size_t m,
size_t n, Deleter d );
569 template<
typename Deleter >
inline void reset( Type* ptr,
size_t m,
size_t n,
size_t nn, Deleter d );
576 template<
typename MT >
578 struct VectorizedAssign {
580 vectorizable && MT::vectorizable &&
581 IsSame<Type,typename MT::ElementType>::value };
588 template<
typename MT >
590 struct VectorizedAddAssign {
592 vectorizable && MT::vectorizable &&
593 IsSame<Type,typename MT::ElementType>::value &&
594 IntrinsicTrait<Type>::addition &&
595 !IsDiagonal<MT>::value };
602 template<
typename MT >
604 struct VectorizedSubAssign {
606 vectorizable && MT::vectorizable &&
607 IsSame<Type,typename MT::ElementType>::value &&
608 IntrinsicTrait<Type>::subtraction &&
609 !IsDiagonal<MT>::value };
618 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
619 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
633 template<
typename MT >
634 inline typename DisableIf< VectorizedAssign<MT> >::Type
635 assign(
const DenseMatrix<MT,SO>& rhs );
637 template<
typename MT >
638 inline typename EnableIf< VectorizedAssign<MT> >::Type
639 assign(
const DenseMatrix<MT,SO>& rhs );
641 template<
typename MT >
inline void assign(
const DenseMatrix<MT,!SO>& rhs );
642 template<
typename MT >
inline void assign(
const SparseMatrix<MT,SO>& rhs );
643 template<
typename MT >
inline void assign(
const SparseMatrix<MT,!SO>& rhs );
645 template<
typename MT >
646 inline typename DisableIf< VectorizedAddAssign<MT> >::Type
647 addAssign(
const DenseMatrix<MT,SO>& rhs );
649 template<
typename MT >
650 inline typename EnableIf< VectorizedAddAssign<MT> >::Type
651 addAssign(
const DenseMatrix<MT,SO>& rhs );
653 template<
typename MT >
inline void addAssign(
const DenseMatrix<MT,!SO>& rhs );
654 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,SO>& rhs );
655 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,!SO>& rhs );
657 template<
typename MT >
658 inline typename DisableIf< VectorizedSubAssign<MT> >::Type
659 subAssign(
const DenseMatrix<MT,SO>& rhs );
661 template<
typename MT >
662 inline typename EnableIf< VectorizedSubAssign<MT> >::Type
663 subAssign(
const DenseMatrix<MT,SO>& rhs );
665 template<
typename MT >
inline void subAssign(
const DenseMatrix<MT,!SO>& rhs );
666 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,SO>& rhs );
667 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,!SO>& rhs );
675 template<
typename Arg >
676 inline typename DisableIf< IsClass<Arg> >::Type
677 construct( Type* ptr,
size_t m,
size_t n, Arg arg );
679 template<
typename Arg >
680 inline typename EnableIf< IsClass<Arg> >::Type
681 construct( Type* ptr,
size_t m,
size_t n, Arg arg );
691 boost::shared_array<Type>
v_;
727 template<
typename Type
760 template<
typename Type
807 template<
typename Type
832 for(
size_t i=0UL; i<
m_; ++i ) {
833 for(
size_t j=
n_; j<
nn_; ++j )
834 v_[i*nn_+j] = Type();
861 template<
typename Type
865 template<
typename Deleter >
872 construct( ptr, m, n, d );
898 template<
typename Type
902 template<
typename Deleter >
924 for(
size_t i=0UL; i<
m_; ++i ) {
925 for(
size_t j=
n_; j<
nn_; ++j )
926 v_[i*nn_+j] = Type();
940 template<
typename Type
971 template<
typename Type
995 template<
typename Type
1020 template<
typename Type
1033 return (*
this)(i,j);
1049 template<
typename Type
1062 return (*
this)(i,j);
1079 template<
typename Type
1102 template<
typename Type
1121 template<
typename Type
1129 return v_.get() + i*nn_;
1142 template<
typename Type
1150 return v_.get() + i*nn_;
1166 template<
typename Type
1174 return Iterator( v_.get() + i*nn_ );
1190 template<
typename Type
1214 template<
typename Type
1238 template<
typename Type
1262 template<
typename Type
1286 template<
typename Type
1336 template<
typename Type
1340 template<
typename Other
1345 if(
m_ != M ||
n_ != N ) {
1349 for(
size_t i=0UL; i<M; ++i )
1350 for(
size_t j=0UL; j<N; ++j )
1351 v_[i*nn_+j] = array[i][j];
1364 template<
typename Type
1370 for(
size_t i=0UL; i<
m_; ++i )
1371 for(
size_t j=0UL; j<
n_; ++j )
1389 template<
typename Type
1416 template<
typename Type
1420 template<
typename MT
1428 if( (~rhs).canAlias(
this ) ) {
1453 template<
typename Type
1457 template<
typename MT
1465 if( (~rhs).canAlias(
this ) ) {
1488 template<
typename Type
1492 template<
typename MT
1500 if( (~rhs).canAlias(
this ) ) {
1523 template<
typename Type
1527 template<
typename MT
1550 template<
typename Type
1554 template<
typename Other >
1571 template<
typename Type
1575 template<
typename Other >
1600 template<
typename Type
1616 template<
typename Type
1637 template<
typename Type
1653 template<
typename Type
1675 template<
typename Type
1693 template<
typename Type
1699 size_t nonzeros( 0UL );
1701 for(
size_t i=0UL; i<
m_; ++i )
1702 for(
size_t j=0UL; j<
n_; ++j )
1722 template<
typename Type
1730 const size_t jend( i*nn_ +
n_ );
1731 size_t nonzeros( 0UL );
1733 for(
size_t j=i*nn_; j<jend; ++j )
1747 template<
typename Type
1755 for(
size_t i=0UL; i<
m_; ++i )
1756 for(
size_t j=0UL; j<
n_; ++j )
1757 clear( v_[i*nn_+j] );
1773 template<
typename Type
1782 for(
size_t j=0UL; j<
n_; ++j )
1783 clear( v_[i*nn_+j] );
1795 template<
typename Type
1817 template<
typename Type
1829 for(
size_t i=1UL; i<
m_; ++i )
1830 for(
size_t j=0UL; j<i; ++j )
1831 swap( v_[i*nn_+j], v_[j*nn_+i] );
1846 template<
typename Type
1856 for(
size_t i=0UL; i<
m_; ++i ) {
1857 for(
size_t j=0UL; j<i; ++j ) {
1858 cswap( v_[i*nn_+j], v_[j*nn_+i] );
1874 template<
typename Type
1878 template<
typename Other >
1881 for(
size_t i=0UL; i<
m_; ++i )
1882 for(
size_t j=0UL; j<
n_; ++j )
1883 v_[i*nn_+j] *= scalar;
1897 template<
typename Type
1944 template<
typename Type
1981 template<
typename Type
2016 template<
typename Type
2020 template<
typename Deleter >
2054 template<
typename Type
2058 template<
typename Deleter >
2085 template<
typename Type
2089 template<
typename Other >
2092 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2107 template<
typename Type
2111 template<
typename Other >
2114 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2128 template<
typename Type
2149 template<
typename Type
2155 return (
rows() > SMP_DMATASSIGN_THRESHOLD );
2175 template<
typename Type
2183 return loada( i, j );
2185 return loadu( i, j );
2205 template<
typename Type
2222 return loada( v_.get()+i*nn_+j );
2242 template<
typename Type
2257 return loadu( v_.get()+i*nn_+j );
2278 template<
typename Type
2309 template<
typename Type
2326 storea( v_.get()+i*nn_+j, value );
2347 template<
typename Type
2362 storeu( v_.get()+i*nn_+j, value );
2383 template<
typename Type
2400 stream( v_.get()+i*nn_+j, value );
2416 template<
typename Type
2420 template<
typename MT >
2427 const size_t jpos(
n_ &
size_t(-2) );
2430 for(
size_t i=0UL; i<
m_; ++i ) {
2431 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2432 v_[i*nn_+j ] = (~rhs)(i,j );
2433 v_[i*nn_+j+1UL] = (~rhs)(i,j+1UL);
2436 v_[i*nn_+jpos] = (~rhs)(i,jpos);
2454 template<
typename Type
2458 template<
typename MT >
2469 const size_t jpos( ( remainder )?(
n_ &
size_t(-
IT::size) ):(
n_ ) );
2473 (
m_*
n_ > (
cacheSize / (
sizeof(Type) * 3UL ) ) ) && !(~rhs).isAliased(
this ) )
2475 for(
size_t i=0UL; i<
m_; ++i )
2480 stream( i, j, (~rhs).load(i,j) );
2482 for( ; remainder && j<
n_; ++j ) {
2483 v_[i*nn_+j] = (~rhs)(i,j);
2489 for(
size_t i=0UL; i<
m_; ++i )
2495 store( i, j , it.load() ); it +=
IT::size;
2501 store( i, j, it.load() );
2503 for( ; remainder && j<
n_; ++j, ++it ) {
2523 template<
typename Type
2527 template<
typename MT >
2535 const size_t block( BLOCK_SIZE );
2537 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
2538 const size_t iend(
min( m_, ii+block ) );
2539 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
2540 const size_t jend(
min( n_, jj+block ) );
2541 for(
size_t i=ii; i<iend; ++i ) {
2542 for(
size_t j=jj; j<jend; ++j ) {
2543 v_[i*nn_+j] = (~rhs)(i,j);
2563 template<
typename Type
2567 template<
typename MT >
2573 for(
size_t i=0UL; i<
m_; ++i )
2575 v_[i*nn_+element->index()] = element->value();
2591 template<
typename Type
2595 template<
typename MT >
2603 for(
size_t j=0UL; j<
n_; ++j )
2605 v_[element->index()*nn_+j] = element->value();
2621 template<
typename Type
2625 template<
typename MT >
2632 for(
size_t i=0UL; i<
m_; ++i )
2636 v_[i*nn_+i] += (~rhs)(i,i);
2650 for( ; (j+2UL) <= jend; j+=2UL ) {
2651 v_[i*nn_+j ] += (~rhs)(i,j );
2652 v_[i*nn_+j+1UL] += (~rhs)(i,j+1UL);
2655 v_[i*nn_+j] += (~rhs)(i,j);
2674 template<
typename Type
2678 template<
typename MT >
2690 for(
size_t i=0UL; i<
m_; ++i )
2700 const size_t jpos( ( remainder )?( jend &
size_t(-
IT::size) ):( jend ) );
2707 store( i, j , load(i,j ) + it.load() ); it +=
IT::size;
2713 store( i, j, load(i,j) + it.load() );
2715 for( ; remainder && j<jend; ++j, ++it ) {
2734 template<
typename Type
2738 template<
typename MT >
2746 const size_t block( BLOCK_SIZE );
2748 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
2749 const size_t iend(
min( m_, ii+block ) );
2750 for(
size_t jj=0UL; jj<
n_; jj+=block )
2755 for(
size_t i=ii; i<iend; ++i )
2762 :(
min( n_, jj+block ) ) );
2765 for(
size_t j=jbegin; j<jend; ++j ) {
2766 v_[i*nn_+j] += (~rhs)(i,j);
2786 template<
typename Type
2790 template<
typename MT >
2796 for(
size_t i=0UL; i<
m_; ++i )
2798 v_[i*nn_+element->index()] += element->value();
2814 template<
typename Type
2818 template<
typename MT >
2826 for(
size_t j=0UL; j<
n_; ++j )
2828 v_[element->index()*nn_+j] += element->value();
2844 template<
typename Type
2848 template<
typename MT >
2855 for(
size_t i=0UL; i<
m_; ++i )
2859 v_[i*nn_+i] -= (~rhs)(i,i);
2873 for( ; (j+2UL) <= jend; j+=2UL ) {
2874 v_[i*nn_+j ] -= (~rhs)(i,j );
2875 v_[i*nn_+j+1UL] -= (~rhs)(i,j+1UL);
2878 v_[i*nn_+j] -= (~rhs)(i,j);
2897 template<
typename Type
2901 template<
typename MT >
2913 for(
size_t i=0UL; i<
m_; ++i )
2923 const size_t jpos( ( remainder )?( jend &
size_t(-
IT::size) ):( jend ) );
2930 store( i, j , load(i,j ) - it.load() ); it +=
IT::size;
2936 store( i, j, load(i,j) - it.load() );
2938 for( ; remainder && j<jend; ++j, ++it ) {
2957 template<
typename Type
2961 template<
typename MT >
2969 const size_t block( BLOCK_SIZE );
2971 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
2972 const size_t iend(
min( m_, ii+block ) );
2973 for(
size_t jj=0UL; jj<
n_; jj+=block )
2978 for(
size_t i=ii; i<iend; ++i )
2985 :(
min( n_, jj+block ) ) );
2988 for(
size_t j=jbegin; j<jend; ++j ) {
2989 v_[i*nn_+j] -= (~rhs)(i,j);
3009 template<
typename Type
3013 template<
typename MT >
3019 for(
size_t i=0UL; i<
m_; ++i )
3021 v_[i*nn_+element->index()] -= element->value();
3037 template<
typename Type
3041 template<
typename MT >
3049 for(
size_t j=0UL; j<
n_; ++j )
3051 v_[element->index()*nn_+j] -= element->value();
3075 template<
typename Type
3079 template<
typename Arg >
3112 template<
typename Type
3116 template<
typename Arg >
3133 v_.reset( ptr, arg );
3158 template<
typename Type
3191 template<
typename ET >
3203 enum { vectorizable = IsVectorizable<Type>::value };
3209 enum { smpAssignable = !IsSMPAssignable<Type>::value };
3216 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n );
3217 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n,
size_t mm );
3219 template<
typename Deleter >
3220 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n, Deleter D );
3222 template<
typename Deleter >
3223 explicit inline CustomMatrix( Type* ptr,
size_t m,
size_t n,
size_t mm, Deleter D );
3236 inline Reference
operator()(
size_t i,
size_t j );
3237 inline ConstReference
operator()(
size_t i,
size_t j )
const;
3238 inline Reference
at(
size_t i,
size_t j );
3239 inline ConstReference
at(
size_t i,
size_t j )
const;
3240 inline Pointer
data ();
3241 inline ConstPointer
data ()
const;
3242 inline Pointer
data (
size_t j );
3243 inline ConstPointer
data (
size_t j )
const;
3244 inline Iterator
begin (
size_t j );
3245 inline ConstIterator
begin (
size_t j )
const;
3246 inline ConstIterator
cbegin(
size_t j )
const;
3247 inline Iterator
end (
size_t j );
3248 inline ConstIterator
end (
size_t j )
const;
3249 inline ConstIterator
cend (
size_t j )
const;
3256 template<
typename Other,
size_t M,
size_t N >
3257 inline CustomMatrix& operator=(
const Other (&array)[M][N] );
3261 template<
typename MT,
bool SO >
inline CustomMatrix& operator= (
const Matrix<MT,SO>& rhs );
3262 template<
typename MT,
bool SO >
inline CustomMatrix& operator+=(
const Matrix<MT,SO>& rhs );
3263 template<
typename MT,
bool SO >
inline CustomMatrix& operator-=(
const Matrix<MT,SO>& rhs );
3264 template<
typename MT,
bool SO >
inline CustomMatrix& operator*=(
const Matrix<MT,SO>& rhs );
3266 template<
typename Other >
3267 inline typename EnableIf< IsNumeric<Other>,
CustomMatrix >::Type&
3268 operator*=( Other rhs );
3270 template<
typename Other >
3271 inline typename EnableIf< IsNumeric<Other>,
CustomMatrix >::Type&
3272 operator/=( Other rhs );
3279 inline size_t rows()
const;
3280 inline size_t columns()
const;
3281 inline size_t spacing()
const;
3283 inline size_t capacity(
size_t j )
const;
3285 inline size_t nonZeros(
size_t j )
const;
3286 inline void reset();
3287 inline void reset(
size_t j );
3288 inline void clear();
3291 template<
typename Other >
inline CustomMatrix& scale(
const Other& scalar );
3299 inline void reset( Type* ptr,
size_t m,
size_t n );
3300 inline void reset( Type* ptr,
size_t m,
size_t n,
size_t mm );
3301 template<
typename Deleter >
inline void reset( Type* ptr,
size_t m,
size_t n, Deleter d );
3302 template<
typename Deleter >
inline void reset( Type* ptr,
size_t m,
size_t n,
size_t mm, Deleter d );
3309 template<
typename MT >
3310 struct VectorizedAssign {
3312 vectorizable && MT::vectorizable &&
3313 IsSame<Type,typename MT::ElementType>::value };
3319 template<
typename MT >
3320 struct VectorizedAddAssign {
3322 vectorizable && MT::vectorizable &&
3323 IsSame<Type,typename MT::ElementType>::value &&
3324 IntrinsicTrait<Type>::addition &&
3325 !IsDiagonal<MT>::value };
3331 template<
typename MT >
3332 struct VectorizedSubAssign {
3334 vectorizable && MT::vectorizable &&
3335 IsSame<Type,typename MT::ElementType>::value &&
3336 IntrinsicTrait<Type>::subtraction &&
3337 !IsDiagonal<MT>::value };
3345 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
3346 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
3360 template<
typename MT >
3361 inline typename DisableIf< VectorizedAssign<MT> >::Type
3362 assign(
const DenseMatrix<MT,true>& rhs );
3364 template<
typename MT >
3365 inline typename EnableIf< VectorizedAssign<MT> >::Type
3366 assign(
const DenseMatrix<MT,true>& rhs );
3368 template<
typename MT >
inline void assign(
const DenseMatrix<MT,false>& rhs );
3369 template<
typename MT >
inline void assign(
const SparseMatrix<MT,true>& rhs );
3370 template<
typename MT >
inline void assign(
const SparseMatrix<MT,false>& rhs );
3372 template<
typename MT >
3373 inline typename DisableIf< VectorizedAddAssign<MT> >::Type
3374 addAssign(
const DenseMatrix<MT,true>& rhs );
3376 template<
typename MT >
3377 inline typename EnableIf< VectorizedAddAssign<MT> >::Type
3378 addAssign(
const DenseMatrix<MT,true>& rhs );
3380 template<
typename MT >
inline void addAssign(
const DenseMatrix<MT,false>& rhs );
3381 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,true>& rhs );
3382 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,false>& rhs );
3384 template<
typename MT >
3385 inline typename DisableIf< VectorizedSubAssign<MT> >::Type
3386 subAssign (
const DenseMatrix<MT,true>& rhs );
3388 template<
typename MT >
3389 inline typename EnableIf< VectorizedSubAssign<MT> >::Type
3390 subAssign (
const DenseMatrix<MT,true>& rhs );
3392 template<
typename MT >
inline void subAssign(
const DenseMatrix<MT,false>& rhs );
3393 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,true>& rhs );
3394 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,false>& rhs );
3402 template<
typename Arg >
3403 inline typename DisableIf< IsClass<Arg> >::Type
3404 construct( Type* ptr,
size_t m,
size_t n, Arg arg );
3406 template<
typename Arg >
3407 inline typename EnableIf< IsClass<Arg> >::Type
3408 construct( Type* ptr,
size_t m,
size_t n, Arg arg );
3418 boost::shared_array<Type>
v_;
3447 template<
typename Type
3481 template<
typename Type
3500 v_.reset( ptr, NoDelete() );
3529 template<
typename Type
3546 if( PF && IsVectorizable<Type>::value && ( mm_ < nextMultiple<size_t>(
m_,
IT::size ) ) ) {
3550 v_.reset( ptr, NoDelete() );
3552 if( PF && IsVectorizable<Type>::value ) {
3553 for(
size_t j=0UL; j<
n_; ++j )
3554 for(
size_t i=
m_; i<mm_; ++i ) {
3555 v_[i+j*mm_] = Type();
3584 template<
typename Type
3587 template<
typename Deleter >
3594 construct( ptr, m, n, d );
3622 template<
typename Type
3625 template<
typename Deleter >
3640 if( PF && IsVectorizable<Type>::value && ( mm_ < nextMultiple<size_t>(
m_,
IT::size ) ) ) {
3646 if( PF && IsVectorizable<Type>::value ) {
3647 for(
size_t j=0UL; j<
n_; ++j )
3648 for(
size_t i=
m_; i<mm_; ++i ) {
3649 v_[i+j*mm_] = Type();
3666 template<
typename Type
3698 template<
typename Type
3723 template<
typename Type
3749 template<
typename Type
3761 return (*
this)(i,j);
3779 template<
typename Type
3791 return (*
this)(i,j);
3809 template<
typename Type
3812 inline typename CustomMatrix<Type,AF,PF,true>::Pointer
3833 template<
typename Type
3836 inline typename CustomMatrix<Type,AF,PF,true>::ConstPointer
3854 template<
typename Type
3857 inline typename CustomMatrix<Type,AF,PF,true>::Pointer
3861 return v_.get() + j*mm_;
3876 template<
typename Type
3879 inline typename CustomMatrix<Type,AF,PF,true>::ConstPointer
3883 return v_.get() + j*mm_;
3896 template<
typename Type
3903 return Iterator( v_.get() + j*mm_ );
3916 template<
typename Type
3936 template<
typename Type
3956 template<
typename Type
3976 template<
typename Type
3996 template<
typename Type
4047 template<
typename Type
4050 template<
typename Other
4053 inline CustomMatrix<Type,AF,PF,true>&
4054 CustomMatrix<Type,AF,PF,true>::operator=(
const Other (&array)[M][N] )
4056 if(
m_ != M ||
n_ != N ) {
4060 for(
size_t j=0UL; j<N; ++j )
4061 for(
size_t i=0UL; i<M; ++i )
4062 v_[i+j*mm_] = array[i][j];
4077 template<
typename Type
4080 inline CustomMatrix<Type,AF,PF,true>& CustomMatrix<Type,AF,PF,true>::operator=(
const Type& rhs )
4082 for(
size_t j=0UL; j<
n_; ++j )
4083 for(
size_t i=0UL; i<
m_; ++i )
4103 template<
typename Type
4106 inline CustomMatrix<Type,AF,PF,true>&
4107 CustomMatrix<Type,AF,PF,true>::operator=(
const CustomMatrix& rhs )
4109 if( rhs.rows() !=
m_ || rhs.columns() !=
n_ ) {
4132 template<
typename Type
4135 template<
typename MT
4137 inline CustomMatrix<Type,AF,PF,true>&
4138 CustomMatrix<Type,AF,PF,true>::operator=(
const Matrix<MT,SO>& rhs )
4144 if( (~rhs).canAlias(
this ) ) {
4149 if( IsSparseMatrix<MT>::value )
4171 template<
typename Type
4174 template<
typename MT
4176 inline CustomMatrix<Type,AF,PF,true>&
4177 CustomMatrix<Type,AF,PF,true>::operator+=(
const Matrix<MT,SO>& rhs )
4183 if( (~rhs).canAlias(
this ) ) {
4208 template<
typename Type
4211 template<
typename MT
4213 inline CustomMatrix<Type,AF,PF,true>&
4214 CustomMatrix<Type,AF,PF,true>::operator-=(
const Matrix<MT,SO>& rhs )
4220 if( (~rhs).canAlias(
this ) ) {
4245 template<
typename Type
4248 template<
typename MT
4250 inline CustomMatrix<Type,AF,PF,true>&
4251 CustomMatrix<Type,AF,PF,true>::operator*=(
const Matrix<MT,SO>& rhs )
4257 const typename MultTrait<ResultType,typename MT::ResultType>::Type tmp( *
this * (~rhs) );
4274 template<
typename Type
4277 template<
typename Other >
4278 inline typename EnableIf< IsNumeric<Other>, CustomMatrix<Type,AF,PF,true> >::Type&
4279 CustomMatrix<Type,AF,PF,true>::operator*=( Other rhs )
4296 template<
typename Type
4299 template<
typename Other >
4300 inline typename EnableIf< IsNumeric<Other>, CustomMatrix<Type,AF,PF,true> >::Type&
4301 CustomMatrix<Type,AF,PF,true>::operator/=( Other rhs )
4326 template<
typename Type
4343 template<
typename Type
4363 template<
typename Type
4380 template<
typename Type
4398 template<
typename Type
4417 template<
typename Type
4422 size_t nonzeros( 0UL );
4424 for(
size_t j=0UL; j<
n_; ++j )
4425 for(
size_t i=0UL; i<
m_; ++i )
4442 template<
typename Type
4449 const size_t iend( j*mm_ + m_ );
4450 size_t nonzeros( 0UL );
4452 for(
size_t i=j*mm_; i<iend; ++i )
4468 template<
typename Type
4475 for(
size_t j=0UL; j<
n_; ++j )
4476 for(
size_t i=0UL; i<
m_; ++i )
4477 clear( v_[i+j*mm_] );
4493 template<
typename Type
4501 for(
size_t i=0UL; i<
m_; ++i )
4502 clear( v_[i+j*mm_] );
4516 template<
typename Type
4539 template<
typename Type
4550 for(
size_t j=1UL; j<
n_; ++j )
4551 for(
size_t i=0UL; i<j; ++i )
4552 swap( v_[i+j*mm_], v_[j+i*mm_] );
4569 template<
typename Type
4578 for(
size_t j=0UL; j<
n_; ++j ) {
4579 for(
size_t i=0UL; i<j; ++i ) {
4580 cswap( v_[i+j*mm_], v_[j+i*mm_] );
4598 template<
typename Type
4601 template<
typename Other >
4602 inline CustomMatrix<Type,AF,PF,true>& CustomMatrix<Type,AF,PF,true>::scale(
const Other& scalar )
4604 for(
size_t j=0UL; j<
n_; ++j )
4605 for(
size_t i=0UL; i<
m_; ++i )
4606 v_[i+j*mm_] *= scalar;
4622 template<
typename Type
4670 template<
typename Type
4677 CustomMatrix tmp( ptr, m, n );
4708 template<
typename Type
4713 CustomMatrix tmp( ptr, m, n, mm );
4744 template<
typename Type
4747 template<
typename Deleter >
4752 CustomMatrix tmp( ptr, m, n, d );
4783 template<
typename Type
4786 template<
typename Deleter >
4789 CustomMatrix tmp( ptr, m, n, mm, d );
4815 template<
typename Type
4818 template<
typename Other >
4821 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
4838 template<
typename Type
4841 template<
typename Other >
4844 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
4860 template<
typename Type
4882 template<
typename Type
4887 return (
columns() > SMP_DMATASSIGN_THRESHOLD );
4908 template<
typename Type
4915 return loada( i, j );
4917 return loadu( i, j );
4938 template<
typename Type
4954 return loada( v_.get()+i+j*mm_ );
4975 template<
typename Type
4989 return loadu( v_.get()+i+j*mm_ );
5011 template<
typename Type
5042 template<
typename Type
5058 storea( v_.get()+i+j*mm_, value );
5080 template<
typename Type
5094 storeu( v_.get()+i+j*mm_, value );
5116 template<
typename Type
5132 stream( v_.get()+i+j*mm_, value );
5150 template<
typename Type
5153 template<
typename MT >
5154 inline typename DisableIf< typename CustomMatrix<Type,AF,PF,true>::BLAZE_TEMPLATE VectorizedAssign<MT> >::Type
5155 CustomMatrix<Type,AF,PF,true>::assign(
const DenseMatrix<MT,true>& rhs )
5160 const size_t ipos( m_ &
size_t(-2) );
5163 for(
size_t j=0UL; j<
n_; ++j ) {
5164 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5165 v_[i +j*mm_] = (~rhs)(i ,j);
5166 v_[i+1UL+j*mm_] = (~rhs)(i+1UL,j);
5169 v_[ipos+j*mm_] = (~rhs)(ipos,j);
5189 template<
typename Type
5192 template<
typename MT >
5193 inline typename EnableIf< typename CustomMatrix<Type,AF,PF,true>::BLAZE_TEMPLATE VectorizedAssign<MT> >::Type
5194 CustomMatrix<Type,AF,PF,true>::assign(
const DenseMatrix<MT,true>& rhs )
5201 const bool remainder( !PF || !IsPadded<MT>::value );
5203 const size_t ipos( ( remainder )?( m_ &
size_t(-
IT::size) ):( m_ ) );
5207 ( m_*n_ > (
cacheSize / (
sizeof(Type) * 3UL ) ) ) && !(~rhs).isAliased(
this ) )
5209 for(
size_t j=0UL; j<
n_; ++j )
5214 stream( i, j, (~rhs).load(i,j) );
5216 for( ; remainder && i<
m_; ++i ) {
5217 v_[i+j*mm_] = (~rhs)(i,j);
5223 for(
size_t j=0UL; j<
n_; ++j )
5229 store( i , j, it.load() ); it +=
IT::size;
5235 store( i, j, it.load() );
5237 for( ; remainder && i<
m_; ++i, ++it ) {
5259 template<
typename Type
5262 template<
typename MT >
5263 inline void CustomMatrix<Type,AF,PF,true>::assign(
const DenseMatrix<MT,false>& rhs )
5270 const size_t block( BLOCK_SIZE );
5272 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
5273 const size_t jend(
min( n_, jj+block ) );
5274 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
5275 const size_t iend(
min( m_, ii+block ) );
5276 for(
size_t j=jj; j<jend; ++j ) {
5277 for(
size_t i=ii; i<iend; ++i ) {
5278 v_[i+j*mm_] = (~rhs)(i,j);
5300 template<
typename Type
5303 template<
typename MT >
5304 inline void CustomMatrix<Type,AF,PF,true>::assign(
const SparseMatrix<MT,true>& rhs )
5309 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
5311 v_[element->index()+j*mm_] = element->value();
5329 template<
typename Type
5332 template<
typename MT >
5333 inline void CustomMatrix<Type,AF,PF,true>::assign(
const SparseMatrix<MT,false>& rhs )
5340 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
5342 v_[i+element->index()*mm_] = element->value();
5360 template<
typename Type
5363 template<
typename MT >
5364 inline typename DisableIf< typename CustomMatrix<Type,AF,PF,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >::Type
5365 CustomMatrix<Type,AF,PF,true>::addAssign(
const DenseMatrix<MT,true>& rhs )
5370 for(
size_t j=0UL; j<
n_; ++j )
5372 if( IsDiagonal<MT>::value )
5374 v_[j+j*mm_] += (~rhs)(j,j);
5378 const size_t ibegin( ( IsLower<MT>::value )
5379 ?( IsStrictlyLower<MT>::value ? j+1UL : j )
5381 const size_t iend ( ( IsUpper<MT>::value )
5382 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5388 for( ; (i+2UL) <= iend; i+=2UL ) {
5389 v_[i +j*mm_] += (~rhs)(i ,j);
5390 v_[i+1UL+j*mm_] += (~rhs)(i+1UL,j);
5393 v_[i+j*mm_] += (~rhs)(i,j);
5414 template<
typename Type
5417 template<
typename MT >
5418 inline typename EnableIf< typename CustomMatrix<Type,AF,PF,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >::Type
5419 CustomMatrix<Type,AF,PF,true>::addAssign(
const DenseMatrix<MT,true>& rhs )
5427 const bool remainder( !PF || !IsPadded<MT>::value );
5429 for(
size_t j=0UL; j<
n_; ++j )
5431 const size_t ibegin( ( IsLower<MT>::value )
5432 ?( ( IsStrictlyLower<MT>::value ? j+1UL : j ) &
size_t(-
IT::size) )
5434 const size_t iend ( ( IsUpper<MT>::value )
5435 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5439 const size_t ipos( ( remainder )?( iend &
size_t(-
IT::size) ):( iend ) );
5446 store( i , j, load(i ,j) + it.load() ); it +=
IT::size;
5452 store( i, j, load(i,j) + it.load() );
5454 for( ; remainder && i<iend; ++i, ++it ) {
5475 template<
typename Type
5478 template<
typename MT >
5479 inline void CustomMatrix<Type,AF,PF,true>::addAssign(
const DenseMatrix<MT,false>& rhs )
5486 const size_t block( BLOCK_SIZE );
5488 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
5489 const size_t jend(
min( n_, jj+block ) );
5490 for(
size_t ii=0UL; ii<
m_; ii+=block )
5492 if( IsLower<MT>::value && ii < jj )
continue;
5493 if( IsUpper<MT>::value && ii > jj )
break;
5495 for(
size_t j=jj; j<jend; ++j )
5497 const size_t ibegin( ( IsLower<MT>::value )
5498 ?(
max( ( IsStrictlyLower<MT>::value ? j+1UL : j ), ii ) )
5500 const size_t iend ( ( IsUpper<MT>::value )
5501 ?(
min( ( IsStrictlyUpper<MT>::value ? j : j+1UL ), m_, ii+block ) )
5502 :(
min( m_, ii+block ) ) );
5505 for(
size_t i=ibegin; i<iend; ++i ) {
5506 v_[i+j*mm_] += (~rhs)(i,j);
5528 template<
typename Type
5531 template<
typename MT >
5532 inline void CustomMatrix<Type,AF,PF,true>::addAssign(
const SparseMatrix<MT,true>& rhs )
5537 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
5539 v_[element->index()+j*mm_] += element->value();
5557 template<
typename Type
5560 template<
typename MT >
5561 inline void CustomMatrix<Type,AF,PF,true>::addAssign(
const SparseMatrix<MT,false>& rhs )
5568 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
5570 v_[i+element->index()*mm_] += element->value();
5588 template<
typename Type
5591 template<
typename MT >
5592 inline typename DisableIf< typename CustomMatrix<Type,AF,PF,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >::Type
5593 CustomMatrix<Type,AF,PF,true>::subAssign(
const DenseMatrix<MT,true>& rhs )
5598 for(
size_t j=0UL; j<
n_; ++j )
5600 if( IsDiagonal<MT>::value )
5602 v_[j+j*mm_] -= (~rhs)(j,j);
5606 const size_t ibegin( ( IsLower<MT>::value )
5607 ?( IsStrictlyLower<MT>::value ? j+1UL : j )
5609 const size_t iend ( ( IsUpper<MT>::value )
5610 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5616 for( ; (i+2UL) <= iend; i+=2UL ) {
5617 v_[i +j*mm_] -= (~rhs)(i ,j);
5618 v_[i+1+j*mm_] -= (~rhs)(i+1,j);
5621 v_[i+j*mm_] -= (~rhs)(i,j);
5643 template<
typename Type
5646 template<
typename MT >
5647 inline typename EnableIf< typename CustomMatrix<Type,AF,PF,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >::Type
5648 CustomMatrix<Type,AF,PF,true>::subAssign(
const DenseMatrix<MT,true>& rhs )
5656 const bool remainder( !PF || !IsPadded<MT>::value );
5658 for(
size_t j=0UL; j<
n_; ++j )
5660 const size_t ibegin( ( IsLower<MT>::value )
5661 ?( ( IsStrictlyLower<MT>::value ? j+1UL : j ) &
size_t(-
IT::size) )
5663 const size_t iend ( ( IsUpper<MT>::value )
5664 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5668 const size_t ipos( ( remainder )?( iend &
size_t(-
IT::size) ):( iend ) );
5675 store( i , j, load(i ,j) - it.load() ); it +=
IT::size;
5681 store( i, j, load(i,j) - it.load() );
5683 for( ; remainder && i<iend; ++i, ++it ) {
5704 template<
typename Type
5707 template<
typename MT >
5708 inline void CustomMatrix<Type,AF,PF,true>::subAssign(
const DenseMatrix<MT,false>& rhs )
5715 const size_t block( BLOCK_SIZE );
5717 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
5718 const size_t jend(
min( n_, jj+block ) );
5719 for(
size_t ii=0UL; ii<
m_; ii+=block )
5721 if( IsLower<MT>::value && ii < jj )
continue;
5722 if( IsUpper<MT>::value && ii > jj )
break;
5724 for(
size_t j=jj; j<jend; ++j )
5726 const size_t ibegin( ( IsLower<MT>::value )
5727 ?(
max( ( IsStrictlyLower<MT>::value ? j+1UL : j ), ii ) )
5729 const size_t iend ( ( IsUpper<MT>::value )
5730 ?(
min( ( IsStrictlyUpper<MT>::value ? j : j+1UL ), m_, ii+block ) )
5731 :(
min( m_, ii+block ) ) );
5734 for(
size_t i=ibegin; i<iend; ++i ) {
5735 v_[i+j*mm_] -= (~rhs)(i,j);
5757 template<
typename Type
5760 template<
typename MT >
5761 inline void CustomMatrix<Type,AF,PF,true>::subAssign(
const SparseMatrix<MT,true>& rhs )
5766 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
5768 v_[element->index()+j*mm_] -= element->value();
5786 template<
typename Type
5789 template<
typename MT >
5790 inline void CustomMatrix<Type,AF,PF,true>::subAssign(
const SparseMatrix<MT,false>& rhs )
5797 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
5799 v_[i+element->index()*mm_] -= element->value();
5825 template<
typename Type
5828 template<
typename Arg >
5829 inline typename DisableIf< IsClass<Arg> >::Type
5830 CustomMatrix<Type,AF,PF,true>::construct( Type* ptr,
size_t m,
size_t n, Arg arg )
5842 if( PF && IsVectorizable<Type>::value && ( arg < nextMultiple<size_t>( m,
IT::size ) ) ) {
5847 v_.reset( ptr, NoDelete() );
5863 template<
typename Type
5866 template<
typename Arg >
5867 inline typename EnableIf< IsClass<Arg> >::Type
5868 CustomMatrix<Type,AF,PF,true>::construct( Type* ptr,
size_t m,
size_t n, Arg arg )
5883 v_.reset( ptr, arg );
5904 template<
typename Type,
bool AF,
bool PF,
bool SO >
5905 inline void reset( CustomMatrix<Type,AF,PF,SO>& m );
5907 template<
typename Type,
bool AF,
bool PF,
bool SO >
5908 inline void reset( CustomMatrix<Type,AF,PF,SO>& m,
size_t i );
5910 template<
typename Type,
bool AF,
bool PF,
bool SO >
5911 inline void clear( CustomMatrix<Type,AF,PF,SO>& m );
5913 template<
typename Type,
bool AF,
bool PF,
bool SO >
5914 inline bool isDefault(
const CustomMatrix<Type,AF,PF,SO>& m );
5916 template<
typename Type,
bool AF,
bool PF,
bool SO >
5917 inline bool isIntact(
const CustomMatrix<Type,AF,PF,SO>& m );
5919 template<
typename Type,
bool AF,
bool PF,
bool SO >
5920 inline void swap( CustomMatrix<Type,AF,PF,SO>& a, CustomMatrix<Type,AF,PF,SO>& b ) ;
5922 template<
typename Type,
bool AF,
bool PF,
bool SO >
5923 inline void move( CustomMatrix<Type,AF,PF,SO>& dst, CustomMatrix<Type,AF,PF,SO>& src ) ;
5935 template<
typename Type
5959 template<
typename Type
5977 template<
typename Type
6009 template<
typename Type
6041 template<
typename Type
6061 template<
typename Type
6081 template<
typename Type
6102 template<
typename T,
bool AF,
bool PF,
bool SO >
6103 struct HasConstDataAccess< CustomMatrix<T,AF,PF,SO> > :
public IsTrue<true>
6119 template<
typename T,
bool AF,
bool PF,
bool SO >
6120 struct HasMutableDataAccess< CustomMatrix<T,AF,PF,SO> > :
public IsTrue<true>
6136 template<
typename T,
bool AF,
bool PF,
bool SO >
6137 struct IsCustom< CustomMatrix<T,AF,PF,SO> > :
public IsTrue<true>
6153 template<
typename T,
bool PF,
bool SO >
6154 struct IsAligned< CustomMatrix<T,
aligned,PF,SO> > :
public IsTrue<true>
6170 template<
typename T,
bool AF,
bool SO >
6171 struct IsPadded< CustomMatrix<T,AF,
padded,SO> > :
public IsTrue<true>
6187 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t M,
size_t N >
6188 struct AddTrait< CustomMatrix<T1,AF,PF,SO>, StaticMatrix<T2,M,N,SO> >
6190 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M, N, SO > Type;
6193 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6194 struct AddTrait< CustomMatrix<T1,AF,PF,SO1>, StaticMatrix<T2,M,N,SO2> >
6196 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M, N,
false > Type;
6199 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6200 struct AddTrait< StaticMatrix<T1,M,N,SO>, CustomMatrix<T2,AF,PF,SO> >
6202 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M, N, SO > Type;
6205 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6206 struct AddTrait< StaticMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6208 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M, N,
false > Type;
6211 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t M,
size_t N >
6212 struct AddTrait< CustomMatrix<T1,AF,PF,SO>, HybridMatrix<T2,M,N,SO> >
6214 typedef HybridMatrix< typename AddTrait<T1,T2>::Type, M, N, SO > Type;
6217 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6218 struct AddTrait< CustomMatrix<T1,AF,PF,SO1>, HybridMatrix<T2,M,N,SO2> >
6220 typedef HybridMatrix< typename AddTrait<T1,T2>::Type, M, N,
false > Type;
6223 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6224 struct AddTrait< HybridMatrix<T1,M,N,SO>, CustomMatrix<T2,AF,PF,SO> >
6226 typedef HybridMatrix< typename AddTrait<T1,T2>::Type, M, N, SO > Type;
6229 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6230 struct AddTrait< HybridMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6232 typedef HybridMatrix< typename AddTrait<T1,T2>::Type, M, N,
false > Type;
6235 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6236 struct AddTrait< CustomMatrix<T1,AF,PF,SO>, DynamicMatrix<T2,SO> >
6238 typedef DynamicMatrix< typename AddTrait<T1,T2>::Type, SO > Type;
6241 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
bool SO2 >
6242 struct AddTrait< CustomMatrix<T1,AF,PF,SO1>, DynamicMatrix<T2,SO2> >
6244 typedef DynamicMatrix< typename AddTrait<T1,T2>::Type,
false > Type;
6247 template<
typename T1,
bool SO,
typename T2,
bool AF,
bool PF >
6248 struct AddTrait< DynamicMatrix<T1,SO>, CustomMatrix<T2,AF,PF,SO> >
6250 typedef DynamicMatrix< typename AddTrait<T1,T2>::Type, SO > Type;
6253 template<
typename T1,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6254 struct AddTrait< DynamicMatrix<T1,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6256 typedef DynamicMatrix< typename AddTrait<T1,T2>::Type,
false > Type;
6259 template<
typename T1,
bool AF1,
bool PF1,
bool SO,
typename T2,
bool AF2,
bool PF2 >
6260 struct AddTrait< CustomMatrix<T1,AF1,PF1,SO>, CustomMatrix<T2,AF2,PF2,SO> >
6262 typedef DynamicMatrix< typename AddTrait<T1,T2>::Type, SO > Type;
6265 template<
typename T1,
bool AF1,
bool PF1,
bool SO1,
typename T2,
bool AF2,
bool PF2,
bool SO2 >
6266 struct AddTrait< CustomMatrix<T1,AF1,PF1,SO1>, CustomMatrix<T2,AF2,PF2,SO2> >
6268 typedef DynamicMatrix< typename AddTrait<T1,T2>::Type,
false > Type;
6284 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t M,
size_t N >
6285 struct SubTrait< CustomMatrix<T1,AF,PF,SO>, StaticMatrix<T2,M,N,SO> >
6287 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M, N, SO > Type;
6290 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6291 struct SubTrait< CustomMatrix<T1,AF,PF,SO1>, StaticMatrix<T2,M,N,SO2> >
6293 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M, N,
false > Type;
6296 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6297 struct SubTrait< StaticMatrix<T1,M,N,SO>, CustomMatrix<T2,AF,PF,SO> >
6299 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M, N, SO > Type;
6302 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6303 struct SubTrait< StaticMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6305 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M, N,
false > Type;
6308 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t M,
size_t N >
6309 struct SubTrait< CustomMatrix<T1,AF,PF,SO>, HybridMatrix<T2,M,N,SO> >
6311 typedef HybridMatrix< typename SubTrait<T1,T2>::Type, M, N, SO > Type;
6314 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6315 struct SubTrait< CustomMatrix<T1,AF,PF,SO1>, HybridMatrix<T2,M,N,SO2> >
6317 typedef HybridMatrix< typename SubTrait<T1,T2>::Type, M, N,
false > Type;
6320 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6321 struct SubTrait< HybridMatrix<T1,M,N,SO>, CustomMatrix<T2,AF,PF,SO> >
6323 typedef HybridMatrix< typename SubTrait<T1,T2>::Type, M, N, SO > Type;
6326 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6327 struct SubTrait< HybridMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6329 typedef HybridMatrix< typename SubTrait<T1,T2>::Type, M, N,
false > Type;
6332 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6333 struct SubTrait< CustomMatrix<T1,AF,PF,SO>, DynamicMatrix<T2,SO> >
6335 typedef DynamicMatrix< typename SubTrait<T1,T2>::Type, SO > Type;
6338 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
bool SO2 >
6339 struct SubTrait< CustomMatrix<T1,AF,PF,SO1>, DynamicMatrix<T2,SO2> >
6341 typedef DynamicMatrix< typename SubTrait<T1,T2>::Type,
false > Type;
6344 template<
typename T1,
bool SO,
typename T2,
bool AF,
bool PF >
6345 struct SubTrait< DynamicMatrix<T1,SO>, CustomMatrix<T2,AF,PF,SO> >
6347 typedef DynamicMatrix< typename SubTrait<T1,T2>::Type, SO > Type;
6350 template<
typename T1,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6351 struct SubTrait< DynamicMatrix<T1,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6353 typedef DynamicMatrix< typename SubTrait<T1,T2>::Type,
false > Type;
6356 template<
typename T1,
bool AF1,
bool PF1,
bool SO,
typename T2,
bool AF2,
bool PF2 >
6357 struct SubTrait< CustomMatrix<T1,AF1,PF1,SO>, CustomMatrix<T2,AF2,PF2,SO> >
6359 typedef DynamicMatrix< typename SubTrait<T1,T2>::Type, SO > Type;
6362 template<
typename T1,
bool AF1,
bool PF1,
bool SO1,
typename T2,
bool AF2,
bool PF2,
bool SO2 >
6363 struct SubTrait< CustomMatrix<T1,AF1,PF1,SO1>, CustomMatrix<T2,AF2,PF2,SO2> >
6365 typedef DynamicMatrix< typename SubTrait<T1,T2>::Type,
false > Type;
6381 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6382 struct MultTrait< CustomMatrix<T1,AF,PF,SO>, T2, typename EnableIf< IsNumeric<T2> >::Type >
6384 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO > Type;
6387 template<
typename T1,
typename T2,
bool AF,
bool PF,
bool SO >
6388 struct MultTrait< T1, CustomMatrix<T2,AF,PF,SO>, typename EnableIf< IsNumeric<T1> >::Type >
6390 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO > Type;
6393 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t N >
6394 struct MultTrait< CustomMatrix<T1,AF,PF,SO>, StaticVector<T2,N,false> >
6396 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
false > Type;
6399 template<
typename T1,
size_t N,
typename T2,
bool AF,
bool PF,
bool SO >
6400 struct MultTrait< StaticVector<T1,N,true>, CustomMatrix<T2,AF,PF,SO> >
6402 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
true > Type;
6405 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2,
size_t N >
6406 struct MultTrait< CustomMatrix<T1,AF,PF,SO>, HybridVector<T2,N,false> >
6408 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
false > Type;
6411 template<
typename T1,
size_t N,
typename T2,
bool AF,
bool PF,
bool SO >
6412 struct MultTrait< HybridVector<T1,N,true>, CustomMatrix<T2,AF,PF,SO> >
6414 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
true > Type;
6417 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6418 struct MultTrait< CustomMatrix<T1,AF,PF,SO>, DynamicVector<T2,false> >
6420 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
false > Type;
6423 template<
typename T1,
typename T2,
bool AF,
bool PF,
bool SO >
6424 struct MultTrait< DynamicVector<T1,true>, CustomMatrix<T2,AF,PF,SO> >
6426 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
true > Type;
6429 template<
typename T1,
bool AF1,
bool PF1,
bool SO,
typename T2,
bool AF2,
bool PF2 >
6430 struct MultTrait< CustomMatrix<T1,AF1,PF1,SO>, CustomVector<T2,AF2,PF2,false> >
6432 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
false > Type;
6435 template<
typename T1,
bool AF1,
bool PF1,
typename T2,
bool AF2,
bool PF2,
bool SO >
6436 struct MultTrait< CustomVector<T1,AF1,PF1,true>, CustomMatrix<T2,AF2,PF2,SO> >
6438 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
true > Type;
6441 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6442 struct MultTrait< CustomMatrix<T1,AF,PF,SO>, CompressedVector<T2,false> >
6444 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
false > Type;
6447 template<
typename T1,
typename T2,
bool AF,
bool PF,
bool SO >
6448 struct MultTrait< CompressedVector<T1,true>, CustomMatrix<T2,AF,PF,SO> >
6450 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
true > Type;
6453 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6454 struct MultTrait< CustomMatrix<T1,AF,PF,SO1>, StaticMatrix<T2,M,N,SO2> >
6456 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO1 > Type;
6459 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6460 struct MultTrait< StaticMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6462 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO1 > Type;
6465 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
6466 struct MultTrait< CustomMatrix<T1,AF,PF,SO1>, HybridMatrix<T2,M,N,SO2> >
6468 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO1 > Type;
6471 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6472 struct MultTrait< HybridMatrix<T1,M,N,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6474 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO1 > Type;
6477 template<
typename T1,
bool AF,
bool PF,
bool SO1,
typename T2,
bool SO2 >
6478 struct MultTrait< CustomMatrix<T1,AF,PF,SO1>, DynamicMatrix<T2,SO2> >
6480 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO1 > Type;
6483 template<
typename T1,
bool SO1,
typename T2,
bool AF,
bool PF,
bool SO2 >
6484 struct MultTrait< DynamicMatrix<T1,SO1>, CustomMatrix<T2,AF,PF,SO2> >
6486 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO1 > Type;
6489 template<
typename T1,
bool AF1,
bool PF1,
bool SO1,
typename T2,
bool AF2,
bool PF2,
bool SO2 >
6490 struct MultTrait< CustomMatrix<T1,AF1,PF1,SO1>, CustomMatrix<T2,AF2,PF2,SO2> >
6492 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO1 > Type;
6508 template<
typename T1,
bool AF,
bool PF,
bool SO,
typename T2 >
6509 struct DivTrait< CustomMatrix<T1,AF,PF,SO>, T2, typename EnableIf< IsNumeric<T2> >::Type >
6511 typedef DynamicMatrix< typename DivTrait<T1,T2>::Type , SO > Type;
6527 template<
typename T1,
bool AF,
bool PF,
bool SO >
6528 struct SubmatrixTrait< CustomMatrix<T1,AF,PF,SO> >
6530 typedef DynamicMatrix<T1,SO> Type;
6546 template<
typename T1,
bool AF,
bool PF,
bool SO >
6547 struct RowTrait< CustomMatrix<T1,AF,PF,SO> >
6549 typedef DynamicVector<T1,true> Type;
6565 template<
typename T1,
bool AF,
bool PF,
bool SO >
6566 struct ColumnTrait< CustomMatrix<T1,AF,PF,SO> >
6568 typedef DynamicVector<T1,false> Type;
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:118
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:116
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
size_t m_
The current number of rows of the matrix.
Definition: CustomMatrix.h:688
CustomMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: CustomMatrix.h:1850
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1729
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type set(T value)
Sets all values in the vector to the given 2-byte integral value.
Definition: Set.h:73
Header file for kernel specific block sizes.
Header file for mathematical functions.
const bool unpadded
Padding flag for unpadded vectors and matrices.Via this flag it is possible to specify custom vectors...
Definition: PaddingFlag.h:64
Iterator begin(size_t i)
Returns an iterator to the first element of row/column i.
Definition: CustomMatrix.h:1171
#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.
Header file for basic type definitions.
No-delete policy class.
Definition: NoDelete.h:51
const bool defaultStorageOrder
The default storage order for all matrices of the Blaze library.This value specifies the default stor...
Definition: StorageOrder.h:56
DynamicMatrix< Type, SO > ResultType
Result type for expression template evaluations.
Definition: CustomMatrix.h:438
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
Header file for the row trait.
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:250
Header file for the IsSparseMatrix type trait.
Header file for the IsDiagonal type trait.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: CustomMatrix.h:1620
BLAZE_ALWAYS_INLINE void storea(size_t i, size_t j, const IntrinsicType &value)
Aligned store of an intrinsic element of the matrix.
Definition: CustomMatrix.h:2314
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 void stream(size_t i, size_t j, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the matrix.
Definition: CustomMatrix.h:2388
const bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Optimizations.h:68
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
BLAZE_ALWAYS_INLINE IntrinsicType loadu(size_t i, size_t j) const
Unaligned load of an intrinsic element of the matrix.
Definition: CustomMatrix.h:2247
size_t m_
The current number of rows of the sparse matrix.
Definition: CompressedMatrix.h:2749
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:308
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: CustomMatrix.h:1697
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:90
CustomMatrix & transpose()
In-place transpose of the matrix.
Definition: CustomMatrix.h:1821
#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:116
size_t nn_
The number of elements between two rows.
Definition: CustomMatrix.h:690
BLAZE_ALWAYS_INLINE IntrinsicType loada(size_t i, size_t j) const
Aligned load of an intrinsic element of the matrix.
Definition: CustomMatrix.h:2210
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:90
void move(CustomMatrix< Type, AF, PF, SO > &dst, CustomMatrix< Type, AF, PF, SO > &src)
Moving the contents of one custom matrix to another.
Definition: CustomMatrix.h:6085
System settings for performance optimizations.
Efficient implementation of a dynamic matrix.The DynamicMatrix class template is the representation ...
Definition: DynamicMatrix.h:195
void swap(CustomMatrix &m)
Swapping the contents of two matrices.
Definition: CustomMatrix.h:1901
DynamicMatrix< Type,!SO > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CustomMatrix.h:439
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:117
BLAZE_ALWAYS_INLINE void store(size_t i, size_t j, const IntrinsicType &value)
Store of an intrinsic element of the matrix.
Definition: CustomMatrix.h:2283
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:547
Constraint on the data type.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CustomMatrix.h:447
Header file for the SparseMatrix base class.
Pointer data()
Low-level data access to the matrix elements.
Definition: CustomMatrix.h:1083
Type * Pointer
Pointer to a non-constant matrix value.
Definition: CustomMatrix.h:448
Header file for the DisableIf class template.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type loadu(const T *address)
Loads a vector of 2-byte integral values.
Definition: Loadu.h:74
Header file for the IsCustom type trait.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
bool isAliased(const Other *alias) const
Returns whether the matrix is aliased with the given address alias.
Definition: CustomMatrix.h:2112
void reset()
Reset to the default initial values.
Definition: CustomMatrix.h:1751
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.
ConstIterator cbegin(size_t i) const
Returns an iterator to the first element of row/column i.
Definition: CustomMatrix.h:1219
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:4998
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type storeu(T *address, const simd_int16_t &value)
Unaligned store of a vector of 2-byte integral values.
Definition: Storeu.h:75
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
#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:116
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:75
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 exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
const MT::ElementType min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1682
Header file for the DenseMatrix base class.
Header file for the DenseIterator class template.
BLAZE_ALWAYS_INLINE void conjugate(T &a)
In-place conjugation of the given value/object.
Definition: Conjugate.h:120
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: CustomMatrix.h:1025
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:116
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:92
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:689
#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:79
Reference operator()(size_t i, size_t j)
2D-access to the matrix elements.
Definition: CustomMatrix.h:976
ConstIterator cend(size_t i) const
Returns an iterator just past the last element of row/column i.
Definition: CustomMatrix.h:1291
Header file for the misalignment function.
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:187
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:120
Compile time type check.The IsClass type trait tests whether or not the given template parameter is a...
Definition: IsClass.h:96
bool canAlias(const Other *alias) const
Returns whether the matrix can alias with the given address alias.
Definition: CustomMatrix.h:2090
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2590
Rebind mechanism to obtain a CustomMatrix with different data/element type.
Definition: CustomMatrix.h:459
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:527
Header file for the IsPadded type trait.
size_t spacing() const
Returns the spacing between the beginning of two rows/columns.
Definition: CustomMatrix.h:1641
DenseIterator< Type, AF > Iterator
Iterator over non-constant elements.
Definition: CustomMatrix.h:451
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.
CustomMatrix< Type, AF, PF, SO > This
Type of this CustomMatrix instance.
Definition: CustomMatrix.h:437
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type loada(const T *address)
Loads a vector of 2-byte integral values.
Definition: Loada.h:77
EnableIf< IsDenseMatrix< MT1 > >::Type 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
#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:116
Iterator end(size_t i)
Returns an iterator just past the last element of row/column i.
Definition: CustomMatrix.h:1243
boost::shared_array< Type > v_
The dynamically allocated matrix elements.
Definition: CustomMatrix.h:691
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type 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
Base template for the MultTrait class.
Definition: MultTrait.h:138
const Type & ReturnType
Return type for expression template evaluations.
Definition: CustomMatrix.h:443
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
Constraint on the data type.
void clear()
Clearing the matrix.
Definition: CustomMatrix.h:1799
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Type & Reference
Reference to a non-constant matrix value.
Definition: CustomMatrix.h:446
const bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
const This & CompositeType
Data type for composite expression templates.
Definition: CustomMatrix.h:444
bool isAligned() const
Returns whether the matrix is properly aligned in memory.
Definition: CustomMatrix.h:2132
Header file for the cache size of the target architecture.
#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:116
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2591
Header file for the column trait.
Header file for the isDefault shim.
Constraint on the data type.
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:94
Constraint on the data type.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: CustomMatrix.h:1604
Constraint on the data type.
Header file for the HasMutableDataAccess type trait.
IntrinsicTrait< Type > IT
Intrinsic trait for the matrix element type.
Definition: CustomMatrix.h:432
CustomMatrix< ET, AF, PF, SO > Other
The type of the other CustomMatrix.
Definition: CustomMatrix.h:460
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:256
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:59
Header file for all intrinsic functionality.
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 void storeu(size_t i, size_t j, const IntrinsicType &value)
Unaligned store of an intrinsic element of the matrix.
Definition: CustomMatrix.h:2352
size_t n_
The current number of columns of the sparse matrix.
Definition: CompressedMatrix.h:2750
CustomMatrix()
The default constructor for CustomMatrix.
Definition: CustomMatrix.h:731
DynamicMatrix< Type,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: CustomMatrix.h:440
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: CustomMatrix.h:449
IT::Type IntrinsicType
Intrinsic type of the matrix elements.
Definition: CustomMatrix.h:442
Efficient implementation of a customizable matrix.The CustomMatrix class template provides the functi...
Definition: CustomMatrix.h:428
EnableIf< IsDenseMatrix< MT1 > >::Type 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
Header file for the alignment check function.
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t i, size_t j) const
Load of an intrinsic element of the matrix.
Definition: CustomMatrix.h:2180
DenseIterator< const Type, AF > ConstIterator
Iterator over constant elements.
Definition: CustomMatrix.h:452
BLAZE_ALWAYS_INLINE void cswap(T &a, T &b)
Swapping two conjugated values/objects.
Definition: Conjugate.h:197
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type stream(T *address, const simd_int16_t &value)
Aligned, non-temporal store of a vector of 2-byte integral values.
Definition: Stream.h:74
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:324
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:237
Compile time check for sparse matrix types.This type trait tests whether or not the given template pa...
Definition: IsSparseMatrix.h:103
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2589
#define BLAZE_THROW_LOGIC_ERROR(MESSAGE)
Macro for the emission of a std::logic_error exceptionThis macro encapsulates the default way of Blaz...
Definition: Exception.h:283
Rebind mechanism to obtain a CompressedMatrix with different data/element type.
Definition: CompressedMatrix.h:2599
Header file for the IsUpper type trait.
Header file for exception macros.
#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:143
const size_t cacheSize
Cache size of the target architecture.This setting specifies the available cache size in Byte of the ...
Definition: CacheSize.h:48
Type ElementType
Type of the matrix elements.
Definition: CustomMatrix.h:441
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
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type storea(T *address, const simd_int16_t &value)
Aligned store of a vector of 2-byte integral values.
Definition: Storea.h:78
Header file for the IsClass type trait.
Header file for a safe C++ NULL pointer implementation.
size_t capacity() const
Returns the maximum capacity of the matrix.
Definition: CustomMatrix.h:1657
bool canSMPAssign() const
Returns whether the matrix can be used in SMP assignments.
Definition: CustomMatrix.h:2153