35 #ifndef _BLAZE_MATH_DENSE_STATICMATRIX_H_ 36 #define _BLAZE_MATH_DENSE_STATICMATRIX_H_ 218 template<
typename Type
221 ,
bool SO = defaultStorageOrder >
223 :
public DenseMatrix< StaticMatrix<Type,M,N,SO>, SO >
249 template<
typename NewType >
258 template<
size_t NewM
277 enum :
bool { smpAssignable =
false };
287 template<
typename Other >
290 template<
typename Other,
size_t Rows,
size_t Cols >
326 inline StaticMatrix&
operator=(
const Type&
set );
329 template<
typename Other,
size_t Rows,
size_t Cols >
330 inline StaticMatrix&
operator=(
const Other (&array)[Rows][Cols] );
332 inline StaticMatrix&
operator= (
const StaticMatrix& rhs );
337 template<
typename MT ,
bool SO2 >
inline StaticMatrix& operator%=(
const Matrix<MT,SO2>& rhs );
344 static inline constexpr
size_t rows() noexcept;
345 static inline constexpr
size_t columns() noexcept;
346 static inline constexpr
size_t spacing() noexcept;
347 static inline constexpr
size_t capacity() noexcept;
348 inline size_t capacity(
size_t i )
const noexcept;
350 inline size_t nonZeros(
size_t i )
const;
352 inline void reset(
size_t i );
353 inline void swap( StaticMatrix& m ) noexcept;
363 template<
typename Other >
inline StaticMatrix& scale(
const Other& scalar );
370 static inline void*
operator new ( std::size_t
size );
371 static inline void*
operator new[]( std::size_t
size );
372 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
373 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
375 static inline void operator delete (
void* ptr );
376 static inline void operator delete[](
void* ptr );
377 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
378 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
385 template<
typename MT >
387 struct VectorizedAssign {
388 enum :
bool { value = useOptimizedKernels &&
389 simdEnabled && MT::simdEnabled &&
398 template<
typename MT >
400 struct VectorizedAddAssign {
401 enum :
bool { value = useOptimizedKernels &&
402 simdEnabled && MT::simdEnabled &&
413 template<
typename MT >
415 struct VectorizedSubAssign {
416 enum :
bool { value = useOptimizedKernels &&
417 simdEnabled && MT::simdEnabled &&
428 template<
typename MT >
430 struct VectorizedSchurAssign {
431 enum :
bool { value = useOptimizedKernels &&
432 simdEnabled && MT::simdEnabled &&
449 inline bool isIntact()
const noexcept;
456 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
457 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
470 template<
typename MT,
bool SO2 >
473 template<
typename MT,
bool SO2 >
479 template<
typename MT,
bool SO2 >
482 template<
typename MT,
bool SO2 >
488 template<
typename MT,
bool SO2 >
491 template<
typename MT,
bool SO2 >
497 template<
typename MT,
bool SO2 >
500 template<
typename MT,
bool SO2 >
520 enum :
size_t { NN = ( usePadding )?(
nextMultiple( N, SIMDSIZE ) ):( N ) };
566 template<
typename Type
576 for(
size_t i=0UL; i<M*NN; ++i )
590 template<
typename Type
599 for(
size_t i=0UL; i<M; ++i ) {
600 for(
size_t j=0UL; j<N; ++j )
603 for(
size_t j=N; j<NN; ++j )
634 template<
typename Type
649 for(
const auto& rowList : list ) {
650 std::fill( std::copy( rowList.begin(), rowList.end(),
v_+i*NN ),
v_+(i+1UL)*NN, Type() );
685 template<
typename Type
689 template<
typename Other >
695 if( m > M || n > N ) {
699 for(
size_t i=0UL; i<m; ++i ) {
700 for(
size_t j=0UL; j<n; ++j )
701 v_[i*NN+j] = array[i*n+j];
704 for(
size_t j=n; j<NN; ++j )
710 for(
size_t i=m; i<M; ++i ) {
711 for(
size_t j=0UL; j<NN; ++j )
741 template<
typename Type
745 template<
typename Other
754 for(
size_t i=0UL; i<M; ++i ) {
755 for(
size_t j=0UL; j<N; ++j )
756 v_[i*NN+j] = array[i][j];
758 for(
size_t j=N; j<NN; ++j )
774 template<
typename Type
783 for(
size_t i=0UL; i<M*NN; ++i )
796 template<
typename Type
800 template<
typename Other
807 for(
size_t i=0UL; i<M; ++i ) {
808 for(
size_t j=0UL; j<N; ++j )
811 for(
size_t j=N; j<NN; ++j )
830 template<
typename Type
834 template<
typename MT
847 for(
size_t i=0UL; i<M; ++i ) {
878 template<
typename Type
902 template<
typename Type
927 template<
typename Type
956 template<
typename Type
986 template<
typename Type
1010 template<
typename Type
1030 template<
typename Type
1051 template<
typename Type
1075 template<
typename Type
1099 template<
typename Type
1123 template<
typename Type
1147 template<
typename Type
1171 template<
typename Type
1195 template<
typename Type
1222 template<
typename Type
1228 for(
size_t i=0UL; i<M; ++i )
1229 for(
size_t j=0UL; j<N; ++j )
1261 template<
typename Type
1274 for(
const auto& rowList : list ) {
1275 std::fill( std::copy( rowList.begin(), rowList.end(),
v_+i*NN ),
v_+(i+1UL)*NN, Type() );
1305 template<
typename Type
1309 template<
typename Other
1316 for(
size_t i=0UL; i<M; ++i )
1317 for(
size_t j=0UL; j<N; ++j )
1318 v_[i*NN+j] = array[i][j];
1333 template<
typename Type
1339 using blaze::assign;
1341 assign( *
this, ~rhs );
1356 template<
typename Type
1360 template<
typename Other
1365 using blaze::assign;
1367 assign( *
this, ~rhs );
1387 template<
typename Type
1391 template<
typename MT
1395 using blaze::assign;
1401 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
1413 assign( *
this, tmp );
1418 assign( *
this, ~rhs );
1438 template<
typename Type
1442 template<
typename MT
1446 using blaze::addAssign;
1448 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
1454 addAssign( *
this, tmp );
1457 addAssign( *
this, ~rhs );
1477 template<
typename Type
1481 template<
typename MT
1485 using blaze::subAssign;
1487 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
1493 subAssign( *
this, tmp );
1496 subAssign( *
this, ~rhs );
1516 template<
typename Type
1520 template<
typename MT
1524 using blaze::schurAssign;
1526 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
1532 schurAssign( *
this, tmp );
1535 schurAssign( *
this, ~rhs );
1558 template<
typename Type
1574 template<
typename Type
1593 template<
typename Type
1609 template<
typename Type
1631 template<
typename Type
1651 template<
typename Type
1657 size_t nonzeros( 0UL );
1659 for(
size_t i=0UL; i<M; ++i )
1660 for(
size_t j=0UL; j<N; ++j )
1680 template<
typename Type
1688 const size_t jend( i*NN + N );
1689 size_t nonzeros( 0UL );
1691 for(
size_t j=i*NN; j<jend; ++j )
1705 template<
typename Type
1713 for(
size_t i=0UL; i<M; ++i )
1714 for(
size_t j=0UL; j<N; ++j )
1731 template<
typename Type
1740 for(
size_t j=0UL; j<N; ++j )
1752 template<
typename Type
1760 for(
size_t i=0UL; i<M; ++i ) {
1761 for(
size_t j=0UL; j<N; ++j ) {
1762 swap(
v_[i*NN+j], m(i,j) );
1785 template<
typename Type
1795 for(
size_t i=1UL; i<M; ++i )
1796 for(
size_t j=0UL; j<i; ++j )
1818 template<
typename Type
1844 template<
typename Type
1862 template<
typename Type
1870 for(
size_t i=0UL; i<M; ++i ) {
1871 for(
size_t j=0UL; j<i; ++j ) {
1896 template<
typename Type
1922 template<
typename Type
1949 template<
typename Type
1953 template<
typename Other >
1956 for(
size_t i=0UL; i<M; ++i )
1957 for(
size_t j=0UL; j<N; ++j )
1958 v_[i*NN+j] *= scalar;
1983 template<
typename Type
1993 return allocate<StaticMatrix>( 1UL );
2008 template<
typename Type
2032 template<
typename Type
2042 return allocate<StaticMatrix>( 1UL );
2057 template<
typename Type
2066 return allocate<StaticMatrix>( size/
sizeof(
StaticMatrix) );
2077 template<
typename Type
2083 deallocate( static_cast<StaticMatrix*>( ptr ) );
2094 template<
typename Type
2100 deallocate( static_cast<StaticMatrix*>( ptr ) );
2111 template<
typename Type
2117 deallocate( static_cast<StaticMatrix*>( ptr ) );
2128 template<
typename Type
2134 deallocate( static_cast<StaticMatrix*>( ptr ) );
2156 template<
typename Type
2163 for(
size_t i=0UL; i<M; ++i ) {
2164 for(
size_t j=N; j<NN; ++j ) {
2165 if(
v_[i*NN+j] != Type() )
2194 template<
typename Type
2198 template<
typename Other >
2201 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2216 template<
typename Type
2220 template<
typename Other >
2223 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2237 template<
typename Type
2243 return ( usePadding ||
columns() % SIMDSIZE == 0UL );
2263 template<
typename Type
2271 return loada( i, j );
2273 return loadu( i, j );
2293 template<
typename Type
2330 template<
typename Type
2366 template<
typename Type
2397 template<
typename Type
2435 template<
typename Type
2472 template<
typename Type
2505 template<
typename Type
2509 template<
typename MT
2516 for(
size_t i=0UL; i<M; ++i ) {
2517 for(
size_t j=0UL; j<N; ++j ) {
2518 v_[i*NN+j] = (~rhs)(i,j);
2536 template<
typename Type
2540 template<
typename MT
2551 const size_t jpos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2552 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2554 for(
size_t i=0UL; i<M; ++i )
2558 for( ; j<jpos; j+=SIMDSIZE ) {
2561 for( ; remainder && j<N; ++j ) {
2562 v_[i*NN+j] = (~rhs)(i,j);
2580 template<
typename Type
2584 template<
typename MT >
2589 for(
size_t i=0UL; i<M; ++i )
2591 v_[i*NN+element->index()] = element->value();
2607 template<
typename Type
2611 template<
typename MT >
2618 for(
size_t j=0UL; j<N; ++j )
2620 v_[element->index()*NN+j] = element->value();
2636 template<
typename Type
2640 template<
typename MT
2647 for(
size_t i=0UL; i<M; ++i )
2651 v_[i*NN+i] += (~rhs)(i,i);
2663 for(
size_t j=jbegin; j<jend; ++j ) {
2664 v_[i*NN+j] += (~rhs)(i,j);
2683 template<
typename Type
2687 template<
typename MT
2699 for(
size_t i=0UL; i<M; ++i )
2709 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
2710 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2714 for( ; j<jpos; j+=SIMDSIZE ) {
2717 for( ; remainder && j<jend; ++j ) {
2718 v_[i*NN+j] += (~rhs)(i,j);
2736 template<
typename Type
2740 template<
typename MT >
2745 for(
size_t i=0UL; i<M; ++i )
2747 v_[i*NN+element->index()] += element->value();
2763 template<
typename Type
2767 template<
typename MT >
2774 for(
size_t j=0UL; j<N; ++j )
2776 v_[element->index()*NN+j] += element->value();
2792 template<
typename Type
2796 template<
typename MT
2803 for(
size_t i=0UL; i<M; ++i )
2807 v_[i*NN+i] -= (~rhs)(i,i);
2819 for(
size_t j=jbegin; j<jend; ++j ) {
2820 v_[i*NN+j] -= (~rhs)(i,j);
2839 template<
typename Type
2843 template<
typename MT
2855 for(
size_t i=0UL; i<M; ++i )
2865 const size_t jpos( ( remainder )?( jend &
size_t(-SIMDSIZE) ):( jend ) );
2866 BLAZE_INTERNAL_ASSERT( !remainder || ( jend - ( jend % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
2870 for( ; j<jpos; j+=SIMDSIZE ) {
2873 for( ; remainder && j<jend; ++j ) {
2874 v_[i*NN+j] -= (~rhs)(i,j);
2892 template<
typename Type
2896 template<
typename MT >
2901 for(
size_t i=0UL; i<M; ++i )
2903 v_[i*NN+element->index()] -= element->value();
2919 template<
typename Type
2923 template<
typename MT >
2930 for(
size_t j=0UL; j<N; ++j )
2932 v_[element->index()*NN+j] -= element->value();
2948 template<
typename Type
2952 template<
typename MT
2959 for(
size_t i=0UL; i<M; ++i ) {
2960 for(
size_t j=0UL; j<N; ++j ) {
2961 v_[i*NN+j] *= (~rhs)(i,j);
2979 template<
typename Type
2983 template<
typename MT
2994 for(
size_t i=0UL; i<M; ++i )
2996 const size_t jpos( ( remainder )?( N &
size_t(-SIMDSIZE) ):( N ) );
2997 BLAZE_INTERNAL_ASSERT( !remainder || ( N - ( N % (SIMDSIZE) ) ) == jpos,
"Invalid end calculation" );
3001 for( ; j<jpos; j+=SIMDSIZE ) {
3004 for( ; remainder && j<N; ++j ) {
3005 v_[i*NN+j] *= (~rhs)(i,j);
3023 template<
typename Type
3027 template<
typename MT >
3036 for(
size_t i=0UL; i<M; ++i )
3038 v_[i*NN+element->index()] = tmp.v_[i*NN+element->index()] * element->value();
3054 template<
typename Type
3058 template<
typename MT >
3069 for(
size_t j=0UL; j<N; ++j )
3071 v_[element->index()*NN+j] = tmp.v_[element->index()*NN+j] * element->value();
3096 template<
typename Type
3100 :
public DenseMatrix< StaticMatrix<Type,M,N,true>, true >
3126 template<
typename NewType >
3135 template<
size_t NewM
3154 enum :
bool { smpAssignable =
false };
3164 template<
typename Other >
3165 explicit inline StaticMatrix(
size_t m,
size_t n,
const Other* array );
3167 template<
typename Other,
size_t Rows,
size_t Cols >
3168 explicit inline StaticMatrix(
const Other (&array)[Rows][Cols] );
3203 inline StaticMatrix&
operator=(
const Type&
set );
3206 template<
typename Other,
size_t Rows,
size_t Cols >
3207 inline StaticMatrix&
operator=(
const Other (&array)[Rows][Cols] );
3209 inline StaticMatrix&
operator= (
const StaticMatrix& rhs );
3214 template<
typename MT ,
bool SO >
inline StaticMatrix& operator%=(
const Matrix<MT,SO>& rhs );
3221 static inline constexpr
size_t rows() noexcept;
3222 static inline constexpr
size_t columns() noexcept;
3223 static inline constexpr
size_t spacing() noexcept;
3224 static inline constexpr
size_t capacity() noexcept;
3225 inline size_t capacity(
size_t j )
const noexcept;
3227 inline size_t nonZeros(
size_t j )
const;
3228 inline void reset();
3229 inline void reset(
size_t i );
3230 inline void swap( StaticMatrix& m ) noexcept;
3240 template<
typename Other >
inline StaticMatrix& scale(
const Other& scalar );
3247 static inline void*
operator new ( std::size_t
size );
3248 static inline void*
operator new[]( std::size_t
size );
3249 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
3250 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
3252 static inline void operator delete (
void* ptr );
3253 static inline void operator delete[](
void* ptr );
3254 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
3255 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
3262 template<
typename MT >
3263 struct VectorizedAssign {
3264 enum :
bool { value = useOptimizedKernels &&
3265 simdEnabled && MT::simdEnabled &&
3273 template<
typename MT >
3274 struct VectorizedAddAssign {
3275 enum :
bool { value = useOptimizedKernels &&
3276 simdEnabled && MT::simdEnabled &&
3286 template<
typename MT >
3287 struct VectorizedSubAssign {
3288 enum :
bool { value = useOptimizedKernels &&
3289 simdEnabled && MT::simdEnabled &&
3299 template<
typename MT >
3300 struct VectorizedSchurAssign {
3301 enum :
bool { value = useOptimizedKernels &&
3302 simdEnabled && MT::simdEnabled &&
3318 inline bool isIntact()
const noexcept;
3325 template<
typename Other >
inline bool canAlias (
const Other* alias )
const noexcept;
3326 template<
typename Other >
inline bool isAliased(
const Other* alias )
const noexcept;
3339 template<
typename MT,
bool SO >
3342 template<
typename MT,
bool SO >
3348 template<
typename MT,
bool SO >
3351 template<
typename MT,
bool SO >
3357 template<
typename MT,
bool SO >
3360 template<
typename MT,
bool SO >
3366 template<
typename MT,
bool SO >
3369 template<
typename MT,
bool SO >
3387 enum :
size_t { MM = ( usePadding )?(
nextMultiple( M, SIMDSIZE ) ):( M ) };
3426 template<
typename Type
3435 for(
size_t i=0UL; i<MM*N; ++i )
3451 template<
typename Type
3459 for(
size_t j=0UL; j<N; ++j ) {
3460 for(
size_t i=0UL; i<M; ++i )
3463 for(
size_t i=M; i<MM; ++i )
3464 v_[i+j*MM] = Type();
3496 template<
typename Type
3510 for(
const auto& rowList : list ) {
3512 for(
const auto& element : rowList ) {
3513 v_[i+j*MM] = element;
3517 v_[i+j*MM] = Type();
3525 for( ; i<MM; ++i ) {
3526 for(
size_t j=0UL; j<N; ++j ) {
3527 v_[i+j*MM] = Type();
3565 template<
typename Type
3568 template<
typename Other >
3574 if( m > M || n > N ) {
3578 for(
size_t j=0UL; j<n; ++j ) {
3579 for(
size_t i=0UL; i<m; ++i )
3580 v_[i+j*MM] = array[i+j*m];
3583 for(
size_t i=m; i<MM; ++i )
3584 v_[i+j*MM] = Type();
3589 for(
size_t j=n; j<N; ++j ) {
3590 for(
size_t i=0UL; i<MM; ++i )
3591 v_[i+j*MM] = Type();
3622 template<
typename Type
3625 template<
typename Other
3634 for(
size_t j=0UL; j<N; ++j ) {
3635 for(
size_t i=0UL; i<M; ++i )
3636 v_[i+j*MM] = array[i][j];
3638 for(
size_t i=M; i<MM; ++i )
3639 v_[i+j*MM] = Type();
3656 template<
typename Type
3664 for(
size_t i=0UL; i<MM*N; ++i )
3679 template<
typename Type
3682 template<
typename Other
3689 for(
size_t j=0UL; j<N; ++j ) {
3690 for(
size_t i=0UL; i<M; ++i )
3691 v_[i+j*MM] = m(i,j);
3693 for(
size_t i=M; i<MM; ++i )
3694 v_[i+j*MM] = Type();
3714 template<
typename Type
3717 template<
typename MT
3722 using blaze::assign;
3730 for(
size_t j=0UL; j<N; ++j ) {
3732 v_[i+j*MM] = Type();
3736 assign( *
this, ~m );
3763 template<
typename Type
3788 template<
typename Type
3814 template<
typename Type
3826 return (*
this)(i,j);
3844 template<
typename Type
3856 return (*
this)(i,j);
3874 template<
typename Type
3898 template<
typename Type
3919 template<
typename Type
3941 template<
typename Type
3961 template<
typename Type
3981 template<
typename Type
4001 template<
typename Type
4021 template<
typename Type
4041 template<
typename Type
4061 template<
typename Type
4089 template<
typename Type
4095 for(
size_t j=0UL; j<N; ++j )
4096 for(
size_t i=0UL; i<M; ++i )
4129 template<
typename Type
4141 for(
const auto& rowList : list ) {
4143 for(
const auto& element : rowList ) {
4144 v_[i+j*MM] = element;
4148 v_[i+j*MM] = Type();
4181 template<
typename Type
4184 template<
typename Other
4192 for(
size_t j=0UL; j<N; ++j )
4193 for(
size_t i=0UL; i<M; ++i )
4194 v_[i+j*MM] = array[i][j];
4211 template<
typename Type
4217 using blaze::assign;
4219 assign( *
this, ~rhs );
4236 template<
typename Type
4239 template<
typename Other
4244 using blaze::assign;
4246 assign( *
this, ~rhs );
4268 template<
typename Type
4271 template<
typename MT
4275 using blaze::assign;
4281 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
4293 assign( *
this, tmp );
4298 assign( *
this, ~rhs );
4320 template<
typename Type
4323 template<
typename MT
4327 using blaze::addAssign;
4329 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
4335 addAssign( *
this, tmp );
4338 addAssign( *
this, ~rhs );
4360 template<
typename Type
4363 template<
typename MT
4367 using blaze::subAssign;
4369 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
4375 subAssign( *
this, tmp );
4378 subAssign( *
this, ~rhs );
4400 template<
typename Type
4403 template<
typename MT
4407 using blaze::schurAssign;
4409 if( (~rhs).
rows() != M || (~rhs).
columns() != N ) {
4415 schurAssign( *
this, tmp );
4418 schurAssign( *
this, ~rhs );
4443 template<
typename Type
4460 template<
typename Type
4480 template<
typename Type
4497 template<
typename Type
4515 template<
typename Type
4536 template<
typename Type
4541 size_t nonzeros( 0UL );
4543 for(
size_t j=0UL; j<N; ++j )
4544 for(
size_t i=0UL; i<M; ++i )
4561 template<
typename Type
4568 const size_t iend( j*MM + M );
4569 size_t nonzeros( 0UL );
4571 for(
size_t i=j*MM; i<iend; ++i )
4587 template<
typename Type
4594 for(
size_t j=0UL; j<N; ++j )
4595 for(
size_t i=0UL; i<M; ++i )
4612 template<
typename Type
4620 for(
size_t i=0UL; i<M; ++i )
4634 template<
typename Type
4641 for(
size_t j=0UL; j<N; ++j ) {
4642 for(
size_t i=0UL; i<M; ++i ) {
4643 swap(
v_[i+j*MM], m(i,j) );
4668 template<
typename Type
4677 for(
size_t j=1UL; j<N; ++j )
4678 for(
size_t i=0UL; i<j; ++i )
4701 template<
typename Type
4726 template<
typename Type
4744 template<
typename Type
4751 for(
size_t j=0UL; j<N; ++j ) {
4752 for(
size_t i=0UL; i<j; ++i ) {
4778 template<
typename Type
4803 template<
typename Type
4830 template<
typename Type
4833 template<
typename Other >
4837 for(
size_t j=0UL; j<N; ++j )
4838 for(
size_t i=0UL; i<M; ++i )
4839 v_[i+j*MM] *= scalar;
4866 template<
typename Type
4875 return allocate<StaticMatrix>( 1UL );
4892 template<
typename Type
4900 return allocate<StaticMatrix>( size/
sizeof(
StaticMatrix) );
4917 template<
typename Type
4926 return allocate<StaticMatrix>( 1UL );
4943 template<
typename Type
4951 return allocate<StaticMatrix>( size/
sizeof(
StaticMatrix) );
4964 template<
typename Type
4969 deallocate( static_cast<StaticMatrix*>( ptr ) );
4982 template<
typename Type
4987 deallocate( static_cast<StaticMatrix*>( ptr ) );
5000 template<
typename Type
5005 deallocate( static_cast<StaticMatrix*>( ptr ) );
5018 template<
typename Type
5023 deallocate( static_cast<StaticMatrix*>( ptr ) );
5047 template<
typename Type
5053 for(
size_t j=0UL; j<N; ++j ) {
5054 for(
size_t i=M; i<MM; ++i ) {
5055 if(
v_[i+j*MM] != Type() )
5086 template<
typename Type
5089 template<
typename Other >
5092 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5109 template<
typename Type
5112 template<
typename Other >
5115 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5131 template<
typename Type
5136 return ( usePadding ||
rows() % SIMDSIZE == 0UL );
5157 template<
typename Type
5164 return loada( i, j );
5166 return loadu( i, j );
5187 template<
typename Type
5224 template<
typename Type
5260 template<
typename Type
5291 template<
typename Type
5329 template<
typename Type
5366 template<
typename Type
5400 template<
typename Type
5403 template<
typename MT
5410 for(
size_t j=0UL; j<N; ++j ) {
5411 for(
size_t i=0UL; i<M; ++i ) {
5412 v_[i+j*MM] = (~rhs)(i,j);
5432 template<
typename Type
5435 template<
typename MT
5446 const size_t ipos( ( remainder )?( M &
size_t(-SIMDSIZE) ):( M ) );
5447 BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5449 for(
size_t j=0UL; j<N; ++j )
5453 for( ; i<ipos; i+=SIMDSIZE ) {
5456 for( ; remainder && i<M; ++i ) {
5457 v_[i+j*MM] = (~rhs)(i,j);
5477 template<
typename Type
5480 template<
typename MT >
5485 for(
size_t j=0UL; j<N; ++j )
5487 v_[element->index()+j*MM] = element->value();
5505 template<
typename Type
5508 template<
typename MT >
5515 for(
size_t i=0UL; i<M; ++i )
5517 v_[i+element->index()*MM] = element->value();
5535 template<
typename Type
5538 template<
typename MT
5545 for(
size_t j=0UL; j<N; ++j )
5549 v_[j+j*MM] += (~rhs)(j,j);
5561 for(
size_t i=ibegin; i<iend; ++i ) {
5562 v_[i+j*MM] += (~rhs)(i,j);
5583 template<
typename Type
5586 template<
typename MT
5598 for(
size_t j=0UL; j<N; ++j )
5608 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5609 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5613 for( ; i<ipos; i+=SIMDSIZE ) {
5616 for( ; remainder && i<iend; ++i ) {
5617 v_[i+j*MM] += (~rhs)(i,j);
5637 template<
typename Type
5640 template<
typename MT >
5645 for(
size_t j=0UL; j<N; ++j )
5647 v_[element->index()+j*MM] += element->value();
5665 template<
typename Type
5668 template<
typename MT >
5675 for(
size_t i=0UL; i<M; ++i )
5677 v_[i+element->index()*MM] += element->value();
5695 template<
typename Type
5698 template<
typename MT
5705 for(
size_t j=0UL; j<N; ++j )
5709 v_[j+j*MM] -= (~rhs)(j,j);
5721 for(
size_t i=ibegin; i<iend; ++i ) {
5722 v_[i+j*MM] -= (~rhs)(i,j);
5743 template<
typename Type
5746 template<
typename MT
5758 for(
size_t j=0UL; j<N; ++j )
5768 const size_t ipos( ( remainder )?( iend &
size_t(-SIMDSIZE) ):( iend ) );
5769 BLAZE_INTERNAL_ASSERT( !remainder || ( iend - ( iend % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5773 for( ; i<ipos; i+=SIMDSIZE ) {
5776 for( ; remainder && i<iend; ++i ) {
5777 v_[i+j*MM] -= (~rhs)(i,j);
5797 template<
typename Type
5800 template<
typename MT >
5805 for(
size_t j=0UL; j<N; ++j )
5807 v_[element->index()+j*MM] -= element->value();
5825 template<
typename Type
5828 template<
typename MT >
5835 for(
size_t i=0UL; i<M; ++i )
5837 v_[i+element->index()*MM] -= element->value();
5855 template<
typename Type
5858 template<
typename MT
5865 for(
size_t j=0UL; j<N; ++j ) {
5866 for(
size_t i=0UL; i<M; ++i ) {
5867 v_[i+j*MM] *= (~rhs)(i,j);
5887 template<
typename Type
5890 template<
typename MT
5901 for(
size_t j=0UL; j<N; ++j )
5903 const size_t ipos( ( remainder )?( M &
size_t(-SIMDSIZE) ):( M ) );
5904 BLAZE_INTERNAL_ASSERT( !remainder || ( M - ( M % (SIMDSIZE) ) ) == ipos,
"Invalid end calculation" );
5908 for( ; i<ipos; i+=SIMDSIZE ) {
5911 for( ; remainder && i<M; ++i ) {
5912 v_[i+j*MM] *= (~rhs)(i,j);
5932 template<
typename Type
5935 template<
typename MT >
5944 for(
size_t j=0UL; j<N; ++j )
5946 v_[element->index()+j*MM] = tmp.v_[element->index()+j*MM] * element->value();
5964 template<
typename Type
5967 template<
typename MT >
5978 for(
size_t i=0UL; i<M; ++i )
5980 v_[i+element->index()*MM] = tmp.v_[i+element->index()*MM] * element->value();
6001 template<
typename Type,
size_t M,
size_t N,
bool SO >
6004 template<
typename Type,
size_t M,
size_t N,
bool SO >
6007 template<
typename Type,
size_t M,
size_t N,
bool SO >
6010 template<
bool RF,
typename Type,
size_t M,
size_t N,
bool SO >
6013 template<
typename Type,
size_t M,
size_t N,
bool SO >
6016 template<
typename Type,
size_t M,
size_t N,
bool SO >
6029 template<
typename Type
6053 template<
typename Type
6073 template<
typename Type
6116 for(
size_t i=0UL; i<M; ++i )
6117 for(
size_t j=0UL; j<N; ++j )
6118 if( !isDefault<RF>( m(i,j) ) )
return false;
6121 for(
size_t j=0UL; j<N; ++j )
6122 for(
size_t i=0UL; i<M; ++i )
6123 if( !isDefault<RF>( m(i,j) ) )
return false;
6149 template<
typename Type
6155 return m.isIntact();
6168 template<
typename Type
6189 template<
typename T,
size_t M,
size_t N,
bool SO >
6190 struct Size< StaticMatrix<T,M,N,SO>, 0UL >
6194 template<
typename T,
size_t M,
size_t N,
bool SO >
6195 struct Size< StaticMatrix<T,M,N,SO>, 1UL >
6212 template<
typename T,
size_t N,
bool SO >
6213 struct IsSquare< StaticMatrix<T,N,N,SO> >
6230 template<
typename T,
size_t M,
size_t N,
bool SO >
6248 template<
typename T,
size_t M,
size_t N,
bool SO >
6266 template<
typename T,
size_t M,
size_t N,
bool SO >
6267 struct IsStatic< StaticMatrix<T,M,N,SO> >
6284 template<
typename T,
size_t M,
size_t N,
bool SO >
6285 struct IsAligned< StaticMatrix<T,M,N,SO> >
6302 template<
typename T,
size_t M,
size_t N,
bool SO >
6320 template<
typename T,
size_t M,
size_t N,
bool SO >
6321 struct IsPadded< StaticMatrix<T,M,N,SO> >
6338 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6339 struct AddTrait< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
6344 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
6345 struct AddTrait< StaticMatrix<T1,M,N,SO1>, StaticMatrix<T2,M,N,SO2> >
6363 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6364 struct SubTrait< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
6369 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
6370 struct SubTrait< StaticMatrix<T1,M,N,SO1>, StaticMatrix<T2,M,N,SO2> >
6388 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6389 struct SchurTrait< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
6394 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
6395 struct SchurTrait< StaticMatrix<T1,M,N,SO1>, StaticMatrix<T2,M,N,SO2> >
6413 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6414 struct MultTrait< StaticMatrix<T1,M,N,SO>, T2, EnableIf_<IsNumeric<T2> > >
6419 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6420 struct MultTrait< T1, StaticMatrix<T2,M,N,SO>, EnableIf_<IsNumeric<T1> > >
6425 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6426 struct MultTrait< StaticMatrix<T1,M,N,SO>, StaticVector<T2,N,false> >
6431 template<
typename T1,
size_t M,
typename T2,
size_t N,
bool SO >
6432 struct MultTrait< StaticVector<T1,M,true>, StaticMatrix<T2,M,N,SO> >
6437 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
size_t L >
6438 struct MultTrait< StaticMatrix<T1,M,N,SO>, HybridVector<T2,L,false> >
6443 template<
typename T1,
size_t L,
typename T2,
size_t M,
size_t N,
bool SO >
6444 struct MultTrait< HybridVector<T1,L,true>, StaticMatrix<T2,M,N,SO> >
6449 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6450 struct MultTrait< StaticMatrix<T1,M,N,SO>, DynamicVector<T2,false> >
6455 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6456 struct MultTrait< DynamicVector<T1,true>, StaticMatrix<T2,M,N,SO> >
6461 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
bool AF,
bool PF >
6462 struct MultTrait< StaticMatrix<T1,M,N,SO>, CustomVector<T2,AF,PF,false> >
6467 template<
typename T1,
bool AF,
bool PF,
typename T2,
size_t M,
size_t N,
bool SO >
6468 struct MultTrait< CustomVector<T1,AF,PF,true>, StaticMatrix<T2,M,N,SO> >
6473 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6474 struct MultTrait< StaticMatrix<T1,M,N,SO>, CompressedVector<T2,false> >
6479 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6480 struct MultTrait< CompressedVector<T1,true>, StaticMatrix<T2,M,N,SO> >
6485 template<
typename T1,
size_t M,
size_t K,
bool SO1,
typename T2,
size_t N,
bool SO2 >
6486 struct MultTrait< StaticMatrix<T1,M,K,SO1>, StaticMatrix<T2,K,N,SO2> >
6504 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6505 struct DivTrait< StaticMatrix<T1,M,N,SO>, T2, EnableIf_<IsNumeric<T2> > >
6523 template<
typename T,
size_t M,
size_t N,
bool SO,
typename OP >
6542 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
typename OP >
6543 struct BinaryMapTrait< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO>, OP >
6548 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2,
typename OP >
6549 struct BinaryMapTrait< StaticMatrix<T1,M,N,SO1>, StaticMatrix<T2,M,N,SO2>, OP >
6567 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6568 struct HighType< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
6586 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6587 struct LowType< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
6605 template<
typename T,
size_t M1,
size_t N1,
bool SO,
size_t I,
size_t J,
size_t M2,
size_t N2 >
6611 template<
typename T,
size_t M,
size_t N,
bool SO >
6630 template<
typename T,
size_t M,
size_t N,
bool SO,
size_t... CRAs >
6631 struct RowTrait< StaticMatrix<T,M,N,SO>, CRAs... >
6649 template<
typename T,
size_t M,
size_t N,
bool SO,
size_t... CRAs >
6650 struct RowsTrait< StaticMatrix<T,M,N,SO>, CRAs... >
6652 using Type = StaticMatrix<T,
sizeof...(CRAs),N,
false>;
6655 template<
typename T,
size_t M,
size_t N,
bool SO >
6656 struct RowsTrait< StaticMatrix<T,M,N,SO> >
6674 template<
typename T,
size_t M,
size_t N,
bool SO,
size_t... CCAs >
6675 struct ColumnTrait< StaticMatrix<T,M,N,SO>, CCAs... >
6693 template<
typename T,
size_t M,
size_t N,
bool SO,
size_t... CCAs >
6696 using Type = StaticMatrix<T,M,
sizeof...(CCAs),
true>;
6699 template<
typename T,
size_t M,
size_t N,
bool SO >
6718 template<
typename T,
size_t M,
size_t N,
bool SO >
6719 struct BandTrait< StaticMatrix<T,M,N,SO> >
6721 enum :
size_t {
Min =
min( M, N ) };
6725 template<
typename T,
size_t M,
size_t N,
bool SO, ptrdiff_t I >
6726 struct BandTrait< StaticMatrix<T,M,N,SO>, I >
6728 enum :
size_t {
Min =
min( M - ( I >= 0L ? 0UL : -I ), N - ( I >= 0L ? I : 0UL ) ) };
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.
Headerfile for the generic min algorithm.
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.
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 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:109
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:108
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:2477
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:570
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Header file for the IsSame and IsStrictlySame type traits.
Base template for the SchurTrait class.
Definition: SchurTrait.h:112
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:233
Resize mechanism to obtain a StaticMatrix with different fixed dimensions.
Definition: StaticMatrix.h:260
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:2335
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1903
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:87
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:2371
#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:232
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:87
Header file for memory allocation and deallocation functionality.
const Type & ConstReference
Reference to a constant matrix value.
Definition: StaticMatrix.h:238
Type & Reference
Reference to a non-constant matrix value.
Definition: StaticMatrix.h:237
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
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:242
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:243
Reference operator()(size_t i, size_t j) noexcept
2D-access to the matrix elements.
Definition: StaticMatrix.h:883
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
static constexpr size_t columns() noexcept
Returns the current number of columns of the matrix.
Definition: StaticMatrix.h:1578
Base template for the RowsTrait class.
Definition: RowsTrait.h:109
AlignedArray< Type, M *NN > v_
The statically allocated matrix elements.
Definition: StaticMatrix.h:526
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
Header file for the band trait.
ConstIterator cend(size_t i) const noexcept
Returns an iterator just past the last element of row/column i.
Definition: StaticMatrix.h:1200
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: StaticMatrix.h:2221
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 SparseMatrix base class.
Efficient implementation of a dynamically sized vector with static memory.The HybridVector class temp...
Definition: Forward.h:59
Pointer data() noexcept
Low-level data access to the matrix elements.
Definition: StaticMatrix.h:991
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:2160
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:109
Compile time check for the memory layout of data types.This type trait tests whether the given data t...
Definition: IsContiguous.h:86
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:1789
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:58
#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:5908
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:2199
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.
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:2402
Header file for the DenseIterator class template.
void reset()
Reset to the default initial values.
Definition: StaticMatrix.h:1709
Header file for all SIMD functionality.
Constraint on the data type.
StaticMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: StaticMatrix.h:1866
#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:89
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
ConstIterator cbegin(size_t i) const noexcept
Returns an iterator to the first element of row/column i.
Definition: StaticMatrix.h:1128
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: StaticMatrix.h:932
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:1756
#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.
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:1152
const Type & ReturnType
Return type for expression template evaluations.
Definition: StaticMatrix.h:234
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:608
Header file for the IsPadded type trait.
bool isAligned() const noexcept
Returns whether the matrix is properly aligned in memory.
Definition: StaticMatrix.h:2241
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:1226
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
Determines the maximum number of columns specified by the given initializer list. ...
Definition: InitializerList.h:107
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:119
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:119
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.
Header file for the IsContiguous type trait.
Header file for the columns trait.
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:1655
Iterator begin(size_t i) noexcept
Returns an iterator to the first element of row/column i.
Definition: StaticMatrix.h:1080
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:2440
BLAZE_ALWAYS_INLINE SIMDType load(size_t i, size_t j) const noexcept
Load of a SIMD element of the matrix.
Definition: StaticMatrix.h:2268
#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:816
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
static constexpr size_t rows() noexcept
Returns the current number of rows of the matrix.
Definition: StaticMatrix.h:1562
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:120
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
Header file for the rows trait.
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
Generic wrapper for the min() function.
Definition: Min.h:62
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
static constexpr size_t spacing() noexcept
Returns the spacing between the beginning of two rows.
Definition: StaticMatrix.h:1597
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:240
Base template for the ColumnsTrait class.
Definition: ColumnsTrait.h:109
const bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71
Header file for the default transpose flag for all vectors of the Blaze library.
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
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
Rebind mechanism to obtain a StaticMatrix with different data/element type.
Definition: StaticMatrix.h:250
Header file for the IntegralConstant class template.
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:628
static constexpr size_t capacity() noexcept
Returns the maximum capacity of the matrix.
Definition: StaticMatrix.h:1613
Base template for the SubTrait class.
Definition: SubTrait.h:119
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:239
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:97
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:2298
StaticMatrix< Type, M, N, SO > This
Type of this StaticMatrix instance.
Definition: StaticMatrix.h:227
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:95
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, 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.
Base template for the BandTrait class.
Definition: BandTrait.h:109