35 #ifndef _BLAZE_MATH_DENSE_DYNAMICMATRIX_H_
36 #define _BLAZE_MATH_DENSE_DYNAMICMATRIX_H_
193 template<
typename Type
225 template<
typename ET >
251 explicit inline DynamicMatrix(
size_t m,
size_t n,
const Type& init );
252 template<
typename Other >
explicit inline DynamicMatrix(
size_t m,
size_t n,
const Other* array );
254 template<
typename Other,
size_t M,
size_t N >
258 template<
typename MT,
bool SO2 >
inline DynamicMatrix(
const Matrix<MT,SO2>& m );
272 inline Reference
operator()(
size_t i,
size_t j );
273 inline ConstReference
operator()(
size_t i,
size_t j )
const;
274 inline Reference
at(
size_t i,
size_t j );
275 inline ConstReference
at(
size_t i,
size_t j )
const;
276 inline Pointer
data ();
277 inline ConstPointer
data ()
const;
278 inline Pointer
data (
size_t i );
279 inline ConstPointer
data (
size_t i )
const;
280 inline Iterator
begin (
size_t i );
281 inline ConstIterator
begin (
size_t i )
const;
282 inline ConstIterator
cbegin(
size_t i )
const;
283 inline Iterator
end (
size_t i );
284 inline ConstIterator
end (
size_t i )
const;
285 inline ConstIterator
cend (
size_t i )
const;
292 template<
typename Other,
size_t M,
size_t N >
293 inline DynamicMatrix& operator=(
const Other (&array)[M][N] );
297 template<
typename MT,
bool SO2 >
inline DynamicMatrix& operator= (
const Matrix<MT,SO2>& rhs );
298 template<
typename MT,
bool SO2 >
inline DynamicMatrix& operator+=(
const Matrix<MT,SO2>& rhs );
299 template<
typename MT,
bool SO2 >
inline DynamicMatrix& operator-=(
const Matrix<MT,SO2>& rhs );
300 template<
typename MT,
bool SO2 >
inline DynamicMatrix& operator*=(
const Matrix<MT,SO2>& rhs );
302 template<
typename Other >
303 inline typename EnableIf< IsNumeric<Other>,
DynamicMatrix >::Type&
304 operator*=( Other rhs );
306 template<
typename Other >
307 inline typename EnableIf< IsNumeric<Other>,
DynamicMatrix >::Type&
308 operator/=( Other rhs );
315 inline size_t rows()
const;
319 inline size_t capacity(
size_t i )
const;
321 inline size_t nonZeros(
size_t i )
const;
323 inline void reset(
size_t i );
325 void resize (
size_t m,
size_t n,
bool preserve=
true );
326 inline void extend (
size_t m,
size_t n,
bool preserve=
true );
327 inline void reserve(
size_t elements );
330 template<
typename Other >
inline DynamicMatrix& scale(
const Other& scalar );
338 template<
typename MT >
340 struct VectorizedAssign {
342 vectorizable && MT::vectorizable &&
343 IsSame<Type,typename MT::ElementType>::value };
350 template<
typename MT >
352 struct VectorizedAddAssign {
354 vectorizable && MT::vectorizable &&
355 IsSame<Type,typename MT::ElementType>::value &&
356 IntrinsicTrait<Type>::addition &&
357 !IsDiagonal<MT>::value };
364 template<
typename MT >
366 struct VectorizedSubAssign {
368 vectorizable && MT::vectorizable &&
369 IsSame<Type,typename MT::ElementType>::value &&
370 IntrinsicTrait<Type>::subtraction &&
371 !IsDiagonal<MT>::value };
380 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
381 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
395 template<
typename MT >
396 inline typename DisableIf< VectorizedAssign<MT> >::Type
397 assign(
const DenseMatrix<MT,SO>& rhs );
399 template<
typename MT >
400 inline typename EnableIf< VectorizedAssign<MT> >::Type
401 assign(
const DenseMatrix<MT,SO>& rhs );
403 template<
typename MT >
inline void assign(
const DenseMatrix<MT,!SO>& rhs );
404 template<
typename MT >
inline void assign(
const SparseMatrix<MT,SO>& rhs );
405 template<
typename MT >
inline void assign(
const SparseMatrix<MT,!SO>& rhs );
407 template<
typename MT >
408 inline typename DisableIf< VectorizedAddAssign<MT> >::Type
409 addAssign(
const DenseMatrix<MT,SO>& rhs );
411 template<
typename MT >
412 inline typename EnableIf< VectorizedAddAssign<MT> >::Type
413 addAssign(
const DenseMatrix<MT,SO>& rhs );
415 template<
typename MT >
inline void addAssign(
const DenseMatrix<MT,!SO>& rhs );
416 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,SO>& rhs );
417 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,!SO>& rhs );
419 template<
typename MT >
420 inline typename DisableIf< VectorizedSubAssign<MT> >::Type
421 subAssign(
const DenseMatrix<MT,SO>& rhs );
423 template<
typename MT >
424 inline typename EnableIf< VectorizedSubAssign<MT> >::Type
425 subAssign(
const DenseMatrix<MT,SO>& rhs );
427 template<
typename MT >
inline void subAssign(
const DenseMatrix<MT,!SO>& rhs );
428 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,SO>& rhs );
429 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,!SO>& rhs );
484 template<
typename Type
505 template<
typename Type
510 , nn_ ( adjustColumns( n ) )
515 for(
size_t i=0UL; i<
m_; ++i ) {
516 for(
size_t j=
n_; j<
nn_; ++j )
517 v_[i*nn_+j] = Type();
533 template<
typename Type
538 , nn_ ( adjustColumns( n ) )
542 for(
size_t i=0UL; i<m; ++i ) {
543 for(
size_t j=0UL; j<
n_; ++j )
547 for(
size_t j=n_; j<
nn_; ++j )
548 v_[i*nn_+j] = Type();
578 template<
typename Type
580 template<
typename Other >
584 , nn_ ( adjustColumns( n ) )
588 for(
size_t i=0UL; i<m; ++i ) {
589 for(
size_t j=0UL; j<n; ++j )
590 v_[i*
nn_+j] = array[i*n+j];
593 for(
size_t j=n; j<
nn_; ++j )
594 v_[i*nn_+j] = Type();
622 template<
typename Type
624 template<
typename Other
630 , nn_ ( adjustColumns( N ) )
634 for(
size_t i=0UL; i<M; ++i ) {
635 for(
size_t j=0UL; j<N; ++j )
636 v_[i*
nn_+j] = array[i][j];
639 for(
size_t j=N; j<
nn_; ++j )
640 v_[i*nn_+j] = Type();
655 template<
typename Type
677 template<
typename Type
679 template<
typename MT
684 , nn_ ( adjustColumns(
n_ ) )
688 for(
size_t i=0UL; i<
m_; ++i ) {
690 j<( IsVectorizable<Type>::value ?
nn_ :
n_ ); ++j ) {
691 v_[i*
nn_+j] = Type();
711 template<
typename Type
738 template<
typename Type
760 template<
typename Type
783 template<
typename Type
810 template<
typename Type
838 template<
typename Type
859 template<
typename Type
876 template<
typename Type
894 template<
typename Type
915 template<
typename Type
937 template<
typename Type
959 template<
typename Type
981 template<
typename Type
1003 template<
typename Type
1025 template<
typename Type
1065 template<
typename Type
1067 template<
typename Other
1074 for(
size_t i=0UL; i<M; ++i )
1075 for(
size_t j=0UL; j<N; ++j )
1076 v_[i*nn_+j] = array[i][j];
1089 template<
typename Type
1093 for(
size_t i=0UL; i<
m_; ++i )
1094 for(
size_t j=0UL; j<
n_; ++j )
1111 template<
typename Type
1115 if( &rhs ==
this )
return *
this;
1134 template<
typename Type
1136 template<
typename MT
1149 else if( (~rhs).canAlias(
this ) ) {
1175 template<
typename Type
1177 template<
typename MT
1185 if( (~rhs).canAlias(
this ) ) {
1208 template<
typename Type
1210 template<
typename MT
1218 if( (~rhs).canAlias(
this ) ) {
1241 template<
typename Type
1243 template<
typename MT
1247 if( (~rhs).
rows() !=
n_ ) {
1266 template<
typename Type
1268 template<
typename Other >
1285 template<
typename Type
1287 template<
typename Other >
1312 template<
typename Type
1326 template<
typename Type
1345 template<
typename Type
1359 template<
typename Type
1379 template<
typename Type
1395 template<
typename Type
1399 size_t nonzeros( 0UL );
1401 for(
size_t i=0UL; i<
m_; ++i )
1402 for(
size_t j=0UL; j<
n_; ++j )
1422 template<
typename Type
1428 const size_t jend( i*nn_ +
n_ );
1429 size_t nonzeros( 0UL );
1431 for(
size_t j=i*nn_; j<jend; ++j )
1445 template<
typename Type
1451 for(
size_t i=0UL; i<
m_; ++i )
1452 for(
size_t j=0UL; j<
n_; ++j )
1453 clear( v_[i*nn_+j] );
1469 template<
typename Type
1476 for(
size_t j=0UL; j<
n_; ++j )
1477 clear( v_[i*nn_+j] );
1489 template<
typename Type
1493 resize( 0UL, 0UL,
false );
1532 template<
typename Type
1538 if( m ==
m_ && n ==
n_ )
return;
1540 const size_t nn( adjustColumns( n ) );
1545 const size_t min_m(
min( m,
m_ ) );
1546 const size_t min_n(
min( n,
n_ ) );
1548 for(
size_t i=0UL; i<min_m; ++i )
1549 for(
size_t j=0UL; j<min_n; ++j )
1550 v[i*nn+j] = v_[i*nn_+j];
1564 for(
size_t i=0UL; i<m; ++i )
1565 for(
size_t j=n; j<nn; ++j )
1566 v_[i*nn+j] = Type();
1590 template<
typename Type
1608 template<
typename Type
1621 for(
size_t i=
capacity_; i<elements; ++i )
1639 template<
typename Type
1645 const size_t block( BLOCK_SIZE );
1649 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
1650 const size_t iend(
min( ii+block, m_ ) );
1651 for(
size_t jj=0UL; jj<=ii; jj+=block ) {
1652 for(
size_t i=ii; i<iend; ++i ) {
1653 const size_t jend(
min( jj+block,
n_, i ) );
1654 for(
size_t j=jj; j<jend; ++j ) {
1655 swap( v_[i*nn_+j], v_[j*nn_+i] );
1677 template<
typename Type
1681 const size_t block( BLOCK_SIZE );
1685 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
1686 const size_t iend(
min( ii+block, m_ ) );
1687 for(
size_t jj=0UL; jj<ii; jj+=block ) {
1688 const size_t jend(
min( jj+block,
n_ ) );
1689 for(
size_t i=ii; i<iend; ++i ) {
1690 for(
size_t j=jj; j<jend; ++j ) {
1691 cswap( v_[i*nn_+j], v_[j*nn_+i] );
1695 for(
size_t i=ii; i<iend; ++i ) {
1696 for(
size_t j=ii; j<i; ++j ) {
1697 cswap( v_[i*nn_+j], v_[j*nn_+i] );
1720 template<
typename Type
1722 template<
typename Other >
1725 for(
size_t i=0UL; i<
m_; ++i )
1726 for(
size_t j=0UL; j<
n_; ++j )
1727 v_[i*nn_+j] *= scalar;
1741 template<
typename Type
1760 template<
typename Type
1765 return nextMultiple<size_t>( minColumns,
IT::size );
1766 else return minColumns;
1789 template<
typename Type
1791 template<
typename Other >
1794 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1809 template<
typename Type
1811 template<
typename Other >
1814 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
1828 template<
typename Type
1847 template<
typename Type
1851 return (
rows() > SMP_DMATASSIGN_THRESHOLD );
1871 template<
typename Type
1877 return loada( i, j );
1879 return loadu( i, j );
1899 template<
typename Type
1914 return loada( v_+i*nn_+j );
1934 template<
typename Type
1947 return loadu( v_+i*nn_+j );
1968 template<
typename Type
1997 template<
typename Type
2012 storea( v_+i*nn_+j, value );
2033 template<
typename Type
2046 storeu( v_+i*nn_+j, value );
2067 template<
typename Type
2082 stream( v_+i*nn_+j, value );
2098 template<
typename Type
2100 template<
typename MT >
2107 const size_t jpos(
n_ &
size_t(-2) );
2110 for(
size_t i=0UL; i<
m_; ++i ) {
2111 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2112 v_[i*nn_+j ] = (~rhs)(i,j );
2113 v_[i*nn_+j+1UL] = (~rhs)(i,j+1UL);
2116 v_[i*nn_+jpos] = (~rhs)(i,jpos);
2134 template<
typename Type
2136 template<
typename MT >
2147 const size_t jpos( ( remainder )?(
n_ &
size_t(-
IT::size) ):(
n_ ) );
2151 (
m_*
n_ > (
cacheSize / (
sizeof(Type) * 3UL ) ) ) && !(~rhs).isAliased(
this ) )
2153 for(
size_t i=0UL; i<
m_; ++i )
2158 stream( i, j, (~rhs).load(i,j) );
2160 for( ; remainder && j<
n_; ++j ) {
2161 v_[i*nn_+j] = (~rhs)(i,j);
2167 for(
size_t i=0UL; i<
m_; ++i )
2173 store( i, j , it.load() ); it +=
IT::size;
2179 store( i, j, it.load() );
2181 for( ; remainder && j<
n_; ++j, ++it ) {
2201 template<
typename Type
2203 template<
typename MT >
2211 const size_t block( BLOCK_SIZE );
2213 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
2214 const size_t iend(
min( m_, ii+block ) );
2215 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
2216 const size_t jend(
min( n_, jj+block ) );
2217 for(
size_t i=ii; i<iend; ++i ) {
2218 for(
size_t j=jj; j<jend; ++j ) {
2219 v_[i*nn_+j] = (~rhs)(i,j);
2239 template<
typename Type
2241 template<
typename MT >
2247 for(
size_t i=0UL; i<
m_; ++i )
2249 v_[i*nn_+element->index()] = element->value();
2265 template<
typename Type
2267 template<
typename MT >
2275 for(
size_t j=0UL; j<
n_; ++j )
2277 v_[element->index()*nn_+j] = element->value();
2293 template<
typename Type
2295 template<
typename MT >
2302 for(
size_t i=0UL; i<
m_; ++i )
2306 v_[i*nn_+i] += (~rhs)(i,i);
2320 for( ; (j+2UL) <= jend; j+=2UL ) {
2321 v_[i*nn_+j ] += (~rhs)(i,j );
2322 v_[i*nn_+j+1UL] += (~rhs)(i,j+1UL);
2325 v_[i*nn_+j] += (~rhs)(i,j);
2344 template<
typename Type
2346 template<
typename MT >
2358 for(
size_t i=0UL; i<
m_; ++i )
2368 const size_t jpos( ( remainder )?( jend &
size_t(-
IT::size) ):( jend ) );
2375 store( i, j , load(i,j ) + it.load() ); it +=
IT::size;
2381 store( i, j, load(i,j) + it.load() );
2383 for( ; remainder && j<jend; ++j, ++it ) {
2402 template<
typename Type
2404 template<
typename MT >
2412 const size_t block( BLOCK_SIZE );
2414 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
2415 const size_t iend(
min( m_, ii+block ) );
2416 for(
size_t jj=0UL; jj<
n_; jj+=block )
2421 for(
size_t i=ii; i<iend; ++i )
2428 :(
min( n_, jj+block ) ) );
2431 for(
size_t j=jbegin; j<jend; ++j ) {
2432 v_[i*nn_+j] += (~rhs)(i,j);
2452 template<
typename Type
2454 template<
typename MT >
2460 for(
size_t i=0UL; i<
m_; ++i )
2462 v_[i*nn_+element->index()] += element->value();
2478 template<
typename Type
2480 template<
typename MT >
2488 for(
size_t j=0UL; j<
n_; ++j )
2490 v_[element->index()*nn_+j] += element->value();
2506 template<
typename Type
2508 template<
typename MT >
2515 for(
size_t i=0UL; i<
m_; ++i )
2519 v_[i*nn_+i] -= (~rhs)(i,i);
2533 for( ; (j+2UL) <= jend; j+=2UL ) {
2534 v_[i*nn_+j ] -= (~rhs)(i,j );
2535 v_[i*nn_+j+1UL] -= (~rhs)(i,j+1UL);
2538 v_[i*nn_+j] -= (~rhs)(i,j);
2557 template<
typename Type
2559 template<
typename MT >
2571 for(
size_t i=0UL; i<
m_; ++i )
2581 const size_t jpos( ( remainder )?( jend &
size_t(-
IT::size) ):( jend ) );
2588 store( i, j , load(i,j ) - it.load() ); it +=
IT::size;
2594 store( i, j, load(i,j) - it.load() );
2596 for( ; remainder && j<jend; ++j, ++it ) {
2615 template<
typename Type
2617 template<
typename MT >
2625 const size_t block( BLOCK_SIZE );
2627 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
2628 const size_t iend(
min( m_, ii+block ) );
2629 for(
size_t jj=0UL; jj<
n_; jj+=block )
2634 for(
size_t i=ii; i<iend; ++i )
2641 :(
min( n_, jj+block ) ) );
2644 for(
size_t j=jbegin; j<jend; ++j ) {
2645 v_[i*nn_+j] -= (~rhs)(i,j);
2665 template<
typename Type
2667 template<
typename MT >
2673 for(
size_t i=0UL; i<
m_; ++i )
2675 v_[i*nn_+element->index()] -= element->value();
2691 template<
typename Type
2693 template<
typename MT >
2701 for(
size_t j=0UL; j<
n_; ++j )
2703 v_[element->index()*nn_+j] -= element->value();
2728 template<
typename Type >
2759 template<
typename ET >
2771 enum { vectorizable = IsVectorizable<Type>::value };
2777 enum { smpAssignable = !IsSMPAssignable<Type>::value };
2785 explicit inline DynamicMatrix(
size_t m,
size_t n,
const Type& init );
2786 template<
typename Other >
explicit inline DynamicMatrix(
size_t m,
size_t n,
const Other* array );
2788 template<
typename Other,
size_t M,
size_t N >
2789 explicit inline DynamicMatrix(
const Other (&array)[M][N] );
2792 template<
typename MT,
bool SO >
inline DynamicMatrix(
const Matrix<MT,SO>& m );
2806 inline Reference
operator()(
size_t i,
size_t j );
2807 inline ConstReference
operator()(
size_t i,
size_t j )
const;
2808 inline Reference
at(
size_t i,
size_t j );
2809 inline ConstReference
at(
size_t i,
size_t j )
const;
2810 inline Pointer
data ();
2811 inline ConstPointer
data ()
const;
2812 inline Pointer
data (
size_t j );
2813 inline ConstPointer
data (
size_t j )
const;
2814 inline Iterator
begin (
size_t j );
2815 inline ConstIterator
begin (
size_t j )
const;
2816 inline ConstIterator
cbegin(
size_t j )
const;
2817 inline Iterator
end (
size_t j );
2818 inline ConstIterator
end (
size_t j )
const;
2819 inline ConstIterator
cend (
size_t j )
const;
2826 template<
typename Other,
size_t M,
size_t N >
2827 inline DynamicMatrix& operator=(
const Other (&array)[M][N] );
2831 template<
typename MT,
bool SO >
inline DynamicMatrix& operator= (
const Matrix<MT,SO>& rhs );
2832 template<
typename MT,
bool SO >
inline DynamicMatrix& operator+=(
const Matrix<MT,SO>& rhs );
2833 template<
typename MT,
bool SO >
inline DynamicMatrix& operator-=(
const Matrix<MT,SO>& rhs );
2834 template<
typename MT,
bool SO >
inline DynamicMatrix& operator*=(
const Matrix<MT,SO>& rhs );
2836 template<
typename Other >
2837 inline typename EnableIf< IsNumeric<Other>,
DynamicMatrix >::Type&
2838 operator*=( Other rhs );
2840 template<
typename Other >
2841 inline typename EnableIf< IsNumeric<Other>,
DynamicMatrix >::Type&
2842 operator/=( Other rhs );
2849 inline size_t rows()
const;
2850 inline size_t columns()
const;
2851 inline size_t spacing()
const;
2853 inline size_t capacity(
size_t j )
const;
2855 inline size_t nonZeros(
size_t j )
const;
2856 inline void reset();
2857 inline void reset(
size_t j );
2858 inline void clear();
2859 void resize (
size_t m,
size_t n,
bool preserve=
true );
2860 inline void extend (
size_t m,
size_t n,
bool preserve=
true );
2861 inline void reserve(
size_t elements );
2864 template<
typename Other >
inline DynamicMatrix& scale(
const Other& scalar );
2872 template<
typename MT >
2873 struct VectorizedAssign {
2875 vectorizable && MT::vectorizable &&
2876 IsSame<Type,typename MT::ElementType>::value };
2882 template<
typename MT >
2883 struct VectorizedAddAssign {
2885 vectorizable && MT::vectorizable &&
2886 IsSame<Type,typename MT::ElementType>::value &&
2887 IntrinsicTrait<Type>::addition &&
2888 !IsDiagonal<MT>::value };
2894 template<
typename MT >
2895 struct VectorizedSubAssign {
2897 vectorizable && MT::vectorizable &&
2898 IsSame<Type,typename MT::ElementType>::value &&
2899 IntrinsicTrait<Type>::subtraction &&
2900 !IsDiagonal<MT>::value };
2908 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
2909 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
2923 template<
typename MT >
2924 inline typename DisableIf< VectorizedAssign<MT> >::Type
2925 assign(
const DenseMatrix<MT,true>& rhs );
2927 template<
typename MT >
2928 inline typename EnableIf< VectorizedAssign<MT> >::Type
2929 assign(
const DenseMatrix<MT,true>& rhs );
2931 template<
typename MT >
inline void assign(
const DenseMatrix<MT,false>& rhs );
2932 template<
typename MT >
inline void assign(
const SparseMatrix<MT,true>& rhs );
2933 template<
typename MT >
inline void assign(
const SparseMatrix<MT,false>& rhs );
2935 template<
typename MT >
2936 inline typename DisableIf< VectorizedAddAssign<MT> >::Type
2937 addAssign(
const DenseMatrix<MT,true>& rhs );
2939 template<
typename MT >
2940 inline typename EnableIf< VectorizedAddAssign<MT> >::Type
2941 addAssign(
const DenseMatrix<MT,true>& rhs );
2943 template<
typename MT >
inline void addAssign(
const DenseMatrix<MT,false>& rhs );
2944 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,true>& rhs );
2945 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,false>& rhs );
2947 template<
typename MT >
2948 inline typename DisableIf< VectorizedSubAssign<MT> >::Type
2949 subAssign (
const DenseMatrix<MT,true>& rhs );
2951 template<
typename MT >
2952 inline typename EnableIf< VectorizedSubAssign<MT> >::Type
2953 subAssign (
const DenseMatrix<MT,true>& rhs );
2955 template<
typename MT >
inline void subAssign(
const DenseMatrix<MT,false>& rhs );
2956 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,true>& rhs );
2957 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,false>& rhs );
2965 inline size_t adjustRows(
size_t minRows )
const;
3005 template<
typename Type >
3027 template<
typename Type >
3030 , mm_ ( adjustRows( m ) )
3035 if( IsVectorizable<Type>::value ) {
3036 for(
size_t j=0UL; j<
n_; ++j )
3037 for(
size_t i=
m_; i<mm_; ++i ) {
3038 v_[i+j*mm_] = Type();
3056 template<
typename Type >
3059 , mm_ ( adjustRows( m ) )
3064 for(
size_t j=0UL; j<
n_; ++j ) {
3065 for(
size_t i=0UL; i<
m_; ++i )
3068 if( IsVectorizable<Type>::value ) {
3069 for(
size_t i=m_; i<mm_; ++i )
3070 v_[i+j*mm_] = Type();
3102 template<
typename Type >
3103 template<
typename Other >
3106 , mm_ ( adjustRows( m ) )
3111 for(
size_t j=0UL; j<n; ++j ) {
3112 for(
size_t i=0UL; i<m; ++i )
3113 v_[i+j*mm_] = array[i+j*m];
3115 if( IsVectorizable<Type>::value ) {
3116 for(
size_t i=m; i<mm_; ++i )
3117 v_[i+j*mm_] = Type();
3147 template<
typename Type >
3148 template<
typename Other
3153 , mm_ ( adjustRows( M ) )
3158 for(
size_t j=0UL; j<N; ++j ) {
3159 for(
size_t i=0UL; i<M; ++i )
3160 v_[i+j*mm_] = array[i][j];
3162 if( IsVectorizable<Type>::value ) {
3163 for(
size_t i=M; i<mm_; ++i )
3164 v_[i+j*mm_] = Type();
3181 template<
typename Type >
3204 template<
typename Type >
3205 template<
typename MT
3208 : m_ ( (~m).
rows() )
3209 , mm_ ( adjustRows( m_ ) )
3214 for(
size_t j=0UL; j<
n_; ++j ) {
3215 for(
size_t i=( IsSparseMatrix<MT>::value ? 0UL : m_ );
3216 i<( IsVectorizable<Type>::value ? mm_ :
m_ ); ++i ) {
3217 v_[i+j*mm_] = Type();
3239 template<
typename Type >
3267 template<
typename Type >
3290 template<
typename Type >
3314 template<
typename Type >
3324 return (*
this)(i,j);
3342 template<
typename Type >
3352 return (*
this)(i,j);
3370 template<
typename Type >
3391 template<
typename Type >
3409 template<
typename Type >
3428 template<
typename Type >
3445 template<
typename Type >
3463 template<
typename Type >
3481 template<
typename Type >
3499 template<
typename Type >
3504 return Iterator( v_ + j*mm_ + m_ );
3517 template<
typename Type >
3535 template<
typename Type >
3576 template<
typename Type >
3577 template<
typename Other
3580 inline DynamicMatrix<Type,true>& DynamicMatrix<Type,true>::operator=(
const Other (&array)[M][N] )
3584 for(
size_t j=0UL; j<N; ++j )
3585 for(
size_t i=0UL; i<M; ++i )
3586 v_[i+j*mm_] = array[i][j];
3601 template<
typename Type >
3602 inline DynamicMatrix<Type,true>& DynamicMatrix<Type,true>::operator=(
const Type& rhs )
3604 for(
size_t j=0UL; j<
n_; ++j )
3605 for(
size_t i=0UL; i<
m_; ++i )
3624 template<
typename Type >
3625 inline DynamicMatrix<Type,true>& DynamicMatrix<Type,true>::operator=(
const DynamicMatrix& rhs )
3627 if( &rhs ==
this )
return *
this;
3629 resize( rhs.m_, rhs.n_,
false );
3648 template<
typename Type >
3649 template<
typename MT
3651 inline DynamicMatrix<Type,true>& DynamicMatrix<Type,true>::operator=(
const Matrix<MT,SO>& rhs )
3653 typedef typename TransExprTrait<This>::Type TT;
3654 typedef typename CTransExprTrait<This>::Type CT;
3656 if( IsSame<MT,TT>::value && (~rhs).isAliased(
this ) ) {
3659 else if( IsSame<MT,CT>::value && (~rhs).isAliased(
this ) ) {
3662 else if( (~rhs).canAlias(
this ) ) {
3663 DynamicMatrix tmp( ~rhs );
3668 if( IsSparseMatrix<MT>::value )
3690 template<
typename Type >
3691 template<
typename MT
3693 inline DynamicMatrix<Type,true>& DynamicMatrix<Type,true>::operator+=(
const Matrix<MT,SO>& rhs )
3695 if( (~rhs).
rows() != m_ || (~rhs).
columns() != n_ ) {
3699 if( (~rhs).canAlias(
this ) ) {
3724 template<
typename Type >
3725 template<
typename MT
3727 inline DynamicMatrix<Type,true>& DynamicMatrix<Type,true>::operator-=(
const Matrix<MT,SO>& rhs )
3729 if( (~rhs).
rows() != m_ || (~rhs).
columns() != n_ ) {
3733 if( (~rhs).canAlias(
this ) ) {
3758 template<
typename Type >
3759 template<
typename MT
3761 inline DynamicMatrix<Type,true>& DynamicMatrix<Type,true>::operator*=(
const Matrix<MT,SO>& rhs )
3763 if( (~rhs).
rows() != n_ ) {
3767 DynamicMatrix tmp( *
this * (~rhs) );
3784 template<
typename Type >
3785 template<
typename Other >
3786 inline typename EnableIf< IsNumeric<Other>, DynamicMatrix<Type,true> >::Type&
3787 DynamicMatrix<Type,true>::operator*=( Other rhs )
3804 template<
typename Type >
3805 template<
typename Other >
3806 inline typename EnableIf< IsNumeric<Other>, DynamicMatrix<Type,true> >::Type&
3807 DynamicMatrix<Type,true>::operator/=( Other rhs )
3832 template<
typename Type >
3847 template<
typename Type >
3865 template<
typename Type >
3880 template<
typename Type >
3896 template<
typename Type >
3913 template<
typename Type >
3916 size_t nonzeros( 0UL );
3918 for(
size_t j=0UL; j<
n_; ++j )
3919 for(
size_t i=0UL; i<
m_; ++i )
3936 template<
typename Type >
3941 const size_t iend( j*mm_ + m_ );
3942 size_t nonzeros( 0UL );
3944 for(
size_t i=j*mm_; i<iend; ++i )
3960 template<
typename Type >
3965 for(
size_t j=0UL; j<
n_; ++j )
3966 for(
size_t i=0UL; i<
m_; ++i )
3967 clear( v_[i+j*mm_] );
3983 template<
typename Type >
3989 for(
size_t i=0UL; i<
m_; ++i )
3990 clear( v_[i+j*mm_] );
4004 template<
typename Type >
4007 resize( 0UL, 0UL,
false );
4048 template<
typename Type >
4053 if( m == m_ && n == n_ )
return;
4055 const size_t mm( adjustRows( m ) );
4060 const size_t min_m(
min( m, m_ ) );
4061 const size_t min_n(
min( n, n_ ) );
4063 for(
size_t j=0UL; j<min_n; ++j )
4064 for(
size_t i=0UL; i<min_m; ++i )
4065 v[i+j*mm] = v_[i+j*mm_];
4078 if( IsVectorizable<Type>::value ) {
4079 for(
size_t j=0UL; j<n; ++j )
4080 for(
size_t i=m; i<mm; ++i )
4081 v_[i+j*mm] = Type();
4107 template<
typename Type >
4110 resize( m_+m, n_+n, preserve );
4126 template<
typename Type >
4137 if( IsVectorizable<Type>::value ) {
4138 for(
size_t i=
capacity_; i<elements; ++i )
4158 template<
typename Type >
4163 const size_t block( BLOCK_SIZE );
4167 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
4168 const size_t jend(
min( jj+block, n_ ) );
4169 for(
size_t ii=0UL; ii<=jj; ii+=block ) {
4170 for(
size_t j=jj; j<jend; ++j ) {
4171 const size_t iend(
min( ii+block, m_, j ) );
4172 for(
size_t i=ii; i<iend; ++i ) {
4173 swap( v_[i+j*mm_], v_[j+i*mm_] );
4181 DynamicMatrix tmp(
trans(*
this) );
4197 template<
typename Type >
4200 const size_t block( BLOCK_SIZE );
4204 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
4205 const size_t jend(
min( jj+block, n_ ) );
4206 for(
size_t ii=0UL; ii<jj; ii+=block ) {
4207 const size_t iend(
min( ii+block, m_ ) );
4208 for(
size_t j=jj; j<jend; ++j ) {
4209 for(
size_t i=ii; i<iend; ++i ) {
4210 cswap( v_[i+j*mm_], v_[j+i*mm_] );
4214 for(
size_t j=jj; j<jend; ++j ) {
4215 for(
size_t i=jj; i<j; ++i ) {
4216 cswap( v_[i+j*mm_], v_[j+i*mm_] );
4224 DynamicMatrix tmp(
ctrans(*
this) );
4241 template<
typename Type >
4242 template<
typename Other >
4243 inline DynamicMatrix<Type,true>& DynamicMatrix<Type,true>::scale(
const Other& scalar )
4245 for(
size_t j=0UL; j<
n_; ++j )
4246 for(
size_t i=0UL; i<
m_; ++i )
4247 v_[i+j*mm_] *= scalar;
4263 template<
typename Type >
4283 template<
typename Type >
4284 inline size_t DynamicMatrix<Type,true>::adjustRows(
size_t minRows )
const
4286 if(
usePadding && IsVectorizable<Type>::value )
4287 return nextMultiple<size_t>( minRows,
IT::size );
4288 else return minRows;
4313 template<
typename Type >
4314 template<
typename Other >
4317 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
4334 template<
typename Type >
4335 template<
typename Other >
4338 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
4354 template<
typename Type >
4374 template<
typename Type >
4377 return (
columns() > SMP_DMATASSIGN_THRESHOLD );
4398 template<
typename Type >
4403 return loada( i, j );
4405 return loadu( i, j );
4426 template<
typename Type >
4440 return loada( v_+i+j*mm_ );
4461 template<
typename Type >
4473 return loadu( v_+i+j*mm_ );
4495 template<
typename Type >
4524 template<
typename Type >
4538 storea( v_+i+j*mm_, value );
4560 template<
typename Type >
4572 storeu( v_+i+j*mm_, value );
4594 template<
typename Type >
4608 stream( v_+i+j*mm_, value );
4626 template<
typename Type >
4627 template<
typename MT >
4628 inline typename DisableIf< typename DynamicMatrix<Type,true>::BLAZE_TEMPLATE VectorizedAssign<MT> >::Type
4629 DynamicMatrix<Type,true>::assign(
const DenseMatrix<MT,true>& rhs )
4634 const size_t ipos( m_ &
size_t(-2) );
4637 for(
size_t j=0UL; j<
n_; ++j ) {
4638 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4639 v_[i +j*mm_] = (~rhs)(i ,j);
4640 v_[i+1UL+j*mm_] = (~rhs)(i+1UL,j);
4643 v_[ipos+j*mm_] = (~rhs)(ipos,j);
4663 template<
typename Type >
4664 template<
typename MT >
4665 inline typename EnableIf< typename DynamicMatrix<Type,true>::BLAZE_TEMPLATE VectorizedAssign<MT> >::Type
4666 DynamicMatrix<Type,true>::assign(
const DenseMatrix<MT,true>& rhs )
4673 const bool remainder( !
usePadding || !IsPadded<MT>::value );
4675 const size_t ipos( ( remainder )?( m_ &
size_t(-
IT::size) ):( m_ ) );
4679 ( m_*n_ > (
cacheSize / (
sizeof(Type) * 3UL ) ) ) && !(~rhs).isAliased(
this ) )
4681 for(
size_t j=0UL; j<
n_; ++j )
4686 stream( i, j, (~rhs).load(i,j) );
4688 for( ; remainder && i<
m_; ++i ) {
4689 v_[i+j*mm_] = (~rhs)(i,j);
4695 for(
size_t j=0UL; j<
n_; ++j )
4701 store( i , j, it.load() ); it +=
IT::size;
4707 store( i, j, it.load() );
4709 for( ; remainder && i<
m_; ++i, ++it ) {
4731 template<
typename Type >
4732 template<
typename MT >
4733 inline void DynamicMatrix<Type,true>::assign(
const DenseMatrix<MT,false>& rhs )
4740 const size_t block( BLOCK_SIZE );
4742 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
4743 const size_t jend(
min( n_, jj+block ) );
4744 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
4745 const size_t iend(
min( m_, ii+block ) );
4746 for(
size_t j=jj; j<jend; ++j ) {
4747 for(
size_t i=ii; i<iend; ++i ) {
4748 v_[i+j*mm_] = (~rhs)(i,j);
4770 template<
typename Type >
4771 template<
typename MT >
4772 inline void DynamicMatrix<Type,true>::assign(
const SparseMatrix<MT,true>& rhs )
4777 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
4779 v_[element->index()+j*mm_] = element->value();
4797 template<
typename Type >
4798 template<
typename MT >
4799 inline void DynamicMatrix<Type,true>::assign(
const SparseMatrix<MT,false>& rhs )
4806 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
4808 v_[i+element->index()*mm_] = element->value();
4826 template<
typename Type >
4827 template<
typename MT >
4828 inline typename DisableIf< typename DynamicMatrix<Type,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >::Type
4829 DynamicMatrix<Type,true>::addAssign(
const DenseMatrix<MT,true>& rhs )
4834 for(
size_t j=0UL; j<
n_; ++j )
4836 if( IsDiagonal<MT>::value )
4838 v_[j+j*mm_] += (~rhs)(j,j);
4842 const size_t ibegin( ( IsLower<MT>::value )
4843 ?( IsStrictlyLower<MT>::value ? j+1UL : j )
4845 const size_t iend ( ( IsUpper<MT>::value )
4846 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
4852 for( ; (i+2UL) <= iend; i+=2UL ) {
4853 v_[i +j*mm_] += (~rhs)(i ,j);
4854 v_[i+1UL+j*mm_] += (~rhs)(i+1UL,j);
4857 v_[i+j*mm_] += (~rhs)(i,j);
4878 template<
typename Type >
4879 template<
typename MT >
4880 inline typename EnableIf< typename DynamicMatrix<Type,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >::Type
4881 DynamicMatrix<Type,true>::addAssign(
const DenseMatrix<MT,true>& rhs )
4889 const bool remainder( !
usePadding || !IsPadded<MT>::value );
4891 for(
size_t j=0UL; j<
n_; ++j )
4893 const size_t ibegin( ( IsLower<MT>::value )
4894 ?( ( IsStrictlyLower<MT>::value ? j+1UL : j ) &
size_t(-
IT::size) )
4896 const size_t iend ( ( IsUpper<MT>::value )
4897 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
4901 const size_t ipos( ( remainder )?( iend &
size_t(-
IT::size) ):( iend ) );
4908 store( i , j, load(i ,j) + it.load() ); it +=
IT::size;
4914 store( i, j, load(i,j) + it.load() );
4916 for( ; remainder && i<iend; ++i, ++it ) {
4937 template<
typename Type >
4938 template<
typename MT >
4939 inline void DynamicMatrix<Type,true>::addAssign(
const DenseMatrix<MT,false>& rhs )
4946 const size_t block( BLOCK_SIZE );
4948 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
4949 const size_t jend(
min( n_, jj+block ) );
4950 for(
size_t ii=0UL; ii<
m_; ii+=block )
4952 if( IsLower<MT>::value && ii < jj )
continue;
4953 if( IsUpper<MT>::value && ii > jj )
break;
4955 for(
size_t j=jj; j<jend; ++j )
4957 const size_t ibegin( ( IsLower<MT>::value )
4958 ?(
max( ( IsStrictlyLower<MT>::value ? j+1UL : j ), ii ) )
4960 const size_t iend ( ( IsUpper<MT>::value )
4961 ?(
min( ( IsStrictlyUpper<MT>::value ? j : j+1UL ), m_, ii+block ) )
4962 :(
min( m_, ii+block ) ) );
4965 for(
size_t i=ibegin; i<iend; ++i ) {
4966 v_[i+j*mm_] += (~rhs)(i,j);
4988 template<
typename Type >
4989 template<
typename MT >
4990 inline void DynamicMatrix<Type,true>::addAssign(
const SparseMatrix<MT,true>& rhs )
4995 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
4997 v_[element->index()+j*mm_] += element->value();
5015 template<
typename Type >
5016 template<
typename MT >
5017 inline void DynamicMatrix<Type,true>::addAssign(
const SparseMatrix<MT,false>& rhs )
5024 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
5026 v_[i+element->index()*mm_] += element->value();
5044 template<
typename Type >
5045 template<
typename MT >
5046 inline typename DisableIf< typename DynamicMatrix<Type,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >::Type
5047 DynamicMatrix<Type,true>::subAssign(
const DenseMatrix<MT,true>& rhs )
5052 for(
size_t j=0UL; j<
n_; ++j )
5054 if( IsDiagonal<MT>::value )
5056 v_[j+j*mm_] -= (~rhs)(j,j);
5060 const size_t ibegin( ( IsLower<MT>::value )
5061 ?( IsStrictlyLower<MT>::value ? j+1UL : j )
5063 const size_t iend ( ( IsUpper<MT>::value )
5064 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5070 for( ; (i+2UL) <= iend; i+=2UL ) {
5071 v_[i +j*mm_] -= (~rhs)(i ,j);
5072 v_[i+1+j*mm_] -= (~rhs)(i+1,j);
5075 v_[i+j*mm_] -= (~rhs)(i,j);
5097 template<
typename Type >
5098 template<
typename MT >
5099 inline typename EnableIf< typename DynamicMatrix<Type,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >::Type
5100 DynamicMatrix<Type,true>::subAssign(
const DenseMatrix<MT,true>& rhs )
5108 const bool remainder( !
usePadding || !IsPadded<MT>::value );
5110 for(
size_t j=0UL; j<
n_; ++j )
5112 const size_t ibegin( ( IsLower<MT>::value )
5113 ?( ( IsStrictlyLower<MT>::value ? j+1UL : j ) &
size_t(-
IT::size) )
5115 const size_t iend ( ( IsUpper<MT>::value )
5116 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5120 const size_t ipos( ( remainder )?( iend &
size_t(-
IT::size) ):( iend ) );
5127 store( i , j, load(i ,j) - it.load() ); it +=
IT::size;
5133 store( i, j, load(i,j) - it.load() );
5135 for( ; remainder && i<iend; ++i, ++it ) {
5156 template<
typename Type >
5157 template<
typename MT >
5158 inline void DynamicMatrix<Type,true>::subAssign(
const DenseMatrix<MT,false>& rhs )
5165 const size_t block( BLOCK_SIZE );
5167 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
5168 const size_t jend(
min( n_, jj+block ) );
5169 for(
size_t ii=0UL; ii<
m_; ii+=block )
5171 if( IsLower<MT>::value && ii < jj )
continue;
5172 if( IsUpper<MT>::value && ii > jj )
break;
5174 for(
size_t j=jj; j<jend; ++j )
5176 const size_t ibegin( ( IsLower<MT>::value )
5177 ?(
max( ( IsStrictlyLower<MT>::value ? j+1UL : j ), ii ) )
5179 const size_t iend ( ( IsUpper<MT>::value )
5180 ?(
min( ( IsStrictlyUpper<MT>::value ? j : j+1UL ), m_, ii+block ) )
5181 :(
min( m_, ii+block ) ) );
5184 for(
size_t i=ibegin; i<iend; ++i ) {
5185 v_[i+j*mm_] -= (~rhs)(i,j);
5207 template<
typename Type >
5208 template<
typename MT >
5209 inline void DynamicMatrix<Type,true>::subAssign(
const SparseMatrix<MT,true>& rhs )
5214 for(
size_t j=0UL; j<(~rhs).
columns(); ++j )
5216 v_[element->index()+j*mm_] -= element->value();
5234 template<
typename Type >
5235 template<
typename MT >
5236 inline void DynamicMatrix<Type,true>::subAssign(
const SparseMatrix<MT,false>& rhs )
5243 for(
size_t i=0UL; i<(~rhs).
rows(); ++i )
5245 v_[i+element->index()*mm_] -= element->value();
5266 template<
typename Type,
bool SO >
5267 inline void reset( DynamicMatrix<Type,SO>& m );
5269 template<
typename Type,
bool SO >
5270 inline void reset( DynamicMatrix<Type,SO>& m,
size_t i );
5272 template<
typename Type,
bool SO >
5273 inline void clear( DynamicMatrix<Type,SO>& m );
5275 template<
typename Type,
bool SO >
5276 inline bool isDefault(
const DynamicMatrix<Type,SO>& m );
5278 template<
typename Type,
bool SO >
5279 inline bool isIntact(
const DynamicMatrix<Type,SO>& m );
5281 template<
typename Type,
bool SO >
5282 inline void swap( DynamicMatrix<Type,SO>& a, DynamicMatrix<Type,SO>& b ) ;
5284 template<
typename Type,
bool SO >
5285 inline void move( DynamicMatrix<Type,SO>& dst, DynamicMatrix<Type,SO>& src ) ;
5297 template<
typename Type
5319 template<
typename Type
5335 template<
typename Type
5362 template<
typename Type
5389 template<
typename Type
5407 template<
typename Type
5425 template<
typename Type
5444 template<
typename T,
bool SO >
5445 struct HasConstDataAccess< DynamicMatrix<T,SO> > :
public IsTrue<true>
5461 template<
typename T,
bool SO >
5462 struct HasMutableDataAccess< DynamicMatrix<T,SO> > :
public IsTrue<true>
5478 template<
typename T,
bool SO >
5479 struct IsAligned< DynamicMatrix<T,SO> > :
public IsTrue<usePadding>
5495 template<
typename T,
bool SO >
5496 struct IsPadded< DynamicMatrix<T,SO> > :
public IsTrue<usePadding>
5512 template<
typename T,
bool SO >
5513 struct IsResizable< DynamicMatrix<T,SO> > :
public IsTrue<true>
5529 template<
typename T1,
bool SO,
typename T2,
size_t M,
size_t N >
5530 struct AddTrait< DynamicMatrix<T1,SO>, StaticMatrix<T2,M,N,SO> >
5532 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M, N, SO > Type;
5535 template<
typename T1,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
5536 struct AddTrait< DynamicMatrix<T1,SO1>, StaticMatrix<T2,M,N,SO2> >
5538 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M, N,
false > Type;
5541 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
5542 struct AddTrait< StaticMatrix<T1,M,N,SO>, DynamicMatrix<T2,SO> >
5544 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M, N, SO > Type;
5547 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
5548 struct AddTrait< StaticMatrix<T1,M,N,SO1>, DynamicMatrix<T2,SO2> >
5550 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M, N,
false > Type;
5553 template<
typename T1,
bool SO,
typename T2,
size_t M,
size_t N >
5554 struct AddTrait< DynamicMatrix<T1,SO>, HybridMatrix<T2,M,N,SO> >
5556 typedef HybridMatrix< typename AddTrait<T1,T2>::Type, M, N, SO > Type;
5559 template<
typename T1,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
5560 struct AddTrait< DynamicMatrix<T1,SO1>, HybridMatrix<T2,M,N,SO2> >
5562 typedef HybridMatrix< typename AddTrait<T1,T2>::Type, M, N,
false > Type;
5565 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
5566 struct AddTrait< HybridMatrix<T1,M,N,SO>, DynamicMatrix<T2,SO> >
5568 typedef HybridMatrix< typename AddTrait<T1,T2>::Type, M, N, SO > Type;
5571 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
5572 struct AddTrait< HybridMatrix<T1,M,N,SO1>, DynamicMatrix<T2,SO2> >
5574 typedef HybridMatrix< typename AddTrait<T1,T2>::Type, M, N,
false > Type;
5577 template<
typename T1,
bool SO,
typename T2 >
5578 struct AddTrait< DynamicMatrix<T1,SO>, DynamicMatrix<T2,SO> >
5580 typedef DynamicMatrix< typename AddTrait<T1,T2>::Type, SO > Type;
5583 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
5584 struct AddTrait< DynamicMatrix<T1,SO1>, DynamicMatrix<T2,SO2> >
5586 typedef DynamicMatrix< typename AddTrait<T1,T2>::Type,
false > Type;
5602 template<
typename T1,
bool SO,
typename T2,
size_t M,
size_t N >
5603 struct SubTrait< DynamicMatrix<T1,SO>, StaticMatrix<T2,M,N,SO> >
5605 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M, N, SO > Type;
5608 template<
typename T1,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
5609 struct SubTrait< DynamicMatrix<T1,SO1>, StaticMatrix<T2,M,N,SO2> >
5611 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M, N,
false > Type;
5614 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
5615 struct SubTrait< StaticMatrix<T1,M,N,SO>, DynamicMatrix<T2,SO> >
5617 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M, N, SO > Type;
5620 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
5621 struct SubTrait< StaticMatrix<T1,M,N,SO1>, DynamicMatrix<T2,SO2> >
5623 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M, N,
false > Type;
5626 template<
typename T1,
bool SO,
typename T2,
size_t M,
size_t N >
5627 struct SubTrait< DynamicMatrix<T1,SO>, HybridMatrix<T2,M,N,SO> >
5629 typedef HybridMatrix< typename SubTrait<T1,T2>::Type, M, N, SO > Type;
5632 template<
typename T1,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
5633 struct SubTrait< DynamicMatrix<T1,SO1>, HybridMatrix<T2,M,N,SO2> >
5635 typedef HybridMatrix< typename SubTrait<T1,T2>::Type, M, N,
false > Type;
5638 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
5639 struct SubTrait< HybridMatrix<T1,M,N,SO>, DynamicMatrix<T2,SO> >
5641 typedef HybridMatrix< typename SubTrait<T1,T2>::Type, M, N, SO > Type;
5644 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
5645 struct SubTrait< HybridMatrix<T1,M,N,SO1>, DynamicMatrix<T2,SO2> >
5647 typedef HybridMatrix< typename SubTrait<T1,T2>::Type, M, N,
false > Type;
5650 template<
typename T1,
bool SO,
typename T2 >
5651 struct SubTrait< DynamicMatrix<T1,SO>, DynamicMatrix<T2,SO> >
5653 typedef DynamicMatrix< typename SubTrait<T1,T2>::Type, SO > Type;
5656 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
5657 struct SubTrait< DynamicMatrix<T1,SO1>, DynamicMatrix<T2,SO2> >
5659 typedef DynamicMatrix< typename SubTrait<T1,T2>::Type,
false > Type;
5675 template<
typename T1,
bool SO,
typename T2 >
5676 struct MultTrait< DynamicMatrix<T1,SO>, T2, typename EnableIf< IsNumeric<T2> >::Type >
5678 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO > Type;
5681 template<
typename T1,
typename T2,
bool SO >
5682 struct MultTrait< T1, DynamicMatrix<T2,SO>, typename EnableIf< IsNumeric<T1> >::Type >
5684 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO > Type;
5687 template<
typename T1,
bool SO,
typename T2,
size_t N >
5688 struct MultTrait< DynamicMatrix<T1,SO>, StaticVector<T2,N,false> >
5690 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
false > Type;
5693 template<
typename T1,
size_t N,
typename T2,
bool SO >
5694 struct MultTrait< StaticVector<T1,N,true>, DynamicMatrix<T2,SO> >
5696 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
true > Type;
5699 template<
typename T1,
bool SO,
typename T2,
size_t N >
5700 struct MultTrait< DynamicMatrix<T1,SO>, HybridVector<T2,N,false> >
5702 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
false > Type;
5705 template<
typename T1,
size_t N,
typename T2,
bool SO >
5706 struct MultTrait< HybridVector<T1,N,true>, DynamicMatrix<T2,SO> >
5708 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
true > Type;
5711 template<
typename T1,
bool SO,
typename T2 >
5712 struct MultTrait< DynamicMatrix<T1,SO>, DynamicVector<T2,false> >
5714 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
false > Type;
5717 template<
typename T1,
typename T2,
bool SO >
5718 struct MultTrait< DynamicVector<T1,true>, DynamicMatrix<T2,SO> >
5720 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
true > Type;
5723 template<
typename T1,
bool SO,
typename T2,
bool AF,
bool PF >
5724 struct MultTrait< DynamicMatrix<T1,SO>, CustomVector<T2,AF,PF,false> >
5726 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
false > Type;
5729 template<
typename T1,
bool AF,
bool PF,
typename T2,
bool SO >
5730 struct MultTrait< CustomVector<T1,AF,PF,true>, DynamicMatrix<T2,SO> >
5732 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
true > Type;
5735 template<
typename T1,
bool SO,
typename T2 >
5736 struct MultTrait< DynamicMatrix<T1,SO>, CompressedVector<T2,false> >
5738 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
false > Type;
5741 template<
typename T1,
typename T2,
bool SO >
5742 struct MultTrait< CompressedVector<T1,true>, DynamicMatrix<T2,SO> >
5744 typedef DynamicVector< typename MultTrait<T1,T2>::Type,
true > Type;
5747 template<
typename T1,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
5748 struct MultTrait< DynamicMatrix<T1,SO1>, StaticMatrix<T2,M,N,SO2> >
5750 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO1 > Type;
5753 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
5754 struct MultTrait< StaticMatrix<T1,M,N,SO1>, DynamicMatrix<T2,SO2> >
5756 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO1 > Type;
5759 template<
typename T1,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
5760 struct MultTrait< DynamicMatrix<T1,SO1>, HybridMatrix<T2,M,N,SO2> >
5762 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO1 > Type;
5765 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
5766 struct MultTrait< HybridMatrix<T1,M,N,SO1>, DynamicMatrix<T2,SO2> >
5768 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO1 > Type;
5771 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
5772 struct MultTrait< DynamicMatrix<T1,SO1>, DynamicMatrix<T2,SO2> >
5774 typedef DynamicMatrix< typename MultTrait<T1,T2>::Type, SO1 > Type;
5790 template<
typename T1,
bool SO,
typename T2 >
5791 struct DivTrait< DynamicMatrix<T1,SO>, T2, typename EnableIf< IsNumeric<T2> >::Type >
5793 typedef DynamicMatrix< typename DivTrait<T1,T2>::Type , SO > Type;
5809 template<
typename T1,
bool SO,
typename T2 >
5810 struct MathTrait< DynamicMatrix<T1,SO>, DynamicMatrix<T2,SO> >
5812 typedef DynamicMatrix< typename MathTrait<T1,T2>::HighType, SO > HighType;
5813 typedef DynamicMatrix< typename MathTrait<T1,T2>::LowType , SO > LowType;
5829 template<
typename T1,
bool SO >
5830 struct SubmatrixTrait< DynamicMatrix<T1,SO> >
5832 typedef DynamicMatrix<T1,SO> Type;
5848 template<
typename T1,
bool SO >
5849 struct RowTrait< DynamicMatrix<T1,SO> >
5851 typedef DynamicVector<T1,true> Type;
5867 template<
typename T1,
bool SO >
5868 struct ColumnTrait< DynamicMatrix<T1,SO> >
5870 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
Reference operator()(size_t i, size_t j)
2D-access to the matrix elements.
Definition: DynamicMatrix.h:741
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1729
size_t n_
The current number of columns of the matrix.
Definition: DynamicMatrix.h:445
Header file for kernel specific block sizes.
Header file for mathematical functions.
void reserve(size_t elements)
Setting the minimum capacity of the matrix.
Definition: DynamicMatrix.h:1610
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the alignment flag values.
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
Header file for basic type definitions.
const bool defaultStorageOrder
The default storage order for all matrices of the Blaze library.This value specifies the default stor...
Definition: StorageOrder.h:56
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
ConstIterator cbegin(size_t i) const
Returns an iterator to the first element of row/column i.
Definition: DynamicMatrix.h:962
Header file for the row trait.
Type *BLAZE_RESTRICT v_
The dynamically allocated matrix elements.
Definition: DynamicMatrix.h:448
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.
void resize(size_t m, size_t n, bool preserve=true)
Changing the size of the matrix.
Definition: DynamicMatrix.h:1534
Header file for the IsDiagonal type trait.
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: DynamicMatrix.h:2070
Header file for the IsSame and IsStrictlySame type traits.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: DynamicMatrix.h:1328
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
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
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
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:584
#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
DynamicMatrix()
The default constructor for DynamicMatrix.
Definition: DynamicMatrix.h:486
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 enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:158
BLAZE_ALWAYS_INLINE IntrinsicType loadu(size_t i, size_t j) const
Unaligned load of an intrinsic element of the matrix.
Definition: DynamicMatrix.h:1937
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:90
Header file for memory allocation and deallocation functionality.
size_t spacing() const
Returns the spacing between the beginning of two rows/columns.
Definition: DynamicMatrix.h:1347
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
EnableIf< IsBuiltin< T >, T * >::Type allocate(size_t size)
Aligned array allocation for built-in data types.
Definition: Memory.h:152
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
const This & CompositeType
Data type for composite expression templates.
Definition: DynamicMatrix.h:211
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:117
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
Constraint on the data type.
size_t capacity_
The current capacity of the pointer array.
Definition: CompressedMatrix.h:2751
BLAZE_ALWAYS_INLINE void storea(size_t i, size_t j, const IntrinsicType &value)
Aligned store of an intrinsic element of the matrix.
Definition: DynamicMatrix.h:2000
~DynamicMatrix()
The destructor for DynamicMatrix.
Definition: DynamicMatrix.h:713
This ResultType
Result type for expression template evaluations.
Definition: DynamicMatrix.h:205
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t i, size_t j) const
Load of an intrinsic element of the matrix.
Definition: DynamicMatrix.h:1874
Header file for the SparseMatrix base class.
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: DynamicMatrix.h:1397
size_t adjustColumns(size_t minColumns) const
Adjusting the number columns of the matrix according to its data type Type.
Definition: DynamicMatrix.h:1762
DenseIterator< Type, usePadding > Iterator
Iterator over non-constant elements.
Definition: DynamicMatrix.h:218
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
ConstIterator cend(size_t i) const
Returns an iterator just past the last element of row/column i.
Definition: DynamicMatrix.h:1028
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
bool isAligned() const
Returns whether the matrix is properly aligned in memory.
Definition: DynamicMatrix.h:1830
DynamicMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: DynamicMatrix.h:1679
Header file for the clear shim.
BLAZE_ALWAYS_INLINE IntrinsicType loada(size_t i, size_t j) const
Aligned load of an intrinsic element of the matrix.
Definition: DynamicMatrix.h:1902
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)
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:4998
Type ElementType
Type of the matrix elements.
Definition: DynamicMatrix.h:208
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
IntrinsicTrait< Type > IT
Intrinsic trait for the matrix element type.
Definition: DynamicMatrix.h:199
#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
DynamicMatrix< Type, SO > This
Type of this DynamicMatrix instance.
Definition: DynamicMatrix.h:204
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.
EnableIf< IsBuiltin< T > >::Type deallocate(T *address)
Deallocation of memory for built-in data types.
Definition: Memory.h:227
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
const CTransExprTrait< MT >::Type ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatConjExpr.h:974
const Type & ReturnType
Return type for expression template evaluations.
Definition: DynamicMatrix.h:210
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
void extend(size_t m, size_t n, bool preserve=true)
Extending the size of the matrix.
Definition: DynamicMatrix.h:1592
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DynamicMatrix.h:1314
#define BLAZE_RESTRICT
Platform dependent setup of the restrict keyword.
Definition: Restrict.h:81
Header file for the default storage order for all vectors of the Blaze library.
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a vectorizable data type...
Definition: Vectorizable.h:79
void reset()
Reset to the default initial values.
Definition: DynamicMatrix.h:1447
Iterator end(size_t i)
Returns an iterator just past the last element of row/column i.
Definition: DynamicMatrix.h:984
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
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:532
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2590
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.
DynamicMatrix< Type,!SO > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DynamicMatrix.h:206
size_t capacity() const
Returns the maximum capacity of the matrix.
Definition: DynamicMatrix.h:1361
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.
size_t nn_
The alignment adjusted number of columns.
Definition: DynamicMatrix.h:446
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
Type * Pointer
Pointer to a non-constant matrix value.
Definition: DynamicMatrix.h:215
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
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
Header file for the addition trait.
void clear()
Clearing the matrix.
Definition: DynamicMatrix.h:1491
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: DynamicMatrix.h:216
Header file for the division trait.
Header file for the submatrix trait.
Constraint on the data type.
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
const bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
size_t m_
The current number of rows of the matrix.
Definition: DynamicMatrix.h:444
Iterator begin(size_t i)
Returns an iterator to the first element of row/column i.
Definition: DynamicMatrix.h:918
BLAZE_ALWAYS_INLINE void storeu(size_t i, size_t j, const IntrinsicType &value)
Unaligned store of an intrinsic element of the matrix.
Definition: DynamicMatrix.h:2036
bool isAliased(const Other *alias) const
Returns whether the matrix is aliased with the given address alias.
Definition: DynamicMatrix.h:1812
const bool usePadding
Configuration of the padding of dense vectors and matrices.This configuration switch enables/disables...
Definition: Optimizations.h:52
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.
System settings for the restrict keyword.
Header file for the TransExprTrait class template.
Constraint on the data type.
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:94
Constraint on the data type.
Constraint on the data type.
void swap(DynamicMatrix &m)
Swapping the contents of two matrices.
Definition: DynamicMatrix.h:1743
Header file for the HasMutableDataAccess type trait.
Evaluation of the return type of a conjugate transpose expression.Via this type trait it is possible ...
Definition: CTransExprTrait.h:87
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
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.
Header file for the mathematical trait.
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
Type & Reference
Reference to a non-constant matrix value.
Definition: DynamicMatrix.h:213
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 store(size_t i, size_t j, const IntrinsicType &value)
Store of an intrinsic element of the matrix.
Definition: DynamicMatrix.h:1971
bool canSMPAssign() const
Returns whether the matrix can be used in SMP assignments.
Definition: DynamicMatrix.h:1849
size_t n_
The current number of columns of the sparse matrix.
Definition: CompressedMatrix.h:2750
Evaluation of the return type of a transpose expression.Via this type trait it is possible to evaluat...
Definition: TransExprTrait.h:87
DenseIterator< const Type, usePadding > ConstIterator
Iterator over constant elements.
Definition: DynamicMatrix.h:219
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:944
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 void cswap(T &a, T &b)
Swapping two conjugated values/objects.
Definition: Conjugate.h:197
IT::Type IntrinsicType
Intrinsic type of the matrix elements.
Definition: DynamicMatrix.h:209
size_t capacity_
The maximum capacity of the matrix.
Definition: DynamicMatrix.h:447
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
Rebind mechanism to obtain a DynamicMatrix with different data/element type.
Definition: DynamicMatrix.h:226
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2589
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.
Header file for the CTransExprTrait class template.
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
Pointer data()
Low-level data access to the matrix elements.
Definition: DynamicMatrix.h:840
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: DynamicMatrix.h:786
Header file for the IsResizable type trait.
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
bool canAlias(const Other *alias) const
Returns whether the matrix can alias with the given address alias.
Definition: DynamicMatrix.h:1792
DynamicMatrix< ET, SO > Other
The type of the other DynamicMatrix.
Definition: DynamicMatrix.h:227
DynamicMatrix & transpose()
In-place transpose of the matrix.
Definition: DynamicMatrix.h:1641
const Type & ConstReference
Reference to a constant matrix value.
Definition: DynamicMatrix.h:214
DynamicMatrix< Type,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: DynamicMatrix.h:207
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
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:558
Header file for a safe C++ NULL pointer implementation.