35 #ifndef _BLAZE_MATH_DENSE_STATICMATRIX_H_ 36 #define _BLAZE_MATH_DENSE_STATICMATRIX_H_ 219 template<
typename Type
222 ,
bool SO = defaultStorageOrder >
224 :
public DenseMatrix< StaticMatrix<Type,M,N,SO>, SO >
262 template<
typename NewType >
271 template<
size_t NewM
300 template<
typename Other >
301 explicit inline StaticMatrix(
size_t m,
size_t n,
const Other* array );
303 template<
typename Other,
size_t Rows,
size_t Cols >
304 explicit inline StaticMatrix(
const Other (&array)[Rows][Cols] );
308 template<
typename Other,
bool SO2 >
311 template<
typename MT,
bool SO2 >
332 inline constexpr
Pointer data (
size_t i ) noexcept;
337 inline constexpr
Iterator end (
size_t i ) noexcept;
349 template< typename Other,
size_t Rows,
size_t Cols >
350 inline
StaticMatrix& operator=( const Other (&array)[Rows][Cols] );
354 template< typename Other,
bool SO2 >
357 template< typename MT,
bool SO2 > inline
StaticMatrix& operator= ( const
Matrix<MT,SO2>& rhs );
358 template< typename MT,
bool SO2 > inline
StaticMatrix& operator+=( const
Matrix<MT,SO2>& rhs );
359 template< typename MT,
bool SO2 > inline
StaticMatrix& operator-=( const
Matrix<MT,SO2>& rhs );
360 template< typename MT,
bool SO2 > inline
StaticMatrix& operator%=( const
Matrix<MT,SO2>& rhs );
367 static inline constexpr
size_t rows() noexcept;
368 static inline constexpr
size_t columns() noexcept;
369 static inline constexpr
size_t spacing() noexcept;
370 static inline constexpr
size_t capacity() noexcept;
371 inline
size_t capacity(
size_t i ) const noexcept;
373 inline
size_t nonZeros(
size_t i ) const;
374 inline constexpr
void reset();
375 inline
void reset(
size_t i );
386 template< typename Other > inline
StaticMatrix& scale( const Other& scalar );
393 static inline
void* operator new ( std::
size_t size );
394 static inline
void* operator new[]( std::
size_t size );
395 static inline
void* operator new ( std::
size_t size, const std::nothrow_t& );
396 static inline
void* operator new[]( std::
size_t size, const std::nothrow_t& );
398 static inline
void operator delete (
void* ptr );
399 static inline
void operator delete[](
void* ptr );
400 static inline
void operator delete (
void* ptr, const std::nothrow_t& );
401 static inline
void operator delete[](
void* ptr, const std::nothrow_t& );
408 template< typename MT >
410 static constexpr
bool VectorizedAssign_v =
411 ( useOptimizedKernels &&
420 template< typename MT >
422 static constexpr
bool VectorizedAddAssign_v =
423 ( useOptimizedKernels &&
434 template< typename MT >
436 static constexpr
bool VectorizedSubAssign_v =
437 ( useOptimizedKernels &&
448 template< typename MT >
450 static constexpr
bool VectorizedSchurAssign_v =
451 ( useOptimizedKernels &&
463 inline constexpr
bool isIntact() const noexcept;
470 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
471 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
473 static inline constexpr
bool isAligned() noexcept;
484 template< typename MT,
bool SO2 >
487 template< typename MT,
bool SO2 >
493 template< typename MT,
bool SO2 >
496 template< typename MT,
bool SO2 >
502 template< typename MT,
bool SO2 >
505 template< typename MT,
bool SO2 >
511 template< typename MT,
bool SO2 >
514 template< typename MT,
bool SO2 >
592 template< typename Type
601 if( IsNumeric_v<Type> ) {
602 if( useDefaultInitialization ) {
603 for(
size_t i=0UL; i<M*
NN; ++i )
606 else if( usePadding ) {
607 for(
size_t i=0UL; i<M; ++i )
608 for(
size_t j=N; j<
NN; ++j )
623 template<
typename Type
632 for(
size_t i=0UL; i<M; ++i ) {
633 for(
size_t j=0UL; j<N; ++j )
636 for(
size_t j=N; j<
NN; ++j )
668 template<
typename Type
683 for(
const auto& rowList : list ) {
685 for(
const auto& element : rowList ) {
686 v_[i*
NN+j] = element;
723 template<
typename Type
727 template<
typename Other >
733 if( m > M || n > N ) {
737 for(
size_t i=0UL; i<m; ++i ) {
738 for(
size_t j=0UL; j<n; ++j )
739 v_[i*
NN+j] = array[i*n+j];
741 if( IsNumeric_v<Type> ) {
742 for(
size_t j=n; j<
NN; ++j )
747 if( IsNumeric_v<Type> ) {
748 for(
size_t i=m; i<M; ++i ) {
749 for(
size_t j=0UL; j<
NN; ++j )
779 template<
typename Type
783 template<
typename Other
792 for(
size_t i=0UL; i<M; ++i ) {
793 for(
size_t j=0UL; j<N; ++j )
794 v_[i*
NN+j] = array[i][j];
796 for(
size_t j=N; j<
NN; ++j )
812 template<
typename Type
831 template<
typename Type
835 template<
typename Other
842 for(
size_t i=0UL; i<M; ++i ) {
843 for(
size_t j=0UL; j<N; ++j )
846 for(
size_t j=N; j<
NN; ++j )
865 template<
typename Type
869 template<
typename MT
882 for(
size_t i=0UL; i<M; ++i ) {
883 for(
size_t j=( IsSparseMatrix_v<MT> ? 0UL : N ); j<
NN; ++j ) {
913 template<
typename Type
937 template<
typename Type
962 template<
typename Type
991 template<
typename Type
1004 return (*
this)(i,j);
1021 template<
typename Type
1045 template<
typename Type
1065 template<
typename Type
1086 template<
typename Type
1110 template<
typename Type
1134 template<
typename Type
1158 template<
typename Type
1182 template<
typename Type
1206 template<
typename Type
1230 template<
typename Type
1257 template<
typename Type
1263 for(
size_t i=0UL; i<M; ++i )
1264 for(
size_t j=0UL; j<N; ++j )
1298 template<
typename Type
1311 for(
const auto& rowList : list ) {
1313 for(
const auto& element : rowList ) {
1314 v_[i*NN+j] = element;
1318 v_[i*NN+j] = Type();
1351 template<
typename Type
1355 template<
typename Other
1363 for(
size_t i=0UL; i<M; ++i )
1364 for(
size_t j=0UL; j<N; ++j )
1365 v_[i*NN+j] = array[i][j];
1382 template<
typename Type
1404 template<
typename Type
1408 template<
typename Other
1413 using blaze::assign;
1415 assign( *
this, ~rhs );
1435 template<
typename Type
1439 template<
typename MT
1443 using blaze::assign;
1445 using TT = decltype(
trans( *
this ) );
1446 using CT = decltype(
ctrans( *
this ) );
1447 using IT = decltype(
inv( *
this ) );
1449 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
1453 if( IsSame_v<MT,TT> && (~rhs).isAliased(
this ) ) {
1456 else if( IsSame_v<MT,CT> && (~rhs).isAliased(
this ) ) {
1459 else if( !IsSame_v<MT,IT> && (~rhs).canAlias(
this ) ) {
1461 assign( *
this, tmp );
1464 if( IsSparseMatrix_v<MT> )
1466 assign( *
this, ~rhs );
1486 template<
typename Type
1490 template<
typename MT
1494 using blaze::addAssign;
1496 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
1500 if( (~rhs).canAlias(
this ) ) {
1502 addAssign( *
this, tmp );
1505 addAssign( *
this, ~rhs );
1525 template<
typename Type
1529 template<
typename MT
1533 using blaze::subAssign;
1535 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
1539 if( (~rhs).canAlias(
this ) ) {
1541 subAssign( *
this, tmp );
1544 subAssign( *
this, ~rhs );
1564 template<
typename Type
1568 template<
typename MT
1572 using blaze::schurAssign;
1574 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
1578 if( (~rhs).canAlias(
this ) ) {
1580 schurAssign( *
this, tmp );
1583 schurAssign( *
this, ~rhs );
1606 template<
typename Type
1622 template<
typename Type
1641 template<
typename Type
1657 template<
typename Type
1679 template<
typename Type
1699 template<
typename Type
1705 size_t nonzeros( 0UL );
1707 for(
size_t i=0UL; i<M; ++i )
1708 for(
size_t j=0UL; j<N; ++j )
1728 template<
typename Type
1736 const size_t jend( i*NN + N );
1737 size_t nonzeros( 0UL );
1739 for(
size_t j=i*NN; j<jend; ++j )
1753 template<
typename Type
1761 for(
size_t i=0UL; i<M; ++i )
1762 for(
size_t j=0UL; j<N; ++j )
1763 clear( v_[i*NN+j] );
1779 template<
typename Type
1788 for(
size_t j=0UL; j<N; ++j )
1789 clear( v_[i*NN+j] );
1800 template<
typename Type
1808 for(
size_t i=0UL; i<M; ++i ) {
1809 for(
size_t j=0UL; j<N; ++j ) {
1810 swap( v_[i*NN+j], m(i,j) );
1833 template<
typename Type
1843 for(
size_t i=1UL; i<M; ++i )
1844 for(
size_t j=0UL; j<i; ++j )
1845 swap( v_[i*NN+j], v_[j*NN+i] );
1866 template<
typename Type
1892 template<
typename Type
1910 template<
typename Type
1918 for(
size_t i=0UL; i<M; ++i ) {
1919 for(
size_t j=0UL; j<i; ++j ) {
1920 cswap( v_[i*NN+j], v_[j*NN+i] );
1944 template<
typename Type
1970 template<
typename Type
1997 template<
typename Type
2001 template<
typename Other >
2004 for(
size_t i=0UL; i<M; ++i )
2005 for(
size_t j=0UL; j<N; ++j )
2006 v_[i*NN+j] *= scalar;
2031 template<
typename Type
2041 return allocate<StaticMatrix>( 1UL );
2056 template<
typename Type
2080 template<
typename Type
2090 return allocate<StaticMatrix>( 1UL );
2105 template<
typename Type
2125 template<
typename Type
2131 deallocate( static_cast<StaticMatrix*>( ptr ) );
2142 template<
typename Type
2148 deallocate( static_cast<StaticMatrix*>( ptr ) );
2159 template<
typename Type
2165 deallocate( static_cast<StaticMatrix*>( ptr ) );
2176 template<
typename Type
2182 deallocate( static_cast<StaticMatrix*>( ptr ) );
2204 template<
typename Type
2210 if( IsNumeric_v<Type> ) {
2211 for(
size_t i=0UL; i<M; ++i ) {
2212 for(
size_t j=N; j<NN; ++j ) {
2213 if( v_[i*NN+j] != Type() )
2242 template<
typename Type
2246 template<
typename Other >
2249 return static_cast<const void*>(
this ) == static_cast<const void*>( alias );
2264 template<
typename Type
2268 template<
typename Other >
2271 return static_cast<const void*>(
this ) == static_cast<const void*>( alias );
2285 template<
typename Type
2311 template<
typename Type
2319 return loada( i, j );
2321 return loadu( i, j );
2341 template<
typename Type
2358 return loada( &v_[i*NN+j] );
2378 template<
typename Type
2393 return loadu( &v_[i*NN+j] );
2414 template<
typename Type
2445 template<
typename Type
2462 storea( &v_[i*NN+j], value );
2483 template<
typename Type
2498 storeu( &v_[i*NN+j], value );
2520 template<
typename Type
2537 stream( &v_[i*NN+j], value );
2553 template<
typename Type
2557 template<
typename MT
2564 for(
size_t i=0UL; i<M; ++i ) {
2565 for(
size_t j=0UL; j<N; ++j ) {
2566 v_[i*NN+j] = (~rhs)(i,j);
2584 template<
typename Type
2588 template<
typename MT
2597 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
2599 constexpr
size_t jpos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2600 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2602 for(
size_t i=0UL; i<M; ++i )
2606 for( ; j<jpos; j+=SIMDSIZE ) {
2607 store( i, j, (~rhs).load(i,j) );
2609 for( ; remainder && j<N; ++j ) {
2610 v_[i*NN+j] = (~rhs)(i,j);
2628 template<
typename Type
2632 template<
typename MT >
2637 for(
size_t i=0UL; i<M; ++i )
2638 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2639 v_[i*NN+element->index()] = element->value();
2655 template<
typename Type
2659 template<
typename MT >
2666 for(
size_t j=0UL; j<N; ++j )
2667 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2668 v_[element->index()*NN+j] = element->value();
2684 template<
typename Type
2688 template<
typename MT
2695 for(
size_t i=0UL; i<M; ++i )
2697 if( IsDiagonal_v<MT> )
2699 v_[i*NN+i] += (~rhs)(i,i);
2703 const size_t jbegin( ( IsUpper_v<MT> )
2704 ?( IsStrictlyUpper_v<MT> ? i+1UL : i )
2706 const size_t jend ( ( IsLower_v<MT> )
2707 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
2711 for(
size_t j=jbegin; j<jend; ++j ) {
2712 v_[i*NN+j] += (~rhs)(i,j);
2731 template<
typename Type
2735 template<
typename MT
2745 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
2747 for(
size_t i=0UL; i<M; ++i )
2749 const size_t jbegin( ( IsUpper_v<MT> )
2750 ?( ( IsStrictlyUpper_v<MT> ? i+1UL : i ) &
size_t(-SIMDSIZE) )
2752 const size_t jend ( ( IsLower_v<MT> )
2753 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
2757 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
2758 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2762 for( ; j<jpos; j+=SIMDSIZE ) {
2763 store( i, j, load(i,j) + (~rhs).load(i,j) );
2765 for( ; remainder && j<jend; ++j ) {
2766 v_[i*NN+j] += (~rhs)(i,j);
2784 template<
typename Type
2788 template<
typename MT >
2793 for(
size_t i=0UL; i<M; ++i )
2794 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2795 v_[i*NN+element->index()] += element->value();
2811 template<
typename Type
2815 template<
typename MT >
2822 for(
size_t j=0UL; j<N; ++j )
2823 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2824 v_[element->index()*NN+j] += element->value();
2840 template<
typename Type
2844 template<
typename MT
2851 for(
size_t i=0UL; i<M; ++i )
2853 if( IsDiagonal_v<MT> )
2855 v_[i*NN+i] -= (~rhs)(i,i);
2859 const size_t jbegin( ( IsUpper_v<MT> )
2860 ?( IsStrictlyUpper_v<MT> ? i+1UL : i )
2862 const size_t jend ( ( IsLower_v<MT> )
2863 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
2867 for(
size_t j=jbegin; j<jend; ++j ) {
2868 v_[i*NN+j] -= (~rhs)(i,j);
2887 template<
typename Type
2891 template<
typename MT
2901 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
2903 for(
size_t i=0UL; i<M; ++i )
2905 const size_t jbegin( ( IsUpper_v<MT> )
2906 ?( ( IsStrictlyUpper_v<MT> ? i+1UL : i ) &
size_t(-SIMDSIZE) )
2908 const size_t jend ( ( IsLower_v<MT> )
2909 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
2913 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
2914 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2918 for( ; j<jpos; j+=SIMDSIZE ) {
2919 store( i, j, load(i,j) - (~rhs).load(i,j) );
2921 for( ; remainder && j<jend; ++j ) {
2922 v_[i*NN+j] -= (~rhs)(i,j);
2940 template<
typename Type
2944 template<
typename MT >
2949 for(
size_t i=0UL; i<M; ++i )
2950 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2951 v_[i*NN+element->index()] -= element->value();
2967 template<
typename Type
2971 template<
typename MT >
2978 for(
size_t j=0UL; j<N; ++j )
2979 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2980 v_[element->index()*NN+j] -= element->value();
2996 template<
typename Type
3000 template<
typename MT
3007 for(
size_t i=0UL; i<M; ++i ) {
3008 for(
size_t j=0UL; j<N; ++j ) {
3009 v_[i*NN+j] *= (~rhs)(i,j);
3027 template<
typename Type
3031 template<
typename MT
3040 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
3042 constexpr
size_t jpos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
3043 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
3045 for(
size_t i=0UL; i<M; ++i )
3049 for( ; j<jpos; j+=SIMDSIZE ) {
3050 store( i, j, load(i,j) * (~rhs).load(i,j) );
3052 for( ; remainder && j<N; ++j ) {
3053 v_[i*NN+j] *= (~rhs)(i,j);
3071 template<
typename Type
3075 template<
typename MT >
3084 for(
size_t i=0UL; i<M; ++i )
3085 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
3086 v_[i*NN+element->index()] = tmp.v_[i*NN+element->index()] * element->value();
3102 template<
typename Type
3106 template<
typename MT >
3117 for(
size_t j=0UL; j<N; ++j )
3118 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
3119 v_[element->index()*NN+j] = tmp.v_[element->index()*NN+j] * element->value();
3144 template<
typename Type
3148 :
public DenseMatrix< StaticMatrix<Type,M,N,true>, true >
3159 static constexpr
bool align = ( usePadding || MM %
SIMDSIZE == 0UL );
3186 template<
typename NewType >
3195 template<
size_t NewM
3198 using Other = StaticMatrix<Type,NewM,NewN,true>;
3208 static constexpr
bool simdEnabled = IsVectorizable_v<Type>;
3222 inline constexpr
StaticMatrix( initializer_list< initializer_list<Type> > list );
3224 template<
typename Other >
3225 explicit inline StaticMatrix(
size_t m,
size_t n,
const Other* array );
3227 template<
typename Other,
size_t Rows,
size_t Cols >
3228 explicit inline StaticMatrix(
const Other (&array)[Rows][Cols] );
3232 template<
typename Other,
bool SO >
3233 inline StaticMatrix(
const StaticMatrix<Other,M,N,SO>& m );
3235 template<
typename MT,
bool SO >
3256 inline constexpr
Pointer data (
size_t j ) noexcept;
3261 inline constexpr
Iterator end (
size_t j ) noexcept;
3271 inline constexpr
StaticMatrix& operator=( initializer_list< initializer_list<Type> > list );
3273 template< typename Other,
size_t Rows,
size_t Cols >
3274 inline
StaticMatrix& operator=( const Other (&array)[Rows][Cols] );
3278 template< typename Other,
bool SO >
3281 template< typename MT,
bool SO > inline
StaticMatrix& operator= ( const Matrix<MT,SO>& rhs );
3282 template< typename MT,
bool SO > inline
StaticMatrix& operator+=( const Matrix<MT,SO>& rhs );
3283 template< typename MT,
bool SO > inline
StaticMatrix& operator-=( const Matrix<MT,SO>& rhs );
3284 template< typename MT,
bool SO > inline
StaticMatrix& operator%=( const Matrix<MT,SO>& rhs );
3291 static inline constexpr
size_t rows() noexcept;
3292 static inline constexpr
size_t columns() noexcept;
3293 static inline constexpr
size_t spacing() noexcept;
3294 static inline constexpr
size_t capacity() noexcept;
3295 inline
size_t capacity(
size_t j ) const noexcept;
3297 inline
size_t nonZeros(
size_t j ) const;
3298 inline constexpr
void reset();
3299 inline
void reset(
size_t i );
3310 template< typename Other > inline
StaticMatrix& scale( const Other& scalar );
3317 static inline
void* operator new ( std::
size_t size );
3318 static inline
void* operator new[]( std::
size_t size );
3319 static inline
void* operator new ( std::
size_t size, const std::nothrow_t& );
3320 static inline
void* operator new[]( std::
size_t size, const std::nothrow_t& );
3322 static inline
void operator delete (
void* ptr );
3323 static inline
void operator delete[](
void* ptr );
3324 static inline
void operator delete (
void* ptr, const std::nothrow_t& );
3325 static inline
void operator delete[](
void* ptr, const std::nothrow_t& );
3332 template< typename MT >
3333 static constexpr
bool VectorizedAssign_v =
3334 ( useOptimizedKernels &&
3342 template< typename MT >
3343 static constexpr
bool VectorizedAddAssign_v =
3344 ( useOptimizedKernels &&
3354 template< typename MT >
3355 static constexpr
bool VectorizedSubAssign_v =
3356 ( useOptimizedKernels &&
3366 template< typename MT >
3367 static constexpr
bool VectorizedSchurAssign_v =
3368 ( useOptimizedKernels &&
3379 inline constexpr
bool isIntact() const noexcept;
3386 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
3387 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
3389 static inline constexpr
bool isAligned() noexcept;
3400 template< typename MT,
bool SO >
3401 inline auto
assign( const DenseMatrix<MT,SO>& rhs ) ->
DisableIf_t< VectorizedAssign_v<MT> >;
3403 template< typename MT,
bool SO >
3404 inline auto
assign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedAssign_v<MT> >;
3406 template< typename MT > inline
void assign( const SparseMatrix<MT,true>& rhs );
3407 template< typename MT > inline
void assign( const SparseMatrix<MT,false>& rhs );
3409 template< typename MT,
bool SO >
3410 inline auto
addAssign( const DenseMatrix<MT,SO>& rhs ) ->
DisableIf_t< VectorizedAddAssign_v<MT> >;
3412 template< typename MT,
bool SO >
3413 inline auto
addAssign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedAddAssign_v<MT> >;
3415 template< typename MT > inline
void addAssign( const SparseMatrix<MT,true>& rhs );
3416 template< typename MT > inline
void addAssign( const SparseMatrix<MT,false>& rhs );
3418 template< typename MT,
bool SO >
3419 inline auto
subAssign( const DenseMatrix<MT,SO>& rhs ) ->
DisableIf_t< VectorizedSubAssign_v<MT> >;
3421 template< typename MT,
bool SO >
3422 inline auto
subAssign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedSubAssign_v<MT> >;
3424 template< typename MT > inline
void subAssign( const SparseMatrix<MT,true>& rhs );
3425 template< typename MT > inline
void subAssign( const SparseMatrix<MT,false>& rhs );
3427 template< typename MT,
bool SO >
3430 template< typename MT,
bool SO >
3431 inline auto
schurAssign( const DenseMatrix<MT,SO>& rhs ) ->
EnableIf_t< VectorizedSchurAssign_v<MT> >;
3433 template< typename MT > inline
void schurAssign( const SparseMatrix<MT,true>& rhs );
3434 template< typename MT > inline
void schurAssign( const SparseMatrix<MT,false>& rhs );
3498 template< typename Type
3506 if( IsNumeric_v<Type> ) {
3507 if( useDefaultInitialization ) {
3508 for(
size_t i=0UL; i<MM*N; ++i )
3511 else if( usePadding ) {
3512 for(
size_t j=0UL; j<N; ++j )
3513 for(
size_t i=M; i<MM; ++i )
3514 v_[i+j*MM] = Type();
3530 template<
typename Type
3538 for(
size_t j=0UL; j<N; ++j ) {
3539 for(
size_t i=0UL; i<M; ++i )
3542 for(
size_t i=M; i<MM; ++i )
3543 v_[i+j*MM] = Type();
3575 template<
typename Type
3589 for(
const auto& rowList : list ) {
3591 for(
const auto& element : rowList ) {
3592 v_[i+j*MM] = element;
3631 template<
typename Type
3634 template<
typename Other >
3640 if( m > M || n > N ) {
3644 for(
size_t j=0UL; j<n; ++j ) {
3645 for(
size_t i=0UL; i<m; ++i )
3646 v_[i+j*MM] = array[i+j*m];
3648 if( IsNumeric_v<Type> ) {
3649 for(
size_t i=m; i<MM; ++i )
3650 v_[i+j*MM] = Type();
3654 if( IsNumeric_v<Type> ) {
3655 for(
size_t j=n; j<N; ++j ) {
3656 for(
size_t i=0UL; i<MM; ++i )
3657 v_[i+j*MM] = Type();
3688 template<
typename Type
3691 template<
typename Other
3700 for(
size_t j=0UL; j<N; ++j ) {
3701 for(
size_t i=0UL; i<M; ++i )
3702 v_[i+j*MM] = array[i][j];
3704 for(
size_t i=M; i<MM; ++i )
3705 v_[i+j*MM] = Type();
3722 template<
typename Type
3742 template<
typename Type
3745 template<
typename Other
3752 for(
size_t j=0UL; j<N; ++j ) {
3753 for(
size_t i=0UL; i<M; ++i )
3754 v_[i+j*MM] = m(i,j);
3756 for(
size_t i=M; i<MM; ++i )
3757 v_[i+j*MM] = Type();
3777 template<
typename Type
3780 template<
typename MT
3785 using blaze::assign;
3793 for(
size_t j=0UL; j<N; ++j ) {
3794 for(
size_t i=( IsSparseMatrix_v<MT> ? 0UL : M ); i<MM; ++i ) {
3795 v_[i+j*MM] = Type();
3826 template<
typename Type
3851 template<
typename Type
3877 template<
typename Type
3889 return (*
this)(i,j);
3907 template<
typename Type
3919 return (*
this)(i,j);
3937 template<
typename Type
3961 template<
typename Type
3982 template<
typename Type
4004 template<
typename Type
4024 template<
typename Type
4031 return Iterator( v_ + j*MM );
4044 template<
typename Type
4051 return ConstIterator( v_ + j*MM );
4064 template<
typename Type
4071 return ConstIterator( v_ + j*MM );
4084 template<
typename Type
4091 return Iterator( v_ + j*MM + M );
4104 template<
typename Type
4111 return ConstIterator( v_ + j*MM + M );
4124 template<
typename Type
4131 return ConstIterator( v_ + j*MM + M );
4152 template<
typename Type
4155 inline constexpr StaticMatrix<Type,M,N,true>&
4158 for(
size_t j=0UL; j<N; ++j )
4159 for(
size_t i=0UL; i<M; ++i )
4194 template<
typename Type
4197 inline constexpr StaticMatrix<Type,M,N,true>&
4206 for(
const auto& rowList : list ) {
4208 for(
const auto& element : rowList ) {
4209 v_[i+j*MM] = element;
4213 v_[i+j*MM] = Type();
4248 template<
typename Type
4251 template<
typename Other
4254 inline StaticMatrix<Type,M,N,true>&
4259 for(
size_t j=0UL; j<N; ++j )
4260 for(
size_t i=0UL; i<M; ++i )
4261 v_[i+j*MM] = array[i][j];
4280 template<
typename Type
4283 inline constexpr StaticMatrix<Type,M,N,true>&
4303 template<
typename Type
4306 template<
typename Other
4308 inline StaticMatrix<Type,M,N,true>&
4311 using blaze::assign;
4313 assign( *
this, ~rhs );
4335 template<
typename Type
4338 template<
typename MT
4342 using blaze::assign;
4344 using TT = decltype(
trans( *
this ) );
4345 using CT = decltype(
ctrans( *
this ) );
4346 using IT = decltype(
inv( *
this ) );
4348 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
4352 if( IsSame_v<MT,TT> && (~rhs).isAliased(
this ) ) {
4353 transpose(
typename IsSquare<This>::Type() );
4355 else if( IsSame_v<MT,CT> && (~rhs).isAliased(
this ) ) {
4356 ctranspose(
typename IsSquare<This>::Type() );
4358 else if( !IsSame_v<MT,IT> && (~rhs).canAlias(
this ) ) {
4359 StaticMatrix tmp( ~rhs );
4360 assign( *
this, tmp );
4363 if( IsSparseMatrix_v<MT> )
4365 assign( *
this, ~rhs );
4387 template<
typename Type
4390 template<
typename MT
4392 inline StaticMatrix<Type,M,N,true>& StaticMatrix<Type,M,N,true>::operator+=(
const Matrix<MT,SO>& rhs )
4394 using blaze::addAssign;
4396 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
4400 if( (~rhs).canAlias(
this ) ) {
4401 const ResultType_t<MT> tmp( ~rhs );
4402 addAssign( *
this, tmp );
4405 addAssign( *
this, ~rhs );
4427 template<
typename Type
4430 template<
typename MT
4432 inline StaticMatrix<Type,M,N,true>& StaticMatrix<Type,M,N,true>::operator-=(
const Matrix<MT,SO>& rhs )
4434 using blaze::subAssign;
4436 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
4440 if( (~rhs).canAlias(
this ) ) {
4441 const ResultType_t<MT> tmp( ~rhs );
4442 subAssign( *
this, tmp );
4445 subAssign( *
this, ~rhs );
4467 template<
typename Type
4470 template<
typename MT
4472 inline StaticMatrix<Type,M,N,true>& StaticMatrix<Type,M,N,true>::operator%=(
const Matrix<MT,SO>& rhs )
4474 using blaze::schurAssign;
4476 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
4480 if( (~rhs).canAlias(
this ) ) {
4481 const ResultType_t<MT> tmp( ~rhs );
4482 schurAssign( *
this, tmp );
4485 schurAssign( *
this, ~rhs );
4510 template<
typename Type
4527 template<
typename Type
4547 template<
typename Type
4564 template<
typename Type
4582 template<
typename Type
4603 template<
typename Type
4608 size_t nonzeros( 0UL );
4610 for(
size_t j=0UL; j<N; ++j )
4611 for(
size_t i=0UL; i<M; ++i )
4628 template<
typename Type
4635 const size_t iend( j*MM + M );
4636 size_t nonzeros( 0UL );
4638 for(
size_t i=j*MM; i<iend; ++i )
4654 template<
typename Type
4661 for(
size_t j=0UL; j<N; ++j )
4662 for(
size_t i=0UL; i<M; ++i )
4663 clear( v_[i+j*MM] );
4679 template<
typename Type
4687 for(
size_t i=0UL; i<M; ++i )
4688 clear( v_[i+j*MM] );
4701 template<
typename Type
4708 for(
size_t j=0UL; j<N; ++j ) {
4709 for(
size_t i=0UL; i<M; ++i ) {
4710 swap( v_[i+j*MM], m(i,j) );
4735 template<
typename Type
4744 for(
size_t j=1UL; j<N; ++j )
4745 for(
size_t i=0UL; i<j; ++i )
4746 swap( v_[i+j*MM], v_[j+i*MM] );
4768 template<
typename Type
4793 template<
typename Type
4811 template<
typename Type
4818 for(
size_t j=0UL; j<N; ++j ) {
4819 for(
size_t i=0UL; i<j; ++i ) {
4820 cswap( v_[i+j*MM], v_[j+i*MM] );
4845 template<
typename Type
4870 template<
typename Type
4897 template<
typename Type
4900 template<
typename Other >
4901 inline StaticMatrix<Type,M,N,true>&
4902 StaticMatrix<Type,M,N,true>::scale(
const Other& scalar )
4904 for(
size_t j=0UL; j<N; ++j )
4905 for(
size_t i=0UL; i<M; ++i )
4906 v_[i+j*MM] *= scalar;
4933 template<
typename Type
4936 inline void* StaticMatrix<Type,M,N,true>::operator
new( std::size_t
size )
4942 return allocate<StaticMatrix>( 1UL );
4959 template<
typename Type
4962 inline void* StaticMatrix<Type,M,N,true>::operator
new[]( std::size_t
size )
4967 return allocate<StaticMatrix>(
size/
sizeof(StaticMatrix) );
4984 template<
typename Type
4987 inline void* StaticMatrix<Type,M,N,true>::operator
new( std::size_t
size,
const std::nothrow_t& )
4993 return allocate<StaticMatrix>( 1UL );
5010 template<
typename Type
5013 inline void* StaticMatrix<Type,M,N,true>::operator
new[]( std::size_t
size,
const std::nothrow_t& )
5018 return allocate<StaticMatrix>(
size/
sizeof(StaticMatrix) );
5031 template<
typename Type
5034 inline void StaticMatrix<Type,M,N,true>::operator
delete(
void* ptr )
5036 deallocate( static_cast<StaticMatrix*>( ptr ) );
5049 template<
typename Type
5052 inline void StaticMatrix<Type,M,N,true>::operator
delete[](
void* ptr )
5054 deallocate( static_cast<StaticMatrix*>( ptr ) );
5067 template<
typename Type
5070 inline void StaticMatrix<Type,M,N,true>::operator
delete(
void* ptr,
const std::nothrow_t& )
5072 deallocate( static_cast<StaticMatrix*>( ptr ) );
5085 template<
typename Type
5088 inline void StaticMatrix<Type,M,N,true>::operator
delete[](
void* ptr,
const std::nothrow_t& )
5090 deallocate( static_cast<StaticMatrix*>( ptr ) );
5114 template<
typename Type
5119 if( IsNumeric_v<Type> ) {
5120 for(
size_t j=0UL; j<N; ++j ) {
5121 for(
size_t i=M; i<MM; ++i ) {
5122 if( v_[i+j*MM] != Type() )
5153 template<
typename Type
5156 template<
typename Other >
5159 return static_cast<const void*>(
this ) == static_cast<const void*>( alias );
5176 template<
typename Type
5179 template<
typename Other >
5182 return static_cast<const void*>(
this ) == static_cast<const void*>( alias );
5198 template<
typename Type
5224 template<
typename Type
5231 return loada( i, j );
5233 return loadu( i, j );
5254 template<
typename Type
5270 return loada( &v_[i+j*MM] );
5291 template<
typename Type
5305 return loadu( &v_[i+j*MM] );
5327 template<
typename Type
5358 template<
typename Type
5374 storea( &v_[i+j*MM], value );
5396 template<
typename Type
5410 storeu( &v_[i+j*MM], value );
5433 template<
typename Type
5449 stream( &v_[i+j*MM], value );
5467 template<
typename Type
5470 template<
typename MT
5473 -> DisableIf_t< VectorizedAssign_v<MT> >
5477 for(
size_t j=0UL; j<N; ++j ) {
5478 for(
size_t i=0UL; i<M; ++i ) {
5479 v_[i+j*MM] = (~rhs)(i,j);
5499 template<
typename Type
5502 template<
typename MT
5505 -> EnableIf_t< VectorizedAssign_v<MT> >
5511 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
5513 constexpr
size_t ipos( ( remainder )?( M &
size_t(-SIMDSIZE) ):( M ) );
5514 BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5516 for(
size_t j=0UL; j<N; ++j )
5520 for( ; i<ipos; i+=SIMDSIZE ) {
5521 store( i, j, (~rhs).load(i,j) );
5523 for( ; remainder && i<M; ++i ) {
5524 v_[i+j*MM] = (~rhs)(i,j);
5544 template<
typename Type
5547 template<
typename MT >
5552 for(
size_t j=0UL; j<N; ++j )
5553 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5554 v_[element->index()+j*MM] = element->value();
5572 template<
typename Type
5575 template<
typename MT >
5582 for(
size_t i=0UL; i<M; ++i )
5583 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5584 v_[i+element->index()*MM] = element->value();
5602 template<
typename Type
5605 template<
typename MT
5608 -> DisableIf_t< VectorizedAddAssign_v<MT> >
5612 for(
size_t j=0UL; j<N; ++j )
5614 if( IsDiagonal_v<MT> )
5616 v_[j+j*MM] += (~rhs)(j,j);
5620 const size_t ibegin( ( IsLower_v<MT> )
5621 ?( IsStrictlyLower_v<MT> ? j+1UL : j )
5623 const size_t iend ( ( IsUpper_v<MT> )
5624 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
5628 for(
size_t i=ibegin; i<iend; ++i ) {
5629 v_[i+j*MM] += (~rhs)(i,j);
5650 template<
typename Type
5653 template<
typename MT
5656 -> EnableIf_t< VectorizedAddAssign_v<MT> >
5663 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
5665 for(
size_t j=0UL; j<N; ++j )
5667 const size_t ibegin( ( IsLower_v<MT> )
5668 ?( ( IsStrictlyLower_v<MT> ? j+1UL : j ) &
size_t(-SIMDSIZE) )
5670 const size_t iend ( ( IsUpper_v<MT> )
5671 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
5675 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5676 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5680 for( ; i<ipos; i+=SIMDSIZE ) {
5681 store( i, j, load(i,j) + (~rhs).load(i,j) );
5683 for( ; remainder && i<iend; ++i ) {
5684 v_[i+j*MM] += (~rhs)(i,j);
5704 template<
typename Type
5707 template<
typename MT >
5712 for(
size_t j=0UL; j<N; ++j )
5713 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5714 v_[element->index()+j*MM] += element->value();
5732 template<
typename Type
5735 template<
typename MT >
5742 for(
size_t i=0UL; i<M; ++i )
5743 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5744 v_[i+element->index()*MM] += element->value();
5762 template<
typename Type
5765 template<
typename MT
5768 -> DisableIf_t< VectorizedSubAssign_v<MT> >
5772 for(
size_t j=0UL; j<N; ++j )
5774 if( IsDiagonal_v<MT> )
5776 v_[j+j*MM] -= (~rhs)(j,j);
5780 const size_t ibegin( ( IsLower_v<MT> )
5781 ?( IsStrictlyLower_v<MT> ? j+1UL : j )
5783 const size_t iend ( ( IsUpper_v<MT> )
5784 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
5788 for(
size_t i=ibegin; i<iend; ++i ) {
5789 v_[i+j*MM] -= (~rhs)(i,j);
5810 template<
typename Type
5813 template<
typename MT
5816 -> EnableIf_t< VectorizedSubAssign_v<MT> >
5823 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
5825 for(
size_t j=0UL; j<N; ++j )
5827 const size_t ibegin( ( IsLower_v<MT> )
5828 ?( ( IsStrictlyLower_v<MT> ? j+1UL : j ) &
size_t(-SIMDSIZE) )
5830 const size_t iend ( ( IsUpper_v<MT> )
5831 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
5835 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5836 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5840 for( ; i<ipos; i+=SIMDSIZE ) {
5841 store( i, j, load(i,j) - (~rhs).load(i,j) );
5843 for( ; remainder && i<iend; ++i ) {
5844 v_[i+j*MM] -= (~rhs)(i,j);
5864 template<
typename Type
5867 template<
typename MT >
5872 for(
size_t j=0UL; j<N; ++j )
5873 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5874 v_[element->index()+j*MM] -= element->value();
5892 template<
typename Type
5895 template<
typename MT >
5902 for(
size_t i=0UL; i<M; ++i )
5903 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5904 v_[i+element->index()*MM] -= element->value();
5922 template<
typename Type
5925 template<
typename MT
5928 -> DisableIf_t< VectorizedSchurAssign_v<MT> >
5932 for(
size_t j=0UL; j<N; ++j ) {
5933 for(
size_t i=0UL; i<M; ++i ) {
5934 v_[i+j*MM] *= (~rhs)(i,j);
5954 template<
typename Type
5957 template<
typename MT
5960 -> EnableIf_t< VectorizedSchurAssign_v<MT> >
5966 constexpr
bool remainder( !usePadding || !IsPadded_v<MT> );
5968 constexpr
size_t ipos( ( remainder )?( M &
size_t(-SIMDSIZE) ):( M ) );
5969 BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5971 for(
size_t j=0UL; j<N; ++j )
5975 for( ; i<ipos; i+=SIMDSIZE ) {
5976 store( i, j, load(i,j) * (~rhs).load(i,j) );
5978 for( ; remainder && i<M; ++i ) {
5979 v_[i+j*MM] *= (~rhs)(i,j);
5999 template<
typename Type
6002 template<
typename MT >
6007 const StaticMatrix tmp(
serial( *
this ) );
6011 for(
size_t j=0UL; j<N; ++j )
6012 for(
auto element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
6013 v_[element->index()+j*MM] = tmp.v_[element->index()+j*MM] * element->value();
6031 template<
typename Type
6034 template<
typename MT >
6041 const StaticMatrix tmp(
serial( *
this ) );
6045 for(
size_t i=0UL; i<M; ++i )
6046 for(
auto element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
6047 v_[i+element->index()*MM] = tmp.v_[i+element->index()*MM] * element->value();
6068 template<
typename Type,
size_t M,
size_t N,
bool SO >
6069 void reset( StaticMatrix<Type,M,N,SO>& m );
6071 template<
typename Type,
size_t M,
size_t N,
bool SO >
6072 void reset( StaticMatrix<Type,M,N,SO>& m,
size_t i );
6074 template<
typename Type,
size_t M,
size_t N,
bool SO >
6075 void clear( StaticMatrix<Type,M,N,SO>& m );
6077 template<
bool RF,
typename Type,
size_t M,
size_t N,
bool SO >
6078 bool isDefault(
const StaticMatrix<Type,M,N,SO>& m );
6080 template<
typename Type,
size_t M,
size_t N,
bool SO >
6081 bool isIntact(
const StaticMatrix<Type,M,N,SO>& m ) noexcept;
6083 template<
typename Type,
size_t M,
size_t N,
bool SO >
6084 void swap( StaticMatrix<Type,M,N,SO>& a, StaticMatrix<Type,M,N,SO>& b ) noexcept;
6096 template<
typename Type
6120 template<
typename Type
6140 template<
typename Type
6183 for(
size_t i=0UL; i<M; ++i )
6184 for(
size_t j=0UL; j<N; ++j )
6185 if( !isDefault<RF>( m(i,j) ) )
return false;
6188 for(
size_t j=0UL; j<N; ++j )
6189 for(
size_t i=0UL; i<M; ++i )
6190 if( !isDefault<RF>( m(i,j) ) )
return false;
6216 template<
typename Type
6222 return m.isIntact();
6235 template<
typename Type
6256 template<
typename T,
size_t M,
size_t N,
bool SO >
6257 struct Size< StaticMatrix<T,M,N,SO>, 0UL >
6261 template<
typename T,
size_t M,
size_t N,
bool SO >
6262 struct Size< StaticMatrix<T,M,N,SO>, 1UL >
6279 template<
typename T,
size_t M,
size_t N,
bool SO >
6280 struct MaxSize< StaticMatrix<T,M,N,SO>, 0UL >
6284 template<
typename T,
size_t M,
size_t N,
bool SO >
6285 struct MaxSize< StaticMatrix<T,M,N,SO>, 1UL >
6302 template<
typename T,
size_t N,
bool SO >
6303 struct IsSquare< StaticMatrix<T,N,N,SO> >
6320 template<
typename T,
size_t M,
size_t N,
bool SO >
6321 struct HasConstDataAccess< StaticMatrix<T,M,N,SO> >
6338 template<
typename T,
size_t M,
size_t N,
bool SO >
6339 struct HasMutableDataAccess< StaticMatrix<T,M,N,SO> >
6356 template<
typename T,
size_t M,
size_t N,
bool SO >
6357 struct IsStatic< StaticMatrix<T,M,N,SO> >
6374 template<
typename T,
size_t M,
size_t N,
bool SO >
6375 struct IsAligned< StaticMatrix<T,M,N,SO> >
6376 :
public BoolConstant< StaticMatrix<T,M,N,SO>::isAligned() >
6392 template<
typename T,
size_t M,
size_t N,
bool SO >
6393 struct IsContiguous< StaticMatrix<T,M,N,SO> >
6410 template<
typename T,
size_t M,
size_t N,
bool SO >
6411 struct IsPadded< StaticMatrix<T,M,N,SO> >
6428 template<
typename T1,
typename T2 >
6429 struct AddTraitEval2< T1, T2
6437 using ET1 = ElementType_t<T1>;
6438 using ET2 = ElementType_t<T2>;
6440 static constexpr
size_t M =
max( Size_v<T1,0UL>, Size_v<T2,0UL> );
6441 static constexpr
size_t N =
max( Size_v<T1,1UL>, Size_v<T2,1UL> );
6443 static constexpr
bool SO1 = StorageOrder_v<T1>;
6444 static constexpr
bool SO2 = StorageOrder_v<T2>;
6446 static constexpr
bool SO = ( IsDenseMatrix_v<T1> && IsDenseMatrix_v<T2>
6447 ? ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
6448 ? ( IsSymmetric_v<T1>
6456 using Type = StaticMatrix< AddTrait_t<ET1,ET2>, M, N, SO >;
6472 template<
typename T1,
typename T2 >
6473 struct SubTraitEval2< T1, T2
6481 using ET1 = ElementType_t<T1>;
6482 using ET2 = ElementType_t<T2>;
6484 static constexpr
size_t M =
max( Size_v<T1,0UL>, Size_v<T2,0UL> );
6485 static constexpr
size_t N =
max( Size_v<T1,1UL>, Size_v<T2,1UL> );
6487 static constexpr
bool SO1 = StorageOrder_v<T1>;
6488 static constexpr
bool SO2 = StorageOrder_v<T2>;
6490 static constexpr
bool SO = ( IsDenseMatrix_v<T1> && IsDenseMatrix_v<T2>
6491 ? ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
6492 ? ( IsSymmetric_v<T1>
6500 using Type = StaticMatrix< SubTrait_t<ET1,ET2>, M, N, SO >;
6516 template<
typename T1,
typename T2 >
6517 struct SchurTraitEval2< T1, T2
6519 IsDenseMatrix_v<T2> &&
6525 using ET1 = ElementType_t<T1>;
6526 using ET2 = ElementType_t<T2>;
6528 static constexpr
size_t M =
max( Size_v<T1,0UL>, Size_v<T2,0UL> );
6529 static constexpr
size_t N =
max( Size_v<T1,1UL>, Size_v<T2,1UL> );
6531 static constexpr
bool SO1 = StorageOrder_v<T1>;
6532 static constexpr
bool SO2 = StorageOrder_v<T2>;
6534 static constexpr
bool SO = ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
6535 ? ( IsSymmetric_v<T1>
6540 using Type = StaticMatrix< MultTrait_t<ET1,ET2>, M, N, SO >;
6556 template<
typename T1,
typename T2 >
6557 struct MultTraitEval2< T1, T2
6563 using ET1 = ElementType_t<T1>;
6565 static constexpr
size_t M = Size_v<T1,0UL>;
6566 static constexpr
size_t N = Size_v<T1,1UL>;
6568 using Type = StaticMatrix< MultTrait_t<ET1,T2>, M, N, StorageOrder_v<T1> >;
6571 template<
typename T1,
typename T2 >
6572 struct MultTraitEval2< T1, T2
6578 using ET2 = ElementType_t<T2>;
6580 static constexpr
size_t M = Size_v<T2,0UL>;
6581 static constexpr
size_t N = Size_v<T2,1UL>;
6583 using Type = StaticMatrix< MultTrait_t<T1,ET2>, M, N, StorageOrder_v<T2> >;
6586 template<
typename T1,
typename T2 >
6587 struct MultTraitEval2< T1, T2
6589 IsRowVector_v<T2> &&
6593 using ET1 = ElementType_t<T1>;
6594 using ET2 = ElementType_t<T2>;
6596 static constexpr
size_t M = Size_v<T1,0UL>;
6597 static constexpr
size_t N = Size_v<T2,0UL>;
6599 using Type = StaticMatrix< MultTrait_t<ET1,ET2>, M, N,
false >;
6602 template<
typename T1,
typename T2 >
6603 struct MultTraitEval2< T1, T2
6611 using ET1 = ElementType_t<T1>;
6612 using ET2 = ElementType_t<T2>;
6614 static constexpr
size_t M = ( Size_v<T1,0UL> !=
DefaultSize_v ? Size_v<T1,0UL> : Size_v<T2,0UL> );
6615 static constexpr
size_t N = ( Size_v<T2,1UL> !=
DefaultSize_v ? Size_v<T2,1UL> : Size_v<T1,1UL> );
6617 static constexpr
bool SO = ( IsSparseMatrix_v<T1> ? StorageOrder_v<T2> : StorageOrder_v<T1> );
6619 using Type = StaticMatrix< MultTrait_t<ET1,ET2>, M, N, SO >;
6635 template<
typename T1,
typename T2 >
6636 struct KronTraitEval2< T1, T2
6638 IsDenseMatrix_v<T2> &&
6644 using ET1 = ElementType_t<T1>;
6645 using ET2 = ElementType_t<T2>;
6647 static constexpr
size_t M = Size_v<T1,0UL> * Size_v<T2,0UL>;
6648 static constexpr
size_t N = Size_v<T1,1UL> * Size_v<T2,1UL>;
6650 using Type = StaticMatrix< MultTrait_t<ET1,ET2>, M, N, StorageOrder_v<T2> >;
6666 template<
typename T1,
typename T2 >
6667 struct DivTraitEval2< T1, T2
6673 using ET1 = ElementType_t<T1>;
6675 static constexpr
size_t M = Size_v<T1,0UL>;
6676 static constexpr
size_t N = Size_v<T1,1UL>;
6678 using Type = StaticMatrix< DivTrait_t<ET1,T2>, M, N, StorageOrder_v<T1> >;
6694 template<
typename T,
typename OP >
6695 struct UnaryMapTraitEval2< T, OP
6700 using ET = ElementType_t<T>;
6702 using Type = StaticMatrix< MapTrait_t<ET,OP>, Size_v<T,0UL>, Size_v<T,1UL>, StorageOrder_v<T> >;
6710 template<
typename T1,
typename T2,
typename OP >
6711 struct BinaryMapTraitEval2< T1, T2, OP
6719 using ET1 = ElementType_t<T1>;
6720 using ET2 = ElementType_t<T2>;
6722 static constexpr
size_t M =
max( Size_v<T1,0UL>, Size_v<T2,0UL> );
6723 static constexpr
size_t N =
max( Size_v<T1,1UL>, Size_v<T2,1UL> );
6725 static constexpr
bool SO1 = StorageOrder_v<T1>;
6726 static constexpr
bool SO2 = StorageOrder_v<T2>;
6728 static constexpr
bool SO = ( IsDenseMatrix_v<T1> && IsDenseMatrix_v<T2>
6729 ? ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
6730 ? ( IsSymmetric_v<T1>
6738 using Type = StaticMatrix< MapTrait_t<ET1,ET2,OP>, M, N, SO >;
6754 template<
typename T
6756 struct ExpandTraitEval2< T, E
6761 static constexpr
size_t M = ( IsColumnVector_v<T> ? Size_v<T,0UL> : E );
6762 static constexpr
size_t N = ( IsColumnVector_v<T> ? E : Size_v<T,0UL> );
6766 using Type = StaticMatrix< ElementType_t<T>, M, N, TF >;
6782 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6783 struct HighType< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
6785 using Type = StaticMatrix< typename HighType<T1,T2>::Type, M, N, SO >;
6801 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6802 struct LowType< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
6804 using Type = StaticMatrix< typename LowType<T1,T2>::Type, M, N, SO >;
6820 template<
typename MT,
size_t I,
size_t J,
size_t M,
size_t N >
6821 struct SubmatrixTraitEval2< MT, I, J, M, N
6823 IsDenseMatrix_v<MT> > >
6825 using Type = StaticMatrix< RemoveConst_t< ElementType_t<MT> >, M, N, StorageOrder_v<MT> >;
6841 template<
typename MT,
size_t M >
6842 struct RowsTraitEval2< MT, M
6844 IsDenseMatrix_v<MT> &&
6847 using Type = StaticMatrix< RemoveConst_t< ElementType_t<MT> >, M, Size_v<MT,1UL>,
false >;
6863 template<
typename MT,
size_t N >
6864 struct ColumnsTraitEval2< MT, N
6866 IsDenseMatrix_v<MT> &&
6869 using Type = StaticMatrix< RemoveConst_t< ElementType_t<MT> >, Size_v<MT,0UL>, N,
true >;
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,...
Definition: Const.h:79
BoolConstant< false > FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: IntegralConstant.h:121
#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.
Headerfile for the generic min algorithm.
Header file for the Schur product trait.
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.The IsMatrix_v variable template provides a c...
Definition: IsMatrix.h:138
Header file for the nextMultiple shim.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression,...
Definition: Assert.h:117
Header file for the AlignmentOf type trait.
static constexpr bool simdEnabled
Compilation flag for SIMD optimization.
Definition: StaticMatrix.h:284
Header file for the subtraction trait.
Header file for basic type definitions.
constexpr StaticMatrix & operator=(const Type &set)
Homogenous assignment to all matrix elements.
Definition: StaticMatrix.h:1261
IntegralConstant< ptrdiff_t, N > Ptrdiff_t
Compile time integral constant wrapper for ptrdiff_t.The Ptrdiff_t alias template represents an integ...
Definition: IntegralConstant.h:237
constexpr Reference operator()(size_t i, size_t j) noexcept
2D-access to the matrix elements.
Definition: StaticMatrix.h:918
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.The IsSIMDCombinable_v variable templ...
Definition: IsSIMDCombinable.h:137
Header file for the IsSparseMatrix type trait.
Header file for the serial shim.
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: StaticMatrix.h:2525
Header file for the IsDiagonal type trait.
StaticMatrix()
The default constructor for StaticMatrix.
Definition: StaticMatrix.h:596
constexpr void reset()
Reset to the default initial values.
Definition: StaticMatrix.h:1757
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:72
Header file for the IsSame and IsStrictlySame type traits.
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
static constexpr bool isAligned() noexcept
Returns whether the matrix is properly aligned in memory.
Definition: StaticMatrix.h:2289
Header file for the IsColumnMajorMatrix type trait.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
Header file for the IsRowVector type trait.
Resize mechanism to obtain a StaticMatrix with different fixed dimensions.
Definition: StaticMatrix.h:273
typename SIMDTrait< T >::Type SIMDTrait_t
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_t alias declaration provid...
Definition: SIMDTrait.h:315
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t i, size_t j) const noexcept
Unaligned load of a SIMD element of the matrix.
Definition: StaticMatrix.h:2383
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:851
BLAZE_ALWAYS_INLINE void store(size_t i, size_t j, const SIMDType &value) noexcept
Store of a SIMD element of the matrix.
Definition: StaticMatrix.h:2419
Header file for the MAYBE_UNUSED function template.
StaticMatrix< Type, M, N,!SO > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: StaticMatrix.h:243
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type,...
Definition: Volatile.h:79
Type ElementType
Type of the matrix elements.
Definition: StaticMatrix.h:245
BLAZE_ALWAYS_INLINE void cswap(T &a, T &b) noexcept(IsNumeric_v< T >)
Swapping two conjugated values/objects.
Definition: Conjugate.h:195
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.The HasSIMDAdd_v variable template provides...
Definition: HasSIMDAdd.h:187
auto assign(const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedAssign_v< MT > >
Default implementation of the assignment of a dense matrix.
Definition: StaticMatrix.h:2559
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: IntegralConstant.h:132
Header file for all forward declarations of the math module.
Header file for memory allocation and deallocation functionality.
const Type & ConstReference
Reference to a constant matrix value.
Definition: StaticMatrix.h:251
Type & Reference
Reference to a non-constant matrix value.
Definition: StaticMatrix.h:250
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:75
StaticMatrix< Type, N, M,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: StaticMatrix.h:244
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: StaticMatrix.h:290
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
auto addAssign(const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedAddAssign_v< MT > >
Default implementation of the addition assignment of a row-major dense matrix.
Definition: StaticMatrix.h:2690
static constexpr size_t Alignment
Alignment of the data elements.
Definition: StaticMatrix.h:534
Header file for the MaxSize type trait.
static constexpr size_t columns() noexcept
Returns the current number of columns of the matrix.
Definition: StaticMatrix.h:1626
void swap(StaticMatrix< Type, M, N, SO > &a, StaticMatrix< Type, M, N, SO > &b) noexcept
Swapping the contents of two static matrices.
Definition: StaticMatrix.h:6239
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
constexpr bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71
constexpr Iterator end(size_t i) noexcept
Returns an iterator just past the last element of row/column i.
Definition: StaticMatrix.h:1187
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes....
Definition: DenseMatrix.h:81
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes....
Definition: Forward.h:145
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: StaticMatrix.h:2269
Constraint on the data type.
static constexpr size_t NN
Alignment adjustment.
Definition: StaticMatrix.h:232
constexpr bool IsDenseMatrix_v
Auxiliary variable template for the IsDenseMatrix type trait.The IsDenseMatrix_v variable template pr...
Definition: IsDenseMatrix.h:138
Header file for the IsMatrix type trait.
Header file for the SparseMatrix base class.
Header file for the IsSquare type trait.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
constexpr bool columnMajor
Storage order flag for column-major matrices.
Definition: StorageOrder.h:99
Headerfile for the generic max algorithm.
constexpr bool IsRowMajorMatrix_v
Auxiliary variable template for the IsRowMajorMatrix type trait.The IsRowMajorMatrix_v variable templ...
Definition: IsRowMajorMatrix.h:145
Header file for the DisableIf class template.
constexpr bool IsColumnMajorMatrix_v
Auxiliary variable template for the IsColumnMajorMatrix type trait.The IsColumnMajorMatrix_v variable...
Definition: IsColumnMajorMatrix.h:145
DenseIterator< Type, align > Iterator
Iterator over non-constant elements.
Definition: StaticMatrix.h:255
Header file for the LowType type trait.
constexpr ConstIterator cend(size_t i) const noexcept
Returns an iterator just past the last element of row/column i.
Definition: StaticMatrix.h:1235
StaticMatrix & transpose()
In-place transpose of the matrix.
Definition: StaticMatrix.h:1837
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
constexpr ConstIterator cbegin(size_t i) const noexcept
Returns an iterator to the first element of row/column i.
Definition: StaticMatrix.h:1163
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1361
AlignedArray< Type, M *NN, Alignment > AlignedStorage
Type of the aligned storage.
Definition: StaticMatrix.h:538
This ResultType
Result type for expression template evaluations.
Definition: StaticMatrix.h:242
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: StaticMatrix.h:2247
#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
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.The HasSIMDSub_v variable template provides...
Definition: HasSIMDSub.h:187
Header file for the expand trait.
#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.
Efficient implementation of a fixed-sized matrix.The StaticMatrix class template is the representatio...
Definition: Forward.h:60
Header file for the DenseMatrix base class.
DenseIterator< const Type, align > ConstIterator
Iterator over constant elements.
Definition: StaticMatrix.h:256
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: StaticMatrix.h:2450
Header file for the DenseIterator class template.
decltype(auto) inv(const DenseMatrix< MT, SO > &dm)
Calculation of the inverse of the given dense matrix.
Definition: DMatInvExpr.h:423
constexpr Iterator begin(size_t i) noexcept
Returns an iterator to the first element of row/column i.
Definition: StaticMatrix.h:1115
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
Header file for all SIMD functionality.
Constraint on the data type.
StaticMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: StaticMatrix.h:1914
#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,...
Definition: Diagonal.h:79
Header file for the IsLower type trait.
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Compile time check for square matrices.This type trait tests whether or not the given template parame...
Definition: IsSquare.h:87
Header file for the IsAligned type trait.
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:78
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: StaticMatrix.h:967
Header file for the default storage order for all vectors of the Blaze library.
StaticMatrix< Type, NewM, NewN, SO > Other
The type of the other StaticMatrix.
Definition: StaticMatrix.h:274
Header file for the Kron product trait.
void swap(StaticMatrix &m) noexcept
Swapping the contents of two static matrices.
Definition: StaticMatrix.h:1804
#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
AlignedStorage v_
The statically allocated matrix elements.
Definition: StaticMatrix.h:544
Header file for the exception macros of the math module.
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1198
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:438
DenseMatrix< This, SO > BaseType
Base type of this StaticMatrix instance.
Definition: StaticMatrix.h:241
Header file for the IsDenseMatrix type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: StaticMatrix.h:247
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:615
Header file for the IsPadded type trait.
auto subAssign(const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedSubAssign_v< MT > >
Default implementation of the subtraction assignment of a dense matrix.
Definition: StaticMatrix.h:2846
const This & CompositeType
Data type for composite expression templates.
Definition: StaticMatrix.h:248
Header file for the IsVectorizable type trait.
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
Header file for the RemoveConst type trait.
Header file for the IsSIMDCombinable type trait.
#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,...
Definition: Symmetric.h:79
Header file for the HasSIMDMult type trait.
constexpr Pointer data() noexcept
Low-level data access to the matrix elements.
Definition: StaticMatrix.h:1026
BLAZE_ALWAYS_INLINE constexpr auto nextMultiple(T1 value, T2 factor) noexcept
Rounds up an integral value to the next multiple of a given factor.
Definition: NextMultiple.h:68
StaticMatrix< NewType, M, N, SO > Other
The type of the other StaticMatrix.
Definition: StaticMatrix.h:264
BLAZE_ALWAYS_INLINE void conjugate(T &a) noexcept(IsNumeric_v< T >)
In-place conjugation of the given value/object.
Definition: Conjugate.h:120
Header file for run time assertion macros.
Header file for the addition trait.
Header file for the division trait.
constexpr bool isIntact() const noexcept
Returns whether the invariants of the static matrix are intact.
Definition: StaticMatrix.h:2208
Header file for the submatrix trait.
Constraint on the data type.
Header file for the IsContiguous type trait.
Header file for the columns trait.
Constraint on the data type.
auto schurAssign(const DenseMatrix< MT, SO2 > &rhs) -> DisableIf_t< VectorizedSchurAssign_v< MT > >
Default implementation of the Schur product assignment of a dense matrix.
Definition: StaticMatrix.h:3002
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: StaticMatrix.h:1703
Header file for the AlignedArray implementation.
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:295
Header file for the IsStatic type trait.
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: StaticMatrix.h:2488
BLAZE_ALWAYS_INLINE SIMDType load(size_t i, size_t j) const noexcept
Load of a SIMD element of the matrix.
Definition: StaticMatrix.h:2316
#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,...
Definition: Reference.h:79
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:282
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:75
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
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:114
Constraint on the data type.
Constraint on the data type.
Header file for the HasSIMDSub type trait.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
Header file for the HasMutableDataAccess type trait.
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition: Size.h:72
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant alias template represents ...
Definition: IntegralConstant.h:110
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
static constexpr size_t rows() noexcept
Returns the current number of rows of the matrix.
Definition: StaticMatrix.h:1610
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
Header file for the IsDenseVector type trait.
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
SIMDTrait_t< ElementType > SIMDType
SIMD type of the matrix elements.
Definition: StaticMatrix.h:246
Header file for the rows trait.
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:74
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
static constexpr size_t spacing() noexcept
Returns the spacing between the beginning of two rows.
Definition: StaticMatrix.h:1645
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
constexpr size_t AlignmentOf_v
Auxiliary variable template for the AlignmentOf type trait.The AlignmentOf_v variable template provid...
Definition: AlignmentOf.h:238
Header file for the IsRowMajorMatrix type trait.
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: StaticMatrix.h:253
EnableIf_t< IsBuiltin_v< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:224
Header file for the default transpose flag for all vectors of the Blaze library.
Initializer list type of the Blaze library.
static constexpr bool align
Compilation switch for the choice of alignment.
Definition: StaticMatrix.h:235
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.The HasSIMDMult_v variable template provid...
Definition: HasSIMDMult.h:188
Header file for the alignment check function.
Rebind mechanism to obtain a StaticMatrix with different data/element type.
Definition: StaticMatrix.h:263
constexpr bool IsDenseVector_v
Auxiliary variable template for the IsDenseVector type trait.The IsDenseVector_v variable template pr...
Definition: IsDenseVector.h:138
Header file for the StorageOrder type trait.
Header file for the IntegralConstant class template.
constexpr Infinity inf
Global Infinity instance.The blaze::inf instance can be used wherever a built-in data type is expecte...
Definition: Infinity.h:1080
Header file for the map trait.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD vector.
Definition: StaticMatrix.h:229
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
static constexpr size_t capacity() noexcept
Returns the maximum capacity of the matrix.
Definition: StaticMatrix.h:1661
constexpr bool IsColumnVector_v
Auxiliary variable template for the IsColumnVector type trait.The IsColumnVector_v variable template ...
Definition: IsColumnVector.h:142
Type * Pointer
Pointer to a non-constant matrix value.
Definition: StaticMatrix.h:252
Header file for the IsUpper type trait.
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
constexpr bool IsDiagonal_v
Auxiliary variable template for the IsDiagonal type trait.The IsDiagonal_v variable template provides...
Definition: IsDiagonal.h:148
Header file for the IsColumnVector type trait.
#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
BLAZE_ALWAYS_INLINE SIMDType loada(size_t i, size_t j) const noexcept
Aligned load of a SIMD element of the matrix.
Definition: StaticMatrix.h:2346
StaticMatrix< Type, M, N, SO > This
Type of this StaticMatrix instance.
Definition: StaticMatrix.h:240
System settings for the inline keywords.
Header file for the Size type trait.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101
constexpr size_t determineColumns(initializer_list< initializer_list< Type > > list) noexcept
Determines the maximum number of columns specified by the given initializer list.
Definition: InitializerList.h:108
Header file for the HighType type trait.
Header file for the clear shim.
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:825