35 #ifndef _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_
36 #define _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_
209 template<
typename Type
213 class HybridMatrix :
public DenseMatrix< HybridMatrix<Type,M,N,SO>, SO >
239 template<
typename ET >
257 enum :
bool { smpAssignable =
false };
265 explicit inline HybridMatrix(
size_t m,
size_t n,
const Type& init );
266 explicit inline HybridMatrix( initializer_list< initializer_list<Type> > list );
268 template<
typename Other >
269 explicit inline HybridMatrix(
size_t m,
size_t n,
const Other* array );
271 template<
typename Other,
size_t M2,
size_t N2 >
272 explicit inline HybridMatrix(
const Other (&array)[M2][N2] );
275 template<
typename MT,
bool SO2 >
inline HybridMatrix(
const Matrix<MT,SO2>& m );
286 inline Reference
operator()(
size_t i,
size_t j ) noexcept;
287 inline ConstReference
operator()(
size_t i,
size_t j )
const noexcept;
288 inline Reference
at(
size_t i,
size_t j );
289 inline ConstReference
at(
size_t i,
size_t j )
const;
290 inline Pointer
data () noexcept;
291 inline ConstPointer
data () const noexcept;
292 inline Pointer
data (
size_t i ) noexcept;
293 inline ConstPointer
data (
size_t i ) const noexcept;
294 inline Iterator
begin (
size_t i ) noexcept;
295 inline ConstIterator
begin (
size_t i ) const noexcept;
296 inline ConstIterator
cbegin(
size_t i ) const noexcept;
297 inline Iterator
end (
size_t i ) noexcept;
298 inline ConstIterator
end (
size_t i ) const noexcept;
299 inline ConstIterator
cend (
size_t i ) const noexcept;
307 inline
HybridMatrix& operator=( initializer_list< initializer_list<Type> > list );
309 template< typename Other,
size_t M2,
size_t N2 >
310 inline
HybridMatrix& operator=( const Other (&array)[M2][N2] );
313 template< typename MT,
bool SO2 > inline
HybridMatrix& operator= ( const Matrix<MT,SO2>& rhs );
314 template< typename MT,
bool SO2 > inline
HybridMatrix& operator+=( const Matrix<MT,SO2>& rhs );
315 template< typename MT,
bool SO2 > inline
HybridMatrix& operator-=( const Matrix<MT,SO2>& rhs );
316 template< typename MT,
bool SO2 > inline
HybridMatrix& operator*=( const Matrix<MT,SO2>& rhs );
318 template< typename Other >
321 template< typename Other >
329 inline
size_t rows() const noexcept;
330 inline
size_t columns() const noexcept;
331 inline constexpr
size_t spacing() const noexcept;
332 inline constexpr
size_t capacity() const noexcept;
333 inline
size_t capacity(
size_t i ) const noexcept;
335 inline
size_t nonZeros(
size_t i ) const;
337 inline
void reset(
size_t i );
339 void resize (
size_t m,
size_t n,
bool preserve=true );
340 inline
void extend (
size_t m,
size_t n,
bool preserve=true );
343 template< typename Other > inline
HybridMatrix& scale( const Other& scalar );
351 static inline
void* operator new (
std::
size_t size );
352 static inline
void* operator new[](
std::
size_t size );
353 static inline
void* operator new (
std::
size_t size, const
std::nothrow_t& );
354 static inline
void* operator new[](
std::
size_t size, const
std::nothrow_t& );
356 static inline
void operator delete (
void* ptr );
357 static inline
void operator delete[](
void* ptr );
358 static inline
void operator delete (
void* ptr, const
std::nothrow_t& );
359 static inline
void operator delete[](
void* ptr, const
std::nothrow_t& );
366 template< typename MT >
368 struct VectorizedAssign {
370 simdEnabled && MT::simdEnabled &&
371 AreSIMDCombinable< Type, ElementType_<MT> >::value &&
372 IsRowMajorMatrix<MT>::value };
379 template<
typename MT >
381 struct VectorizedAddAssign {
383 simdEnabled && MT::simdEnabled &&
384 AreSIMDCombinable< Type, ElementType_<MT> >::value &&
385 HasSIMDAdd< Type, ElementType_<MT> >::value &&
386 IsRowMajorMatrix<MT>::value &&
387 !IsDiagonal<MT>::value };
394 template<
typename MT >
396 struct VectorizedSubAssign {
398 simdEnabled && MT::simdEnabled &&
399 AreSIMDCombinable< Type, ElementType_<MT> >::value &&
400 HasSIMDSub< Type, ElementType_<MT> >::value &&
401 IsRowMajorMatrix<MT>::value &&
402 !IsDiagonal<MT>::value };
416 inline bool isIntact() const noexcept;
423 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
424 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
437 template< typename MT,
bool SO2 >
438 inline
DisableIf_<VectorizedAssign<MT> > assign( const DenseMatrix<MT,SO2>& rhs );
440 template< typename MT,
bool SO2 >
441 inline
EnableIf_<VectorizedAssign<MT> > assign( const DenseMatrix<MT,SO2>& rhs );
443 template< typename MT > inline
void assign( const SparseMatrix<MT,SO>& rhs );
444 template< typename MT > inline
void assign( const SparseMatrix<MT,!SO>& rhs );
446 template< typename MT,
bool SO2 >
447 inline
DisableIf_<VectorizedAddAssign<MT> > addAssign( const DenseMatrix<MT,SO2>& rhs );
449 template< typename MT,
bool SO2 >
450 inline
EnableIf_<VectorizedAddAssign<MT> > addAssign( const DenseMatrix<MT,SO2>& rhs );
452 template< typename MT > inline
void addAssign( const SparseMatrix<MT,SO>& rhs );
453 template< typename MT > inline
void addAssign( const SparseMatrix<MT,!SO>& rhs );
455 template< typename MT,
bool SO2 >
456 inline
DisableIf_<VectorizedSubAssign<MT> > subAssign( const DenseMatrix<MT,SO2>& rhs );
458 template< typename MT,
bool SO2 >
459 inline
EnableIf_<VectorizedSubAssign<MT> > subAssign( const DenseMatrix<MT,SO2>& rhs );
461 template< typename MT > inline
void subAssign( const SparseMatrix<MT,SO>& rhs );
462 template< typename MT > inline
void subAssign( const SparseMatrix<MT,!SO>& rhs );
469 enum :
size_t { NN = (
usePadding )?( NextMultiple< SizeT<N>, SizeT<SIMDSIZE> >::value ):( N ) };
517 template<
typename Type
529 for(
size_t i=0UL; i<M*NN; ++i )
551 template<
typename Type
571 for(
size_t i=0UL; i<M*NN; ++i )
594 template<
typename Type
613 for(
size_t i=0UL; i<m; ++i ) {
614 for(
size_t j=0UL; j<n; ++j )
618 for(
size_t j=n; j<NN; ++j )
624 for(
size_t i=m; i<M; ++i )
625 for(
size_t j=0UL; j<NN; ++j )
658 template<
typename Type
679 for(
const auto& rowList : list ) {
680 std::fill( std::copy( rowList.begin(), rowList.end(),
v_+i*NN ),
v_+(i+1UL)*NN, Type() );
686 for(
size_t j=0UL; j<NN; ++j )
722 template<
typename Type
726 template<
typename Other >
742 for(
size_t i=0UL; i<m; ++i ) {
743 for(
size_t j=0UL; j<n; ++j )
744 v_[i*NN+j] = array[i*n+j];
747 for(
size_t j=n; j<NN; ++j )
753 for(
size_t i=m; i<M; ++i )
754 for(
size_t j=0UL; j<NN; ++j )
784 template<
typename Type
788 template<
typename Other
800 for(
size_t i=0UL; i<M2; ++i ) {
801 for(
size_t j=0UL; j<N2; ++j )
802 v_[i*NN+j] = array[i][j];
805 for(
size_t j=N2; j<NN; ++j )
811 for(
size_t i=M2; i<M; ++i )
812 for(
size_t j=0UL; j<NN; ++j )
829 template<
typename Type
840 for(
size_t i=0UL; i<
m_; ++i ) {
841 for(
size_t j=0UL; j<
n_; ++j )
842 v_[i*NN+j] = m.v_[i*NN+j];
845 for(
size_t j=n_; j<NN; ++j )
851 for(
size_t i=m_; i<M; ++i )
852 for(
size_t j=0UL; j<NN; ++j )
867 template<
typename Type
871 template<
typename MT
886 for(
size_t i=0UL; i<
m_; ++i ) {
888 j<( IsNumeric<Type>::value ? NN :
n_ );
895 for(
size_t i=m_; i<M; ++i )
896 for(
size_t j=0UL; j<NN; ++j )
925 template<
typename Type
949 template<
typename Type
974 template<
typename Type
1003 template<
typename Type
1016 return (*
this)(i,j);
1033 template<
typename Type
1057 template<
typename Type
1077 template<
typename Type
1098 template<
typename Type
1122 template<
typename Type
1146 template<
typename Type
1170 template<
typename Type
1194 template<
typename Type
1218 template<
typename Type
1242 template<
typename Type
1269 template<
typename Type
1278 for(
size_t i=0UL; i<
m_; ++i )
1279 for(
size_t j=0UL; j<
n_; ++j )
1312 template<
typename Type
1319 const size_t m( list.size() );
1334 for(
const auto& rowList : list ) {
1335 std::fill( std::copy( rowList.begin(), rowList.end(), v_+i*NN ), v_+(i+1UL)*NN, Type() );
1365 template<
typename Type
1369 template<
typename Other
1379 for(
size_t i=0UL; i<M2; ++i )
1380 for(
size_t j=0UL; j<N2; ++j )
1381 v_[i*NN+j] = array[i][j];
1396 template<
typename Type
1402 using blaze::assign;
1407 resize( rhs.rows(), rhs.columns() );
1408 assign( *
this, ~rhs );
1428 template<
typename Type
1432 template<
typename MT
1436 using blaze::assign;
1454 resize( tmp.rows(), tmp.columns() );
1455 assign( *
this, tmp );
1461 assign( *
this, ~rhs );
1481 template<
typename Type
1485 template<
typename MT
1489 using blaze::addAssign;
1495 if( (~rhs).canAlias(
this ) ) {
1497 addAssign( *
this, tmp );
1500 addAssign( *
this, ~rhs );
1520 template<
typename Type
1524 template<
typename MT
1528 using blaze::subAssign;
1534 if( (~rhs).canAlias(
this ) ) {
1536 subAssign( *
this, tmp );
1539 subAssign( *
this, ~rhs );
1559 template<
typename Type
1563 template<
typename MT
1572 this->operator=( tmp );
1588 template<
typename Type
1592 template<
typename Other >
1596 using blaze::assign;
1598 assign( *
this, (*
this) * rhs );
1616 template<
typename Type
1620 template<
typename Other >
1624 using blaze::assign;
1628 assign( *
this, (*
this) / rhs );
1650 template<
typename Type
1666 template<
typename Type
1685 template<
typename Type
1701 template<
typename Type
1723 template<
typename Type
1743 template<
typename Type
1749 size_t nonzeros( 0UL );
1751 for(
size_t i=0UL; i<
m_; ++i )
1752 for(
size_t j=0UL; j<
n_; ++j )
1772 template<
typename Type
1780 const size_t jend( i*NN +
n_ );
1781 size_t nonzeros( 0UL );
1783 for(
size_t j=i*NN; j<jend; ++j )
1797 template<
typename Type
1805 for(
size_t i=0UL; i<
m_; ++i )
1806 for(
size_t j=0UL; j<
n_; ++j )
1807 clear( v_[i*NN+j] );
1823 template<
typename Type
1832 for(
size_t j=0UL; j<
n_; ++j )
1833 clear( v_[i*NN+j] );
1845 template<
typename Type
1892 template<
typename Type
1909 for(
size_t i=0UL; i<m; ++i )
1910 for(
size_t j=n; j<
n_; ++j )
1911 v_[i*NN+j] = Type();
1915 for(
size_t i=m; i<
m_; ++i )
1916 for(
size_t j=0UL; j<
n_; ++j )
1917 v_[i*NN+j] = Type();
1941 template<
typename Type
1964 template<
typename Type
1972 if(
m_ > N ||
n_ > M ) {
1976 const size_t maxsize(
max(
m_,
n_ ) );
1977 for(
size_t i=1UL; i<maxsize; ++i ) {
1978 for(
size_t j=0UL; j<i; ++j ) {
1979 swap( v_[i*NN+j], v_[j*NN+i] );
1984 for(
size_t i=0UL; i<
m_; ++i ) {
1985 for(
size_t j=m_; j<
n_; ++j ) {
1986 v_[i*NN+j] = Type();
1992 for(
size_t i=
n_; i<
m_; ++i ) {
1993 for(
size_t j=0UL; j<
n_; ++j ) {
1994 v_[i*NN+j] = Type();
2019 template<
typename Type
2027 if(
m_ > N ||
n_ > M ) {
2031 const size_t maxsize(
max(
m_,
n_ ) );
2032 for(
size_t i=0UL; i<maxsize; ++i ) {
2033 for(
size_t j=0UL; j<i; ++j ) {
2034 cswap( v_[i*NN+j], v_[j*NN+i] );
2040 for(
size_t i=0UL; i<
m_; ++i ) {
2041 for(
size_t j=m_; j<
n_; ++j ) {
2042 v_[i*NN+j] = Type();
2048 for(
size_t i=
n_; i<
m_; ++i ) {
2049 for(
size_t j=0UL; j<
n_; ++j ) {
2050 v_[i*NN+j] = Type();
2070 template<
typename Type
2074 template<
typename Other >
2077 for(
size_t i=0UL; i<
m_; ++i )
2078 for(
size_t j=0UL; j<
n_; ++j )
2079 v_[i*NN+j] *= scalar;
2092 template<
typename Type
2100 const size_t maxrows(
max(
m_, m.m_ ) );
2101 const size_t maxcols(
max(
n_, m.n_ ) );
2103 for(
size_t i=0UL; i<maxrows; ++i ) {
2104 for(
size_t j=0UL; j<maxcols; ++j ) {
2105 swap( v_[i*NN+j], m(i,j) );
2133 template<
typename Type
2143 return allocate<HybridMatrix>( 1UL );
2158 template<
typename Type
2182 template<
typename Type
2192 return allocate<HybridMatrix>( 1UL );
2207 template<
typename Type
2216 return allocate<HybridMatrix>( size/
sizeof(
HybridMatrix) );
2227 template<
typename Type
2233 deallocate( static_cast<HybridMatrix*>( ptr ) );
2244 template<
typename Type
2250 deallocate( static_cast<HybridMatrix*>( ptr ) );
2261 template<
typename Type
2267 deallocate( static_cast<HybridMatrix*>( ptr ) );
2278 template<
typename Type
2284 deallocate( static_cast<HybridMatrix*>( ptr ) );
2306 template<
typename Type
2312 if(
m_ > M ||
n_ > N )
2317 for(
size_t i=0UL; i<
m_; ++i ) {
2318 for(
size_t j=
n_; j<NN; ++j ) {
2319 if( v_[i*NN+j] != Type() )
2324 for(
size_t i=m_; i<M; ++i ) {
2325 for(
size_t j=0UL; j<NN; ++j ) {
2326 if( v_[i*NN+j] != Type() )
2355 template<
typename Type
2359 template<
typename Other >
2362 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2377 template<
typename Type
2381 template<
typename Other >
2384 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2398 template<
typename Type
2424 template<
typename Type
2432 return loada( i, j );
2434 return loadu( i, j );
2454 template<
typename Type
2471 return loada( &v_[i*NN+j] );
2491 template<
typename Type
2506 return loadu( &v_[i*NN+j] );
2527 template<
typename Type
2558 template<
typename Type
2575 storea( &v_[i*NN+j], value );
2596 template<
typename Type
2611 storeu( &v_[i*NN+j], value );
2633 template<
typename Type
2650 stream( &v_[i*NN+j], value );
2666 template<
typename Type
2670 template<
typename MT
2677 for(
size_t i=0UL; i<
m_; ++i ) {
2678 for(
size_t j=0UL; j<
n_; ++j ) {
2679 v_[i*NN+j] = (~rhs)(i,j);
2697 template<
typename Type
2701 template<
typename MT
2712 const size_t jpos( ( remainder )?(
n_ &
size_t(-SIMDSIZE) ):(
n_ ) );
2715 for(
size_t i=0UL; i<
m_; ++i )
2719 for( ; j<jpos; j+=SIMDSIZE ) {
2720 store( i, j, (~rhs).load(i,j) );
2722 for( ; remainder && j<
n_; ++j ) {
2723 v_[i*NN+j] = (~rhs)(i,j);
2741 template<
typename Type
2745 template<
typename MT >
2750 for(
size_t i=0UL; i<
m_; ++i )
2752 v_[i*NN+element->index()] = element->value();
2768 template<
typename Type
2772 template<
typename MT >
2779 for(
size_t j=0UL; j<
n_; ++j )
2781 v_[element->index()*NN+j] = element->value();
2797 template<
typename Type
2801 template<
typename MT
2808 for(
size_t i=0UL; i<
m_; ++i )
2812 v_[i*NN+i] += (~rhs)(i,i);
2824 for(
size_t j=jbegin; j<jend; ++j ) {
2825 v_[i*NN+j] += (~rhs)(i,j);
2844 template<
typename Type
2848 template<
typename MT
2860 for(
size_t i=0UL; i<
m_; ++i )
2870 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
2871 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2875 for( ; j<jpos; j+=SIMDSIZE ) {
2876 store( i, j, load(i,j) + (~rhs).load(i,j) );
2878 for( ; remainder && j<jend; ++j ) {
2879 v_[i*NN+j] += (~rhs)(i,j);
2897 template<
typename Type
2901 template<
typename MT >
2906 for(
size_t i=0UL; i<
m_; ++i )
2908 v_[i*NN+element->index()] += element->value();
2924 template<
typename Type
2928 template<
typename MT >
2935 for(
size_t j=0UL; j<
n_; ++j )
2937 v_[element->index()*NN+j] += element->value();
2953 template<
typename Type
2957 template<
typename MT
2964 for(
size_t i=0UL; i<
m_; ++i )
2968 v_[i*NN+i] -= (~rhs)(i,i);
2980 for(
size_t j=jbegin; j<jend; ++j ) {
2981 v_[i*NN+j] -= (~rhs)(i,j);
3000 template<
typename Type
3004 template<
typename MT
3016 for(
size_t i=0UL; i<
m_; ++i )
3026 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
3027 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
3031 for( ; j<jpos; j+=SIMDSIZE ) {
3032 store( i, j, load(i,j) - (~rhs).load(i,j) );
3034 for( ; remainder && j<jend; ++j ) {
3035 v_[i*NN+j] -= (~rhs)(i,j);
3053 template<
typename Type
3057 template<
typename MT >
3062 for(
size_t i=0UL; i<
m_; ++i )
3064 v_[i*NN+element->index()] -= element->value();
3080 template<
typename Type
3084 template<
typename MT >
3091 for(
size_t j=0UL; j<
n_; ++j )
3093 v_[element->index()*NN+j] -= element->value();
3118 template<
typename Type
3147 template<
typename ET >
3159 enum :
bool { simdEnabled = IsVectorizable<Type>::value };
3165 enum :
bool { smpAssignable =
false };
3173 explicit inline HybridMatrix(
size_t m,
size_t n,
const Type& init );
3174 explicit inline HybridMatrix( initializer_list< initializer_list<Type> > list );
3176 template<
typename Other >
3177 explicit inline HybridMatrix(
size_t m,
size_t n,
const Other* array );
3179 template<
typename Other,
size_t M2,
size_t N2 >
3180 explicit inline HybridMatrix(
const Other (&array)[M2][N2] );
3183 template<
typename MT,
bool SO >
inline HybridMatrix(
const Matrix<MT,SO>& m );
3194 inline Reference
operator()(
size_t i,
size_t j ) noexcept;
3195 inline ConstReference
operator()(
size_t i,
size_t j )
const noexcept;
3196 inline Reference
at(
size_t i,
size_t j );
3197 inline ConstReference
at(
size_t i,
size_t j )
const;
3198 inline Pointer
data () noexcept;
3199 inline ConstPointer
data () const noexcept;
3200 inline Pointer
data (
size_t j ) noexcept;
3201 inline ConstPointer
data (
size_t j ) const noexcept;
3202 inline Iterator
begin (
size_t j ) noexcept;
3203 inline ConstIterator
begin (
size_t j ) const noexcept;
3204 inline ConstIterator
cbegin(
size_t j ) const noexcept;
3205 inline Iterator
end (
size_t j ) noexcept;
3206 inline ConstIterator
end (
size_t j ) const noexcept;
3207 inline ConstIterator
cend (
size_t j ) const noexcept;
3215 inline
HybridMatrix& operator=( initializer_list< initializer_list<Type> > list );
3217 template< typename Other,
size_t M2,
size_t N2 >
3218 inline
HybridMatrix& operator=( const Other (&array)[M2][N2] );
3221 template< typename MT,
bool SO > inline
HybridMatrix& operator= ( const Matrix<MT,SO>& rhs );
3222 template< typename MT,
bool SO > inline
HybridMatrix& operator+=( const Matrix<MT,SO>& rhs );
3223 template< typename MT,
bool SO > inline
HybridMatrix& operator-=( const Matrix<MT,SO>& rhs );
3224 template< typename MT,
bool SO > inline
HybridMatrix& operator*=( const Matrix<MT,SO>& rhs );
3226 template< typename Other >
3229 template< typename Other >
3237 inline
size_t rows() const noexcept;
3238 inline
size_t columns() const noexcept;
3239 inline constexpr
size_t spacing() const noexcept;
3240 inline constexpr
size_t capacity() const noexcept;
3241 inline
size_t capacity(
size_t j ) const noexcept;
3243 inline
size_t nonZeros(
size_t j ) const;
3244 inline
void reset();
3245 inline
void reset(
size_t i );
3246 inline
void clear();
3247 void resize (
size_t m,
size_t n,
bool preserve=true );
3248 inline
void extend (
size_t m,
size_t n,
bool preserve=true );
3251 template< typename Other > inline
HybridMatrix& scale( const Other& scalar );
3259 static inline
void* operator new (
std::
size_t size );
3260 static inline
void* operator new[](
std::
size_t size );
3261 static inline
void* operator new (
std::
size_t size, const
std::nothrow_t& );
3262 static inline
void* operator new[](
std::
size_t size, const
std::nothrow_t& );
3264 static inline
void operator delete (
void* ptr );
3265 static inline
void operator delete[](
void* ptr );
3266 static inline
void operator delete (
void* ptr, const
std::nothrow_t& );
3267 static inline
void operator delete[](
void* ptr, const
std::nothrow_t& );
3274 template< typename MT >
3275 struct VectorizedAssign {
3277 simdEnabled && MT::simdEnabled &&
3278 AreSIMDCombinable< Type, ElementType_<MT> >::value &&
3279 IsColumnMajorMatrix<MT>::value };
3285 template<
typename MT >
3286 struct VectorizedAddAssign {
3288 simdEnabled && MT::simdEnabled &&
3289 AreSIMDCombinable< Type, ElementType_<MT> >::value &&
3290 HasSIMDAdd< Type, ElementType_<MT> >::value &&
3291 IsColumnMajorMatrix<MT>::value &&
3292 !IsDiagonal<MT>::value };
3298 template<
typename MT >
3299 struct VectorizedSubAssign {
3301 simdEnabled && MT::simdEnabled &&
3302 AreSIMDCombinable< Type, ElementType_<MT> >::value &&
3303 HasSIMDSub< Type, ElementType_<MT> >::value &&
3304 IsColumnMajorMatrix<MT>::value &&
3305 !IsDiagonal<MT>::value };
3318 inline bool isIntact() const noexcept;
3325 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
3326 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
3339 template< typename MT,
bool SO >
3340 inline
DisableIf_<VectorizedAssign<MT> > assign( const DenseMatrix<MT,SO>& rhs );
3342 template< typename MT,
bool SO >
3343 inline
EnableIf_<VectorizedAssign<MT> > assign( const DenseMatrix<MT,SO>& rhs );
3345 template< typename MT > inline
void assign( const SparseMatrix<MT,true>& rhs );
3346 template< typename MT > inline
void assign( const SparseMatrix<MT,false>& rhs );
3348 template< typename MT,
bool SO >
3349 inline
DisableIf_<VectorizedAddAssign<MT> > addAssign( const DenseMatrix<MT,SO>& rhs );
3351 template< typename MT,
bool SO >
3352 inline
EnableIf_<VectorizedAddAssign<MT> > addAssign( const DenseMatrix<MT,SO>& rhs );
3354 template< typename MT > inline
void addAssign( const SparseMatrix<MT,true>& rhs );
3355 template< typename MT > inline
void addAssign( const SparseMatrix<MT,false>& rhs );
3357 template< typename MT,
bool SO >
3358 inline
DisableIf_<VectorizedSubAssign<MT> > subAssign( const DenseMatrix<MT,SO>& rhs );
3360 template< typename MT,
bool SO >
3361 inline
EnableIf_<VectorizedSubAssign<MT> > subAssign( const DenseMatrix<MT,SO>& rhs );
3363 template< typename MT > inline
void subAssign( const SparseMatrix<MT,true>& rhs );
3364 template< typename MT > inline
void subAssign( const SparseMatrix<MT,false>& rhs );
3371 enum :
size_t { MM = (
usePadding )?( NextMultiple< SizeT<M>, SizeT<SIMDSIZE> >::value ):( M ) };
3377 AlignedArray<Type,MM*N>
v_;
3412 template<
typename Type
3422 if( IsNumeric<Type>::value ) {
3423 for(
size_t i=0UL; i<MM*N; ++i )
3447 template<
typename Type
3465 if( IsNumeric<Type>::value ) {
3466 for(
size_t i=0UL; i<MM*N; ++i )
3491 template<
typename Type
3509 for(
size_t j=0UL; j<n; ++j ) {
3510 for(
size_t i=0UL; i<m; ++i )
3513 if( IsNumeric<Type>::value ) {
3514 for(
size_t i=m; i<MM; ++i )
3515 v_[i+j*MM] = Type();
3519 if( IsNumeric<Type>::value ) {
3520 for(
size_t j=n; j<N; ++j )
3521 for(
size_t i=0UL; i<MM; ++i )
3522 v_[i+j*MM] = Type();
3556 template<
typename Type
3576 for(
const auto& rowList : list ) {
3578 for(
const auto& element : rowList ) {
3579 v_[i+j*MM] = element;
3582 if( IsNumeric<Type>::value ) {
3584 v_[i+j*MM] = Type();
3592 if( IsNumeric<Type>::value ) {
3593 for( ; i<MM; ++i ) {
3594 for(
size_t j=0UL; j<N; ++j ) {
3595 v_[i+j*MM] = Type();
3634 template<
typename Type
3637 template<
typename Other >
3653 for(
size_t j=0UL; j<n; ++j ) {
3654 for(
size_t i=0UL; i<m; ++i )
3655 v_[i+j*MM] = array[i+j*m];
3657 if( IsNumeric<Type>::value ) {
3658 for(
size_t i=m; i<MM; ++i )
3659 v_[i+j*MM] = Type();
3663 if( IsNumeric<Type>::value ) {
3664 for(
size_t j=n; j<N; ++j )
3665 for(
size_t i=0UL; i<MM; ++i )
3666 v_[i+j*MM] = Type();
3697 template<
typename Type
3700 template<
typename Other
3712 for(
size_t j=0UL; j<N2; ++j ) {
3713 for(
size_t i=0UL; i<M2; ++i )
3714 v_[i+j*MM] = array[i][j];
3716 if( IsNumeric<Type>::value ) {
3717 for(
size_t i=M2; i<MM; ++i )
3718 v_[i+j*MM] = Type();
3722 if( IsNumeric<Type>::value ) {
3723 for(
size_t j=N2; j<N; ++j )
3724 for(
size_t i=0UL; i<MM; ++i )
3725 v_[i+j*MM] = Type();
3743 template<
typename Type
3753 for(
size_t j=0UL; j<
n_; ++j ) {
3754 for(
size_t i=0UL; i<
m_; ++i )
3755 v_[i+j*MM] = m.v_[i+j*MM];
3757 if( IsNumeric<Type>::value ) {
3758 for(
size_t i=m_; i<MM; ++i )
3759 v_[i+j*MM] = Type();
3763 if( IsNumeric<Type>::value ) {
3764 for(
size_t j=n_; j<N; ++j )
3765 for(
size_t i=0UL; i<MM; ++i )
3766 v_[i+j*MM] = Type();
3782 template<
typename Type
3785 template<
typename MT
3792 using blaze::assign;
3800 for(
size_t j=0UL; j<
n_; ++j ) {
3801 for(
size_t i=( IsSparseMatrix<MT>::value ? 0UL : m_ );
3802 i<( IsNumeric<Type>::value ? MM :
m_ );
3804 v_[i+j*MM] = Type();
3808 if( IsNumeric<Type>::value ) {
3809 for(
size_t j=n_; j<N; ++j )
3810 for(
size_t i=0UL; i<MM; ++i )
3811 v_[i+j*MM] = Type();
3814 assign( *
this, ~m );
3841 template<
typename Type
3866 template<
typename Type
3892 template<
typename Type
3904 return (*
this)(i,j);
3922 template<
typename Type
3934 return (*
this)(i,j);
3952 template<
typename Type
3955 inline typename HybridMatrix<Type,M,N,true>::Pointer
3976 template<
typename Type
3979 inline typename HybridMatrix<Type,M,N,true>::ConstPointer
3997 template<
typename Type
4000 inline typename HybridMatrix<Type,M,N,true>::Pointer
4019 template<
typename Type
4022 inline typename HybridMatrix<Type,M,N,true>::ConstPointer
4039 template<
typename Type
4059 template<
typename Type
4079 template<
typename Type
4099 template<
typename Type
4119 template<
typename Type
4139 template<
typename Type
4167 template<
typename Type
4170 inline HybridMatrix<Type,M,N,true>&
4176 for(
size_t j=0UL; j<
n_; ++j )
4177 for(
size_t i=0UL; i<
m_; ++i )
4212 template<
typename Type
4215 inline HybridMatrix<Type,M,N,true>&
4218 const size_t m( list.size() );
4233 for(
const auto& rowList : list ) {
4235 for(
const auto& element : rowList ) {
4236 v_[i+j*MM] = element;
4239 for( ; j<
n_; ++j ) {
4240 v_[i+j*MM] = Type();
4273 template<
typename Type
4276 template<
typename Other
4279 inline HybridMatrix<Type,M,N,true>&
4287 for(
size_t j=0UL; j<N2; ++j )
4288 for(
size_t i=0UL; i<M2; ++i )
4289 v_[i+j*MM] = array[i][j];
4306 template<
typename Type
4309 inline HybridMatrix<Type,M,N,true>&
4312 using blaze::assign;
4317 resize( rhs.rows(), rhs.columns() );
4318 assign( *
this, ~rhs );
4340 template<
typename Type
4343 template<
typename MT
4347 using blaze::assign;
4349 typedef TransExprTrait_<This> TT;
4350 typedef CTransExprTrait_<This> CT;
4351 typedef InvExprTrait_<This> IT;
4357 if( IsSame<MT,TT>::value && (~rhs).isAliased(
this ) ) {
4360 else if( IsSame<MT,CT>::value && (~rhs).isAliased(
this ) ) {
4363 else if( !IsSame<MT,IT>::value && (~rhs).canAlias(
this ) ) {
4364 HybridMatrix tmp( ~rhs );
4365 resize( tmp.rows(), tmp.columns() );
4366 assign( *
this, tmp );
4370 if( IsSparseMatrix<MT>::value )
4372 assign( *
this, ~rhs );
4394 template<
typename Type
4397 template<
typename MT
4401 using blaze::addAssign;
4403 if( (~rhs).
rows() != m_ || (~rhs).
columns() != n_ ) {
4407 if( (~rhs).canAlias(
this ) ) {
4408 const ResultType_<MT> tmp( ~rhs );
4409 addAssign( *
this, tmp );
4412 addAssign( *
this, ~rhs );
4434 template<
typename Type
4437 template<
typename MT
4441 using blaze::subAssign;
4443 if( (~rhs).
rows() != m_ || (~rhs).
columns() != n_ ) {
4447 if( (~rhs).canAlias(
this ) ) {
4448 const ResultType_<MT> tmp( ~rhs );
4449 subAssign( *
this, tmp );
4452 subAssign( *
this, ~rhs );
4474 template<
typename Type
4477 template<
typename MT
4481 if( n_ != (~rhs).
rows() || (~rhs).
columns() > N ) {
4485 const HybridMatrix tmp( *
this * (~rhs) );
4486 this->operator=( tmp );
4504 template<
typename Type
4507 template<
typename Other >
4508 inline EnableIf_<IsNumeric<Other>, HybridMatrix<Type,M,N,true> >&
4511 using blaze::assign;
4513 assign( *
this, (*
this) * rhs );
4533 template<
typename Type
4536 template<
typename Other >
4537 inline EnableIf_<IsNumeric<Other>, HybridMatrix<Type,M,N,true> >&
4540 using blaze::assign;
4544 assign( *
this, (*
this) / rhs );
4568 template<
typename Type
4585 template<
typename Type
4605 template<
typename Type
4622 template<
typename Type
4640 template<
typename Type
4661 template<
typename Type
4666 size_t nonzeros( 0UL );
4668 for(
size_t j=0UL; j<
n_; ++j )
4669 for(
size_t i=0UL; i<
m_; ++i )
4686 template<
typename Type
4693 const size_t iend( j*MM + m_ );
4694 size_t nonzeros( 0UL );
4696 for(
size_t i=j*MM; i<iend; ++i )
4712 template<
typename Type
4719 for(
size_t j=0UL; j<
n_; ++j )
4720 for(
size_t i=0UL; i<
m_; ++i )
4721 clear( v_[i+j*MM] );
4737 template<
typename Type
4745 for(
size_t i=0UL; i<
m_; ++i )
4746 clear( v_[i+j*MM] );
4760 template<
typename Type
4808 template<
typename Type
4823 if( IsVectorizable<Type>::value && m < m_ ) {
4824 for(
size_t j=0UL; j<n; ++j )
4825 for(
size_t i=m; i<
m_; ++i )
4826 v_[i+j*MM] = Type();
4829 if( IsVectorizable<Type>::value && n < n_ ) {
4830 for(
size_t j=n; j<
n_; ++j )
4831 for(
size_t i=0UL; i<
m_; ++i )
4832 v_[i+j*MM] = Type();
4858 template<
typename Type
4882 template<
typename Type
4889 if( m_ > N || n_ > M ) {
4893 const size_t maxsize(
max( m_, n_ ) );
4894 for(
size_t j=1UL; j<maxsize; ++j ) {
4895 for(
size_t i=0UL; i<j; ++i ) {
4896 swap( v_[i+j*MM], v_[j+i*MM] );
4900 if( IsVectorizable<Type>::value && n_ < m_ ) {
4901 for(
size_t j=0UL; j<
n_; ++j ) {
4902 for(
size_t i=n_; i<
m_; ++i ) {
4903 v_[i+j*MM] = Type();
4908 if( IsVectorizable<Type>::value && n_ > m_ ) {
4909 for(
size_t j=m_; j<
n_; ++j ) {
4910 for(
size_t i=0UL; i<
m_; ++i ) {
4911 v_[i+j*MM] = Type();
4938 template<
typename Type
4945 if( m_ > N || n_ > M ) {
4949 const size_t maxsize(
max( m_, n_ ) );
4950 for(
size_t j=0UL; j<maxsize; ++j ) {
4951 for(
size_t i=0UL; i<j; ++i ) {
4952 cswap( v_[i+j*MM], v_[j+i*MM] );
4957 if( IsVectorizable<Type>::value && n_ < m_ ) {
4958 for(
size_t j=0UL; j<
n_; ++j ) {
4959 for(
size_t i=n_; i<
m_; ++i ) {
4960 v_[i+j*MM] = Type();
4965 if( IsVectorizable<Type>::value && n_ > m_ ) {
4966 for(
size_t j=m_; j<
n_; ++j ) {
4967 for(
size_t i=0UL; i<
m_; ++i ) {
4968 v_[i+j*MM] = Type();
4990 template<
typename Type
4993 template<
typename Other >
4994 inline HybridMatrix<Type,M,N,true>&
4995 HybridMatrix<Type,M,N,true>::scale(
const Other& scalar )
4997 for(
size_t j=0UL; j<
n_; ++j )
4998 for(
size_t i=0UL; i<
m_; ++i )
4999 v_[i+j*MM] *= scalar;
5014 template<
typename Type
5021 const size_t maxrows(
max( m_, m.m_ ) );
5022 const size_t maxcols(
max( n_, m.n_ ) );
5024 for(
size_t j=0UL; j<maxcols; ++j ) {
5025 for(
size_t i=0UL; i<maxrows; ++i ) {
5026 swap( v_[i+j*MM], m(i,j) );
5056 template<
typename Type
5059 inline void* HybridMatrix<Type,M,N,true>::operator
new( std::size_t
size )
5065 return allocate<HybridMatrix>( 1UL );
5082 template<
typename Type
5085 inline void* HybridMatrix<Type,M,N,true>::operator
new[]( std::size_t
size )
5090 return allocate<HybridMatrix>( size/
sizeof(HybridMatrix) );
5107 template<
typename Type
5110 inline void* HybridMatrix<Type,M,N,true>::operator
new( std::size_t
size,
const std::nothrow_t& )
5116 return allocate<HybridMatrix>( 1UL );
5133 template<
typename Type
5136 inline void* HybridMatrix<Type,M,N,true>::operator
new[]( std::size_t
size,
const std::nothrow_t& )
5141 return allocate<HybridMatrix>( size/
sizeof(HybridMatrix) );
5154 template<
typename Type
5157 inline void HybridMatrix<Type,M,N,true>::operator
delete(
void* ptr )
5159 deallocate( static_cast<HybridMatrix*>( ptr ) );
5172 template<
typename Type
5175 inline void HybridMatrix<Type,M,N,true>::operator
delete[](
void* ptr )
5177 deallocate( static_cast<HybridMatrix*>( ptr ) );
5190 template<
typename Type
5193 inline void HybridMatrix<Type,M,N,true>::operator
delete(
void* ptr,
const std::nothrow_t& )
5195 deallocate( static_cast<HybridMatrix*>( ptr ) );
5208 template<
typename Type
5211 inline void HybridMatrix<Type,M,N,true>::operator
delete[](
void* ptr,
const std::nothrow_t& )
5213 deallocate( static_cast<HybridMatrix*>( ptr ) );
5237 template<
typename Type
5242 if( m_ > M || n_ > N )
5245 if( IsNumeric<Type>::value )
5247 for(
size_t j=0UL; j<
n_; ++j ) {
5248 for(
size_t i=m_; i<MM; ++i ) {
5249 if( v_[i+j*MM] != Type() )
5254 for(
size_t j=n_; j<N; ++j ) {
5255 for(
size_t i=0UL; i<MM; ++i ) {
5256 if( v_[i+j*MM] != Type() )
5287 template<
typename Type
5290 template<
typename Other >
5293 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5310 template<
typename Type
5313 template<
typename Other >
5316 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5332 template<
typename Type
5358 template<
typename Type
5365 return loada( i, j );
5367 return loadu( i, j );
5388 template<
typename Type
5404 return loada( &v_[i+j*MM] );
5425 template<
typename Type
5439 return loadu( &v_[i+j*MM] );
5461 template<
typename Type
5492 template<
typename Type
5508 storea( &v_[i+j*MM], value );
5530 template<
typename Type
5544 storeu( &v_[i+j*MM], value );
5567 template<
typename Type
5583 stream( &v_[i+j*MM], value );
5601 template<
typename Type
5604 template<
typename MT
5606 inline DisableIf_<typename HybridMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAssign<MT> >
5607 HybridMatrix<Type,M,N,true>::assign(
const DenseMatrix<MT,SO>& rhs )
5611 for(
size_t j=0UL; j<
n_; ++j ) {
5612 for(
size_t i=0UL; i<
m_; ++i ) {
5613 v_[i+j*MM] = (~rhs)(i,j);
5633 template<
typename Type
5636 template<
typename MT
5638 inline EnableIf_<typename HybridMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAssign<MT> >
5639 HybridMatrix<Type,M,N,true>::assign(
const DenseMatrix<MT,SO>& rhs )
5645 const bool remainder( !
usePadding || !IsPadded<MT>::value );
5647 const size_t ipos( ( remainder )?( m_ &
size_t(-SIMDSIZE) ):( m_ ) );
5648 BLAZE_INTERNAL_ASSERT( !remainder || ( m_ - ( m_ % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5650 for(
size_t j=0UL; j<
n_; ++j )
5654 for( ; i<ipos; i+=SIMDSIZE ) {
5655 store( i, j, (~rhs).load(i,j) );
5657 for( ; remainder && i<
m_; ++i ) {
5658 v_[i+j*MM] = (~rhs)(i,j);
5678 template<
typename Type
5681 template<
typename MT >
5682 inline void HybridMatrix<Type,M,N,true>::assign(
const SparseMatrix<MT,true>& rhs )
5686 for(
size_t j=0UL; j<
n_; ++j )
5687 for( ConstIterator_<MT> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5688 v_[element->index()+j*MM] = element->value();
5706 template<
typename Type
5709 template<
typename MT >
5710 inline void HybridMatrix<Type,M,N,true>::assign(
const SparseMatrix<MT,false>& rhs )
5716 for(
size_t i=0UL; i<
m_; ++i )
5717 for( ConstIterator_<MT> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5718 v_[i+element->index()*MM] = element->value();
5736 template<
typename Type
5739 template<
typename MT
5741 inline DisableIf_<typename HybridMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >
5742 HybridMatrix<Type,M,N,true>::addAssign(
const DenseMatrix<MT,SO>& rhs )
5746 for(
size_t j=0UL; j<
n_; ++j )
5748 if( IsDiagonal<MT>::value )
5750 v_[j+j*MM] += (~rhs)(j,j);
5754 const size_t ibegin( ( IsLower<MT>::value )
5755 ?( IsStrictlyLower<MT>::value ? j+1UL : j )
5757 const size_t iend ( ( IsUpper<MT>::value )
5758 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5762 for(
size_t i=ibegin; i<iend; ++i ) {
5763 v_[i+j*MM] += (~rhs)(i,j);
5784 template<
typename Type
5787 template<
typename MT
5789 inline EnableIf_<typename HybridMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >
5790 HybridMatrix<Type,M,N,true>::addAssign(
const DenseMatrix<MT,SO>& rhs )
5797 const bool remainder( !
usePadding || !IsPadded<MT>::value );
5799 for(
size_t j=0UL; j<
n_; ++j )
5801 const size_t ibegin( ( IsLower<MT>::value )
5802 ?( ( IsStrictlyLower<MT>::value ? j+1UL : j ) &
size_t(-SIMDSIZE) )
5804 const size_t iend ( ( IsUpper<MT>::value )
5805 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5809 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5810 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5814 for( ; i<ipos; i+=SIMDSIZE ) {
5815 store( i, j, load(i,j) + (~rhs).load(i,j) );
5817 for( ; remainder && i<iend; ++i ) {
5818 v_[i+j*MM] += (~rhs)(i,j);
5838 template<
typename Type
5841 template<
typename MT >
5842 inline void HybridMatrix<Type,M,N,true>::addAssign(
const SparseMatrix<MT,true>& rhs )
5846 for(
size_t j=0UL; j<
n_; ++j )
5847 for( ConstIterator_<MT> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5848 v_[element->index()+j*MM] += element->value();
5866 template<
typename Type
5869 template<
typename MT >
5870 inline void HybridMatrix<Type,M,N,true>::addAssign(
const SparseMatrix<MT,false>& rhs )
5876 for(
size_t i=0UL; i<
m_; ++i )
5877 for( ConstIterator_<MT> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5878 v_[i+element->index()*MM] += element->value();
5896 template<
typename Type
5899 template<
typename MT
5901 inline DisableIf_<typename HybridMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >
5902 HybridMatrix<Type,M,N,true>::subAssign(
const DenseMatrix<MT,SO>& rhs )
5906 for(
size_t j=0UL; j<
n_; ++j )
5908 if( IsDiagonal<MT>::value )
5910 v_[j+j*MM] -= (~rhs)(j,j);
5914 const size_t ibegin( ( IsLower<MT>::value )
5915 ?( IsStrictlyLower<MT>::value ? j+1UL : j )
5917 const size_t iend ( ( IsUpper<MT>::value )
5918 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5922 for(
size_t i=ibegin; i<iend; ++i ) {
5923 v_[i+j*MM] -= (~rhs)(i,j);
5944 template<
typename Type
5947 template<
typename MT
5949 inline EnableIf_<typename HybridMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >
5950 HybridMatrix<Type,M,N,true>::subAssign(
const DenseMatrix<MT,SO>& rhs )
5957 const bool remainder( !
usePadding || !IsPadded<MT>::value );
5959 for(
size_t j=0UL; j<
n_; ++j )
5961 const size_t ibegin( ( IsLower<MT>::value )
5962 ?( ( IsStrictlyLower<MT>::value ? j+1UL : j ) &
size_t(-SIMDSIZE) )
5964 const size_t iend ( ( IsUpper<MT>::value )
5965 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5969 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5970 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5974 for( ; i<ipos; i+=SIMDSIZE ) {
5975 store( i, j, load(i,j) - (~rhs).load(i,j) );
5977 for( ; remainder && i<iend; ++i ) {
5978 v_[i+j*MM] -= (~rhs)(i,j);
5998 template<
typename Type
6001 template<
typename MT >
6002 inline void HybridMatrix<Type,M,N,true>::subAssign(
const SparseMatrix<MT,true>& rhs )
6006 typedef ConstIterator_<MT> RhsConstIterator;
6008 for(
size_t j=0UL; j<
n_; ++j )
6009 for( RhsConstIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
6010 v_[element->index()+j*MM] -= element->value();
6028 template<
typename Type
6031 template<
typename MT >
6032 inline void HybridMatrix<Type,M,N,true>::subAssign(
const SparseMatrix<MT,false>& rhs )
6038 typedef ConstIterator_<MT> RhsConstIterator;
6040 for(
size_t i=0UL; i<
m_; ++i )
6041 for( RhsConstIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
6042 v_[i+element->index()*MM] -= element->value();
6068 template<
typename Type
6071 class HybridMatrix<Type,M,0UL,SO>;
6084 template<
typename Type
6087 class HybridMatrix<Type,0UL,N,SO>;
6100 template<
typename Type
6102 class HybridMatrix<Type,0UL,0UL,SO>;
6122 template<
typename Type,
size_t M,
size_t N,
bool SO >
6123 inline void reset( HybridMatrix<Type,M,N,SO>& m );
6125 template<
typename Type,
size_t M,
size_t N,
bool SO >
6126 inline void reset( HybridMatrix<Type,M,N,SO>& m,
size_t i );
6128 template<
typename Type,
size_t M,
size_t N,
bool SO >
6129 inline void clear( HybridMatrix<Type,M,N,SO>& m );
6131 template<
typename Type,
size_t M,
size_t N,
bool SO >
6132 inline bool isDefault(
const HybridMatrix<Type,M,N,SO>& m );
6134 template<
typename Type,
size_t M,
size_t N,
bool SO >
6135 inline bool isIntact(
const HybridMatrix<Type,M,N,SO>& m ) noexcept;
6137 template<
typename Type,
size_t M,
size_t N,
bool SO >
6138 inline void swap( HybridMatrix<Type,M,N,SO>& a, HybridMatrix<Type,M,N,SO>& b ) noexcept;
6150 template<
typename Type
6174 template<
typename Type
6192 template<
typename Type
6221 template<
typename Type
6227 return ( m.rows() == 0UL && m.columns() == 0UL );
6250 template<
typename Type
6256 return m.isIntact();
6269 template<
typename Type
6290 template<
typename T,
size_t M,
size_t N,
bool SO >
6291 struct HasConstDataAccess< HybridMatrix<T,M,N,SO> > :
public TrueType
6307 template<
typename T,
size_t M,
size_t N,
bool SO >
6308 struct HasMutableDataAccess< HybridMatrix<T,M,N,SO> > :
public TrueType
6324 template<
typename T,
size_t M,
size_t N,
bool SO >
6325 struct IsAligned< HybridMatrix<T,M,N,SO> > :
public BoolConstant<usePadding>
6341 template<
typename T,
size_t M,
size_t N,
bool SO >
6342 struct IsPadded< HybridMatrix<T,M,N,SO> > :
public BoolConstant<usePadding>
6358 template<
typename T,
size_t M,
size_t N,
bool SO >
6359 struct IsResizable< HybridMatrix<T,M,N,SO> > :
public TrueType
6375 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6376 struct AddTrait< HybridMatrix<T1,M1,N1,SO>, StaticMatrix<T2,M2,N2,SO> >
6378 using Type = StaticMatrix< AddTrait_<T1,T2>, M2, N2, SO >;
6381 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6382 struct AddTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
6384 using Type = StaticMatrix< AddTrait_<T1,T2>, M2, N2,
false >;
6387 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6388 struct AddTrait< StaticMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6390 using Type = StaticMatrix< AddTrait_<T1,T2>, M2, N2, SO >;
6393 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6394 struct AddTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6396 using Type = StaticMatrix< AddTrait_<T1,T2>, M2, N2,
false >;
6399 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6400 struct AddTrait< HybridMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6402 using Type = HybridMatrix< AddTrait_<T1,T2>, ( M1 < M2 )?( M1 ):( M2 ), ( N1 < N2 )?( N1 ):( N2 ), SO >;
6405 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6406 struct AddTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6408 using Type = HybridMatrix< AddTrait_<T1,T2>, ( M1 < M2 )?( M1 ):( M2 ), ( N1 < N2 )?( N1 ):( N2 ), false >;
6424 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6425 struct SubTrait< HybridMatrix<T1,M1,N1,SO>, StaticMatrix<T2,M2,N2,SO> >
6427 using Type = StaticMatrix< SubTrait_<T1,T2>, M2, N2, SO >;
6430 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6431 struct SubTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
6433 using Type = StaticMatrix< SubTrait_<T1,T2>, M2, N2,
false >;
6436 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6437 struct SubTrait< StaticMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6439 using Type = StaticMatrix< SubTrait_<T1,T2>, M2, N2, SO >;
6442 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6443 struct SubTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6445 using Type = StaticMatrix< SubTrait_<T1,T2>, M2, N2,
false >;
6448 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6449 struct SubTrait< HybridMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6451 using Type = HybridMatrix< SubTrait_<T1,T2>, ( M1 < M2 )?( M1 ):( M2 ), ( N1 < N2 )?( N1 ):( N2 ), SO >;
6454 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6455 struct SubTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6457 using Type = HybridMatrix< SubTrait_<T1,T2>, ( M1 < M2 )?( M1 ):( M2 ), ( N1 < N2 )?( N1 ):( N2 ), false >;
6473 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6474 struct MultTrait< HybridMatrix<T1,M,N,SO>, T2,
EnableIf_<IsNumeric<T2> > >
6476 using Type = HybridMatrix< MultTrait_<T1,T2>, M, N, SO >;
6479 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6480 struct MultTrait< T1, HybridMatrix<T2,M,N,SO>,
EnableIf_<IsNumeric<T1> > >
6482 using Type = HybridMatrix< MultTrait_<T1,T2>, M, N, SO >;
6485 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
size_t K >
6486 struct MultTrait< HybridMatrix<T1,M,N,SO>, StaticVector<T2,K,false> >
6488 using Type = HybridVector< MultTrait_<T1,T2>, M,
false >;
6491 template<
typename T1,
size_t K,
typename T2,
size_t M,
size_t N,
bool SO >
6492 struct MultTrait< StaticVector<T1,K,true>, HybridMatrix<T2,M,N,SO> >
6494 using Type = HybridVector< MultTrait_<T1,T2>, N,
true >;
6497 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
size_t K >
6498 struct MultTrait< HybridMatrix<T1,M,N,SO>, HybridVector<T2,K,false> >
6500 using Type = HybridVector< MultTrait_<T1,T2>, M,
false >;
6503 template<
typename T1,
size_t K,
typename T2,
size_t M,
size_t N,
bool SO >
6504 struct MultTrait< HybridVector<T1,K,true>, HybridMatrix<T2,M,N,SO> >
6506 using Type = HybridVector< MultTrait_<T1,T2>, N,
true >;
6509 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6510 struct MultTrait< HybridMatrix<T1,M,N,SO>, DynamicVector<T2,false> >
6512 using Type = HybridVector< MultTrait_<T1,T2>, M,
false >;
6515 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6516 struct MultTrait< DynamicVector<T1,true>, HybridMatrix<T2,M,N,SO> >
6518 using Type = HybridVector< MultTrait_<T1,T2>, N,
true >;
6521 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6522 struct MultTrait< HybridMatrix<T1,M,N,SO>, CustomVector<T2,AF,PF,false> >
6524 using Type = HybridVector< MultTrait_<T1,T2>, M,
false >;
6527 template<
typename T1,
bool AF,
bool PF,
typename T2,
size_t M,
size_t N,
bool SO >
6528 struct MultTrait< CustomVector<T1,AF,PF,true>, HybridMatrix<T2,M,N,SO> >
6530 using Type = HybridVector< MultTrait_<T1,T2>, N,
true >;
6533 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6534 struct MultTrait< HybridMatrix<T1,M,N,SO>, CompressedVector<T2,false> >
6536 using Type = HybridVector< MultTrait_<T1,T2>, M,
false >;
6539 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6540 struct MultTrait< CompressedVector<T1,true>, HybridMatrix<T2,M,N,SO> >
6542 using Type = HybridVector< MultTrait_<T1,T2>, N,
true >;
6545 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6546 struct MultTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
6548 using Type = HybridMatrix< MultTrait_<T1,T2>, M1, N2, SO1 >;
6551 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6552 struct MultTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6554 using Type = HybridMatrix< MultTrait_<T1,T2>, M1, N2, SO1 >;
6557 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6558 struct MultTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6560 using Type = HybridMatrix< MultTrait_<T1,T2>, M1, N2, SO1 >;
6576 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6577 struct DivTrait< HybridMatrix<T1,M,N,SO>, T2,
EnableIf_<IsNumeric<T2> > >
6579 using Type = HybridMatrix< DivTrait_<T1,T2>, M, N, SO >;
6595 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6596 struct MathTrait< HybridMatrix<T1,M,N,SO>, HybridMatrix<T2,M,N,SO> >
6598 using HighType = HybridMatrix< typename MathTrait<T1,T2>::HighType, M, N, SO >;
6599 using LowType = HybridMatrix< typename MathTrait<T1,T2>::LowType , M, N, SO >;
6615 template<
typename T1,
size_t M,
size_t N,
bool SO >
6616 struct SubmatrixTrait< HybridMatrix<T1,M,N,SO> >
6618 using Type = HybridMatrix<T1,M,N,SO>;
6634 template<
typename T1,
size_t M,
size_t N,
bool SO >
6635 struct RowTrait< HybridMatrix<T1,M,N,SO> >
6637 using Type = HybridVector<T1,N,true>;
6653 template<
typename T1,
size_t M,
size_t N,
bool SO >
6654 struct ColumnTrait< HybridMatrix<T1,M,N,SO> >
6656 using Type = HybridVector<T1,M,false>;
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:133
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:79
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:79
Header file for mathematical functions.
constexpr bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
Header file for the NextMultiple class template.
#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.
Type ElementType
Type of the matrix elements.
Definition: HybridMatrix.h:222
Header file for basic type definitions.
constexpr size_t spacing() const noexcept
Returns the spacing between the beginning of two rows.
Definition: HybridMatrix.h:1689
constexpr size_t capacity() const noexcept
Returns the maximum capacity of the matrix.
Definition: HybridMatrix.h:1705
Header file for the row trait.
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:79
Header file for the IsSparseMatrix type trait.
Header file for the IsDiagonal type trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1339
Header file for the IsSame and IsStrictlySame type traits.
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:188
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:315
Iterator begin(size_t i) noexcept
Returns an iterator to the first element of row/column i.
Definition: HybridMatrix.h:1127
Header file for the IsColumnMajorMatrix type trait.
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: HybridMatrix.h:979
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
size_t m_
The current number of rows of the sparse matrix.
Definition: CompressedMatrix.h:2805
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: HybridMatrix.h:230
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:590
Iterator end(size_t i) noexcept
Returns an iterator just past the last element of row/column i.
Definition: HybridMatrix.h:1199
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
const Type & ConstReference
Reference to a constant matrix value.
Definition: HybridMatrix.h:228
Header file for the SizeT class template.
SIMDTrait_< ElementType > SIMDType
SIMD type of the matrix elements.
Definition: HybridMatrix.h:223
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member constant is set to true, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to false, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:138
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Header file for memory allocation and deallocation functionality.
System settings for performance optimizations.
HybridMatrix< Type, N, M,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: HybridMatrix.h:221
Type & Reference
Reference to a non-constant matrix value.
Definition: HybridMatrix.h:227
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1321
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1716
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:109
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Constraint on the data type.
Header file for the std::initializer_list aliases.
Header file for the SparseMatrix base class.
const This & CompositeType
Data type for composite expression templates.
Definition: HybridMatrix.h:225
void resize(size_t m, size_t n, bool preserve=true)
Changing the size of the matrix.
Definition: HybridMatrix.h:1896
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: HybridMatrix.h:1654
ConstIterator cend(size_t i) const noexcept
Returns an iterator just past the last element of row/column i.
Definition: HybridMatrix.h:1247
typename TransExprTrait< T >::Type TransExprTrait_
Auxiliary alias declaration for the TransExprTrait class template.The TransExprTrait_ alias declarati...
Definition: TransExprTrait.h:143
Header file for the DisableIf class template.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
typename CTransExprTrait< T >::Type CTransExprTrait_
Auxiliary alias declaration for the CTransExprTrait class template.The CTransExprTrait_ alias declara...
Definition: CTransExprTrait.h:143
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for nested template disabiguation.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5148
HybridMatrix & operator=(const Type &set)
Homogenous assignment to all matrix elements.
Definition: HybridMatrix.h:1273
BLAZE_ALWAYS_INLINE void storeu(size_t i, size_t j, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the matrix.
Definition: HybridMatrix.h:2601
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t i, size_t j) const noexcept
Unaligned load of a SIMD element of the matrix.
Definition: HybridMatrix.h:2496
BLAZE_ALWAYS_INLINE void store(size_t i, size_t j, const SIMDType &value) noexcept
Store of a SIMD element of the matrix.
Definition: HybridMatrix.h:2532
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: HybridMatrix.h:1747
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the HasSIMDAdd type trait.
Header file for the DenseMatrix base class.
Header file for the DenseIterator class template.
bool isIntact() const noexcept
Returns whether the invariants of the hybrid matrix are intact.
Definition: HybridMatrix.h:2310
Header file for all SIMD functionality.
HybridMatrix()
The default constructor for HybridMatrix.
Definition: HybridMatrix.h:521
Type * Pointer
Pointer to a non-constant matrix value.
Definition: HybridMatrix.h:229
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_DIAGONAL_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a diagonal matrix type, a compilation error is created.
Definition: Diagonal.h:79
Reference operator()(size_t i, size_t j) noexcept
2D-access to the matrix elements.
Definition: HybridMatrix.h:930
const Type & ReturnType
Return type for expression template evaluations.
Definition: HybridMatrix.h:224
Header file for the IsLower type trait.
size_t m_
The current number of rows of the matrix.
Definition: HybridMatrix.h:485
Header file for the IsAligned type trait.
HybridMatrix< Type, M, N, SO > This
Type of this HybridMatrix instance.
Definition: HybridMatrix.h:217
Compile time check for diagonal matrices.This type trait tests whether or not the given template para...
Definition: IsDiagonal.h:90
BLAZE_ALWAYS_INLINE SIMDType load(size_t i, size_t j) const noexcept
Load of a SIMD element of the matrix.
Definition: HybridMatrix.h:2429
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:330
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:80
Header file for the default storage order for all vectors of the Blaze library.
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a vectorizable data type...
Definition: Vectorizable.h:61
void reset()
Reset to the default initial values.
Definition: HybridMatrix.h:1801
BLAZE_ALWAYS_INLINE SIMDType loada(size_t i, size_t j) const noexcept
Aligned load of a SIMD element of the matrix.
Definition: HybridMatrix.h:2459
Header file for the exception macros of the math module.
HybridMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: HybridMatrix.h:2023
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
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:538
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:254
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2645
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
Header file for the IsPadded type trait.
ConstIterator cbegin(size_t i) const noexcept
Returns an iterator to the first element of row/column i.
Definition: HybridMatrix.h:1175
Header file for the IsVectorizable type trait.
HybridMatrix< Type, M, N,!SO > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: HybridMatrix.h:220
BLAZE_ALWAYS_INLINE void stream(size_t i, size_t j, const SIMDType &value) noexcept
Aligned, non-temporal store of a SIMD element of the matrix.
Definition: HybridMatrix.h:2638
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:76
Header file for the HasConstDataAccess type trait.
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:75
void swap(HybridMatrix &m) noexcept
Swapping the contents of two hybrid matrices.
Definition: HybridMatrix.h:2096
AlignedArray< Type, M *NN > v_
The statically allocated matrix elements.
Definition: HybridMatrix.h:475
BLAZE_ALWAYS_INLINE void storea(size_t i, size_t j, const SIMDType &value) noexcept
Aligned store of a SIMD element of the matrix.
Definition: HybridMatrix.h:2563
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
Pointer data() noexcept
Low-level data access to the matrix elements.
Definition: HybridMatrix.h:1038
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1285
size_t determineColumns(initializer_list< initializer_list< Type > > list) noexcept
Determine the maximum number of columns specified by the given initializer list.
Definition: InitializerList.h:80
DenseMatrix< This, SO > BaseType
Base type of this HybridMatrix instance.
Definition: HybridMatrix.h:218
Header file for run time assertion macros.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: HybridMatrix.h:1670
HybridMatrix & transpose()
In-place transpose of the matrix.
Definition: HybridMatrix.h:1968
Header file for the addition trait.
Header file for the division trait.
Header file for the InvExprTrait class template.
Header file for the submatrix trait.
bool isAligned() const noexcept
Returns whether the matrix is properly aligned in memory.
Definition: HybridMatrix.h:2402
Constraint on the data type.
This ResultType
Result type for expression template evaluations.
Definition: HybridMatrix.h:219
Constraint on the data type.
DenseIterator< Type, usePadding > Iterator
Iterator over non-constant elements.
Definition: HybridMatrix.h:232
Header file for the AlignedArray implementation.
Efficient implementation of a dynamically sized matrix with static memory.The HybridMatrix class temp...
Definition: Forward.h:58
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2646
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: HybridMatrix.h:2382
Header file for the column trait.
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:258
Header file for the TransExprTrait class template.
Constraint on the data type.
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:89
Constraint on the data type.
Constraint on the data type.
Header file for the HasSIMDSub type trait.
BLAZE_ALWAYS_INLINE void conjugate(T &a) noexcept(IsNumeric< T >::value)
In-place conjugation of the given value/object.
Definition: Conjugate.h:120
Header file for the HasMutableDataAccess type trait.
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
EnableIf_< IsBuiltin< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:225
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:76
Header file for the mathematical trait.
BLAZE_ALWAYS_INLINE void cswap(T &a, T &b) noexcept(IsNumeric< T >::value)
Swapping two conjugated values/objects.
Definition: Conjugate.h:195
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
Rebind mechanism to obtain a HybridMatrix with different data/element type.
Definition: HybridMatrix.h:240
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
DenseIterator< const Type, usePadding > ConstIterator
Iterator over constant elements.
Definition: HybridMatrix.h:233
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:314
HybridMatrix< ET, M, N, SO > Other
The type of the other HybridMatrix.
Definition: HybridMatrix.h:241
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
size_t n_
The current number of columns of the sparse matrix.
Definition: CompressedMatrix.h:2806
Header file for the AreSIMDCombinable type trait.
constexpr bool usePadding
Configuration of the padding of dense vectors and matrices.This configuration switch enables/disables...
Definition: Optimizations.h:52
Header file for the IsRowMajorMatrix type trait.
Initializer list type of the Blaze library.
Header file for the alignment check function.
typename InvExprTrait< T >::Type InvExprTrait_
Auxiliary alias declaration for the InvExprTrait class template.The InvExprTrait_ alias declaration p...
Definition: InvExprTrait.h:134
size_t n_
The current number of columns of the matrix.
Definition: HybridMatrix.h:486
Header file for the IntegralConstant class template.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
void clear()
Clearing the hybrid matrix.
Definition: HybridMatrix.h:1849
Compile time check for sparse matrix types.This type trait tests whether or not the given template pa...
Definition: IsSparseMatrix.h:78
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2644
#define BLAZE_THROW_LOGIC_ERROR(MESSAGE)
Macro for the emission of a std::logic_error exception.This macro encapsulates the default way of Bla...
Definition: Exception.h:187
Rebind mechanism to obtain a CompressedMatrix with different data/element type.
Definition: CompressedMatrix.h:2654
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1303
Header file for the IsUpper type trait.
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the CTransExprTrait class template.
void extend(size_t m, size_t n, bool preserve=true)
Extending the size of the matrix.
Definition: HybridMatrix.h:1945
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: HybridMatrix.h:2360
Header file for the IsResizable type trait.
System settings for the inline keywords.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the TrueType type/value trait base class.
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:564
constexpr bool defaultStorageOrder
The default storage order for all matrices of the Blaze library.This value specifies the default stor...
Definition: StorageOrder.h:56