35 #ifndef _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_
36 #define _BLAZE_MATH_DENSE_HYBRIDMATRIX_H_
202 template<
typename Type
206 class HybridMatrix :
public DenseMatrix< HybridMatrix<Type,M,N,SO>, SO >
241 template<
typename ET >
259 enum { smpAssignable = 0 };
267 explicit inline HybridMatrix(
size_t m,
size_t n,
const Type& init );
268 template<
typename Other >
explicit inline HybridMatrix(
size_t m,
size_t n,
const Other* array );
270 template<
typename Other,
size_t M2,
size_t N2 >
271 explicit inline HybridMatrix(
const Other (&array)[M2][N2] );
274 template<
typename MT,
bool SO2 >
inline HybridMatrix(
const Matrix<MT,SO2>& m );
285 inline Reference
operator()(
size_t i,
size_t j );
286 inline ConstReference
operator()(
size_t i,
size_t j )
const;
287 inline Reference
at(
size_t i,
size_t j );
288 inline ConstReference
at(
size_t i,
size_t j )
const;
289 inline Pointer
data ();
290 inline ConstPointer
data ()
const;
291 inline Pointer
data (
size_t i );
292 inline ConstPointer
data (
size_t i )
const;
293 inline Iterator
begin (
size_t i );
294 inline ConstIterator
begin (
size_t i )
const;
295 inline ConstIterator
cbegin(
size_t i )
const;
296 inline Iterator
end (
size_t i );
297 inline ConstIterator
end (
size_t i )
const;
298 inline ConstIterator
cend (
size_t i )
const;
305 template<
typename Other,
size_t M2,
size_t N2 >
306 inline HybridMatrix& operator=(
const Other (&array)[M2][N2] );
310 template<
typename MT,
bool SO2 >
inline HybridMatrix& operator= (
const Matrix<MT,SO2>& rhs );
311 template<
typename MT,
bool SO2 >
inline HybridMatrix& operator+=(
const Matrix<MT,SO2>& rhs );
312 template<
typename MT,
bool SO2 >
inline HybridMatrix& operator-=(
const Matrix<MT,SO2>& rhs );
313 template<
typename MT,
bool SO2 >
inline HybridMatrix& operator*=(
const Matrix<MT,SO2>& rhs );
315 template<
typename Other >
316 inline typename EnableIf< IsNumeric<Other>,
HybridMatrix >::Type&
317 operator*=( Other rhs );
319 template<
typename Other >
320 inline typename EnableIf< IsNumeric<Other>,
HybridMatrix >::Type&
321 operator/=( Other rhs );
328 inline size_t rows()
const;
332 inline size_t capacity(
size_t i )
const;
334 inline size_t nonZeros(
size_t i )
const;
336 inline void reset(
size_t i );
338 void resize (
size_t m,
size_t n,
bool preserve=
true );
339 inline void extend (
size_t m,
size_t n,
bool preserve=
true );
342 template<
typename Other >
inline HybridMatrix& scale(
const Other& scalar );
350 static inline void*
operator new ( std::size_t
size );
351 static inline void*
operator new[]( std::size_t
size );
352 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
353 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
355 static inline void operator delete (
void* ptr );
356 static inline void operator delete[](
void* ptr );
357 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
358 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
365 template<
typename MT >
367 struct VectorizedAssign {
369 vectorizable && MT::vectorizable &&
370 IsSame<Type,typename MT::ElementType>::value &&
371 IsRowMajorMatrix<MT>::value };
378 template<
typename MT >
380 struct VectorizedAddAssign {
382 vectorizable && MT::vectorizable &&
383 IsSame<Type,typename MT::ElementType>::value &&
384 IntrinsicTrait<Type>::addition &&
385 IsRowMajorMatrix<MT>::value &&
386 !IsDiagonal<MT>::value };
393 template<
typename MT >
395 struct VectorizedSubAssign {
397 vectorizable && MT::vectorizable &&
398 IsSame<Type,typename MT::ElementType>::value &&
399 IntrinsicTrait<Type>::subtraction &&
400 IsRowMajorMatrix<MT>::value &&
401 !IsDiagonal<MT>::value };
410 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
411 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
424 template<
typename MT,
bool SO2 >
425 inline typename DisableIf< VectorizedAssign<MT> >::Type
426 assign(
const DenseMatrix<MT,SO2>& rhs );
428 template<
typename MT,
bool SO2 >
429 inline typename EnableIf< VectorizedAssign<MT> >::Type
430 assign(
const DenseMatrix<MT,SO2>& rhs );
432 template<
typename MT >
inline void assign(
const SparseMatrix<MT,SO>& rhs );
433 template<
typename MT >
inline void assign(
const SparseMatrix<MT,!SO>& rhs );
435 template<
typename MT,
bool SO2 >
436 inline typename DisableIf< VectorizedAddAssign<MT> >::Type
437 addAssign(
const DenseMatrix<MT,SO2>& rhs );
439 template<
typename MT,
bool SO2 >
440 inline typename EnableIf< VectorizedAddAssign<MT> >::Type
441 addAssign(
const DenseMatrix<MT,SO2>& rhs );
443 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,SO>& rhs );
444 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,!SO>& rhs );
446 template<
typename MT,
bool SO2 >
447 inline typename DisableIf< VectorizedSubAssign<MT> >::Type
448 subAssign(
const DenseMatrix<MT,SO2>& rhs );
450 template<
typename MT,
bool SO2 >
451 inline typename EnableIf< VectorizedSubAssign<MT> >::Type
452 subAssign(
const DenseMatrix<MT,SO2>& rhs );
454 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,SO>& rhs );
455 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,!SO>& rhs );
505 template<
typename Type
517 for(
size_t i=0UL; i<M*
NN; ++i )
537 template<
typename Type
557 for(
size_t i=0UL; i<M*
NN; ++i )
578 template<
typename Type
597 for(
size_t i=0UL; i<m; ++i ) {
598 for(
size_t j=0UL; j<n; ++j )
602 for(
size_t j=n; j<
NN; ++j )
608 for(
size_t i=m; i<M; ++i )
609 for(
size_t j=0UL; j<
NN; ++j )
643 template<
typename Type
647 template<
typename Other >
663 for(
size_t i=0UL; i<m; ++i ) {
664 for(
size_t j=0UL; j<n; ++j )
665 v_[i*NN+j] = array[i*n+j];
668 for(
size_t j=n; j<
NN; ++j )
674 for(
size_t i=m; i<M; ++i )
675 for(
size_t j=0UL; j<
NN; ++j )
703 template<
typename Type
707 template<
typename Other
719 for(
size_t i=0UL; i<M2; ++i ) {
720 for(
size_t j=0UL; j<N2; ++j )
721 v_[i*NN+j] = array[i][j];
724 for(
size_t j=N2; j<
NN; ++j )
730 for(
size_t i=M2; i<M; ++i )
731 for(
size_t j=0UL; j<
NN; ++j )
746 template<
typename Type
757 for(
size_t i=0UL; i<
m_; ++i ) {
758 for(
size_t j=0UL; j<
n_; ++j )
759 v_[i*NN+j] = m.v_[i*NN+j];
762 for(
size_t j=n_; j<
NN; ++j )
768 for(
size_t i=m_; i<M; ++i )
769 for(
size_t j=0UL; j<
NN; ++j )
782 template<
typename Type
786 template<
typename MT
801 for(
size_t i=0UL; i<
m_; ++i ) {
803 j<( IsNumeric<Type>::value ? NN :
n_ );
810 for(
size_t i=m_; i<M; ++i )
811 for(
size_t j=0UL; j<
NN; ++j )
838 template<
typename Type
862 template<
typename Type
887 template<
typename Type
916 template<
typename Type
946 template<
typename Type
970 template<
typename Type
990 template<
typename Type
1011 template<
typename Type
1035 template<
typename Type
1059 template<
typename Type
1083 template<
typename Type
1107 template<
typename Type
1131 template<
typename Type
1155 template<
typename Type
1197 template<
typename Type
1201 template<
typename Other
1211 for(
size_t i=0UL; i<M2; ++i )
1212 for(
size_t j=0UL; j<N2; ++j )
1213 v_[i*NN+j] = array[i][j];
1226 template<
typename Type
1235 for(
size_t i=0UL; i<
m_; ++i )
1236 for(
size_t j=0UL; j<
n_; ++j )
1252 template<
typename Type
1258 using blaze::assign;
1263 resize( rhs.rows(), rhs.columns() );
1264 assign( *
this, ~rhs );
1282 template<
typename Type
1286 template<
typename MT
1290 using blaze::assign;
1305 else if( (~rhs).canAlias(
this ) ) {
1307 resize( tmp.rows(), tmp.columns() );
1308 assign( *
this, tmp );
1314 assign( *
this, ~rhs );
1332 template<
typename Type
1336 template<
typename MT
1340 using blaze::addAssign;
1346 if( (~rhs).canAlias(
this ) ) {
1348 addAssign( *
this, tmp );
1351 addAssign( *
this, ~rhs );
1369 template<
typename Type
1373 template<
typename MT
1377 using blaze::subAssign;
1383 if( (~rhs).canAlias(
this ) ) {
1385 subAssign( *
this, tmp );
1388 subAssign( *
this, ~rhs );
1406 template<
typename Type
1410 template<
typename MT
1419 return this->operator=( tmp );
1431 template<
typename Type
1435 template<
typename Other >
1439 using blaze::assign;
1441 assign( *
this, (*
this) * rhs );
1456 template<
typename Type
1460 template<
typename Other >
1464 using blaze::assign;
1468 assign( *
this, (*
this) / rhs );
1487 template<
typename Type
1503 template<
typename Type
1522 template<
typename Type
1538 template<
typename Type
1560 template<
typename Type
1580 template<
typename Type
1586 size_t nonzeros( 0UL );
1588 for(
size_t i=0UL; i<
m_; ++i )
1589 for(
size_t j=0UL; j<
n_; ++j )
1609 template<
typename Type
1617 const size_t jend( i*NN +
n_ );
1618 size_t nonzeros( 0UL );
1620 for(
size_t j=i*NN; j<jend; ++j )
1634 template<
typename Type
1642 for(
size_t i=0UL; i<
m_; ++i )
1643 for(
size_t j=0UL; j<
n_; ++j )
1644 clear( v_[i*NN+j] );
1660 template<
typename Type
1669 for(
size_t j=0UL; j<
n_; ++j )
1670 clear( v_[i*NN+j] );
1682 template<
typename Type
1729 template<
typename Type
1746 for(
size_t i=0UL; i<m; ++i )
1747 for(
size_t j=n; j<
n_; ++j )
1748 v_[i*NN+j] = Type();
1752 for(
size_t i=m; i<
m_; ++i )
1753 for(
size_t j=0UL; j<
n_; ++j )
1754 v_[i*NN+j] = Type();
1778 template<
typename Type
1801 template<
typename Type
1809 if(
m_ > N ||
n_ > M ) {
1813 const size_t maxsize(
max(
m_,
n_ ) );
1814 for(
size_t i=1UL; i<maxsize; ++i )
1815 for(
size_t j=0UL; j<i; ++j )
1816 swap( v_[i*NN+j], v_[j*NN+i] );
1819 for(
size_t i=0UL; i<
m_; ++i ) {
1820 for(
size_t j=m_; j<
n_; ++j ) {
1821 v_[i*NN+j] = Type();
1827 for(
size_t i=
n_; i<
m_; ++i ) {
1828 for(
size_t j=0UL; j<
n_; ++j ) {
1829 v_[i*NN+j] = Type();
1852 template<
typename Type
1860 if(
m_ > N ||
n_ > M ) {
1864 const size_t maxsize(
max(
m_,
n_ ) );
1865 for(
size_t i=0UL; i<maxsize; ++i ) {
1866 for(
size_t j=0UL; j<i; ++j ) {
1867 cswap( v_[i*NN+j], v_[j*NN+i] );
1873 for(
size_t i=0UL; i<
m_; ++i ) {
1874 for(
size_t j=m_; j<
n_; ++j ) {
1875 v_[i*NN+j] = Type();
1881 for(
size_t i=
n_; i<
m_; ++i ) {
1882 for(
size_t j=0UL; j<
n_; ++j ) {
1883 v_[i*NN+j] = Type();
1901 template<
typename Type
1905 template<
typename Other >
1908 for(
size_t i=0UL; i<
m_; ++i )
1909 for(
size_t j=0UL; j<
n_; ++j )
1910 v_[i*NN+j] *= scalar;
1924 template<
typename Type
1932 const size_t maxrows(
max(
m_, m.m_ ) );
1933 const size_t maxcols(
max(
n_, m.n_ ) );
1935 for(
size_t i=0UL; i<maxrows; ++i ) {
1936 for(
size_t j=0UL; j<maxcols; ++j ) {
1937 swap( v_[i*NN+j], m(i,j) );
1965 template<
typename Type
1975 return allocate<HybridMatrix>( 1UL );
1990 template<
typename Type
2014 template<
typename Type
2024 return allocate<HybridMatrix>( 1UL );
2039 template<
typename Type
2048 return allocate<HybridMatrix>( size/
sizeof(
HybridMatrix) );
2059 template<
typename Type
2065 deallocate( static_cast<HybridMatrix*>( ptr ) );
2076 template<
typename Type
2082 deallocate( static_cast<HybridMatrix*>( ptr ) );
2093 template<
typename Type
2099 deallocate( static_cast<HybridMatrix*>( ptr ) );
2110 template<
typename Type
2116 deallocate( static_cast<HybridMatrix*>( ptr ) );
2139 template<
typename Type
2143 template<
typename Other >
2146 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2161 template<
typename Type
2165 template<
typename Other >
2168 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2182 template<
typename Type
2208 template<
typename Type
2216 return loada( i, j );
2218 return loadu( i, j );
2238 template<
typename Type
2255 return loada( &v_[i*NN+j] );
2275 template<
typename Type
2290 return loadu( &v_[i*NN+j] );
2311 template<
typename Type
2342 template<
typename Type
2359 storea( &v_[i*NN+j], value );
2380 template<
typename Type
2395 storeu( &v_[i*NN+j], value );
2416 template<
typename Type
2433 stream( &v_[i*NN+j], value );
2449 template<
typename Type
2453 template<
typename MT
2460 for(
size_t i=0UL; i<
m_; ++i ) {
2461 for(
size_t j=0UL; j<
n_; ++j ) {
2462 v_[i*NN+j] = (~rhs)(i,j);
2480 template<
typename Type
2484 template<
typename MT
2495 const size_t jpos( ( remainder )?(
n_ &
size_t(-
IT::size) ):(
n_ ) );
2498 for(
size_t i=0UL; i<
m_; ++i )
2503 store( i, j, (~rhs).load(i,j) );
2505 for( ; remainder && j<
n_; ++j ) {
2506 v_[i*NN+j] = (~rhs)(i,j);
2524 template<
typename Type
2528 template<
typename MT >
2535 for(
size_t i=0UL; i<
m_; ++i )
2536 for( RhsConstIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2537 v_[i*NN+element->index()] = element->value();
2553 template<
typename Type
2557 template<
typename MT >
2566 for(
size_t j=0UL; j<
n_; ++j )
2567 for( RhsConstIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2568 v_[element->index()*NN+j] = element->value();
2584 template<
typename Type
2588 template<
typename MT
2595 for(
size_t i=0UL; i<
m_; ++i )
2599 v_[i*NN+i] += (~rhs)(i,i);
2611 for(
size_t j=jbegin; j<jend; ++j ) {
2612 v_[i*NN+j] += (~rhs)(i,j);
2631 template<
typename Type
2635 template<
typename MT
2647 for(
size_t i=0UL; i<
m_; ++i )
2657 const size_t jpos( ( remainder )?( jend &
size_t(-
IT::size) ):( jend ) );
2663 store( i, j, load(i,j) + (~rhs).load(i,j) );
2665 for( ; remainder && j<jend; ++j ) {
2666 v_[i*NN+j] += (~rhs)(i,j);
2684 template<
typename Type
2688 template<
typename MT >
2695 for(
size_t i=0UL; i<
m_; ++i )
2696 for( RhsConstIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2697 v_[i*NN+element->index()] += element->value();
2713 template<
typename Type
2717 template<
typename MT >
2726 for(
size_t j=0UL; j<
n_; ++j )
2727 for( RhsConstIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2728 v_[element->index()*NN+j] += element->value();
2744 template<
typename Type
2748 template<
typename MT
2755 for(
size_t i=0UL; i<
m_; ++i )
2759 v_[i*NN+i] -= (~rhs)(i,i);
2771 for(
size_t j=jbegin; j<jend; ++j ) {
2772 v_[i*NN+j] -= (~rhs)(i,j);
2791 template<
typename Type
2795 template<
typename MT
2807 for(
size_t i=0UL; i<
m_; ++i )
2817 const size_t jpos( ( remainder )?( jend &
size_t(-
IT::size) ):( jend ) );
2823 store( i, j, load(i,j) - (~rhs).load(i,j) );
2825 for( ; remainder && j<jend; ++j ) {
2826 v_[i*NN+j] -= (~rhs)(i,j);
2844 template<
typename Type
2848 template<
typename MT >
2855 for(
size_t i=0UL; i<
m_; ++i )
2856 for( RhsConstIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2857 v_[i*NN+element->index()] -= element->value();
2873 template<
typename Type
2877 template<
typename MT >
2886 for(
size_t j=0UL; j<
n_; ++j )
2887 for( RhsConstIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2888 v_[element->index()*NN+j] -= element->value();
2913 template<
typename Type
2951 template<
typename ET >
2963 enum { vectorizable = IsVectorizable<Type>::value };
2969 enum { smpAssignable = 0 };
2977 explicit inline HybridMatrix(
size_t m,
size_t n,
const Type& init );
2978 template<
typename Other >
explicit inline HybridMatrix(
size_t m,
size_t n,
const Other* array );
2980 template<
typename Other,
size_t M2,
size_t N2 >
2981 explicit inline HybridMatrix(
const Other (&array)[M2][N2] );
2984 template<
typename MT,
bool SO >
inline HybridMatrix(
const Matrix<MT,SO>& m );
2995 inline Reference
operator()(
size_t i,
size_t j );
2996 inline ConstReference
operator()(
size_t i,
size_t j )
const;
2997 inline Reference
at(
size_t i,
size_t j );
2998 inline ConstReference
at(
size_t i,
size_t j )
const;
2999 inline Pointer
data ();
3000 inline ConstPointer
data ()
const;
3001 inline Pointer
data (
size_t j );
3002 inline ConstPointer
data (
size_t j )
const;
3003 inline Iterator
begin (
size_t j );
3004 inline ConstIterator
begin (
size_t j )
const;
3005 inline ConstIterator
cbegin(
size_t j )
const;
3006 inline Iterator
end (
size_t j );
3007 inline ConstIterator
end (
size_t j )
const;
3008 inline ConstIterator
cend (
size_t j )
const;
3015 template<
typename Other,
size_t M2,
size_t N2 >
3016 inline HybridMatrix& operator=(
const Other (&array)[M2][N2] );
3020 template<
typename MT,
bool SO >
inline HybridMatrix& operator= (
const Matrix<MT,SO>& rhs );
3021 template<
typename MT,
bool SO >
inline HybridMatrix& operator+=(
const Matrix<MT,SO>& rhs );
3022 template<
typename MT,
bool SO >
inline HybridMatrix& operator-=(
const Matrix<MT,SO>& rhs );
3023 template<
typename MT,
bool SO >
inline HybridMatrix& operator*=(
const Matrix<MT,SO>& rhs );
3025 template<
typename Other >
3026 inline typename EnableIf< IsNumeric<Other>,
HybridMatrix >::Type&
3027 operator*=( Other rhs );
3029 template<
typename Other >
3030 inline typename EnableIf< IsNumeric<Other>,
HybridMatrix >::Type&
3031 operator/=( Other rhs );
3038 inline size_t rows()
const;
3039 inline size_t columns()
const;
3040 inline size_t spacing()
const;
3042 inline size_t capacity(
size_t j )
const;
3044 inline size_t nonZeros(
size_t j )
const;
3045 inline void reset();
3046 inline void reset(
size_t i );
3047 inline void clear();
3048 void resize (
size_t m,
size_t n,
bool preserve=
true );
3049 inline void extend (
size_t m,
size_t n,
bool preserve=
true );
3052 template<
typename Other >
inline HybridMatrix& scale(
const Other& scalar );
3060 static inline void*
operator new ( std::size_t
size );
3061 static inline void*
operator new[]( std::size_t
size );
3062 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
3063 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
3065 static inline void operator delete (
void* ptr );
3066 static inline void operator delete[](
void* ptr );
3067 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
3068 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
3075 template<
typename MT >
3076 struct VectorizedAssign {
3078 vectorizable && MT::vectorizable &&
3079 IsSame<Type,typename MT::ElementType>::value &&
3080 IsColumnMajorMatrix<MT>::value };
3086 template<
typename MT >
3087 struct VectorizedAddAssign {
3089 vectorizable && MT::vectorizable &&
3090 IsSame<Type,typename MT::ElementType>::value &&
3091 IntrinsicTrait<Type>::addition &&
3092 IsColumnMajorMatrix<MT>::value &&
3093 !IsDiagonal<MT>::value };
3099 template<
typename MT >
3100 struct VectorizedSubAssign {
3102 vectorizable && MT::vectorizable &&
3103 IsSame<Type,typename MT::ElementType>::value &&
3104 IntrinsicTrait<Type>::subtraction &&
3105 IsColumnMajorMatrix<MT>::value &&
3106 !IsDiagonal<MT>::value };
3114 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
3115 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
3128 template<
typename MT,
bool SO >
3129 inline typename DisableIf< VectorizedAssign<MT> >::Type
3130 assign(
const DenseMatrix<MT,SO>& rhs );
3132 template<
typename MT,
bool SO >
3133 inline typename EnableIf< VectorizedAssign<MT> >::Type
3134 assign(
const DenseMatrix<MT,SO>& rhs );
3136 template<
typename MT >
inline void assign(
const SparseMatrix<MT,true>& rhs );
3137 template<
typename MT >
inline void assign(
const SparseMatrix<MT,false>& rhs );
3139 template<
typename MT,
bool SO >
3140 inline typename DisableIf< VectorizedAddAssign<MT> >::Type
3141 addAssign(
const DenseMatrix<MT,SO>& rhs );
3143 template<
typename MT,
bool SO >
3144 inline typename EnableIf< VectorizedAddAssign<MT> >::Type
3145 addAssign(
const DenseMatrix<MT,SO>& rhs );
3147 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,true>& rhs );
3148 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,false>& rhs );
3150 template<
typename MT,
bool SO >
3151 inline typename DisableIf< VectorizedSubAssign<MT> >::Type
3152 subAssign(
const DenseMatrix<MT,SO>& rhs );
3154 template<
typename MT,
bool SO >
3155 inline typename EnableIf< VectorizedSubAssign<MT> >::Type
3156 subAssign(
const DenseMatrix<MT,SO>& rhs );
3158 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,true>& rhs );
3159 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,false>& rhs );
3167 AlignedArray<Type,MM*N>
v_;
3202 template<
typename Type
3212 if( IsNumeric<Type>::value ) {
3213 for(
size_t i=0UL; i<MM*N; ++i )
3235 template<
typename Type
3253 if( IsNumeric<Type>::value ) {
3254 for(
size_t i=0UL; i<MM*N; ++i )
3277 template<
typename Type
3295 for(
size_t j=0UL; j<n; ++j ) {
3296 for(
size_t i=0UL; i<m; ++i )
3299 if( IsNumeric<Type>::value ) {
3300 for(
size_t i=m; i<MM; ++i )
3301 v_[i+j*MM] = Type();
3305 if( IsNumeric<Type>::value ) {
3306 for(
size_t j=n; j<N; ++j )
3307 for(
size_t i=0UL; i<MM; ++i )
3308 v_[i+j*MM] = Type();
3343 template<
typename Type
3346 template<
typename Other >
3362 for(
size_t j=0UL; j<n; ++j ) {
3363 for(
size_t i=0UL; i<m; ++i )
3364 v_[i+j*MM] = array[i+j*m];
3366 if( IsNumeric<Type>::value ) {
3367 for(
size_t i=m; i<MM; ++i )
3368 v_[i+j*MM] = Type();
3372 if( IsNumeric<Type>::value ) {
3373 for(
size_t j=n; j<N; ++j )
3374 for(
size_t i=0UL; i<MM; ++i )
3375 v_[i+j*MM] = Type();
3404 template<
typename Type
3407 template<
typename Other
3419 for(
size_t j=0UL; j<N2; ++j ) {
3420 for(
size_t i=0UL; i<M2; ++i )
3421 v_[i+j*MM] = array[i][j];
3423 if( IsNumeric<Type>::value ) {
3424 for(
size_t i=M2; i<MM; ++i )
3425 v_[i+j*MM] = Type();
3429 if( IsNumeric<Type>::value ) {
3430 for(
size_t j=N2; j<N; ++j )
3431 for(
size_t i=0UL; i<MM; ++i )
3432 v_[i+j*MM] = Type();
3448 template<
typename Type
3458 for(
size_t j=0UL; j<
n_; ++j ) {
3459 for(
size_t i=0UL; i<
m_; ++i )
3460 v_[i+j*MM] = m.v_[i+j*MM];
3462 if( IsNumeric<Type>::value ) {
3463 for(
size_t i=m_; i<MM; ++i )
3464 v_[i+j*MM] = Type();
3468 if( IsNumeric<Type>::value ) {
3469 for(
size_t j=n_; j<N; ++j )
3470 for(
size_t i=0UL; i<MM; ++i )
3471 v_[i+j*MM] = Type();
3485 template<
typename Type
3488 template<
typename MT
3495 using blaze::assign;
3503 for(
size_t j=0UL; j<
n_; ++j ) {
3504 for(
size_t i=( IsSparseMatrix<MT>::value ? 0UL : m_ );
3505 i<( IsNumeric<Type>::value ? MM :
m_ );
3507 v_[i+j*MM] = Type();
3511 if( IsNumeric<Type>::value ) {
3512 for(
size_t j=n_; j<N; ++j )
3513 for(
size_t i=0UL; i<MM; ++i )
3514 v_[i+j*MM] = Type();
3517 assign( *
this, ~m );
3542 template<
typename Type
3567 template<
typename Type
3593 template<
typename Type
3605 return (*
this)(i,j);
3623 template<
typename Type
3635 return (*
this)(i,j);
3653 template<
typename Type
3656 inline typename HybridMatrix<Type,M,N,true>::Pointer
3677 template<
typename Type
3680 inline typename HybridMatrix<Type,M,N,true>::ConstPointer
3698 template<
typename Type
3701 inline typename HybridMatrix<Type,M,N,true>::Pointer
3720 template<
typename Type
3723 inline typename HybridMatrix<Type,M,N,true>::ConstPointer
3740 template<
typename Type
3760 template<
typename Type
3780 template<
typename Type
3800 template<
typename Type
3820 template<
typename Type
3840 template<
typename Type
3883 template<
typename Type
3886 template<
typename Other
3889 inline HybridMatrix<Type,M,N,true>&
3890 HybridMatrix<Type,M,N,true>::operator=(
const Other (&array)[M2][N2] )
3897 for(
size_t j=0UL; j<N2; ++j )
3898 for(
size_t i=0UL; i<M2; ++i )
3899 v_[i+j*MM] = array[i][j];
3914 template<
typename Type
3917 inline HybridMatrix<Type,M,N,true>&
3918 HybridMatrix<Type,M,N,true>::operator=(
const Type&
set )
3923 for(
size_t j=0UL; j<
n_; ++j )
3924 for(
size_t i=0UL; i<
m_; ++i )
3942 template<
typename Type
3945 inline HybridMatrix<Type,M,N,true>&
3946 HybridMatrix<Type,M,N,true>::operator=(
const HybridMatrix& rhs )
3948 using blaze::assign;
3953 resize( rhs.rows(), rhs.columns() );
3954 assign( *
this, ~rhs );
3974 template<
typename Type
3977 template<
typename MT
3979 inline HybridMatrix<Type,M,N,true>& HybridMatrix<Type,M,N,true>::operator=(
const Matrix<MT,SO>& rhs )
3981 using blaze::assign;
3983 typedef typename TransExprTrait<This>::Type TT;
3984 typedef typename CTransExprTrait<This>::Type CT;
3990 if( IsSame<MT,TT>::value && (~rhs).isAliased(
this ) ) {
3993 else if( IsSame<MT,CT>::value && (~rhs).isAliased(
this ) ) {
3996 else if( (~rhs).canAlias(
this ) ) {
3997 HybridMatrix tmp( ~rhs );
3998 resize( tmp.rows(), tmp.columns() );
3999 assign( *
this, tmp );
4003 if( IsSparseMatrix<MT>::value )
4005 assign( *
this, ~rhs );
4025 template<
typename Type
4028 template<
typename MT
4030 inline HybridMatrix<Type,M,N,true>& HybridMatrix<Type,M,N,true>::operator+=(
const Matrix<MT,SO>& rhs )
4032 using blaze::addAssign;
4034 if( (~rhs).
rows() != m_ || (~rhs).
columns() != n_ ) {
4038 if( (~rhs).canAlias(
this ) ) {
4040 addAssign( *
this, tmp );
4043 addAssign( *
this, ~rhs );
4063 template<
typename Type
4066 template<
typename MT
4068 inline HybridMatrix<Type,M,N,true>& HybridMatrix<Type,M,N,true>::operator-=(
const Matrix<MT,SO>& rhs )
4070 using blaze::subAssign;
4072 if( (~rhs).
rows() != m_ || (~rhs).
columns() != n_ ) {
4076 if( (~rhs).canAlias(
this ) ) {
4078 subAssign( *
this, tmp );
4081 subAssign( *
this, ~rhs );
4101 template<
typename Type
4104 template<
typename MT
4106 inline HybridMatrix<Type,M,N,true>& HybridMatrix<Type,M,N,true>::operator*=(
const Matrix<MT,SO>& rhs )
4108 if( n_ != (~rhs).
rows() || (~rhs).
columns() > N ) {
4112 const HybridMatrix tmp( *
this * (~rhs) );
4113 return this->operator=( tmp );
4127 template<
typename Type
4130 template<
typename Other >
4131 inline typename EnableIf< IsNumeric<Other>, HybridMatrix<Type,M,N,true> >::Type&
4132 HybridMatrix<Type,M,N,true>::operator*=( Other rhs )
4134 using blaze::assign;
4136 assign( *
this, (*
this) * rhs );
4153 template<
typename Type
4156 template<
typename Other >
4157 inline typename EnableIf< IsNumeric<Other>, HybridMatrix<Type,M,N,true> >::Type&
4158 HybridMatrix<Type,M,N,true>::operator/=( Other rhs )
4160 using blaze::assign;
4164 assign( *
this, (*
this) / rhs );
4185 template<
typename Type
4202 template<
typename Type
4222 template<
typename Type
4239 template<
typename Type
4257 template<
typename Type
4278 template<
typename Type
4283 size_t nonzeros( 0UL );
4285 for(
size_t j=0UL; j<
n_; ++j )
4286 for(
size_t i=0UL; i<
m_; ++i )
4303 template<
typename Type
4310 const size_t iend( j*MM + m_ );
4311 size_t nonzeros( 0UL );
4313 for(
size_t i=j*MM; i<iend; ++i )
4329 template<
typename Type
4336 for(
size_t j=0UL; j<
n_; ++j )
4337 for(
size_t i=0UL; i<
m_; ++i )
4338 clear( v_[i+j*MM] );
4354 template<
typename Type
4362 for(
size_t i=0UL; i<
m_; ++i )
4363 clear( v_[i+j*MM] );
4377 template<
typename Type
4425 template<
typename Type
4440 if( IsVectorizable<Type>::value && m < m_ ) {
4441 for(
size_t j=0UL; j<n; ++j )
4442 for(
size_t i=m; i<
m_; ++i )
4443 v_[i+j*MM] = Type();
4446 if( IsVectorizable<Type>::value && n < n_ ) {
4447 for(
size_t j=n; j<
n_; ++j )
4448 for(
size_t i=0UL; i<
m_; ++i )
4449 v_[i+j*MM] = Type();
4475 template<
typename Type
4499 template<
typename Type
4506 if( m_ > N || n_ > M ) {
4510 const size_t maxsize(
max( m_, n_ ) );
4511 for(
size_t j=1UL; j<maxsize; ++j )
4512 for(
size_t i=0UL; i<j; ++i )
4513 swap( v_[i+j*MM], v_[j+i*MM] );
4515 if( IsVectorizable<Type>::value && n_ < m_ ) {
4516 for(
size_t j=0UL; j<
n_; ++j ) {
4517 for(
size_t i=n_; i<
m_; ++i ) {
4518 v_[i+j*MM] = Type();
4523 if( IsVectorizable<Type>::value && n_ > m_ ) {
4524 for(
size_t j=m_; j<
n_; ++j )
4525 for(
size_t i=0UL; i<
m_; ++i )
4526 v_[i+j*MM] = Type();
4549 template<
typename Type
4556 if( m_ > N || n_ > M ) {
4560 const size_t maxsize(
max( m_, n_ ) );
4561 for(
size_t j=0UL; j<maxsize; ++j ) {
4562 for(
size_t i=0UL; i<j; ++i ) {
4563 cswap( v_[i+j*MM], v_[j+i*MM] );
4568 if( IsVectorizable<Type>::value && n_ < m_ ) {
4569 for(
size_t j=0UL; j<
n_; ++j ) {
4570 for(
size_t i=n_; i<
m_; ++i ) {
4571 v_[i+j*MM] = Type();
4576 if( IsVectorizable<Type>::value && n_ > m_ ) {
4577 for(
size_t j=m_; j<
n_; ++j )
4578 for(
size_t i=0UL; i<
m_; ++i )
4579 v_[i+j*MM] = Type();
4597 template<
typename Type
4600 template<
typename Other >
4601 inline HybridMatrix<Type,M,N,true>&
4602 HybridMatrix<Type,M,N,true>::scale(
const Other& scalar )
4604 for(
size_t j=0UL; j<
n_; ++j )
4605 for(
size_t i=0UL; i<
m_; ++i )
4606 v_[i+j*MM] *= scalar;
4622 template<
typename Type
4629 const size_t maxrows(
max( m_, m.m_ ) );
4630 const size_t maxcols(
max( n_, m.n_ ) );
4632 for(
size_t j=0UL; j<maxcols; ++j ) {
4633 for(
size_t i=0UL; i<maxrows; ++i ) {
4634 swap( v_[i+j*MM], m(i,j) );
4664 template<
typename Type
4667 inline void* HybridMatrix<Type,M,N,true>::operator
new( std::size_t
size )
4673 return allocate<HybridMatrix>( 1UL );
4690 template<
typename Type
4693 inline void* HybridMatrix<Type,M,N,true>::operator
new[]( std::size_t
size )
4698 return allocate<HybridMatrix>( size/
sizeof(HybridMatrix) );
4715 template<
typename Type
4718 inline void* HybridMatrix<Type,M,N,true>::operator
new( std::size_t
size,
const std::nothrow_t& )
4724 return allocate<HybridMatrix>( 1UL );
4741 template<
typename Type
4744 inline void* HybridMatrix<Type,M,N,true>::operator
new[]( std::size_t
size,
const std::nothrow_t& )
4749 return allocate<HybridMatrix>( size/
sizeof(HybridMatrix) );
4762 template<
typename Type
4765 inline void HybridMatrix<Type,M,N,true>::operator
delete(
void* ptr )
4767 deallocate( static_cast<HybridMatrix*>( ptr ) );
4780 template<
typename Type
4783 inline void HybridMatrix<Type,M,N,true>::operator
delete[](
void* ptr )
4785 deallocate( static_cast<HybridMatrix*>( ptr ) );
4798 template<
typename Type
4801 inline void HybridMatrix<Type,M,N,true>::operator
delete(
void* ptr,
const std::nothrow_t& )
4803 deallocate( static_cast<HybridMatrix*>( ptr ) );
4816 template<
typename Type
4819 inline void HybridMatrix<Type,M,N,true>::operator
delete[](
void* ptr,
const std::nothrow_t& )
4821 deallocate( static_cast<HybridMatrix*>( ptr ) );
4846 template<
typename Type
4849 template<
typename Other >
4852 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
4869 template<
typename Type
4872 template<
typename Other >
4875 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
4891 template<
typename Type
4917 template<
typename Type
4924 return loada( i, j );
4926 return loadu( i, j );
4947 template<
typename Type
4963 return loada( &v_[i+j*MM] );
4984 template<
typename Type
4998 return loadu( &v_[i+j*MM] );
5020 template<
typename Type
5051 template<
typename Type
5067 storea( &v_[i+j*MM], value );
5089 template<
typename Type
5103 storeu( &v_[i+j*MM], value );
5125 template<
typename Type
5141 stream( &v_[i+j*MM], value );
5159 template<
typename Type
5162 template<
typename MT
5164 inline typename DisableIf< typename HybridMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAssign<MT> >::Type
5165 HybridMatrix<Type,M,N,true>::assign(
const DenseMatrix<MT,SO>& rhs )
5169 for(
size_t j=0UL; j<
n_; ++j ) {
5170 for(
size_t i=0UL; i<
m_; ++i ) {
5171 v_[i+j*MM] = (~rhs)(i,j);
5191 template<
typename Type
5194 template<
typename MT
5196 inline typename EnableIf< typename HybridMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAssign<MT> >::Type
5197 HybridMatrix<Type,M,N,true>::assign(
const DenseMatrix<MT,SO>& rhs )
5203 const bool remainder( !
usePadding || !IsPadded<MT>::value );
5205 const size_t ipos( ( remainder )?( m_ &
size_t(-
IT::size) ):( m_ ) );
5208 for(
size_t j=0UL; j<
n_; ++j )
5213 store( i, j, (~rhs).load(i,j) );
5215 for( ; remainder && i<
m_; ++i ) {
5216 v_[i+j*MM] = (~rhs)(i,j);
5236 template<
typename Type
5239 template<
typename MT >
5240 inline void HybridMatrix<Type,M,N,true>::assign(
const SparseMatrix<MT,true>& rhs )
5246 for(
size_t j=0UL; j<
n_; ++j )
5247 for( RhsConstIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5248 v_[element->index()+j*MM] = element->value();
5266 template<
typename Type
5269 template<
typename MT >
5270 inline void HybridMatrix<Type,M,N,true>::assign(
const SparseMatrix<MT,false>& rhs )
5278 for(
size_t i=0UL; i<
m_; ++i )
5279 for( RhsConstIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5280 v_[i+element->index()*MM] = element->value();
5298 template<
typename Type
5301 template<
typename MT
5303 inline typename DisableIf< typename HybridMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >::Type
5304 HybridMatrix<Type,M,N,true>::addAssign(
const DenseMatrix<MT,SO>& rhs )
5308 for(
size_t j=0UL; j<
n_; ++j )
5310 if( IsDiagonal<MT>::value )
5312 v_[j+j*MM] += (~rhs)(j,j);
5316 const size_t ibegin( ( IsLower<MT>::value )
5317 ?( IsStrictlyLower<MT>::value ? j+1UL : j )
5319 const size_t iend ( ( IsUpper<MT>::value )
5320 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5324 for(
size_t i=ibegin; i<iend; ++i ) {
5325 v_[i+j*MM] += (~rhs)(i,j);
5346 template<
typename Type
5349 template<
typename MT
5351 inline typename EnableIf< typename HybridMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >::Type
5352 HybridMatrix<Type,M,N,true>::addAssign(
const DenseMatrix<MT,SO>& rhs )
5359 const bool remainder( !
usePadding || !IsPadded<MT>::value );
5361 for(
size_t j=0UL; j<
n_; ++j )
5363 const size_t ibegin( ( IsLower<MT>::value )
5364 ?( ( IsStrictlyLower<MT>::value ? j+1UL : j ) &
size_t(-
IT::size) )
5366 const size_t iend ( ( IsUpper<MT>::value )
5367 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5371 const size_t ipos( ( remainder )?( iend &
size_t(-
IT::size) ):( iend ) );
5377 store( i, j, load(i,j) + (~rhs).load(i,j) );
5379 for( ; remainder && i<iend; ++i ) {
5380 v_[i+j*MM] += (~rhs)(i,j);
5400 template<
typename Type
5403 template<
typename MT >
5404 inline void HybridMatrix<Type,M,N,true>::addAssign(
const SparseMatrix<MT,true>& rhs )
5410 for(
size_t j=0UL; j<
n_; ++j )
5411 for( RhsConstIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5412 v_[element->index()+j*MM] += element->value();
5430 template<
typename Type
5433 template<
typename MT >
5434 inline void HybridMatrix<Type,M,N,true>::addAssign(
const SparseMatrix<MT,false>& rhs )
5442 for(
size_t i=0UL; i<
m_; ++i )
5443 for( RhsConstIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5444 v_[i+element->index()*MM] += element->value();
5462 template<
typename Type
5465 template<
typename MT
5467 inline typename DisableIf< typename HybridMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >::Type
5468 HybridMatrix<Type,M,N,true>::subAssign(
const DenseMatrix<MT,SO>& rhs )
5472 for(
size_t j=0UL; j<
n_; ++j )
5474 if( IsDiagonal<MT>::value )
5476 v_[j+j*MM] -= (~rhs)(j,j);
5480 const size_t ibegin( ( IsLower<MT>::value )
5481 ?( IsStrictlyLower<MT>::value ? j+1UL : j )
5483 const size_t iend ( ( IsUpper<MT>::value )
5484 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5488 for(
size_t i=ibegin; i<iend; ++i ) {
5489 v_[i+j*MM] -= (~rhs)(i,j);
5510 template<
typename Type
5513 template<
typename MT
5515 inline typename EnableIf< typename HybridMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >::Type
5516 HybridMatrix<Type,M,N,true>::subAssign(
const DenseMatrix<MT,SO>& rhs )
5523 const bool remainder( !
usePadding || !IsPadded<MT>::value );
5525 for(
size_t j=0UL; j<
n_; ++j )
5527 const size_t ibegin( ( IsLower<MT>::value )
5528 ?( ( IsStrictlyLower<MT>::value ? j+1UL : j ) &
size_t(-
IT::size) )
5530 const size_t iend ( ( IsUpper<MT>::value )
5531 ?( IsStrictlyUpper<MT>::value ? j : j+1UL )
5535 const size_t ipos( ( remainder )?( iend &
size_t(-
IT::size) ):( iend ) );
5541 store( i, j, load(i,j) - (~rhs).load(i,j) );
5543 for( ; remainder && i<iend; ++i ) {
5544 v_[i+j*MM] -= (~rhs)(i,j);
5564 template<
typename Type
5567 template<
typename MT >
5568 inline void HybridMatrix<Type,M,N,true>::subAssign(
const SparseMatrix<MT,true>& rhs )
5574 for(
size_t j=0UL; j<
n_; ++j )
5575 for( RhsConstIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5576 v_[element->index()+j*MM] -= element->value();
5594 template<
typename Type
5597 template<
typename MT >
5598 inline void HybridMatrix<Type,M,N,true>::subAssign(
const SparseMatrix<MT,false>& rhs )
5606 for(
size_t i=0UL; i<
m_; ++i )
5607 for( RhsConstIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5608 v_[i+element->index()*MM] -= element->value();
5634 template<
typename Type
5637 class HybridMatrix<Type,M,0UL,SO>;
5650 template<
typename Type
5653 class HybridMatrix<Type,0UL,N,SO>;
5666 template<
typename Type
5668 class HybridMatrix<Type,0UL,0UL,SO>;
5688 template<
typename Type,
size_t M,
size_t N,
bool SO >
5689 inline void reset( HybridMatrix<Type,M,N,SO>& m );
5691 template<
typename Type,
size_t M,
size_t N,
bool SO >
5692 inline void reset( HybridMatrix<Type,M,N,SO>& m,
size_t i );
5694 template<
typename Type,
size_t M,
size_t N,
bool SO >
5695 inline void clear( HybridMatrix<Type,M,N,SO>& m );
5697 template<
typename Type,
size_t M,
size_t N,
bool SO >
5698 inline bool isDefault(
const HybridMatrix<Type,M,N,SO>& m );
5700 template<
typename Type,
size_t M,
size_t N,
bool SO >
5701 inline bool isIntact(
const HybridMatrix<Type,M,N,SO>& m );
5703 template<
typename Type,
size_t M,
size_t N,
bool SO >
5704 inline void swap( HybridMatrix<Type,M,N,SO>& a, HybridMatrix<Type,M,N,SO>& b ) ;
5706 template<
typename Type,
size_t M,
size_t N,
bool SO >
5707 inline void move( HybridMatrix<Type,M,N,SO>& dst, HybridMatrix<Type,M,N,SO>& src ) ;
5719 template<
typename Type
5743 template<
typename Type
5761 template<
typename Type
5790 template<
typename Type
5796 return ( m.rows() == 0UL && m.columns() == 0UL );
5819 template<
typename Type
5825 return ( m.rows() <= M && m.columns() <= N );
5839 template<
typename Type
5859 template<
typename Type
5880 template<
typename T,
size_t M,
size_t N,
bool SO >
5881 struct HasConstDataAccess< HybridMatrix<T,M,N,SO> > :
public IsTrue<true>
5897 template<
typename T,
size_t M,
size_t N,
bool SO >
5898 struct HasMutableDataAccess< HybridMatrix<T,M,N,SO> > :
public IsTrue<true>
5914 template<
typename T,
size_t M,
size_t N,
bool SO >
5915 struct IsAligned< HybridMatrix<T,M,N,SO> > :
public IsTrue<usePadding>
5931 template<
typename T,
size_t M,
size_t N,
bool SO >
5932 struct IsPadded< HybridMatrix<T,M,N,SO> > :
public IsTrue<usePadding>
5948 template<
typename T,
size_t M,
size_t N,
bool SO >
5949 struct IsResizable< HybridMatrix<T,M,N,SO> > :
public IsTrue<true>
5965 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
5966 struct AddTrait< HybridMatrix<T1,M1,N1,SO>, StaticMatrix<T2,M2,N2,SO> >
5968 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M2, N2, SO > Type;
5971 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
5972 struct AddTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
5974 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M2, N2,
false > Type;
5977 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
5978 struct AddTrait< StaticMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
5980 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M2, N2, SO > Type;
5983 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
5984 struct AddTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
5986 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M2, N2,
false > Type;
5989 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
5990 struct AddTrait< HybridMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
5992 typedef HybridMatrix< typename AddTrait<T1,T2>::Type, ( M1 < M2 )?( M1 ):( M2 ), ( N1 < N2 )?( N1 ):( N2 ), SO > Type;
5995 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
5996 struct AddTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
5998 typedef HybridMatrix< typename AddTrait<T1,T2>::Type, ( M1 < M2 )?( M1 ):( M2 ), ( N1 < N2 )?( N1 ):( N2 ), false > Type;
6014 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6015 struct SubTrait< HybridMatrix<T1,M1,N1,SO>, StaticMatrix<T2,M2,N2,SO> >
6017 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M2, N2, SO > Type;
6020 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6021 struct SubTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
6023 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M2, N2,
false > Type;
6026 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6027 struct SubTrait< StaticMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6029 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M2, N2, SO > Type;
6032 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6033 struct SubTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6035 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M2, N2,
false > Type;
6038 template<
typename T1,
size_t M1,
size_t N1,
bool SO,
typename T2,
size_t M2,
size_t N2 >
6039 struct SubTrait< HybridMatrix<T1,M1,N1,SO>, HybridMatrix<T2,M2,N2,SO> >
6041 typedef HybridMatrix< typename SubTrait<T1,T2>::Type, ( M1 < M2 )?( M1 ):( M2 ), ( N1 < N2 )?( N1 ):( N2 ), SO > Type;
6044 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6045 struct SubTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6047 typedef HybridMatrix< typename SubTrait<T1,T2>::Type, ( M1 < M2 )?( M1 ):( M2 ), ( N1 < N2 )?( N1 ):( N2 ), false > Type;
6063 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6064 struct MultTrait< HybridMatrix<T1,M,N,SO>, T2, typename EnableIf< IsNumeric<T2> >::Type >
6066 typedef HybridMatrix< typename MultTrait<T1,T2>::Type, M, N, SO > Type;
6069 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6070 struct MultTrait< T1, HybridMatrix<T2,M,N,SO>, typename EnableIf< IsNumeric<T1> >::Type >
6072 typedef HybridMatrix< typename MultTrait<T1,T2>::Type, M, N, SO > Type;
6075 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
size_t K >
6076 struct MultTrait< HybridMatrix<T1,M,N,SO>, StaticVector<T2,K,false> >
6078 typedef HybridVector< typename MultTrait<T1,T2>::Type, M,
false > Type;
6081 template<
typename T1,
size_t K,
typename T2,
size_t M,
size_t N,
bool SO >
6082 struct MultTrait< StaticVector<T1,K,true>, HybridMatrix<T2,M,N,SO> >
6084 typedef HybridVector< typename MultTrait<T1,T2>::Type, N,
true > Type;
6087 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
size_t K >
6088 struct MultTrait< HybridMatrix<T1,M,N,SO>, HybridVector<T2,K,false> >
6090 typedef HybridVector< typename MultTrait<T1,T2>::Type, M,
false > Type;
6093 template<
typename T1,
size_t K,
typename T2,
size_t M,
size_t N,
bool SO >
6094 struct MultTrait< HybridVector<T1,K,true>, HybridMatrix<T2,M,N,SO> >
6096 typedef HybridVector< typename MultTrait<T1,T2>::Type, N,
true > Type;
6099 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6100 struct MultTrait< HybridMatrix<T1,M,N,SO>, DynamicVector<T2,false> >
6102 typedef HybridVector< typename MultTrait<T1,T2>::Type, M,
false > Type;
6105 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6106 struct MultTrait< DynamicVector<T1,true>, HybridMatrix<T2,M,N,SO> >
6108 typedef HybridVector< typename MultTrait<T1,T2>::Type, N,
true > Type;
6111 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6112 struct MultTrait< HybridMatrix<T1,M,N,SO>, CustomVector<T2,AF,PF,false> >
6114 typedef HybridVector< typename MultTrait<T1,T2>::Type, M,
false > Type;
6117 template<
typename T1,
bool AF,
bool PF,
typename T2,
size_t M,
size_t N,
bool SO >
6118 struct MultTrait< CustomVector<T1,AF,PF,true>, HybridMatrix<T2,M,N,SO> >
6120 typedef HybridVector< typename MultTrait<T1,T2>::Type, N,
true > Type;
6123 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6124 struct MultTrait< HybridMatrix<T1,M,N,SO>, CompressedVector<T2,false> >
6126 typedef HybridVector< typename MultTrait<T1,T2>::Type, M,
false > Type;
6129 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6130 struct MultTrait< CompressedVector<T1,true>, HybridMatrix<T2,M,N,SO> >
6132 typedef HybridVector< typename MultTrait<T1,T2>::Type, N,
true > Type;
6135 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6136 struct MultTrait< HybridMatrix<T1,M1,N1,SO1>, StaticMatrix<T2,M2,N2,SO2> >
6138 typedef HybridMatrix< typename MultTrait<T1,T2>::Type, M1, N2, SO1 > Type;
6141 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6142 struct MultTrait< StaticMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6144 typedef HybridMatrix< typename MultTrait<T1,T2>::Type, M1, N2, SO1 > Type;
6147 template<
typename T1,
size_t M1,
size_t N1,
bool SO1,
typename T2,
size_t M2,
size_t N2,
bool SO2 >
6148 struct MultTrait< HybridMatrix<T1,M1,N1,SO1>, HybridMatrix<T2,M2,N2,SO2> >
6150 typedef HybridMatrix< typename MultTrait<T1,T2>::Type, M1, N2, SO1 > Type;
6166 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6167 struct DivTrait< HybridMatrix<T1,M,N,SO>, T2, typename EnableIf< IsNumeric<T2> >::Type >
6169 typedef HybridMatrix< typename DivTrait<T1,T2>::Type, M, N, SO > Type;
6185 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6186 struct MathTrait< HybridMatrix<T1,M,N,SO>, HybridMatrix<T2,M,N,SO> >
6188 typedef HybridMatrix< typename MathTrait<T1,T2>::HighType, M, N, SO > HighType;
6189 typedef HybridMatrix< typename MathTrait<T1,T2>::LowType , M, N, SO > LowType;
6205 template<
typename T1,
size_t M,
size_t N,
bool SO >
6206 struct SubmatrixTrait< HybridMatrix<T1,M,N,SO> >
6208 typedef HybridMatrix<T1,M,N,SO> Type;
6224 template<
typename T1,
size_t M,
size_t N,
bool SO >
6225 struct RowTrait< HybridMatrix<T1,M,N,SO> >
6227 typedef HybridVector<T1,N,true> Type;
6243 template<
typename T1,
size_t M,
size_t N,
bool SO >
6244 struct ColumnTrait< HybridMatrix<T1,M,N,SO> >
6246 typedef HybridVector<T1,M,false> Type;
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:118
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:116
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1729
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type set(T value)
Sets all values in the vector to the given 2-byte integral value.
Definition: Set.h:73
ConstIterator cbegin(size_t i) const
Returns an iterator to the first element of row/column i.
Definition: HybridMatrix.h:1088
ConstIterator cend(size_t i) const
Returns an iterator just past the last element of row/column i.
Definition: HybridMatrix.h:1160
BLAZE_ALWAYS_INLINE IntrinsicType loada(size_t i, size_t j) const
Aligned load of an intrinsic element of the matrix.
Definition: HybridMatrix.h:2243
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:98
Header file for mathematical functions.
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:224
Header file for basic type definitions.
size_t spacing() const
Returns the spacing between the beginning of two rows.
Definition: HybridMatrix.h:1526
const bool defaultStorageOrder
The default storage order for all matrices of the Blaze library.This value specifies the default stor...
Definition: StorageOrder.h:56
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
Header file for the row trait.
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:250
Header file for the IsSparseMatrix type trait.
Header file for the IsDiagonal type trait.
BLAZE_ALWAYS_INLINE void store(size_t i, size_t j, const IntrinsicType &value)
Store of an intrinsic element of the matrix.
Definition: HybridMatrix.h:2316
Header file for the IsSame and IsStrictlySame type traits.
BLAZE_ALWAYS_INLINE void storea(size_t i, size_t j, const IntrinsicType &value)
Aligned store of an intrinsic element of the matrix.
Definition: HybridMatrix.h:2347
Header file for the IsColumnMajorMatrix type trait.
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: HybridMatrix.h:892
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
IT::Type IntrinsicType
Intrinsic type of the matrix elements.
Definition: HybridMatrix.h:225
size_t m_
The current number of rows of the sparse matrix.
Definition: CompressedMatrix.h:2749
Reference operator()(size_t i, size_t j)
2D-access to the matrix elements.
Definition: HybridMatrix.h:843
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:308
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: HybridMatrix.h:232
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:90
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:584
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:116
const Type & ConstReference
Reference to a constant matrix value.
Definition: HybridMatrix.h:230
Header file for the SizeT class template.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:158
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:90
Header file for memory allocation and deallocation functionality.
void move(CustomMatrix< Type, AF, PF, SO > &dst, CustomMatrix< Type, AF, PF, SO > &src)
Moving the contents of one custom matrix to another.
Definition: CustomMatrix.h:6085
System settings for performance optimizations.
HybridMatrix< Type, N, M,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: HybridMatrix.h:223
Type & Reference
Reference to a non-constant matrix value.
Definition: HybridMatrix.h:229
bool isAliased(const Other *alias) const
Returns whether the matrix is aliased with the given address alias.
Definition: HybridMatrix.h:2166
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:117
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
Constraint on the data type.
Header file for the SparseMatrix base class.
const This & CompositeType
Data type for composite expression templates.
Definition: HybridMatrix.h:227
void resize(size_t m, size_t n, bool preserve=true)
Changing the size of the matrix.
Definition: HybridMatrix.h:1733
Header file for the DisableIf class template.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type loadu(const T *address)
Loads a vector of 2-byte integral values.
Definition: Loadu.h:74
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
size_t rows() const
Returns the current number of rows of the matrix.
Definition: HybridMatrix.h:1491
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.
Iterator end(size_t i)
Returns an iterator just past the last element of row/column i.
Definition: HybridMatrix.h:1112
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:4998
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type storeu(T *address, const simd_int16_t &value)
Unaligned store of a vector of 2-byte integral values.
Definition: Storeu.h:75
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: HybridMatrix.h:1584
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:116
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:75
bool isAligned() const
Returns whether the matrix is properly aligned in memory.
Definition: HybridMatrix.h:2186
bool canAlias(const Other *alias) const
Returns whether the matrix can alias with the given address alias.
Definition: HybridMatrix.h:2144
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
Pointer data()
Low-level data access to the matrix elements.
Definition: HybridMatrix.h:951
EnableIf< IsBuiltin< T > >::Type deallocate(T *address)
Deallocation of memory for built-in data types.
Definition: Memory.h:227
Header file for the DenseIterator class template.
BLAZE_ALWAYS_INLINE void conjugate(T &a)
In-place conjugation of the given value/object.
Definition: Conjugate.h:120
HybridMatrix()
The default constructor for HybridMatrix.
Definition: HybridMatrix.h:509
Type * Pointer
Pointer to a non-constant matrix value.
Definition: HybridMatrix.h:231
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_DIAGONAL_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a diagonal matrix type, a compilation error is created.
Definition: Diagonal.h:116
const Type & ReturnType
Return type for expression template evaluations.
Definition: HybridMatrix.h:226
Header file for the IsLower type trait.
IntrinsicTrait< Type > IT
Intrinsic trait for the matrix element type.
Definition: HybridMatrix.h:210
size_t m_
The current number of rows of the matrix.
Definition: HybridMatrix.h:473
Header file for the IsAligned type trait.
HybridMatrix< Type, M, N, SO > This
Type of this HybridMatrix instance.
Definition: HybridMatrix.h:220
Compile time check for diagonal matrices.This type trait tests whether or not the given template para...
Definition: IsDiagonal.h:92
Header file for the default storage order for all vectors of the Blaze library.
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a vectorizable data type...
Definition: Vectorizable.h:79
void reset()
Reset to the default initial values.
Definition: HybridMatrix.h:1638
HybridMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: HybridMatrix.h:1856
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:187
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:532
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2590
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:527
Header file for the IsPadded type trait.
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:222
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type loada(const T *address)
Loads a vector of 2-byte integral values.
Definition: Loada.h:77
Iterator begin(size_t i)
Returns an iterator to the first element of row/column i.
Definition: HybridMatrix.h:1040
AlignedArray< Type, M *NN > v_
The statically allocated matrix elements.
Definition: HybridMatrix.h:463
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:116
Compile time integral constant wrapper for size_t.The SizeT class template represents an integral wra...
Definition: SizeT.h:72
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
Header file for run time assertion macros.
HybridMatrix & transpose()
In-place transpose of the matrix.
Definition: HybridMatrix.h:1805
Header file for the addition trait.
Header file for the division trait.
size_t capacity() const
Returns the maximum capacity of the matrix.
Definition: HybridMatrix.h:1542
Header file for the submatrix trait.
Constraint on the data type.
This ResultType
Result type for expression template evaluations.
Definition: HybridMatrix.h:221
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Constraint on the data type.
DenseIterator< Type, usePadding > Iterator
Iterator over non-constant elements.
Definition: HybridMatrix.h:234
const bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
Header file for the AlignedArray implementation.
const bool usePadding
Configuration of the padding of dense vectors and matrices.This configuration switch enables/disables...
Definition: Optimizations.h:52
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:116
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2591
Header file for the column trait.
Header file for the isDefault shim.
Header file for the TransExprTrait class template.
Constraint on the data type.
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:94
Constraint on the data type.
Constraint on the data type.
Header file for the HasMutableDataAccess type trait.
Evaluation of the return type of a conjugate transpose expression.Via this type trait it is possible ...
Definition: CTransExprTrait.h:87
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:256
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:59
Header file for all intrinsic functionality.
Header file for the mathematical trait.
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
Rebind mechanism to obtain a HybridMatrix with different data/element type.
Definition: HybridMatrix.h:242
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:235
HybridMatrix< ET, M, N, SO > Other
The type of the other HybridMatrix.
Definition: HybridMatrix.h:243
size_t n_
The current number of columns of the sparse matrix.
Definition: CompressedMatrix.h:2750
Evaluation of the return type of a transpose expression.Via this type trait it is possible to evaluat...
Definition: TransExprTrait.h:87
Header file for the IsRowMajorMatrix type trait.
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t i, size_t j) const
Load of an intrinsic element of the matrix.
Definition: HybridMatrix.h:2213
Header file for the alignment check function.
BLAZE_ALWAYS_INLINE void cswap(T &a, T &b)
Swapping two conjugated values/objects.
Definition: Conjugate.h:197
BLAZE_ALWAYS_INLINE void stream(size_t i, size_t j, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the matrix.
Definition: HybridMatrix.h:2421
static const size_t NN
Alignment adjustment.
Definition: HybridMatrix.h:215
size_t n_
The current number of columns of the matrix.
Definition: HybridMatrix.h:474
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type stream(T *address, const simd_int16_t &value)
Aligned, non-temporal store of a vector of 2-byte integral values.
Definition: Stream.h:74
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:324
void swap(HybridMatrix &m)
Swapping the contents of two hybrid matrices.
Definition: HybridMatrix.h:1928
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:237
void clear()
Clearing the hybrid matrix.
Definition: HybridMatrix.h:1686
Compile time check for sparse matrix types.This type trait tests whether or not the given template pa...
Definition: IsSparseMatrix.h:103
size_t columns() const
Returns the current number of columns of the matrix.
Definition: HybridMatrix.h:1507
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2589
#define BLAZE_THROW_LOGIC_ERROR(MESSAGE)
Macro for the emission of a std::logic_error exceptionThis macro encapsulates the default way of Blaz...
Definition: Exception.h:283
Rebind mechanism to obtain a CompressedMatrix with different data/element type.
Definition: CompressedMatrix.h:2599
Header file for the IsUpper type trait.
Header file for exception macros.
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:1782
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:143
BLAZE_ALWAYS_INLINE void storeu(size_t i, size_t j, const IntrinsicType &value)
Unaligned store of an intrinsic element of the matrix.
Definition: HybridMatrix.h:2385
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
BLAZE_ALWAYS_INLINE IntrinsicType loadu(size_t i, size_t j) const
Unaligned load of an intrinsic element of the matrix.
Definition: HybridMatrix.h:2280
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type storea(T *address, const simd_int16_t &value)
Aligned store of a vector of 2-byte integral values.
Definition: Storea.h:78
Compile time integral round up operation.The NextMultiple class template rounds up the given template...
Definition: NextMultiple.h:81
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:558