35#ifndef _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_
36#define _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_
247template<
typename Type
255 :
public DenseMatrix< HybridMatrix<Type,M,N,SO,AF,PF,Tag>, SO >
289 template<
typename NewType >
298 template<
size_t NewM
328 template<
typename Other >
331 template<
typename Other,
size_t Rows,
size_t Cols >
334 template<
typename Other,
size_t Rows,
size_t Cols >
335 inline HybridMatrix(
const std::array<std::array<Other,Cols>,Rows>& array );
339 template<
typename MT,
bool SO2 >
377 template< typename Other,
size_t Rows,
size_t Cols >
378 constexpr
HybridMatrix& operator=( const Other (&array)[Rows][Cols] ) &;
380 template< typename Other,
size_t Rows,
size_t Cols >
381 constexpr
HybridMatrix& operator=( const std::array<std::array<Other,Cols>,Rows>& array ) &;
385 template< typename MT,
bool SO2 > inline
HybridMatrix& operator= ( const
Matrix<MT,SO2>& rhs ) &;
386 template< typename MT,
bool SO2 > inline
HybridMatrix& operator+=( const
Matrix<MT,SO2>& rhs ) &;
387 template< typename MT,
bool SO2 > inline
HybridMatrix& operator-=( const
Matrix<MT,SO2>& rhs ) &;
388 template< typename MT,
bool SO2 > inline
HybridMatrix& operator%=( const
Matrix<MT,SO2>& rhs ) &;
395 constexpr
size_t rows() const noexcept;
399 constexpr
size_t capacity(
size_t i ) const noexcept;
405 constexpr
void resize (
size_t m,
size_t n,
bool preserve=true );
406 constexpr
void extend (
size_t m,
size_t n,
bool preserve=true );
417 template< typename Other > inline
HybridMatrix& scale( const Other& scalar );
424 static inline
void* operator new ( std::
size_t size );
425 static inline
void* operator new[]( std::
size_t size );
426 static inline
void* operator new ( std::
size_t size, const std::nothrow_t& );
427 static inline
void* operator new[]( std::
size_t size, const std::nothrow_t& );
429 static inline
void operator delete (
void* ptr );
430 static inline
void operator delete[](
void* ptr );
431 static inline
void operator delete (
void* ptr, const std::nothrow_t& );
432 static inline
void operator delete[](
void* ptr, const std::nothrow_t& );
448 template< typename MT >
449 static constexpr
bool VectorizedAssign_v =
450 ( useOptimizedKernels &&
461 template< typename MT >
462 static constexpr
bool VectorizedAddAssign_v =
463 ( VectorizedAssign_v<MT> &&
472 template< typename MT >
473 static constexpr
bool VectorizedSubAssign_v =
474 ( VectorizedAssign_v<MT> &&
483 template< typename MT >
484 static constexpr
bool VectorizedSchurAssign_v =
485 ( VectorizedAssign_v<MT> &&
501 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
502 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
515 template< typename MT,
bool SO2 >
518 template< typename MT,
bool SO2 >
519 inline auto
assign( const DenseMatrix<MT,SO2>& rhs ) ->
EnableIf_t< VectorizedAssign_v<MT> >;
524 template< typename MT,
bool SO2 >
527 template< typename MT,
bool SO2 >
533 template< typename MT,
bool SO2 >
536 template< typename MT,
bool SO2 >
542 template< typename MT,
bool SO2 >
545 template< typename MT,
bool SO2 >
608template<
typename Type,
size_t M,
size_t N >
611template<
typename Type,
size_t M,
size_t N >
631template<
typename Type
661template<
typename Type
700template<
typename Type
722 for(
size_t i=0UL; i<m; ++i ) {
723 for(
size_t j=0UL; j<n; ++j )
727 for(
size_t j=n; j<
NN; ++j )
733 for(
size_t i=m; i<M; ++i )
734 for(
size_t j=0UL; j<
NN; ++j )
767template<
typename Type
789 for(
const auto& rowList : list ) {
791 for(
const auto& element : rowList ) {
792 v_[i*
NN+j] = element;
830template<
typename Type
837template<
typename Other >
853 for(
size_t i=0UL; i<m; ++i ) {
854 for(
size_t j=0UL; j<n; ++j )
855 v_[i*
NN+j] = array[i*n+j];
858 for(
size_t j=n; j<
NN; ++j )
864 for(
size_t i=m; i<M; ++i )
865 for(
size_t j=0UL; j<
NN; ++j )
895template<
typename Type
902template<
typename Other
915 for(
size_t i=0UL; i<Rows; ++i ) {
916 for(
size_t j=0UL; j<Cols; ++j )
917 v_[i*
NN+j] = array[i][j];
920 for(
size_t j=Cols; j<
NN; ++j )
926 for(
size_t i=Rows; i<M; ++i )
927 for(
size_t j=0UL; j<
NN; ++j )
957template<
typename Type
964template<
typename Other
977 for(
size_t i=0UL; i<Rows; ++i ) {
978 for(
size_t j=0UL; j<Cols; ++j )
979 v_[i*
NN+j] = array[i][j];
982 for(
size_t j=Cols; j<
NN; ++j )
988 for(
size_t i=Rows; i<M; ++i )
989 for(
size_t j=0UL; j<
NN; ++j )
1006template<
typename Type
1030template<
typename Type
1037template<
typename MT
1044 using blaze::assign;
1049 if( (*m).rows() > M || (*m).columns() > N ) {
1053 for(
size_t i=0UL; i<
m_; ++i ) {
1062 for(
size_t i=
m_; i<M; ++i )
1063 for(
size_t j=0UL; j<
NN; ++j )
1092template<
typename Type
1119template<
typename Type
1147template<
typename Type
1163 return (*
this)(i,j);
1179template<
typename Type
1195 return (*
this)(i,j);
1212template<
typename Type
1239template<
typename Type
1262template<
typename Type
1286template<
typename Type
1313template<
typename Type
1340template<
typename Type
1367template<
typename Type
1394template<
typename Type
1421template<
typename Type
1448template<
typename Type
1478template<
typename Type
1491 for(
size_t i=0UL; i<
m_; ++i )
1492 for(
size_t j=0UL; j<
n_; ++j )
1525template<
typename Type
1537 const size_t m( list.size() );
1552 for(
const auto& rowList : list ) {
1554 for(
const auto& element : rowList ) {
1555 v_[i*
NN+j] = element;
1590template<
typename Type
1597template<
typename Other
1608 for(
size_t i=0UL; i<Rows; ++i )
1609 for(
size_t j=0UL; j<Cols; ++j )
1610 v_[i*
NN+j] = array[i][j];
1638template<
typename Type
1645template<
typename Other
1656 for(
size_t i=0UL; i<Rows; ++i )
1657 for(
size_t j=0UL; j<Cols; ++j )
1658 v_[i*
NN+j] = array[i][j];
1673template<
typename Type
1683 using blaze::assign;
1688 resize( rhs.rows(), rhs.columns() );
1709template<
typename Type
1716template<
typename MT
1721 using blaze::assign;
1723 using TT =
decltype(
trans( *
this ) );
1724 using CT =
decltype(
ctrans( *
this ) );
1725 using IT =
decltype(
inv( *
this ) );
1729 if( (*rhs).rows() > M || (*rhs).columns() > N ) {
1745 resize( (*rhs).rows(), (*rhs).columns() );
1768template<
typename Type
1775template<
typename MT
1780 using blaze::addAssign;
1784 if( (*rhs).rows() !=
m_ || (*rhs).columns() !=
n_ ) {
1788 if( (*rhs).canAlias(
this ) ) {
1813template<
typename Type
1820template<
typename MT
1825 using blaze::subAssign;
1829 if( (*rhs).rows() !=
m_ || (*rhs).columns() !=
n_ ) {
1833 if( (*rhs).canAlias(
this ) ) {
1858template<
typename Type
1865template<
typename MT
1870 using blaze::schurAssign;
1874 if( (*rhs).rows() !=
m_ || (*rhs).columns() !=
n_ ) {
1878 if( (*rhs).canAlias(
this ) ) {
1906template<
typename Type
1925template<
typename Type
1947template<
typename Type
1966template<
typename Type
1991template<
typename Type
2018template<
typename Type
2027 size_t nonzeros( 0UL );
2029 for(
size_t i=0UL; i<
m_; ++i )
2030 for(
size_t j=0UL; j<
n_; ++j )
2051template<
typename Type
2062 const size_t jend( i*
NN +
n_ );
2063 size_t nonzeros( 0UL );
2065 for(
size_t j=i*
NN; j<jend; ++j )
2079template<
typename Type
2090 for(
size_t i=0UL; i<
m_; ++i )
2091 for(
size_t j=0UL; j<
n_; ++j )
2108template<
typename Type
2120 for(
size_t j=0UL; j<
n_; ++j )
2133template<
typename Type
2183template<
typename Type
2205 for(
size_t i=0UL; i<m; ++i )
2206 for(
size_t j=n; j<
n_; ++j )
2211 for(
size_t i=m; i<
m_; ++i )
2212 for(
size_t j=0UL; j<
n_; ++j )
2237template<
typename Type
2258template<
typename Type
2269 const size_t maxrows(
max(
m_, m.m_ ) );
2270 const size_t maxcols(
max(
n_, m.n_ ) );
2272 for(
size_t i=0UL; i<maxrows; ++i ) {
2273 for(
size_t j=0UL; j<maxcols; ++j ) {
2303template<
typename Type
2310inline HybridMatrix<Type,M,N,SO,AF,PF,Tag>&
HybridMatrix<Type,M,N,SO,AF,PF,Tag>::transpose()
2315 if(
m_ > N ||
n_ > M ) {
2319 const size_t maxsize(
max(
m_,
n_ ) );
2320 for(
size_t i=1UL; i<maxsize; ++i ) {
2321 for(
size_t j=0UL; j<i; ++j ) {
2327 for(
size_t i=0UL; i<
m_; ++i ) {
2328 for(
size_t j=
m_; j<
n_; ++j ) {
2335 for(
size_t i=
n_; i<
m_; ++i ) {
2336 for(
size_t j=0UL; j<
n_; ++j ) {
2362template<
typename Type
2369inline HybridMatrix<Type,M,N,SO,AF,PF,Tag>&
HybridMatrix<Type,M,N,SO,AF,PF,Tag>::ctranspose()
2374 if(
m_ > N ||
n_ > M ) {
2378 const size_t maxsize(
max(
m_,
n_ ) );
2379 for(
size_t i=0UL; i<maxsize; ++i ) {
2380 for(
size_t j=0UL; j<i; ++j ) {
2387 for(
size_t i=0UL; i<
m_; ++i ) {
2388 for(
size_t j=
m_; j<
n_; ++j ) {
2395 for(
size_t i=
n_; i<
m_; ++i ) {
2396 for(
size_t j=0UL; j<
n_; ++j ) {
2428template<
typename Type
2435template<
typename Other >
2437 HybridMatrix<Type,M,N,SO,AF,PF,Tag>::scale(
const Other& scalar )
2439 for(
size_t i=0UL; i<
m_; ++i )
2440 for(
size_t j=0UL; j<
n_; ++j )
2441 v_[i*
NN+j] *= scalar;
2466template<
typename Type
2494template<
typename Type
2521template<
typename Type
2549template<
typename Type
2572template<
typename Type
2592template<
typename Type
2612template<
typename Type
2632template<
typename Type
2663template<
typename Type
2672 if(
m_ > M ||
n_ > N )
2677 for(
size_t i=0UL; i<
m_; ++i ) {
2678 for(
size_t j=
n_; j<
NN; ++j ) {
2684 for(
size_t i=
m_; i<M; ++i ) {
2685 for(
size_t j=0UL; j<
NN; ++j ) {
2715template<
typename Type
2722template<
typename Other >
2725 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
2740template<
typename Type
2747template<
typename Other >
2750 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
2764template<
typename Type
2793template<
typename Type
2804 return loada( i, j );
2806 return loadu( i, j );
2826template<
typename Type
2866template<
typename Type
2905template<
typename Type
2939template<
typename Type
2980template<
typename Type
3020template<
typename Type
3056template<
typename Type
3063template<
typename MT
3070 for(
size_t i=0UL; i<
m_; ++i ) {
3071 for(
size_t j=0UL; j<
n_; ++j ) {
3072 v_[i*
NN+j] = (*rhs)(i,j);
3090template<
typename Type
3097template<
typename MT
3111 for(
size_t i=0UL; i<
m_; ++i )
3116 store( i, j, (*rhs).load(i,j) );
3118 for( ; remainder && j<
n_; ++j ) {
3119 v_[i*
NN+j] = (*rhs)(i,j);
3137template<
typename Type
3144template<
typename MT >
3149 for(
size_t i=0UL; i<
m_; ++i )
3150 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
3151 v_[i*
NN+element->index()] = element->value();
3167template<
typename Type
3174template<
typename MT >
3181 for(
size_t j=0UL; j<
n_; ++j )
3182 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
3183 v_[element->index()*
NN+j] = element->value();
3199template<
typename Type
3206template<
typename MT
3213 for(
size_t i=0UL; i<
m_; ++i )
3217 v_[i*
NN+i] += (*rhs)(i,i);
3229 for(
size_t j=jbegin; j<jend; ++j ) {
3230 v_[i*
NN+j] += (*rhs)(i,j);
3249template<
typename Type
3256template<
typename MT
3268 for(
size_t i=0UL; i<
m_; ++i )
3284 store( i, j,
load(i,j) + (*rhs).load(i,j) );
3286 for( ; remainder && j<jend; ++j ) {
3287 v_[i*
NN+j] += (*rhs)(i,j);
3305template<
typename Type
3312template<
typename MT >
3317 for(
size_t i=0UL; i<
m_; ++i )
3318 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
3319 v_[i*
NN+element->index()] += element->value();
3335template<
typename Type
3342template<
typename MT >
3349 for(
size_t j=0UL; j<
n_; ++j )
3350 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
3351 v_[element->index()*
NN+j] += element->value();
3367template<
typename Type
3374template<
typename MT
3381 for(
size_t i=0UL; i<
m_; ++i )
3385 v_[i*
NN+i] -= (*rhs)(i,i);
3397 for(
size_t j=jbegin; j<jend; ++j ) {
3398 v_[i*
NN+j] -= (*rhs)(i,j);
3417template<
typename Type
3424template<
typename MT
3436 for(
size_t i=0UL; i<
m_; ++i )
3452 store( i, j,
load(i,j) - (*rhs).load(i,j) );
3454 for( ; remainder && j<jend; ++j ) {
3455 v_[i*
NN+j] -= (*rhs)(i,j);
3473template<
typename Type
3480template<
typename MT >
3485 for(
size_t i=0UL; i<
m_; ++i )
3486 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
3487 v_[i*
NN+element->index()] -= element->value();
3503template<
typename Type
3510template<
typename MT >
3517 for(
size_t j=0UL; j<
n_; ++j )
3518 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
3519 v_[element->index()*
NN+j] -= element->value();
3535template<
typename Type
3542template<
typename MT
3549 for(
size_t i=0UL; i<
m_; ++i ) {
3550 for(
size_t j=0UL; j<
n_; ++j ) {
3551 v_[i*
NN+j] *= (*rhs)(i,j);
3569template<
typename Type
3576template<
typename MT
3587 for(
size_t i=0UL; i<
m_; ++i )
3595 store( i, j,
load(i,j) * (*rhs).load(i,j) );
3597 for( ; remainder && j<
n_; ++j ) {
3598 v_[i*
NN+j] *= (*rhs)(i,j);
3616template<
typename Type
3623template<
typename MT >
3632 for(
size_t i=0UL; i<
m_; ++i )
3633 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
3634 v_[i*
NN+element->index()] = tmp.
v_[i*
NN+element->index()] * element->value();
3650template<
typename Type
3657template<
typename MT >
3668 for(
size_t j=0UL; j<
n_; ++j )
3669 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
3670 v_[element->index()*
NN+j] = tmp.
v_[element->index()*
NN+j] * element->value();
3695template<
typename Type
3702 :
public DenseMatrix< HybridMatrix<Type,M,N,true,AF,PF,Tag>, true >
3736 template<
typename NewType >
3745 template<
size_t NewM
3772 inline HybridMatrix(
size_t m,
size_t n,
const Type& init );
3773 constexpr HybridMatrix( initializer_list< initializer_list<Type> > list );
3775 template<
typename Other >
3776 inline HybridMatrix(
size_t m,
size_t n,
const Other* array );
3778 template<
typename Other,
size_t Rows,
size_t Cols >
3779 inline HybridMatrix(
const Other (&array)[Rows][Cols] );
3781 template<
typename Other,
size_t Rows,
size_t Cols >
3782 inline HybridMatrix(
const std::array<std::array<Other,Cols>,Rows>& array );
3786 template<
typename MT,
bool SO >
3822 constexpr
HybridMatrix& operator=( initializer_list< initializer_list<Type> > list ) &;
3824 template< typename Other,
size_t Rows,
size_t Cols >
3825 constexpr
HybridMatrix& operator=( const Other (&array)[Rows][Cols] ) &;
3827 template< typename Other,
size_t Rows,
size_t Cols >
3828 constexpr
HybridMatrix& operator=( const std::array<std::array<Other,Cols>,Rows>& array ) &;
3832 template< typename MT,
bool SO > inline
HybridMatrix& operator= ( const Matrix<MT,SO>& rhs ) &;
3833 template< typename MT,
bool SO > inline
HybridMatrix& operator+=( const Matrix<MT,SO>& rhs ) &;
3834 template< typename MT,
bool SO > inline
HybridMatrix& operator-=( const Matrix<MT,SO>& rhs ) &;
3835 template< typename MT,
bool SO > inline
HybridMatrix& operator%=( const Matrix<MT,SO>& rhs ) &;
3842 constexpr
size_t rows() const noexcept;
3843 constexpr
size_t columns() const noexcept;
3844 static constexpr
size_t spacing() noexcept;
3845 static constexpr
size_t capacity() noexcept;
3846 constexpr
size_t capacity(
size_t j ) const noexcept;
3848 inline
size_t nonZeros(
size_t j ) const;
3849 constexpr
void reset();
3850 constexpr
void reset(
size_t i );
3851 constexpr
void clear();
3852 constexpr
void resize (
size_t m,
size_t n,
bool preserve=true );
3853 constexpr
void extend (
size_t m,
size_t n,
bool preserve=true );
3864 template< typename Other > inline
HybridMatrix& scale( const Other& scalar );
3871 static inline
void* operator new ( std::
size_t size );
3872 static inline
void* operator new[]( std::
size_t size );
3873 static inline
void* operator new ( std::
size_t size, const std::nothrow_t& );
3874 static inline
void* operator new[]( std::
size_t size, const std::nothrow_t& );
3876 static inline
void operator delete (
void* ptr );
3877 static inline
void operator delete[](
void* ptr );
3878 static inline
void operator delete (
void* ptr, const std::nothrow_t& );
3879 static inline
void operator delete[](
void* ptr, const std::nothrow_t& );
3886 static constexpr
size_t SIMDSIZE = SIMDTrait<Type>::
size;
3894 template< typename MT >
3895 static constexpr
bool VectorizedAssign_v =
3896 ( useOptimizedKernels &&
3905 template< typename MT >
3906 static constexpr
bool VectorizedAddAssign_v =
3907 ( VectorizedAssign_v<MT> &&
3914 template< typename MT >
3915 static constexpr
bool VectorizedSubAssign_v =
3916 ( VectorizedAssign_v<MT> &&
3923 template< typename MT >
3924 static constexpr
bool VectorizedSchurAssign_v =
3925 ( VectorizedAssign_v<MT> &&
3933 constexpr
bool isIntact() const noexcept;
3940 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
3941 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
3943 static constexpr
bool isAligned() noexcept;
3954 template< typename MT,
bool SO >
3955 inline auto
assign( const DenseMatrix<MT,SO>& rhs ) ->
DisableIf_t< VectorizedAssign_v<MT> >;
3957 template< typename MT,
bool SO >
3958 inline auto
assign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedAssign_v<MT> >;
3960 template< typename MT > inline
void assign( const SparseMatrix<MT,true>& rhs );
3961 template< typename MT > inline
void assign( const SparseMatrix<MT,false>& rhs );
3963 template< typename MT,
bool SO >
3964 inline auto
addAssign( const DenseMatrix<MT,SO>& rhs ) ->
DisableIf_t< VectorizedAddAssign_v<MT> >;
3966 template< typename MT,
bool SO >
3967 inline auto
addAssign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedAddAssign_v<MT> >;
3969 template< typename MT > inline
void addAssign( const SparseMatrix<MT,true>& rhs );
3970 template< typename MT > inline
void addAssign( const SparseMatrix<MT,false>& rhs );
3972 template< typename MT,
bool SO >
3973 inline auto
subAssign( const DenseMatrix<MT,SO>& rhs ) ->
DisableIf_t< VectorizedSubAssign_v<MT> >;
3975 template< typename MT,
bool SO >
3976 inline auto
subAssign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedSubAssign_v<MT> >;
3978 template< typename MT > inline
void subAssign( const SparseMatrix<MT,true>& rhs );
3979 template< typename MT > inline
void subAssign( const SparseMatrix<MT,false>& rhs );
3981 template< typename MT,
bool SO >
3984 template< typename MT,
bool SO >
3985 inline auto
schurAssign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedSchurAssign_v<MT> >;
3987 template< typename MT > inline
void schurAssign( const SparseMatrix<MT,true>& rhs );
3988 template< typename MT > inline
void schurAssign( const SparseMatrix<MT,false>& rhs );
4041template< typename Type
4072template<
typename Type
4112template<
typename Type
4133 for(
size_t j=0UL; j<n; ++j ) {
4134 for(
size_t i=0UL; i<m; ++i )
4138 for(
size_t i=m; i<MM; ++i )
4144 for(
size_t j=n; j<N; ++j )
4145 for(
size_t i=0UL; i<MM; ++i )
4180template<
typename Type
4201 for(
const auto& rowList : list ) {
4203 for(
const auto& element : rowList ) {
4204 v_[i+j*MM] = element;
4244template<
typename Type
4250template<
typename Other >
4266 for(
size_t j=0UL; j<n; ++j ) {
4267 for(
size_t i=0UL; i<m; ++i )
4268 v_[i+j*MM] = array[i+j*m];
4271 for(
size_t i=m; i<MM; ++i )
4277 for(
size_t j=n; j<N; ++j )
4278 for(
size_t i=0UL; i<MM; ++i )
4310template<
typename Type
4316template<
typename Other
4329 for(
size_t j=0UL; j<Cols; ++j ) {
4330 for(
size_t i=0UL; i<Rows; ++i )
4331 v_[i+j*MM] = array[i][j];
4334 for(
size_t i=Rows; i<MM; ++i )
4340 for(
size_t j=Cols; j<N; ++j )
4341 for(
size_t i=0UL; i<MM; ++i )
4373template<
typename Type
4379template<
typename Other
4392 for(
size_t j=0UL; j<Cols; ++j ) {
4393 for(
size_t i=0UL; i<Rows; ++i )
4394 v_[i+j*MM] = array[i][j];
4397 for(
size_t i=Rows; i<MM; ++i )
4403 for(
size_t j=Cols; j<N; ++j )
4404 for(
size_t i=0UL; i<MM; ++i )
4423template<
typename Type
4448template<
typename Type
4454template<
typename MT
4461 using blaze::assign;
4466 if( (*m).rows() > M || (*m).columns() > N ) {
4470 for(
size_t j=0UL; j<
n_; ++j ) {
4479 for(
size_t j=
n_; j<N; ++j )
4480 for(
size_t i=0UL; i<MM; ++i )
4511template<
typename Type
4539template<
typename Type
4568template<
typename Type
4583 return (*
this)(i,j);
4601template<
typename Type
4616 return (*
this)(i,j);
4634template<
typename Type
4661template<
typename Type
4685template<
typename Type
4710template<
typename Type
4733template<
typename Type
4743 return Iterator( v_ + j*MM );
4756template<
typename Type
4766 return ConstIterator( v_ + j*MM );
4779template<
typename Type
4789 return ConstIterator( v_ + j*MM );
4802template<
typename Type
4812 return Iterator( v_ + j*MM + M );
4825template<
typename Type
4835 return ConstIterator( v_ + j*MM + M );
4848template<
typename Type
4858 return ConstIterator( v_ + j*MM + M );
4879template<
typename Type
4891 for(
size_t j=0UL; j<n_; ++j )
4892 for(
size_t i=0UL; i<m_; ++i )
4927template<
typename Type
4938 const size_t m( list.size() );
4953 for(
const auto& rowList : list ) {
4955 for(
const auto& element : rowList ) {
4956 v_[i+j*MM] = element;
4959 for( ; j<n_; ++j ) {
4960 clear( v_[i+j*MM] );
4993template<
typename Type
4999template<
typename Other
5010 for(
size_t j=0UL; j<Cols; ++j )
5011 for(
size_t i=0UL; i<Rows; ++i )
5012 v_[i+j*MM] = array[i][j];
5042template<
typename Type
5048template<
typename Other
5059 for(
size_t j=0UL; j<Cols; ++j )
5060 for(
size_t i=0UL; i<Rows; ++i )
5061 v_[i+j*MM] = array[i][j];
5078template<
typename Type
5087 using blaze::assign;
5092 resize( rhs.rows(), rhs.columns() );
5093 assign( *
this, *rhs );
5115template<
typename Type
5121template<
typename MT
5126 using blaze::assign;
5128 using TT =
decltype(
trans( *
this ) );
5129 using CT =
decltype(
ctrans( *
this ) );
5130 using IT =
decltype(
inv( *
this ) );
5134 if( (*rhs).rows() > M || (*rhs).columns() > N ) {
5146 resize( tmp.rows(), tmp.columns() );
5147 assign( *
this, tmp );
5150 resize( (*rhs).rows(), (*rhs).columns() );
5153 assign( *
this, *rhs );
5175template<
typename Type
5181template<
typename MT
5184 HybridMatrix<Type,M,N,true,AF,PF,Tag>::operator+=(
const Matrix<MT,SO>& rhs ) &
5186 using blaze::addAssign;
5190 if( (*rhs).rows() != m_ || (*rhs).columns() != n_ ) {
5194 if( (*rhs).canAlias(
this ) ) {
5196 addAssign( *
this, tmp );
5199 addAssign( *
this, *rhs );
5221template<
typename Type
5227template<
typename MT
5230 HybridMatrix<Type,M,N,true,AF,PF,Tag>::operator-=(
const Matrix<MT,SO>& rhs ) &
5232 using blaze::subAssign;
5236 if( (*rhs).rows() != m_ || (*rhs).columns() != n_ ) {
5240 if( (*rhs).canAlias(
this ) ) {
5242 subAssign( *
this, tmp );
5245 subAssign( *
this, *rhs );
5267template<
typename Type
5273template<
typename MT
5276 HybridMatrix<Type,M,N,true,AF,PF,Tag>::operator%=(
const Matrix<MT,SO>& rhs ) &
5278 using blaze::schurAssign;
5282 if( (*rhs).rows() != m_ || (*rhs).columns() != n_ ) {
5286 if( (*rhs).canAlias(
this ) ) {
5288 schurAssign( *
this, tmp );
5291 schurAssign( *
this, *rhs );
5316template<
typename Type
5336template<
typename Type
5359template<
typename Type
5379template<
typename Type
5400template<
typename Type
5428template<
typename Type
5436 size_t nonzeros( 0UL );
5438 for(
size_t j=0UL; j<n_; ++j )
5439 for(
size_t i=0UL; i<m_; ++i )
5459template<
typename Type
5469 const size_t iend( j*MM + m_ );
5470 size_t nonzeros( 0UL );
5472 for(
size_t i=j*MM; i<iend; ++i )
5488template<
typename Type
5498 for(
size_t j=0UL; j<n_; ++j )
5499 for(
size_t i=0UL; i<m_; ++i )
5500 clear( v_[i+j*MM] );
5516template<
typename Type
5527 for(
size_t i=0UL; i<m_; ++i )
5528 clear( v_[i+j*MM] );
5542template<
typename Type
5593template<
typename Type
5614 for(
size_t j=0UL; j<n; ++j )
5615 for(
size_t i=m; i<m_; ++i )
5616 clear( v_[i+j*MM] );
5620 for(
size_t j=n; j<n_; ++j )
5621 for(
size_t i=0UL; i<m_; ++i )
5622 clear( v_[i+j*MM] );
5648template<
typename Type
5670template<
typename Type
5680 const size_t maxrows(
max( m_, m.m_ ) );
5681 const size_t maxcols(
max( n_, m.n_ ) );
5683 for(
size_t j=0UL; j<maxcols; ++j ) {
5684 for(
size_t i=0UL; i<maxrows; ++i ) {
5685 swap( v_[i+j*MM], m(i,j) );
5716template<
typename Type
5722inline HybridMatrix<Type,M,N,true,AF,PF,Tag>&
HybridMatrix<Type,M,N,true,AF,PF,Tag>::transpose()
5727 if( m_ > N || n_ > M ) {
5731 const size_t maxsize(
max( m_, n_ ) );
5732 for(
size_t j=1UL; j<maxsize; ++j ) {
5733 for(
size_t i=0UL; i<j; ++i ) {
5734 swap( v_[i+j*MM], v_[j+i*MM] );
5739 for(
size_t j=0UL; j<n_; ++j ) {
5740 for(
size_t i=n_; i<m_; ++i ) {
5741 clear( v_[i+j*MM] );
5747 for(
size_t j=m_; j<n_; ++j ) {
5748 for(
size_t i=0UL; i<m_; ++i ) {
5749 clear( v_[i+j*MM] );
5776template<
typename Type
5782inline HybridMatrix<Type,M,N,true,AF,PF,Tag>&
HybridMatrix<Type,M,N,true,AF,PF,Tag>::ctranspose()
5787 if( m_ > N || n_ > M ) {
5791 const size_t maxsize(
max( m_, n_ ) );
5792 for(
size_t j=0UL; j<maxsize; ++j ) {
5793 for(
size_t i=0UL; i<j; ++i ) {
5794 cswap( v_[i+j*MM], v_[j+i*MM] );
5800 for(
size_t j=0UL; j<n_; ++j ) {
5801 for(
size_t i=n_; i<m_; ++i ) {
5802 clear( v_[i+j*MM] );
5808 for(
size_t j=m_; j<n_; ++j ) {
5809 for(
size_t i=0UL; i<m_; ++i ) {
5810 clear( v_[i+j*MM] );
5843template<
typename Type
5849template<
typename Other >
5851 HybridMatrix<Type,M,N,true,AF,PF,Tag>::scale(
const Other& scalar )
5853 for(
size_t j=0UL; j<n_; ++j )
5854 for(
size_t i=0UL; i<m_; ++i )
5855 v_[i+j*MM] *= scalar;
5882template<
typename Type
5911template<
typename Type
5939template<
typename Type
5968template<
typename Type
5992template<
typename Type
6013template<
typename Type
6034template<
typename Type
6055template<
typename Type
6087template<
typename Type
6095 if( m_ > M || n_ > N )
6100 for(
size_t j=0UL; j<n_; ++j ) {
6101 for(
size_t i=m_; i<MM; ++i ) {
6107 for(
size_t j=n_; j<N; ++j ) {
6108 for(
size_t i=0UL; i<MM; ++i ) {
6140template<
typename Type
6146template<
typename Other >
6149 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
6166template<
typename Type
6172template<
typename Other >
6175 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
6191template<
typename Type
6220template<
typename Type
6230 return loada( i, j );
6232 return loadu( i, j );
6253template<
typename Type
6272 return loada( &v_[i+j*MM] );
6293template<
typename Type
6310 return loadu( &v_[i+j*MM] );
6332template<
typename Type
6366template<
typename Type
6385 storea( &v_[i+j*MM], value );
6407template<
typename Type
6424 storeu( &v_[i+j*MM], value );
6447template<
typename Type
6466 stream( &v_[i+j*MM], value );
6484template<
typename Type
6490template<
typename MT
6497 for(
size_t j=0UL; j<n_; ++j ) {
6498 for(
size_t i=0UL; i<m_; ++i ) {
6499 v_[i+j*MM] = (*rhs)(i,j);
6519template<
typename Type
6525template<
typename MT
6536 const size_t ipos( remainder ?
prevMultiple( m_, SIMDSIZE ) : m_ );
6539 for(
size_t j=0UL; j<n_; ++j )
6543 for( ; i<ipos; i+=SIMDSIZE ) {
6544 store( i, j, (*rhs).load(i,j) );
6546 for( ; remainder && i<m_; ++i ) {
6547 v_[i+j*MM] = (*rhs)(i,j);
6567template<
typename Type
6573template<
typename MT >
6578 for(
size_t j=0UL; j<n_; ++j )
6579 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
6580 v_[element->index()+j*MM] = element->value();
6598template<
typename Type
6604template<
typename MT >
6611 for(
size_t i=0UL; i<m_; ++i )
6612 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
6613 v_[i+element->index()*MM] = element->value();
6631template<
typename Type
6637template<
typename MT
6644 for(
size_t j=0UL; j<n_; ++j )
6648 v_[j+j*MM] += (*rhs)(j,j);
6660 for(
size_t i=ibegin; i<iend; ++i ) {
6661 v_[i+j*MM] += (*rhs)(i,j);
6682template<
typename Type
6688template<
typename MT
6700 for(
size_t j=0UL; j<n_; ++j )
6710 const size_t ipos( remainder ?
prevMultiple( iend, SIMDSIZE ) : iend );
6715 for( ; i<ipos; i+=SIMDSIZE ) {
6716 store( i, j, load(i,j) + (*rhs).load(i,j) );
6718 for( ; remainder && i<iend; ++i ) {
6719 v_[i+j*MM] += (*rhs)(i,j);
6739template<
typename Type
6745template<
typename MT >
6750 for(
size_t j=0UL; j<n_; ++j )
6751 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
6752 v_[element->index()+j*MM] += element->value();
6770template<
typename Type
6776template<
typename MT >
6783 for(
size_t i=0UL; i<m_; ++i )
6784 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
6785 v_[i+element->index()*MM] += element->value();
6803template<
typename Type
6809template<
typename MT
6816 for(
size_t j=0UL; j<n_; ++j )
6820 v_[j+j*MM] -= (*rhs)(j,j);
6832 for(
size_t i=ibegin; i<iend; ++i ) {
6833 v_[i+j*MM] -= (*rhs)(i,j);
6854template<
typename Type
6860template<
typename MT
6872 for(
size_t j=0UL; j<n_; ++j )
6882 const size_t ipos( remainder ?
prevMultiple( iend, SIMDSIZE ) : iend );
6887 for( ; i<ipos; i+=SIMDSIZE ) {
6888 store( i, j, load(i,j) - (*rhs).load(i,j) );
6890 for( ; remainder && i<iend; ++i ) {
6891 v_[i+j*MM] -= (*rhs)(i,j);
6911template<
typename Type
6917template<
typename MT >
6922 for(
size_t j=0UL; j<n_; ++j )
6923 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
6924 v_[element->index()+j*MM] -= element->value();
6942template<
typename Type
6948template<
typename MT >
6955 for(
size_t i=0UL; i<m_; ++i )
6956 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
6957 v_[i+element->index()*MM] -= element->value();
6975template<
typename Type
6981template<
typename MT
6988 for(
size_t j=0UL; j<n_; ++j ) {
6989 for(
size_t i=0UL; i<m_; ++i ) {
6990 v_[i+j*MM] *= (*rhs)(i,j);
7010template<
typename Type
7016template<
typename MT
7027 for(
size_t j=0UL; j<n_; ++j )
7029 const size_t ipos( remainder ?
prevMultiple( m_, SIMDSIZE ) : m_ );
7034 for( ; i<ipos; i+=SIMDSIZE ) {
7035 store( i, j, load(i,j) * (*rhs).load(i,j) );
7037 for( ; remainder && i<m_; ++i ) {
7038 v_[i+j*MM] *= (*rhs)(i,j);
7058template<
typename Type
7064template<
typename MT >
7073 for(
size_t j=0UL; j<n_; ++j )
7074 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
7075 v_[element->index()+j*MM] = tmp.v_[element->index()+j*MM] * element->value();
7093template<
typename Type
7099template<
typename MT >
7110 for(
size_t i=0UL; i<m_; ++i )
7111 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
7112 v_[i+element->index()*MM] = tmp.v_[i+element->index()*MM] * element->value();
7133template< RelaxationFlag RF,
typename Type,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7136template<
typename Type,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7139template<
typename Type,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7140void swap(
HybridMatrix<Type,M,N,SO,AF,PF,Tag>& a,
HybridMatrix<Type,M,N,SO,AF,PF,Tag>& b )
noexcept;
7203template<
typename Type
7212 return m.isIntact();
7225template<
typename Type
7232inline void swap(
HybridMatrix<Type,M,N,SO,AF,PF,Tag>& a,
HybridMatrix<Type,M,N,SO,AF,PF,Tag>& b )
noexcept
7249template<
typename T,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7250struct MaxSize< HybridMatrix<T,M,N,SO,AF,PF,Tag>, 0UL >
7251 :
public Ptrdiff_t< static_cast<ptrdiff_t>(M) >
7254template<
typename T,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7256 :
public Ptrdiff_t< static_cast<ptrdiff_t>(N) >
7272template<
typename T,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7290template<
typename T,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7308template<
typename T,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7326template<
typename T,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7344template<
typename T,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag >
7362template<
typename T1,
typename T2 >
7363struct AddTraitEval2< T1, T2
7410template<
typename T1,
typename T2 >
7411struct SubTraitEval2< T1, T2
7458template<
typename T1,
typename T2 >
7459struct SchurTraitEval2< T1, T2
7502template<
typename T1,
typename T2 >
7503struct MultTraitEval2< T1, T2
7520template<
typename T1,
typename T2 >
7521struct MultTraitEval2< T1, T2
7538template<
typename T1,
typename T2 >
7539struct MultTraitEval2< T1, T2
7556template<
typename T1,
typename T2 >
7557struct MultTraitEval2< T1, T2
7594template<
typename T1,
typename T2 >
7595struct KronTraitEval2< T1, T2
7629template<
typename T1,
typename T2 >
7630struct DivTraitEval2< T1, T2
7660template<
typename T,
typename OP >
7661struct UnaryMapTraitEval2< T, OP
7668 using ElementType =
decltype( std::declval<OP>()( std::declval< ElementType_t<T> >() ) );
7684template<
typename T1,
typename T2,
typename OP >
7685struct BinaryMapTraitEval2< T1, T2, OP
7693 using ElementType =
decltype( std::declval<OP>()( std::declval< ElementType_t<T1> >()
7694 , std::declval< ElementType_t<T2> >() ) );
7705template<
typename T1,
typename T2,
typename OP >
7706struct BinaryMapTraitEval2< T1, T2, OP
7718 using ElementType =
decltype( std::declval<OP>()( std::declval< ElementType_t<T1> >()
7719 , std::declval< ElementType_t<T2> >() ) );
7756template<
typename T,
size_t E >
7757struct ExpandTraitEval2< T, E
7785template<
typename T,
size_t R0,
size_t R1 >
7786struct RepeatTraitEval2< T, R0, R1,
inf
7817template<
typename T1,
typename T2 >
7818struct SolveTraitEval2< T1, T2
7866template<
typename T1,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag,
typename T2 >
7867struct HighType<
HybridMatrix<T1,M,N,SO,AF,PF,Tag>,
HybridMatrix<T2,M,N,SO,AF,PF,Tag> >
7869 using Type = HybridMatrix< typename HighType<T1,T2>::Type, M, N, SO, AF, PF, Tag >;
7885template<
typename T1,
size_t M,
size_t N,
bool SO, AlignmentFlag AF, PaddingFlag PF,
typename Tag,
typename T2 >
7886struct LowType<
HybridMatrix<T1,M,N,SO,AF,PF,Tag>,
HybridMatrix<T2,M,N,SO,AF,PF,Tag> >
7888 using Type = HybridMatrix< typename LowType<T1,T2>::Type, M, N, SO, AF, PF, Tag >;
7904template<
typename MT >
7934template<
typename MT,
size_t M >
7935struct RowsTraitEval2< MT, M
7963template<
typename MT,
size_t N >
7964struct ColumnsTraitEval2< MT, N
Header file for the addition trait.
Header file for auxiliary alias declarations.
typename ResultType_t< T >::TagType TagType_t
Alias declaration for nested TagType type definitions.
Definition Aliases.h:530
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition Aliases.h:190
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition Aliases.h:450
Header file for the AlignedArray implementation.
Header file for the alignment check function.
Header file for the alignment flag enumeration.
Header file for the AlignmentOf type trait.
Header file for run time assertion macros.
Header file for the columns trait.
Header file for the conjugate shim.
Constraint on the data type.
Header file for the DenseIterator class template.
Constraint on the data type.
Header file for the division trait.
Header file for the EnableIf class template.
Header file for the EvaluateTrait class template.
Header file for the expand trait.
Constraint on the data type.
Header file for the HasConstDataAccess type trait.
Header file for the HasMutableDataAccess type trait.
Header file for the HasSIMDAdd type trait.
Header file for the HasSIMDMult type trait.
Header file for the HasSIMDSub type trait.
Header file for the HighType type trait.
Header file for the IntegralConstant class template.
Header file for the IsAligned type trait.
Header file for the IsColumnMajorMatrix type trait.
Header file for the IsColumnVector type trait.
Header file for the IsContiguous type trait.
Header file for the isDefault shim.
Header file for the IsDenseMatrix type trait.
Header file for the IsDenseVector type trait.
Header file for the IsDiagonal type trait.
Header file for the IsLower type trait.
Header file for the IsMatrix type trait.
Header file for the IsNumeric type trait.
Header file for the IsPadded type trait.
Header file for the IsRowMajorMatrix type trait.
Header file for the IsRowVector type trait.
Header file for the IsSIMDCombinable type trait.
Header file for the IsSame and IsStrictlySame type traits.
Header file for the IsScalar type trait.
Header file for the IsSparseMatrix type trait.
Header file for the IsSquare type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Header file for the IsUpper type trait.
Header file for the IsVectorizable type trait.
Header file for the Kron product trait.
Header file for the LowType type trait.
Header file for the map trait.
Header file for the MaxSize type trait.
Header file for the MAYBE_UNUSED function template.
Header file for memory allocation and deallocation functionality.
Header file for the multiplication trait.
Header file for the nextMultiple shim.
Header file for the padding flag enumeration.
Constraint on the data type.
Header file for the prevMultiple shim.
Constraint on the data type.
Header file for the relaxation flag enumeration.
Header file for the RemoveCV type trait.
Header file for the RemoveConst type trait.
Header file for the repeat trait.
Header file for the rows trait.
Header file for all SIMD functionality.
Header file for the Schur product trait.
Header file for the Solver trait.
Header file for the subtraction trait.
Header file for the submatrix trait.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Implementation of a static array with a fixed alignment.
Definition AlignedArray.h:101
Implementation of a generic iterator for dense vectors and matrices.
Definition DenseIterator.h:60
Base class for dense matrices.
Definition DenseMatrix.h:82
Efficient implementation of a dynamically sized matrix with static memory.
Definition HybridMatrix.h:256
constexpr HybridMatrix(size_t m, size_t n)
Constructor for a matrix of size . No element initialization is performed!
Definition HybridMatrix.h:668
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t i, size_t j) const noexcept
constexpr size_t columns() const noexcept
static constexpr bool simdEnabled
Definition HybridMatrix.h:311
static constexpr size_t Alignment
Definition HybridMatrix.h:556
void swap(HybridMatrix &m) noexcept
size_t m_
Definition HybridMatrix.h:576
constexpr ConstReference operator()(size_t i, size_t j) const noexcept
2D-access to the matrix elements.
Definition HybridMatrix.h:1127
static constexpr bool smpAssignable
Definition HybridMatrix.h:317
HybridMatrix< Type, M, N,!SO, AF, PF, Tag > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition HybridMatrix.h:266
SIMDTrait_t< ElementType > SIMDType
Definition HybridMatrix.h:272
BLAZE_ALWAYS_INLINE void store(size_t i, size_t j, const SIMDType &value) noexcept
size_t n_
Definition HybridMatrix.h:577
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition HybridMatrix.h:1155
static constexpr size_t NN
Definition HybridMatrix.h:442
constexpr ConstIterator cbegin(size_t i) const noexcept
HybridMatrix(const std::array< std::array< Other, Cols >, Rows > &array)
Initialization of all matrix elements from the given std::array.
Definition HybridMatrix.h:967
const Type * ConstPointer
Definition HybridMatrix.h:280
static constexpr size_t capacity() noexcept
constexpr void resize(size_t m, size_t n, bool preserve=true)
HybridMatrix(size_t m, size_t n, const Type &init)
Constructor for a homogenous initialization of all matrix elements.
Definition HybridMatrix.h:707
auto schurAssign(const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedSchurAssign_v< MT > >
BLAZE_ALWAYS_INLINE SIMDType load(size_t i, size_t j) const noexcept
BLAZE_ALWAYS_INLINE void storeu(size_t i, size_t j, const SIMDType &value) noexcept
Type ElementType
Definition HybridMatrix.h:271
constexpr void extend(size_t m, size_t n, bool preserve=true)
BLAZE_ALWAYS_INLINE SIMDType loada(size_t i, size_t j) const noexcept
auto assign(const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedAssign_v< MT > >
constexpr HybridMatrix(const HybridMatrix &m)
The copy constructor for HybridMatrix.
Definition HybridMatrix.h:1013
Type * Pointer
Definition HybridMatrix.h:279
constexpr Iterator end(size_t i) noexcept
ConstReference at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition HybridMatrix.h:1187
const This & CompositeType
Definition HybridMatrix.h:275
constexpr ConstIterator cend(size_t i) const noexcept
HybridMatrix & transpose()
HybridMatrix< Type, M, N, SO, AF, PF, Tag > This
Type of this HybridMatrix instance.
Definition HybridMatrix.h:260
constexpr Pointer data() noexcept
Low-level data access to the matrix elements.
Definition HybridMatrix.h:1220
auto subAssign(const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedSubAssign_v< MT > >
constexpr Iterator begin(size_t i) noexcept
static constexpr size_t SIMDSIZE
Definition HybridMatrix.h:439
AlignedArray< Type, M *NN, Alignment > AlignedStorage
Definition HybridMatrix.h:560
constexpr size_t rows() const noexcept
DenseIterator< Type, AF > Iterator
Definition HybridMatrix.h:282
constexpr Reference operator()(size_t i, size_t j) noexcept
2D-access to the matrix elements.
Definition HybridMatrix.h:1100
constexpr HybridMatrix & operator=(const Type &set) &
Homogenous assignment to all matrix elements.
Definition HybridMatrix.h:1486
DenseIterator< const Type, AF > ConstIterator
Definition HybridMatrix.h:283
bool isAliased(const Other *alias) const noexcept
Type & Reference
Definition HybridMatrix.h:277
static constexpr bool isAligned() noexcept
BLAZE_ALWAYS_INLINE void storea(size_t i, size_t j, const SIMDType &value) noexcept
bool canAlias(const Other *alias) const noexcept
constexpr HybridMatrix(initializer_list< initializer_list< Type > > list)
List initialization of all matrix elements.
Definition HybridMatrix.h:774
auto addAssign(const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedAddAssign_v< MT > >
Tag TagType
Definition HybridMatrix.h:273
DenseMatrix< This, SO > BaseType
Base type of this HybridMatrix instance.
Definition HybridMatrix.h:262
This ResultType
Result type for expression template evaluations.
Definition HybridMatrix.h:263
constexpr HybridMatrix()
The default constructor for HybridMatrix.
Definition HybridMatrix.h:638
HybridMatrix & ctranspose()
AlignedStorage v_
Definition HybridMatrix.h:566
HybridMatrix(const Other(&array)[Rows][Cols])
Array initialization of all matrix elements.
Definition HybridMatrix.h:905
const Type & ConstReference
Definition HybridMatrix.h:278
BLAZE_ALWAYS_INLINE void stream(size_t i, size_t j, const SIMDType &value) noexcept
constexpr bool isIntact() const noexcept
HybridMatrix< Type, N, M,!SO, AF, PF, Tag > TransposeType
Definition HybridMatrix.h:269
const Type & ReturnType
Definition HybridMatrix.h:274
HybridMatrix(const Matrix< MT, SO2 > &m)
Conversion constructor from different matrices.
Definition HybridMatrix.h:1039
static constexpr size_t spacing() noexcept
HybridMatrix(size_t m, size_t n, const Other *array)
Array initialization of all matrix elements.
Definition HybridMatrix.h:838
Base class for matrices.
Definition Matrix.h:85
Base class for sparse matrices.
Definition SparseMatrix.h:77
Initializer list type of the Blaze library.
Header file for the DenseMatrix base class.
Header file for the SparseMatrix base class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.
Definition Volatile.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.
Definition Pointer.h:79
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.
Definition Vectorizable.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.
Definition Const.h:79
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TAG(A, B)
Data type constraint.
Definition SameTag.h:68
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.
Definition Reference.h:79
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition DMatDMatMapExpr.h:1339
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition DMatDMatMapExpr.h:1375
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition DMatMapExpr.h:1501
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition DMatTransExpr.h:766
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition DMatSerialExpr.h:812
decltype(auto) inv(const DenseMatrix< MT, SO > &dm)
Calculation of the inverse of the given dense matrix.
Definition DMatInvExpr.h:405
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition DiagonalMatrix.h:207
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition DiagonalMatrix.h:225
bool isDefault(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the given diagonal matrix is in default state.
Definition DiagonalMatrix.h:169
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_DIAGONAL_MATRIX_TYPE(T)
Constraint on the data type.
Definition Diagonal.h:79
BLAZE_ALWAYS_INLINE void cswap(T &a, T &b) noexcept(IsNumeric_v< T >)
Swapping two conjugated values/objects.
Definition Conjugate.h:193
BLAZE_ALWAYS_INLINE void conjugate(T &a) noexcept(IsNumeric_v< T >)
In-place conjugation of the given value/object.
Definition Conjugate.h:118
typename SubTrait< T1, T2 >::Type SubTrait_t
Auxiliary alias declaration for the SubTrait class template.
Definition SubTrait.h:163
typename AddTrait< T1, T2 >::Type AddTrait_t
Auxiliary alias declaration for the AddTrait class template.
Definition AddTrait.h:163
typename MapTrait< Args... >::Type MapTrait_t
Auxiliary alias declaration for the MapTrait class template.
Definition MapTrait.h:131
typename DivTrait< T1, T2 >::Type DivTrait_t
Auxiliary alias declaration for the DivTrait class template.
Definition DivTrait.h:164
typename MultTrait< T1, T2 >::Type MultTrait_t
Auxiliary alias declaration for the MultTrait class template.
Definition MultTrait.h:165
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.
Definition HasSIMDSub.h:187
constexpr bool IsStrictlyUpper_v
Auxiliary variable template for the IsStrictlyUpper type trait.
Definition IsStrictlyUpper.h:173
constexpr bool IsSymmetric_v
Auxiliary variable template for the IsSymmetric type trait.
Definition IsSymmetric.h:172
constexpr ptrdiff_t DefaultMaxSize_v
Default size of the MaxSize type trait.
Definition MaxSize.h:72
constexpr ptrdiff_t MaxSize_v
Auxiliary variable template for the MaxSize type trait.
Definition MaxSize.h:175
constexpr bool IsSquare_v
Auxiliary variable template for the IsSquare type trait.
Definition IsSquare.h:146
constexpr bool IsScalar_v
Auxiliary variable template for the IsScalar type trait.
Definition IsScalar.h:104
constexpr bool IsStrictlyLower_v
Auxiliary variable template for the IsStrictlyLower type trait.
Definition IsStrictlyLower.h:173
constexpr bool IsRowMajorMatrix_v
Auxiliary variable template for the IsRowMajorMatrix type trait.
Definition IsRowMajorMatrix.h:129
constexpr bool IsUpper_v
Auxiliary variable template for the IsUpper type trait.
Definition IsUpper.h:175
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.
Definition IsSIMDCombinable.h:137
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.
Definition Size.h:176
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition Size.h:72
constexpr bool IsDiagonal_v
Auxiliary variable template for the IsDiagonal type trait.
Definition IsDiagonal.h:148
constexpr bool StorageOrder_v
Auxiliary variable template for the StorageOrder type trait.
Definition StorageOrder.h:93
constexpr bool IsColumnMajorMatrix_v
Auxiliary variable template for the IsColumnMajorMatrix type trait.
Definition IsColumnMajorMatrix.h:129
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.
Definition IsMatrix.h:124
constexpr bool IsColumnVector_v
Auxiliary variable template for the IsColumnVector type trait.
Definition IsColumnVector.h:126
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.
Definition HasSIMDAdd.h:187
constexpr bool IsSparseMatrix_v
Auxiliary variable template for the IsSparseMatrix type trait.
Definition IsSparseMatrix.h:124
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.
Definition HasSIMDMult.h:188
constexpr bool IsRowVector_v
Auxiliary variable template for the IsRowVector type trait.
Definition IsRowVector.h:126
constexpr bool IsDenseMatrix_v
Auxiliary variable template for the IsDenseMatrix type trait.
Definition IsDenseMatrix.h:124
constexpr bool IsDenseVector_v
Auxiliary variable template for the IsDenseVector type trait.
Definition IsDenseVector.h:124
constexpr bool IsPadded_v
Auxiliary variable template for the IsPadded type trait.
Definition IsPadded.h:134
constexpr bool IsLower_v
Auxiliary variable template for the IsLower type trait.
Definition IsLower.h:175
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition RelaxationFlag.h:66
BLAZE_ALWAYS_INLINE constexpr auto prevMultiple(T1 value, T2 factor) noexcept
Rounds down an integral value to the previous multiple of a given factor.
Definition PrevMultiple.h:68
constexpr Infinity inf
Global Infinity instance.
Definition Infinity.h:1080
constexpr size_t determineColumns(initializer_list< initializer_list< Type > > list) noexcept
Determines the maximum number of columns specified by the given initializer list.
Definition InitializerList.h:107
BLAZE_ALWAYS_INLINE constexpr auto nextMultiple(T1 value, T2 factor) noexcept
Rounds up an integral value to the next multiple of a given factor.
Definition NextMultiple.h:68
PaddingFlag
Padding flag for (un-)padded vectors and matrices.
Definition PaddingFlag.h:77
AlignmentFlag
Alignment flag for (un-)aligned vectors and matrices.
Definition AlignmentFlag.h:63
@ padded
Flag for padded vectors and matrices.
Definition PaddingFlag.h:79
@ unpadded
Flag for unpadded vectors and matrices.
Definition PaddingFlag.h:78
@ unaligned
Flag for unaligned vectors and matrices.
Definition AlignmentFlag.h:64
@ aligned
Flag for aligned vectors and matrices.
Definition AlignmentFlag.h:65
constexpr void clear(Matrix< MT, SO > &matrix)
Clearing the given matrix.
Definition Matrix.h:960
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition Matrix.h:644
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition Matrix.h:806
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition Matrix.h:660
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition Matrix.h:1108
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition Matrix.h:1221
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition Matrix.h:676
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition Matrix.h:1195
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition Assert.h:101
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition Assert.h:117
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition Set.h:75
typename SIMDTrait< T >::Type SIMDTrait_t
Auxiliary alias declaration for the SIMDTrait class template.
Definition SIMDTrait.h:315
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition Storea.h:78
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition Storeu.h:75
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition Stream.h:74
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition Loadu.h:76
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition Loada.h:79
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition StaticAssert.h:112
constexpr PaddingFlag defaultPaddingFlag
The default padding flag for all vectors and matrices of the Blaze library.
Definition Padding.h:74
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition Inline.h:85
constexpr AlignmentFlag defaultAlignmentFlag
The default alignment for all vectors and matrices of the Blaze library.
Definition Alignment.h:75
constexpr bool IsSame_v
Auxiliary variable template for the IsSame type trait.
Definition IsSame.h:159
constexpr bool IsVectorizable_v
Auxiliary variable template for the IsVectorizable type trait.
Definition IsVectorizable.h:157
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.
Definition IsNumeric.h:132
constexpr size_t AlignmentOf_v
Auxiliary variable template for the AlignmentOf type trait.
Definition AlignmentOf.h:239
void deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition Memory.h:230
IntegralConstant< ptrdiff_t, N > Ptrdiff_t
Compile time integral constant wrapper for ptrdiff_t.
Definition IntegralConstant.h:237
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition MaybeUnused.h:81
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:138
BoolConstant< true > TrueType
Type traits base class.
Definition IntegralConstant.h:132
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition Exception.h:235
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition AlignmentCheck.h:68
#define BLAZE_THROW_LOGIC_ERROR(MESSAGE)
Macro for the emission of a std::logic_error exception.
Definition Exception.h:187
T * allocate(size_t size)
Aligned array allocation for built-in data types.
Definition Memory.h:158
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:175
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition IntegralConstant.h:110
Header file for the exception macros of the math module.
Header file for all forward declarations of the math module.
Header file for the extended initializer_list functionality.
constexpr bool rowMajor
Storage order flag for row-major matrices.
Definition StorageOrder.h:71
constexpr bool columnMajor
Storage order flag for column-major matrices.
Definition StorageOrder.h:99
Header file for all forward declarations for dense vectors and matrices.
Header file for the Size type trait.
Header file for the StorageOrder type trait.
Header file for the clear shim.
Header file for the serial shim.
Compile time check for low-level access to constant data.
Definition HasConstDataAccess.h:76
Compile time check for low-level access to mutable data.
Definition HasMutableDataAccess.h:76
Base template for the HighType type trait.
Definition HighType.h:322
Rebind mechanism to obtain a HybridMatrix with different data/element type.
Definition HybridMatrix.h:290
HybridMatrix< NewType, M, N, SO, AF, PF, Tag > Other
The type of the other HybridMatrix.
Definition HybridMatrix.h:291
Resize mechanism to obtain a HybridMatrix with different fixed dimensions.
Definition HybridMatrix.h:300
HybridMatrix< Type, NewM, NewN, SO, AF, PF, Tag > Other
The type of the other HybridMatrix.
Definition HybridMatrix.h:301
Compile time check for the alignment of data types.
Definition IsAligned.h:88
Compile time check for the memory layout of data types.
Definition IsContiguous.h:87
Compile time check for data types with padding.
Definition IsPadded.h:77
Base template for the LowType type trait.
Definition LowType.h:322
Compile time evaluation of the maximum size of vectors and matrices.
Definition MaxSize.h:118
Header file for the default alignment for all vectors and matrices of the Blaze library.
System settings for the inline keywords.
System settings for performance optimizations.
Header file for the default padding flag for all vectors and matrices of the Blaze library.
Header file for basic type definitions.
Header file for the generic max algorithm.
Header file for the generic min algorithm.