35 #ifndef _BLAZE_MATH_DENSE_STATICMATRIX_H_ 36 #define _BLAZE_MATH_DENSE_STATICMATRIX_H_ 213 template<
typename Type
216 ,
bool SO = defaultStorageOrder >
218 :
public DenseMatrix< StaticMatrix<Type,M,N,SO>, SO >
244 template<
typename NewType >
253 template<
size_t NewM
272 enum :
bool { smpAssignable =
false };
282 template<
typename Other >
285 template<
typename Other,
size_t Rows,
size_t Cols >
321 inline StaticMatrix&
operator=(
const Type&
set );
324 template<
typename Other,
size_t Rows,
size_t Cols >
327 inline StaticMatrix&
operator= (
const StaticMatrix& rhs );
332 template<
typename MT ,
bool SO2 >
inline StaticMatrix& operator%=(
const Matrix<MT,SO2>& rhs );
335 template<
typename Other >
338 template<
typename Other >
346 inline constexpr
size_t rows()
const noexcept;
347 inline constexpr
size_t columns()
const noexcept;
348 inline constexpr
size_t spacing()
const noexcept;
349 inline constexpr
size_t capacity()
const noexcept;
350 inline size_t capacity(
size_t i )
const noexcept;
352 inline size_t nonZeros(
size_t i )
const;
354 inline void reset(
size_t i );
355 inline void swap( StaticMatrix& m ) noexcept;
365 template<
typename Other >
inline StaticMatrix& scale(
const Other& scalar );
372 static inline void*
operator new ( std::size_t
size );
373 static inline void*
operator new[]( std::size_t
size );
374 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
375 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
377 static inline void operator delete (
void* ptr );
378 static inline void operator delete[](
void* ptr );
379 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
380 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
387 template<
typename MT >
389 struct VectorizedAssign {
390 enum :
bool { value = useOptimizedKernels &&
391 simdEnabled && MT::simdEnabled &&
400 template<
typename MT >
402 struct VectorizedAddAssign {
403 enum :
bool { value = useOptimizedKernels &&
404 simdEnabled && MT::simdEnabled &&
415 template<
typename MT >
417 struct VectorizedSubAssign {
418 enum :
bool { value = useOptimizedKernels &&
419 simdEnabled && MT::simdEnabled &&
430 template<
typename MT >
432 struct VectorizedSchurAssign {
433 enum :
bool { value = useOptimizedKernels &&
434 simdEnabled && MT::simdEnabled &&
451 inline bool isIntact()
const noexcept;
458 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
459 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
472 template<
typename MT,
bool SO2 >
475 template<
typename MT,
bool SO2 >
481 template<
typename MT,
bool SO2 >
484 template<
typename MT,
bool SO2 >
490 template<
typename MT,
bool SO2 >
493 template<
typename MT,
bool SO2 >
499 template<
typename MT,
bool SO2 >
502 template<
typename MT,
bool SO2 >
522 enum :
size_t { NN = ( usePadding )?(
nextMultiple( N, SIMDSIZE ) ):( N ) };
568 template<
typename Type
578 for(
size_t i=0UL; i<M*NN; ++i )
592 template<
typename Type
601 for(
size_t i=0UL; i<M; ++i ) {
602 for(
size_t j=0UL; j<N; ++j )
605 for(
size_t j=N; j<NN; ++j )
636 template<
typename Type
651 for(
const auto& rowList : list ) {
652 std::fill( std::copy( rowList.begin(), rowList.end(),
v_+i*NN ),
v_+(i+1UL)*NN, Type() );
687 template<
typename Type
691 template<
typename Other >
697 if( m > M || n > N ) {
701 for(
size_t i=0UL; i<m; ++i ) {
702 for(
size_t j=0UL; j<n; ++j )
703 v_[i*NN+j] = array[i*n+j];
706 for(
size_t j=n; j<NN; ++j )
712 for(
size_t i=m; i<M; ++i ) {
713 for(
size_t j=0UL; j<NN; ++j )
743 template<
typename Type
747 template<
typename Other
756 for(
size_t i=0UL; i<M; ++i ) {
757 for(
size_t j=0UL; j<N; ++j )
758 v_[i*NN+j] = array[i][j];
760 for(
size_t j=N; j<NN; ++j )
776 template<
typename Type
785 for(
size_t i=0UL; i<M*NN; ++i )
798 template<
typename Type
802 template<
typename Other
809 for(
size_t i=0UL; i<M; ++i ) {
810 for(
size_t j=0UL; j<N; ++j )
813 for(
size_t j=N; j<NN; ++j )
832 template<
typename Type
836 template<
typename MT
849 for(
size_t i=0UL; i<M; ++i ) {
880 template<
typename Type
904 template<
typename Type
929 template<
typename Type
958 template<
typename Type
988 template<
typename Type
1012 template<
typename Type
1032 template<
typename Type
1053 template<
typename Type
1077 template<
typename Type
1101 template<
typename Type
1125 template<
typename Type
1149 template<
typename Type
1173 template<
typename Type
1197 template<
typename Type
1224 template<
typename Type
1230 for(
size_t i=0UL; i<M; ++i )
1231 for(
size_t j=0UL; j<N; ++j )
1262 template<
typename Type
1275 for(
const auto& rowList : list ) {
1276 std::fill( std::copy( rowList.begin(), rowList.end(),
v_+i*NN ),
v_+(i+1UL)*NN, Type() );
1306 template<
typename Type
1310 template<
typename Other
1317 for(
size_t i=0UL; i<M; ++i )
1318 for(
size_t j=0UL; j<N; ++j )
1319 v_[i*NN+j] = array[i][j];
1334 template<
typename Type
1340 using blaze::assign;
1342 assign( *
this, ~rhs );
1357 template<
typename Type
1361 template<
typename Other
1366 using blaze::assign;
1368 assign( *
this, ~rhs );
1388 template<
typename Type
1392 template<
typename MT
1396 using blaze::assign;
1402 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
1414 assign( *
this, tmp );
1419 assign( *
this, ~rhs );
1439 template<
typename Type
1443 template<
typename MT
1447 using blaze::addAssign;
1449 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
1455 addAssign( *
this, tmp );
1458 addAssign( *
this, ~rhs );
1478 template<
typename Type
1482 template<
typename MT
1486 using blaze::subAssign;
1488 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
1494 subAssign( *
this, tmp );
1497 subAssign( *
this, ~rhs );
1517 template<
typename Type
1521 template<
typename MT
1525 using blaze::schurAssign;
1527 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
1533 schurAssign( *
this, tmp );
1536 schurAssign( *
this, ~rhs );
1556 template<
typename Type
1560 template<
typename MT
1564 using blaze::assign;
1566 if( M != N || (~rhs).
rows() != M || (~rhs).
columns() != N ) {
1571 assign( *
this, tmp );
1587 template<
typename Type
1591 template<
typename Other >
1595 using blaze::assign;
1597 assign( *
this, (*
this) * rhs );
1615 template<
typename Type
1619 template<
typename Other >
1623 using blaze::assign;
1627 assign( *
this, (*
this) / rhs );
1649 template<
typename Type
1665 template<
typename Type
1684 template<
typename Type
1700 template<
typename Type
1722 template<
typename Type
1742 template<
typename Type
1748 size_t nonzeros( 0UL );
1750 for(
size_t i=0UL; i<M; ++i )
1751 for(
size_t j=0UL; j<N; ++j )
1771 template<
typename Type
1779 const size_t jend( i*NN + N );
1780 size_t nonzeros( 0UL );
1782 for(
size_t j=i*NN; j<jend; ++j )
1796 template<
typename Type
1804 for(
size_t i=0UL; i<M; ++i )
1805 for(
size_t j=0UL; j<N; ++j )
1822 template<
typename Type
1831 for(
size_t j=0UL; j<N; ++j )
1843 template<
typename Type
1851 for(
size_t i=0UL; i<M; ++i ) {
1852 for(
size_t j=0UL; j<N; ++j ) {
1853 swap(
v_[i*NN+j], m(i,j) );
1876 template<
typename Type
1886 for(
size_t i=1UL; i<M; ++i )
1887 for(
size_t j=0UL; j<i; ++j )
1909 template<
typename Type
1935 template<
typename Type
1953 template<
typename Type
1961 for(
size_t i=0UL; i<M; ++i ) {
1962 for(
size_t j=0UL; j<i; ++j ) {
1987 template<
typename Type
2013 template<
typename Type
2040 template<
typename Type
2044 template<
typename Other >
2047 for(
size_t i=0UL; i<M; ++i )
2048 for(
size_t j=0UL; j<N; ++j )
2049 v_[i*NN+j] *= scalar;
2074 template<
typename Type
2084 return allocate<StaticMatrix>( 1UL );
2099 template<
typename Type
2123 template<
typename Type
2133 return allocate<StaticMatrix>( 1UL );
2148 template<
typename Type
2157 return allocate<StaticMatrix>( size/
sizeof(
StaticMatrix) );
2168 template<
typename Type
2174 deallocate( static_cast<StaticMatrix*>( ptr ) );
2185 template<
typename Type
2191 deallocate( static_cast<StaticMatrix*>( ptr ) );
2202 template<
typename Type
2208 deallocate( static_cast<StaticMatrix*>( ptr ) );
2219 template<
typename Type
2225 deallocate( static_cast<StaticMatrix*>( ptr ) );
2247 template<
typename Type
2254 for(
size_t i=0UL; i<M; ++i ) {
2255 for(
size_t j=N; j<NN; ++j ) {
2256 if(
v_[i*NN+j] != Type() )
2285 template<
typename Type
2289 template<
typename Other >
2292 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2307 template<
typename Type
2311 template<
typename Other >
2314 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2328 template<
typename Type
2334 return ( usePadding ||
columns() % SIMDSIZE == 0UL );
2354 template<
typename Type
2362 return loada( i, j );
2364 return loadu( i, j );
2384 template<
typename Type
2421 template<
typename Type
2457 template<
typename Type
2488 template<
typename Type
2526 template<
typename Type
2563 template<
typename Type
2596 template<
typename Type
2600 template<
typename MT
2607 for(
size_t i=0UL; i<M; ++i ) {
2608 for(
size_t j=0UL; j<N; ++j ) {
2609 v_[i*NN+j] = (~rhs)(i,j);
2627 template<
typename Type
2631 template<
typename MT
2642 const size_t jpos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2643 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2645 for(
size_t i=0UL; i<M; ++i )
2649 for( ; j<jpos; j+=SIMDSIZE ) {
2652 for( ; remainder && j<N; ++j ) {
2653 v_[i*NN+j] = (~rhs)(i,j);
2671 template<
typename Type
2675 template<
typename MT >
2680 for(
size_t i=0UL; i<M; ++i )
2682 v_[i*NN+element->index()] = element->value();
2698 template<
typename Type
2702 template<
typename MT >
2709 for(
size_t j=0UL; j<N; ++j )
2711 v_[element->index()*NN+j] = element->value();
2727 template<
typename Type
2731 template<
typename MT
2738 for(
size_t i=0UL; i<M; ++i )
2742 v_[i*NN+i] += (~rhs)(i,i);
2754 for(
size_t j=jbegin; j<jend; ++j ) {
2755 v_[i*NN+j] += (~rhs)(i,j);
2774 template<
typename Type
2778 template<
typename MT
2790 for(
size_t i=0UL; i<M; ++i )
2800 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
2801 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2805 for( ; j<jpos; j+=SIMDSIZE ) {
2808 for( ; remainder && j<jend; ++j ) {
2809 v_[i*NN+j] += (~rhs)(i,j);
2827 template<
typename Type
2831 template<
typename MT >
2836 for(
size_t i=0UL; i<M; ++i )
2838 v_[i*NN+element->index()] += element->value();
2854 template<
typename Type
2858 template<
typename MT >
2865 for(
size_t j=0UL; j<N; ++j )
2867 v_[element->index()*NN+j] += element->value();
2883 template<
typename Type
2887 template<
typename MT
2894 for(
size_t i=0UL; i<M; ++i )
2898 v_[i*NN+i] -= (~rhs)(i,i);
2910 for(
size_t j=jbegin; j<jend; ++j ) {
2911 v_[i*NN+j] -= (~rhs)(i,j);
2930 template<
typename Type
2934 template<
typename MT
2946 for(
size_t i=0UL; i<M; ++i )
2956 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
2957 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2961 for( ; j<jpos; j+=SIMDSIZE ) {
2964 for( ; remainder && j<jend; ++j ) {
2965 v_[i*NN+j] -= (~rhs)(i,j);
2983 template<
typename Type
2987 template<
typename MT >
2992 for(
size_t i=0UL; i<M; ++i )
2994 v_[i*NN+element->index()] -= element->value();
3010 template<
typename Type
3014 template<
typename MT >
3021 for(
size_t j=0UL; j<N; ++j )
3023 v_[element->index()*NN+j] -= element->value();
3039 template<
typename Type
3043 template<
typename MT
3050 for(
size_t i=0UL; i<M; ++i ) {
3051 for(
size_t j=0UL; j<N; ++j ) {
3052 v_[i*NN+j] *= (~rhs)(i,j);
3070 template<
typename Type
3074 template<
typename MT
3085 for(
size_t i=0UL; i<M; ++i )
3087 const size_t jpos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
3088 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
3092 for( ; j<jpos; j+=SIMDSIZE ) {
3095 for( ; remainder && j<N; ++j ) {
3096 v_[i*NN+j] *= (~rhs)(i,j);
3114 template<
typename Type
3118 template<
typename MT >
3127 for(
size_t i=0UL; i<M; ++i )
3129 v_[i*NN+element->index()] = tmp.v_[i*NN+element->index()] * element->value();
3145 template<
typename Type
3149 template<
typename MT >
3160 for(
size_t j=0UL; j<N; ++j )
3162 v_[element->index()*NN+j] = tmp.v_[element->index()*NN+j] * element->value();
3187 template<
typename Type
3191 :
public DenseMatrix< StaticMatrix<Type,M,N,true>, true >
3217 template<
typename NewType >
3226 template<
size_t NewM
3245 enum :
bool { smpAssignable =
false };
3255 template<
typename Other >
3256 explicit inline StaticMatrix(
size_t m,
size_t n,
const Other* array );
3258 template<
typename Other,
size_t Rows,
size_t Cols >
3259 explicit inline StaticMatrix(
const Other (&array)[Rows][Cols] );
3294 inline StaticMatrix&
operator=(
const Type&
set );
3297 template<
typename Other,
size_t Rows,
size_t Cols >
3298 inline StaticMatrix&
operator=(
const Other (&array)[Rows][Cols] );
3300 inline StaticMatrix&
operator= (
const StaticMatrix& rhs );
3305 template<
typename MT ,
bool SO >
inline StaticMatrix& operator%=(
const Matrix<MT,SO>& rhs );
3308 template<
typename Other >
3309 inline EnableIf_<IsNumeric<Other>, StaticMatrix >& operator*=( Other rhs );
3311 template<
typename Other >
3312 inline EnableIf_<IsNumeric<Other>, StaticMatrix >&
operator/=( Other rhs );
3319 inline constexpr
size_t rows()
const noexcept;
3320 inline constexpr
size_t columns()
const noexcept;
3321 inline constexpr
size_t spacing()
const noexcept;
3322 inline constexpr
size_t capacity()
const noexcept;
3323 inline size_t capacity(
size_t j )
const noexcept;
3325 inline size_t nonZeros(
size_t j )
const;
3326 inline void reset();
3327 inline void reset(
size_t i );
3328 inline void swap( StaticMatrix& m ) noexcept;
3338 template<
typename Other >
inline StaticMatrix& scale(
const Other& scalar );
3345 static inline void*
operator new ( std::size_t
size );
3346 static inline void*
operator new[]( std::size_t
size );
3347 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
3348 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
3350 static inline void operator delete (
void* ptr );
3351 static inline void operator delete[](
void* ptr );
3352 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
3353 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
3360 template<
typename MT >
3361 struct VectorizedAssign {
3362 enum :
bool { value = useOptimizedKernels &&
3363 simdEnabled && MT::simdEnabled &&
3371 template<
typename MT >
3372 struct VectorizedAddAssign {
3373 enum :
bool { value = useOptimizedKernels &&
3374 simdEnabled && MT::simdEnabled &&
3384 template<
typename MT >
3385 struct VectorizedSubAssign {
3386 enum :
bool { value = useOptimizedKernels &&
3387 simdEnabled && MT::simdEnabled &&
3397 template<
typename MT >
3398 struct VectorizedSchurAssign {
3399 enum :
bool { value = useOptimizedKernels &&
3400 simdEnabled && MT::simdEnabled &&
3416 inline bool isIntact()
const noexcept;
3423 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
3424 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
3437 template<
typename MT,
bool SO >
3440 template<
typename MT,
bool SO >
3446 template<
typename MT,
bool SO >
3449 template<
typename MT,
bool SO >
3455 template<
typename MT,
bool SO >
3458 template<
typename MT,
bool SO >
3464 template<
typename MT,
bool SO >
3467 template<
typename MT,
bool SO >
3485 enum :
size_t { MM = ( usePadding )?(
nextMultiple( M, SIMDSIZE ) ):( M ) };
3524 template<
typename Type
3533 for(
size_t i=0UL; i<MM*N; ++i )
3549 template<
typename Type
3557 for(
size_t j=0UL; j<N; ++j ) {
3558 for(
size_t i=0UL; i<M; ++i )
3561 for(
size_t i=M; i<MM; ++i )
3562 v_[i+j*MM] = Type();
3594 template<
typename Type
3608 for(
const auto& rowList : list ) {
3610 for(
const auto& element : rowList ) {
3611 v_[i+j*MM] = element;
3615 v_[i+j*MM] = Type();
3623 for( ; i<MM; ++i ) {
3624 for(
size_t j=0UL; j<N; ++j ) {
3625 v_[i+j*MM] = Type();
3663 template<
typename Type
3666 template<
typename Other >
3672 if( m > M || n > N ) {
3676 for(
size_t j=0UL; j<n; ++j ) {
3677 for(
size_t i=0UL; i<m; ++i )
3678 v_[i+j*MM] = array[i+j*m];
3681 for(
size_t i=m; i<MM; ++i )
3682 v_[i+j*MM] = Type();
3687 for(
size_t j=n; j<N; ++j ) {
3688 for(
size_t i=0UL; i<M; ++i )
3689 v_[i+j*MM] = Type();
3720 template<
typename Type
3723 template<
typename Other
3732 for(
size_t j=0UL; j<N; ++j ) {
3733 for(
size_t i=0UL; i<M; ++i )
3734 v_[i+j*MM] = array[i][j];
3736 for(
size_t i=M; i<MM; ++i )
3737 v_[i+j*MM] = Type();
3754 template<
typename Type
3762 for(
size_t i=0UL; i<MM*N; ++i )
3777 template<
typename Type
3780 template<
typename Other
3787 for(
size_t j=0UL; j<N; ++j ) {
3788 for(
size_t i=0UL; i<M; ++i )
3789 v_[i+j*MM] = m(i,j);
3791 for(
size_t i=M; i<MM; ++i )
3792 v_[i+j*MM] = Type();
3812 template<
typename Type
3815 template<
typename MT
3820 using blaze::assign;
3828 for(
size_t j=0UL; j<N; ++j ) {
3830 v_[i+j*MM] = Type();
3834 assign( *
this, ~m );
3861 template<
typename Type
3886 template<
typename Type
3912 template<
typename Type
3924 return (*
this)(i,j);
3942 template<
typename Type
3954 return (*
this)(i,j);
3972 template<
typename Type
3996 template<
typename Type
4017 template<
typename Type
4039 template<
typename Type
4059 template<
typename Type
4079 template<
typename Type
4099 template<
typename Type
4119 template<
typename Type
4139 template<
typename Type
4159 template<
typename Type
4187 template<
typename Type
4193 for(
size_t j=0UL; j<N; ++j )
4194 for(
size_t i=0UL; i<M; ++i )
4227 template<
typename Type
4239 for(
const auto& rowList : list ) {
4241 for(
const auto& element : rowList ) {
4242 v_[i+j*MM] = element;
4246 v_[i+j*MM] = Type();
4279 template<
typename Type
4282 template<
typename Other
4290 for(
size_t j=0UL; j<N; ++j )
4291 for(
size_t i=0UL; i<M; ++i )
4292 v_[i+j*MM] = array[i][j];
4309 template<
typename Type
4315 using blaze::assign;
4317 assign( *
this, ~rhs );
4334 template<
typename Type
4337 template<
typename Other
4342 using blaze::assign;
4344 assign( *
this, ~rhs );
4366 template<
typename Type
4369 template<
typename MT
4373 using blaze::assign;
4379 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
4391 assign( *
this, tmp );
4396 assign( *
this, ~rhs );
4418 template<
typename Type
4421 template<
typename MT
4425 using blaze::addAssign;
4427 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
4433 addAssign( *
this, tmp );
4436 addAssign( *
this, ~rhs );
4458 template<
typename Type
4461 template<
typename MT
4465 using blaze::subAssign;
4467 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
4473 subAssign( *
this, tmp );
4476 subAssign( *
this, ~rhs );
4498 template<
typename Type
4501 template<
typename MT
4505 using blaze::schurAssign;
4507 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
4513 schurAssign( *
this, tmp );
4516 schurAssign( *
this, ~rhs );
4538 template<
typename Type
4541 template<
typename MT
4545 using blaze::assign;
4547 if( M != N || (~rhs).
rows() != M || (~rhs).
columns() != N ) {
4552 assign( *
this, tmp );
4570 template<
typename Type
4573 template<
typename Other >
4577 using blaze::assign;
4579 assign( *
this, (*
this) * rhs );
4599 template<
typename Type
4602 template<
typename Other >
4606 using blaze::assign;
4610 assign( *
this, (*
this) / rhs );
4634 template<
typename Type
4651 template<
typename Type
4671 template<
typename Type
4688 template<
typename Type
4706 template<
typename Type
4727 template<
typename Type
4732 size_t nonzeros( 0UL );
4734 for(
size_t j=0UL; j<N; ++j )
4735 for(
size_t i=0UL; i<M; ++i )
4752 template<
typename Type
4759 const size_t iend( j*MM + M );
4760 size_t nonzeros( 0UL );
4762 for(
size_t i=j*MM; i<iend; ++i )
4778 template<
typename Type
4785 for(
size_t j=0UL; j<N; ++j )
4786 for(
size_t i=0UL; i<M; ++i )
4803 template<
typename Type
4811 for(
size_t i=0UL; i<M; ++i )
4825 template<
typename Type
4832 for(
size_t j=0UL; j<N; ++j ) {
4833 for(
size_t i=0UL; i<M; ++i ) {
4834 swap(
v_[i+j*MM], m(i,j) );
4859 template<
typename Type
4868 for(
size_t j=1UL; j<N; ++j )
4869 for(
size_t i=0UL; i<j; ++i )
4892 template<
typename Type
4917 template<
typename Type
4935 template<
typename Type
4942 for(
size_t j=0UL; j<N; ++j ) {
4943 for(
size_t i=0UL; i<j; ++i ) {
4969 template<
typename Type
4994 template<
typename Type
5021 template<
typename Type
5024 template<
typename Other >
5028 for(
size_t j=0UL; j<N; ++j )
5029 for(
size_t i=0UL; i<M; ++i )
5030 v_[i+j*MM] *= scalar;
5057 template<
typename Type
5066 return allocate<StaticMatrix>( 1UL );
5083 template<
typename Type
5091 return allocate<StaticMatrix>( size/
sizeof(
StaticMatrix) );
5108 template<
typename Type
5117 return allocate<StaticMatrix>( 1UL );
5134 template<
typename Type
5142 return allocate<StaticMatrix>( size/
sizeof(
StaticMatrix) );
5155 template<
typename Type
5160 deallocate( static_cast<StaticMatrix*>( ptr ) );
5173 template<
typename Type
5178 deallocate( static_cast<StaticMatrix*>( ptr ) );
5191 template<
typename Type
5196 deallocate( static_cast<StaticMatrix*>( ptr ) );
5209 template<
typename Type
5214 deallocate( static_cast<StaticMatrix*>( ptr ) );
5238 template<
typename Type
5244 for(
size_t j=0UL; j<N; ++j ) {
5245 for(
size_t i=M; i<MM; ++i ) {
5246 if(
v_[i+j*MM] != Type() )
5277 template<
typename Type
5280 template<
typename Other >
5283 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5300 template<
typename Type
5303 template<
typename Other >
5306 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5322 template<
typename Type
5327 return ( usePadding ||
rows() % SIMDSIZE == 0UL );
5348 template<
typename Type
5355 return loada( i, j );
5357 return loadu( i, j );
5378 template<
typename Type
5415 template<
typename Type
5451 template<
typename Type
5482 template<
typename Type
5520 template<
typename Type
5557 template<
typename Type
5591 template<
typename Type
5594 template<
typename MT
5601 for(
size_t j=0UL; j<N; ++j ) {
5602 for(
size_t i=0UL; i<M; ++i ) {
5603 v_[i+j*MM] = (~rhs)(i,j);
5623 template<
typename Type
5626 template<
typename MT
5637 const size_t ipos( ( remainder )?( M &
size_t(-SIMDSIZE) ):( M ) );
5638 BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5640 for(
size_t j=0UL; j<N; ++j )
5644 for( ; i<ipos; i+=SIMDSIZE ) {
5647 for( ; remainder && i<M; ++i ) {
5648 v_[i+j*MM] = (~rhs)(i,j);
5668 template<
typename Type
5671 template<
typename MT >
5676 for(
size_t j=0UL; j<N; ++j )
5678 v_[element->index()+j*MM] = element->value();
5696 template<
typename Type
5699 template<
typename MT >
5706 for(
size_t i=0UL; i<M; ++i )
5708 v_[i+element->index()*MM] = element->value();
5726 template<
typename Type
5729 template<
typename MT
5736 for(
size_t j=0UL; j<N; ++j )
5740 v_[j+j*MM] += (~rhs)(j,j);
5752 for(
size_t i=ibegin; i<iend; ++i ) {
5753 v_[i+j*MM] += (~rhs)(i,j);
5774 template<
typename Type
5777 template<
typename MT
5789 for(
size_t j=0UL; j<N; ++j )
5799 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5800 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5804 for( ; i<ipos; i+=SIMDSIZE ) {
5807 for( ; remainder && i<iend; ++i ) {
5808 v_[i+j*MM] += (~rhs)(i,j);
5828 template<
typename Type
5831 template<
typename MT >
5836 for(
size_t j=0UL; j<N; ++j )
5838 v_[element->index()+j*MM] += element->value();
5856 template<
typename Type
5859 template<
typename MT >
5866 for(
size_t i=0UL; i<M; ++i )
5868 v_[i+element->index()*MM] += element->value();
5886 template<
typename Type
5889 template<
typename MT
5896 for(
size_t j=0UL; j<N; ++j )
5900 v_[j+j*MM] -= (~rhs)(j,j);
5912 for(
size_t i=ibegin; i<iend; ++i ) {
5913 v_[i+j*MM] -= (~rhs)(i,j);
5934 template<
typename Type
5937 template<
typename MT
5949 for(
size_t j=0UL; j<N; ++j )
5959 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5960 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5964 for( ; i<ipos; i+=SIMDSIZE ) {
5967 for( ; remainder && i<iend; ++i ) {
5968 v_[i+j*MM] -= (~rhs)(i,j);
5988 template<
typename Type
5991 template<
typename MT >
5996 for(
size_t j=0UL; j<N; ++j )
5998 v_[element->index()+j*MM] -= element->value();
6016 template<
typename Type
6019 template<
typename MT >
6026 for(
size_t i=0UL; i<M; ++i )
6028 v_[i+element->index()*MM] -= element->value();
6046 template<
typename Type
6049 template<
typename MT
6056 for(
size_t j=0UL; j<N; ++j ) {
6057 for(
size_t i=0UL; i<M; ++i ) {
6058 v_[i+j*MM] *= (~rhs)(i,j);
6078 template<
typename Type
6081 template<
typename MT
6092 for(
size_t j=0UL; j<N; ++j )
6094 const size_t ipos( ( remainder )?( M &
size_t(-SIMDSIZE) ):( M ) );
6095 BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
6099 for( ; i<ipos; i+=SIMDSIZE ) {
6102 for( ; remainder && i<M; ++i ) {
6103 v_[i+j*MM] *= (~rhs)(i,j);
6123 template<
typename Type
6126 template<
typename MT >
6135 for(
size_t j=0UL; j<N; ++j )
6137 v_[element->index()+j*MM] = tmp.v_[element->index()+j*MM] * element->value();
6155 template<
typename Type
6158 template<
typename MT >
6169 for(
size_t i=0UL; i<M; ++i )
6171 v_[i+element->index()*MM] = tmp.v_[i+element->index()*MM] * element->value();
6192 template<
typename Type,
size_t M,
size_t N,
bool SO >
6195 template<
typename Type,
size_t M,
size_t N,
bool SO >
6198 template<
typename Type,
size_t M,
size_t N,
bool SO >
6201 template<
bool RF,
typename Type,
size_t M,
size_t N,
bool SO >
6204 template<
typename Type,
size_t M,
size_t N,
bool SO >
6207 template<
typename Type,
size_t M,
size_t N,
bool SO >
6220 template<
typename Type
6244 template<
typename Type
6264 template<
typename Type
6307 for(
size_t i=0UL; i<M; ++i )
6308 for(
size_t j=0UL; j<N; ++j )
6309 if( !isDefault<RF>( m(i,j) ) )
return false;
6312 for(
size_t j=0UL; j<N; ++j )
6313 for(
size_t i=0UL; i<M; ++i )
6314 if( !isDefault<RF>( m(i,j) ) )
return false;
6340 template<
typename Type
6346 return m.isIntact();
6359 template<
typename Type
6380 template<
typename T,
size_t M,
size_t N,
bool SO >
6381 struct Rows< StaticMatrix<T,M,N,SO> >
6398 template<
typename T,
size_t M,
size_t N,
bool SO >
6399 struct Columns< StaticMatrix<T,M,N,SO> >
6416 template<
typename T,
size_t N,
bool SO >
6417 struct IsSquare< StaticMatrix<T,N,N,SO> >
6434 template<
typename T,
size_t M,
size_t N,
bool SO >
6452 template<
typename T,
size_t M,
size_t N,
bool SO >
6470 template<
typename T,
size_t M,
size_t N,
bool SO >
6471 struct IsStatic< StaticMatrix<T,M,N,SO> >
6488 template<
typename T,
size_t M,
size_t N,
bool SO >
6489 struct IsAligned< StaticMatrix<T,M,N,SO> >
6506 template<
typename T,
size_t M,
size_t N,
bool SO >
6507 struct IsPadded< StaticMatrix<T,M,N,SO> >
6524 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6525 struct AddTrait< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
6530 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
6531 struct AddTrait< StaticMatrix<T1,M,N,SO1>, StaticMatrix<T2,M,N,SO2> >
6549 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6550 struct SubTrait< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
6555 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
6556 struct SubTrait< StaticMatrix<T1,M,N,SO1>, StaticMatrix<T2,M,N,SO2> >
6574 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6575 struct SchurTrait< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
6580 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
6581 struct SchurTrait< StaticMatrix<T1,M,N,SO1>, StaticMatrix<T2,M,N,SO2> >
6599 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6600 struct MultTrait< StaticMatrix<T1,M,N,SO>, T2, EnableIf_<IsNumeric<T2> > >
6605 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6606 struct MultTrait< T1, StaticMatrix<T2,M,N,SO>, EnableIf_<IsNumeric<T1> > >
6611 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6612 struct MultTrait< StaticMatrix<T1,M,N,SO>, StaticVector<T2,N,false> >
6617 template<
typename T1,
size_t M,
typename T2,
size_t N,
bool SO >
6618 struct MultTrait< StaticVector<T1,M,true>, StaticMatrix<T2,M,N,SO> >
6623 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
size_t L >
6624 struct MultTrait< StaticMatrix<T1,M,N,SO>, HybridVector<T2,L,false> >
6629 template<
typename T1,
size_t L,
typename T2,
size_t M,
size_t N,
bool SO >
6630 struct MultTrait< HybridVector<T1,L,true>, StaticMatrix<T2,M,N,SO> >
6635 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6636 struct MultTrait< StaticMatrix<T1,M,N,SO>, DynamicVector<T2,false> >
6641 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6642 struct MultTrait< DynamicVector<T1,true>, StaticMatrix<T2,M,N,SO> >
6647 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6648 struct MultTrait< StaticMatrix<T1,M,N,SO>, CustomVector<T2,AF,PF,false> >
6653 template<
typename T1,
bool AF,
bool PF,
typename T2,
size_t M,
size_t N,
bool SO >
6654 struct MultTrait< CustomVector<T1,AF,PF,true>, StaticMatrix<T2,M,N,SO> >
6659 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6660 struct MultTrait< StaticMatrix<T1,M,N,SO>, CompressedVector<T2,false> >
6665 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6666 struct MultTrait< CompressedVector<T1,true>, StaticMatrix<T2,M,N,SO> >
6671 template<
typename T1,
size_t M,
size_t K,
bool SO1,
typename T2,
size_t N,
bool SO2 >
6672 struct MultTrait< StaticMatrix<T1,M,K,SO1>, StaticMatrix<T2,K,N,SO2> >
6690 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6691 struct DivTrait< StaticMatrix<T1,M,N,SO>, T2, EnableIf_<IsNumeric<T2> > >
6709 template<
typename T,
size_t M,
size_t N,
bool SO,
typename OP >
6728 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
typename OP >
6729 struct BinaryMapTrait< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO>, OP >
6734 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2,
typename OP >
6735 struct BinaryMapTrait< StaticMatrix<T1,M,N,SO1>, StaticMatrix<T2,M,N,SO2>, OP >
6753 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6754 struct HighType< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
6772 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6773 struct LowType< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
6791 template<
typename T,
size_t M,
size_t N,
bool SO >
6810 template<
typename T,
size_t M,
size_t N,
bool SO >
6811 struct RowTrait< StaticMatrix<T,M,N,SO> >
6829 template<
typename T,
size_t M,
size_t N,
bool SO >
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:135
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:79
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:79
Availability of a SIMD subtraction for the given data types.Depending on the available instruction se...
Definition: HasSIMDSub.h:171
Header file for mathematical functions.
Header file for the Schur product trait.
constexpr size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: StaticMatrix.h:1653
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
#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 Rows type trait.
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
Header file for basic type definitions.
Header file for the row trait.
Base template for the SubmatrixTrait class.
Definition: SubmatrixTrait.h:128
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:127
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:79
Header file for the IsSparseMatrix type trait.
Header file for the FalseType type/value trait base class.
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:2568
Header file for the IsDiagonal type trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
StaticMatrix()
The default constructor for StaticMatrix.
Definition: StaticMatrix.h:572
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1411
Header file for the IsSame and IsStrictlySame type traits.
Base template for the SchurTrait class.
Definition: SchurTrait.h:124
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:172
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:316
Header file for the IsColumnMajorMatrix type trait.
SIMDTrait_< ElementType > SIMDType
SIMD type of the matrix elements.
Definition: StaticMatrix.h:228
Resize mechanism to obtain a StaticMatrix with different fixed dimensions.
Definition: StaticMatrix.h:255
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
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:2426
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
Availability of a SIMD addition for the given data types.Depending on the available instruction set (...
Definition: HasSIMDAdd.h:171
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:2462
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
Type ElementType
Type of the matrix elements.
Definition: StaticMatrix.h:227
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member constant is set to true, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to false, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:140
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
Header file for memory allocation and deallocation functionality.
const Type & ConstReference
Reference to a constant matrix value.
Definition: StaticMatrix.h:233
Type & Reference
Reference to a non-constant matrix value.
Definition: StaticMatrix.h:232
System settings for performance optimizations.
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1393
Compile time check for data types.This type trait tests whether or not the given types can be combine...
Definition: IsSIMDCombinable.h:120
DenseIterator< Type, usePadding > Iterator
Iterator over non-constant elements.
Definition: StaticMatrix.h:237
Compile time check for static data types.This type trait tests whether the given data type is a stati...
Definition: IsStatic.h:85
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
DenseIterator< const Type, usePadding > ConstIterator
Iterator over constant elements.
Definition: StaticMatrix.h:238
Reference operator()(size_t i, size_t j) noexcept
2D-access to the matrix elements.
Definition: StaticMatrix.h:885
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
AlignedArray< Type, M *NN > v_
The statically allocated matrix elements.
Definition: StaticMatrix.h:528
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:78
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
ConstIterator cend(size_t i) const noexcept
Returns an iterator just past the last element of row/column i.
Definition: StaticMatrix.h:1202
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: StaticMatrix.h:2312
Constraint on the data type.
Efficient implementation of a fixed-sized vector.The StaticVector class template is the representatio...
Definition: Forward.h:61
Header file for the std::initializer_list aliases.
Header file for the SparseMatrix base class.
Pointer data() noexcept
Low-level data access to the matrix elements.
Definition: StaticMatrix.h:993
Compile time check for low-level access to mutable data.This type trait tests whether the given data ...
Definition: HasMutableDataAccess.h:75
bool isIntact() const noexcept
Returns whether the invariants of the static matrix are intact.
Definition: StaticMatrix.h:2251
Header file for the IsSquare type trait.
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Base template for the RowTrait class.
Definition: RowTrait.h:127
typename TransExprTrait< T >::Type TransExprTrait_
Auxiliary alias declaration for the TransExprTrait class template.The TransExprTrait_ alias declarati...
Definition: TransExprTrait.h:112
Header file for the DisableIf class template.
Header file for the LowType type trait.
Base template for the HighType type trait.
Definition: HighType.h:133
StaticMatrix & transpose()
In-place transpose of the matrix.
Definition: StaticMatrix.h:1880
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Header file for the unary map trait.
typename CTransExprTrait< T >::Type CTransExprTrait_
Auxiliary alias declaration for the CTransExprTrait class template.The CTransExprTrait_ alias declara...
Definition: CTransExprTrait.h:112
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for nested template disabiguation.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5924
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:110
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: StaticMatrix.h:2290
Header file for all forward declarations of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the HasSIMDAdd type trait.
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.
Header file for the Columns type trait.
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:2493
Header file for the DenseIterator class template.
void reset()
Reset to the default initial values.
Definition: StaticMatrix.h:1800
Header file for all SIMD functionality.
Constraint on the data type.
StaticMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: StaticMatrix.h:1957
#define BLAZE_CONSTRAINT_MUST_NOT_BE_DIAGONAL_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a diagonal matrix type, a compilation error is created.
Definition: Diagonal.h:79
Header file for the IsLower type trait.
Compile time check for square matrices.This type trait tests whether or not the given template parame...
Definition: IsSquare.h:88
Header file for the IsAligned type trait.
Compile time check for diagonal matrices.This type trait tests whether or not the given template para...
Definition: IsDiagonal.h:90
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:80
constexpr size_t spacing() const noexcept
Returns the spacing between the beginning of two rows.
Definition: StaticMatrix.h:1688
ConstIterator cbegin(size_t i) const noexcept
Returns an iterator to the first element of row/column i.
Definition: StaticMatrix.h:1130
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: StaticMatrix.h:934
Header file for the default storage order for all vectors of the Blaze library.
void swap(StaticMatrix &m) noexcept
Swapping the contents of two static matrices.
Definition: StaticMatrix.h:1847
#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
Header file for the exception macros of the math module.
constexpr size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: StaticMatrix.h:1669
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Iterator end(size_t i) noexcept
Returns an iterator just past the last element of row/column i.
Definition: StaticMatrix.h:1154
const Type & ReturnType
Return type for expression template evaluations.
Definition: StaticMatrix.h:229
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:580
Header file for the IsPadded type trait.
bool isAligned() const noexcept
Returns whether the matrix is properly aligned in memory.
Definition: StaticMatrix.h:2332
Header file for the IsVectorizable type trait.
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
Base template for the LowType type trait.
Definition: LowType.h:133
Header file for the HasConstDataAccess type trait.
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:75
Header file for the IsSIMDCombinable type trait.
StaticMatrix & operator=(const Type &set)
Homogenous assignment to all matrix elements.
Definition: StaticMatrix.h:1228
Header file for the PtrdiffT class template.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
Header file for the HasSIMDMult type trait.
Header file for the binary map trait.
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: Functions.h:156
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
size_t determineColumns(initializer_list< initializer_list< Type > > list) noexcept
Determine the maximum number of columns specified by the given initializer list.
Definition: InitializerList.h:80
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:139
Compile time check for column-major matrix types.This type trait tests whether or not the given templ...
Definition: IsColumnMajorMatrix.h:110
Base template for the MultTrait class.
Definition: MultTrait.h:139
Header file for the addition trait.
Header file for the division trait.
Header file for the InvExprTrait class template.
Header file for the submatrix trait.
Constraint on the data type.
Constraint on the data type.
Compile time integral constant wrapper for ptrdiff_t.The PtrdiffT class template represents an integr...
Definition: PtrdiffT.h:72
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: StaticMatrix.h:1746
Iterator begin(size_t i) noexcept
Returns an iterator to the first element of row/column i.
Definition: StaticMatrix.h:1082
Header file for the AlignedArray implementation.
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
Header file for the IsStatic type trait.
Efficient implementation of a dynamically sized matrix with static memory.The HybridMatrix class temp...
Definition: Forward.h:58
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:2531
BLAZE_ALWAYS_INLINE SIMDType load(size_t i, size_t j) const noexcept
Load of a SIMD element of the matrix.
Definition: StaticMatrix.h:2359
constexpr size_t capacity() const noexcept
Returns the maximum capacity of the matrix.
Definition: StaticMatrix.h:1704
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
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:101
Constraint on the data type.
Constraint on the data type.
Header file for the HasSIMDSub type trait.
BLAZE_ALWAYS_INLINE void conjugate(T &a) noexcept(IsNumeric< T >::value)
In-place conjugation of the given value/object.
Definition: Conjugate.h:120
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:819
Header file for the HasMutableDataAccess type trait.
EnableIf_< IsBuiltin< T > > deallocate(T *address) noexcept
Deallocation of memory for built-in data types.
Definition: Memory.h:230
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
Base template for the DivTrait class.
Definition: DivTrait.h:139
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:76
BLAZE_ALWAYS_INLINE void cswap(T &a, T &b) noexcept(IsNumeric< T >::value)
Swapping two conjugated values/objects.
Definition: Conjugate.h:195
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
Header file for the IsRowMajorMatrix type trait.
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: StaticMatrix.h:235
const bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71
Initializer list type of the Blaze library.
Header file for the alignment check function.
typename InvExprTrait< T >::Type InvExprTrait_
Auxiliary alias declaration for the InvExprTrait class template.The InvExprTrait_ alias declaration p...
Definition: InvExprTrait.h:123
Rebind mechanism to obtain a StaticMatrix with different data/element type.
Definition: StaticMatrix.h:245
Header file for the IntegralConstant class template.
Compile time evaluation of the number of columns of a matrix.The Columns type trait evaluates the num...
Definition: Columns.h:75
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:75
Compile time check for sparse matrix types.This type trait tests whether or not the given template pa...
Definition: IsSparseMatrix.h:103
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:600
Base template for the SubTrait class.
Definition: SubTrait.h:139
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
Type * Pointer
Pointer to a non-constant matrix value.
Definition: StaticMatrix.h:234
Header file for the IsUpper type trait.
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the CTransExprTrait class template.
#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
Base template for the BinaryMapTrait class.
Definition: BinaryMapTrait.h:119
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:2389
StaticMatrix< Type, M, N, SO > This
Type of this StaticMatrix instance.
Definition: StaticMatrix.h:222
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:117
System settings for the inline keywords.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.