35#ifndef _BLAZE_MATH_DENSE_DYNAMICMATRIX_H_
36#define _BLAZE_MATH_DENSE_DYNAMICMATRIX_H_
236template<
typename Type
241 :
public DenseMatrix< DynamicMatrix<Type,SO,Alloc,Tag>, SO >
280 template<
typename NewType >
284 using NewAlloc =
typename std::allocator_traits<Alloc>::template rebind_alloc<NewType>;
294 template<
size_t NewM
320 inline DynamicMatrix(
const Alloc& alloc = Alloc{} )
noexcept;
321 inline DynamicMatrix(
size_t m,
size_t n,
const Alloc& alloc = Alloc{} );
322 inline DynamicMatrix(
size_t m,
size_t n,
const Type& init,
const Alloc& alloc = Alloc{} );
325 template<
typename Other >
326 inline DynamicMatrix(
size_t m,
size_t n,
const Other* array,
const Alloc& alloc = Alloc{} );
328 template<
typename Other,
size_t Rows,
size_t Cols >
329 inline DynamicMatrix(
const Other (&array)[Rows][Cols],
const Alloc& alloc = Alloc{} );
331 template<
typename Other,
size_t Rows,
size_t Cols >
332 inline DynamicMatrix(
const std::array<std::array<Other,Cols>,Rows>& array,
const Alloc& alloc = Alloc{} );
337 template<
typename MT,
bool SO2 >
375 template< typename Other,
size_t Rows,
size_t Cols >
376 inline
DynamicMatrix& operator=( const Other (&array)[Rows][Cols] ) &;
378 template< typename Other,
size_t Rows,
size_t Cols >
379 inline
DynamicMatrix& operator=( const std::array<std::array<Other,Cols>,Rows>& array ) &;
384 template< typename MT,
bool SO2 > inline
DynamicMatrix& operator= ( const Matrix<MT,SO2>& rhs ) &;
385 template< typename MT,
bool SO2 > inline
DynamicMatrix& operator+=( const Matrix<MT,SO2>& rhs ) &;
386 template< typename MT,
bool SO2 > inline
DynamicMatrix& operator-=( const Matrix<MT,SO2>& rhs ) &;
387 template< typename MT,
bool SO2 > inline
DynamicMatrix& operator%=( const Matrix<MT,SO2>& rhs ) &;
394 inline
size_t rows() const noexcept;
395 inline
size_t columns() const noexcept;
396 inline
size_t spacing() const noexcept;
397 inline
size_t capacity() const noexcept;
398 inline
size_t capacity(
size_t i ) const noexcept;
400 inline
size_t nonZeros(
size_t i ) const;
402 inline
void reset(
size_t i );
404 void resize (
size_t m,
size_t n,
bool preserve=true );
405 inline
void extend (
size_t m,
size_t n,
bool preserve=true );
418 template< typename Other > inline
DynamicMatrix& scale( const Other& scalar );
426 template< typename MT >
427 static constexpr
bool VectorizedAssign_v =
428 ( useOptimizedKernels &&
437 template< typename MT >
438 static constexpr
bool VectorizedAddAssign_v =
439 ( VectorizedAssign_v<MT> &&
448 template< typename MT >
449 static constexpr
bool VectorizedSubAssign_v =
450 ( VectorizedAssign_v<MT> &&
459 template< typename MT >
460 static constexpr
bool VectorizedSchurAssign_v =
461 ( VectorizedAssign_v<MT> &&
475 inline
bool isIntact() const noexcept;
482 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
483 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
497 template< typename MT >
500 template< typename MT >
507 template< typename MT >
510 template< typename MT >
517 template< typename MT >
520 template< typename MT >
527 template< typename MT >
530 template< typename MT >
557 inline size_t addPadding(
size_t value )
const noexcept;
607template<
typename Type >
610template<
typename Type,
size_t M,
size_t N >
613template<
typename Type,
size_t M,
size_t N >
633template<
typename Type
657template<
typename Type
677template<
typename Type
710template<
typename Type
721 if( IsVectorizable_v<Type> && IsBuiltin_v<Type> ) {
722 for(
size_t i=0UL; i<
m_; ++i ) {
723 for(
size_t j=
n_; j<
nn_; ++j ) {
744template<
typename Type
751 for(
size_t i=0UL; i<m; ++i ) {
752 for(
size_t j=0UL; j<
n_; ++j ) {
783template<
typename Type
792 for(
const auto& rowList : list ) {
793 std::fill( std::copy( rowList.begin(), rowList.end(),
begin(i) ),
end(i), Type() );
826template<
typename Type
830template<
typename Other >
834 for(
size_t i=0UL; i<m; ++i ) {
835 for(
size_t j=0UL; j<n; ++j ) {
836 v_[i*
nn_+j] = array[i*n+j];
867template<
typename Type
871template<
typename Other
877 for(
size_t i=0UL; i<Rows; ++i ) {
878 for(
size_t j=0UL; j<Cols; ++j ) {
879 v_[i*
nn_+j] = array[i][j];
910template<
typename Type
914template<
typename Other
920 for(
size_t i=0UL; i<Rows; ++i ) {
921 for(
size_t j=0UL; j<Cols; ++j ) {
922 v_[i*
nn_+j] = array[i][j];
939template<
typename Type
960template<
typename Type
968 , capacity_( m.capacity_ )
985template<
typename Type
996 if( IsSparseMatrix_v<MT> && IsBuiltin_v<Type> ) {
1018template<
typename Type
1025 alloc_.deallocate( v_, capacity_ );
1048template<
typename Type
1072template<
typename Type
1097template<
typename Type
1110 return (*
this)(i,j);
1126template<
typename Type
1139 return (*
this)(i,j);
1156template<
typename Type
1180template<
typename Type
1200template<
typename Type
1221template<
typename Type
1245template<
typename Type
1269template<
typename Type
1293template<
typename Type
1317template<
typename Type
1325 return Iterator( v_ + i*nn_ + n_ );
1341template<
typename Type
1365template<
typename Type
1392template<
typename Type
1399 for(
size_t i=0UL; i<m_; ++i )
1400 for(
size_t j=0UL; j<n_; ++j )
1429template<
typename Type
1440 for(
const auto& rowList : list ) {
1441 std::fill( std::copy( rowList.begin(), rowList.end(), v_+i*nn_ ), v_+(i+1UL)*nn_, Type() );
1472template<
typename Type
1476template<
typename Other
1482 resize( Rows, Cols,
false );
1484 for(
size_t i=0UL; i<Rows; ++i )
1485 for(
size_t j=0UL; j<Cols; ++j )
1486 v_[i*nn_+j] = array[i][j];
1515template<
typename Type
1519template<
typename Other
1525 resize( Rows, Cols,
false );
1527 for(
size_t i=0UL; i<Rows; ++i )
1528 for(
size_t j=0UL; j<Cols; ++j )
1529 v_[i*nn_+j] = array[i][j];
1545template<
typename Type
1552 if( &rhs ==
this )
return *
this;
1554 resize( rhs.m_, rhs.n_,
false );
1570template<
typename Type
1578 alloc_.deallocate( v_, capacity_ );
1583 capacity_ = rhs.capacity_;
1589 rhs.capacity_ = 0UL;
1606template<
typename Type
1610template<
typename MT
1612inline DynamicMatrix<Type,SO,Alloc,Tag>&
1615 using TT =
decltype(
trans( *
this ) );
1616 using CT =
decltype(
ctrans( *
this ) );
1617 using IT =
decltype(
inv( *
this ) );
1621 if( IsSame_v<MT,TT> && (*rhs).isAliased(
this ) ) {
1624 else if( IsSame_v<MT,CT> && (*rhs).isAliased(
this ) ) {
1627 else if( !IsSame_v<MT,IT> && (*rhs).canAlias(
this ) ) {
1632 resize( (*rhs).rows(), (*rhs).columns(),
false );
1633 if( IsSparseMatrix_v<MT> )
1655template<
typename Type
1659template<
typename MT
1666 if( (*rhs).rows() != m_ || (*rhs).columns() != n_ ) {
1670 if( (*rhs).canAlias(
this ) ) {
1695template<
typename Type
1699template<
typename MT
1706 if( (*rhs).rows() != m_ || (*rhs).columns() != n_ ) {
1710 if( (*rhs).canAlias(
this ) ) {
1735template<
typename Type
1739template<
typename MT
1746 if( (*rhs).rows() != m_ || (*rhs).columns() != n_ ) {
1750 if( (*rhs).canAlias(
this ) ) {
1778template<
typename Type
1794template<
typename Type
1815template<
typename Type
1831template<
typename Type
1853template<
typename Type
1875template<
typename Type
1881 size_t nonzeros( 0UL );
1883 for(
size_t i=0UL; i<m_; ++i )
1884 for(
size_t j=0UL; j<n_; ++j )
1885 if( !isDefault<strict>( v_[i*nn_+j] ) )
1905template<
typename Type
1913 const size_t jend( i*nn_ + n_ );
1914 size_t nonzeros( 0UL );
1916 for(
size_t j=i*nn_; j<jend; ++j )
1917 if( !isDefault<strict>( v_[j] ) )
1930template<
typename Type
1938 for(
size_t i=0UL; i<m_; ++i )
1939 for(
size_t j=0UL; j<n_; ++j )
1940 clear( v_[i*nn_+j] );
1956template<
typename Type
1965 for(
size_t j=0UL; j<n_; ++j )
1966 clear( v_[i*nn_+j] );
1978template<
typename Type
1984 resize( 0UL, 0UL,
false );
2024template<
typename Type
2033 if( m == m_ && n == n_ )
return;
2035 const size_t nn( addPadding( n ) );
2039 const size_t min_m(
min( m, m_ ) );
2040 const size_t min_n(
min( n, n_ ) );
2044 for(
size_t i=0UL; i<min_m; ++i ) {
2053 else if( m*nn > capacity_ )
2063 if( IsVectorizable_v<Type> ) {
2064 for(
size_t i=0UL; i<m; ++i )
2065 for(
size_t j=n; j<nn; ++j )
2066 clear( v_[i*nn+j] );
2092template<
typename Type
2098 resize( m_+m, n_+n, preserve );
2112template<
typename Type
2144template<
typename Type
2150 if( ( m_ * nn_ ) < capacity_ ) {
2163template<
typename Type
2174 swap( capacity_, m.capacity_ );
2189template<
typename Type
2195 if( usePadding && IsVectorizable_v<Type> )
2196 return nextMultiple<size_t>( value, SIMDSIZE );
2215template<
typename Type
2223 constexpr size_t block( BLOCK_SIZE );
2227 for(
size_t ii=0UL; ii<m_; ii+=block ) {
2228 const size_t iend(
min( ii+block, m_ ) );
2229 for(
size_t jj=0UL; jj<=ii; jj+=block ) {
2230 for(
size_t i=ii; i<iend; ++i ) {
2231 const size_t jend(
min( jj+block, n_, i ) );
2232 for(
size_t j=jj; j<jend; ++j ) {
2233 swap( v_[i*nn_+j], v_[j*nn_+i] );
2255template<
typename Type
2261 constexpr size_t block( BLOCK_SIZE );
2265 for(
size_t ii=0UL; ii<m_; ii+=block ) {
2266 const size_t iend(
min( ii+block, m_ ) );
2267 for(
size_t jj=0UL; jj<ii; jj+=block ) {
2268 const size_t jend(
min( jj+block, n_ ) );
2269 for(
size_t i=ii; i<iend; ++i ) {
2270 for(
size_t j=jj; j<jend; ++j ) {
2271 cswap( v_[i*nn_+j], v_[j*nn_+i] );
2275 for(
size_t i=ii; i<iend; ++i ) {
2276 for(
size_t j=ii; j<i; ++j ) {
2277 cswap( v_[i*nn_+j], v_[j*nn_+i] );
2311template<
typename Type
2315template<
typename Other >
2319 for(
size_t i=0UL; i<m_; ++i )
2320 for(
size_t j=0UL; j<n_; ++j )
2321 v_[i*nn_+j] *= scalar;
2345template<
typename Type
2351 if( n_ > nn_ || m_ * nn_ > capacity_ )
2354 if( IsVectorizable_v<Type> ) {
2355 for(
size_t i=0UL; i<m_; ++i ) {
2356 for(
size_t j=n_; j<nn_; ++j ) {
2357 if( !isDefault<strict>( v_[i*nn_+j] ) )
2386template<
typename Type
2390template<
typename Other >
2393 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
2408template<
typename Type
2412template<
typename Other >
2415 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
2429template<
typename Type
2435 return ( usePadding ||
columns() % SIMDSIZE == 0UL );
2450template<
typename Type
2456 return (
rows() *
columns() >= SMP_DMATASSIGN_THRESHOLD );
2476template<
typename Type
2484 return loada( i, j );
2486 return loadu( i, j );
2506template<
typename Type
2523 return loada( v_+i*nn_+j );
2543template<
typename Type
2558 return loadu( v_+i*nn_+j );
2579template<
typename Type
2610template<
typename Type
2627 storea( v_+i*nn_+j, value );
2648template<
typename Type
2663 storeu( v_+i*nn_+j, value );
2685template<
typename Type
2702 stream( v_+i*nn_+j, value );
2718template<
typename Type
2722template<
typename MT >
2732 for(
size_t i=0UL; i<m_; ++i ) {
2733 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2734 v_[i*nn_+j ] = (*rhs)(i,j );
2735 v_[i*nn_+j+1UL] = (*rhs)(i,j+1UL);
2738 v_[i*nn_+jpos] = (*rhs)(i,jpos);
2756template<
typename Type
2760template<
typename MT >
2769 constexpr bool remainder( !usePadding || !IsPadded_v<MT> );
2771 const size_t jpos( remainder ?
prevMultiple( n_, SIMDSIZE ) : n_ );
2774 if( usePadding && useStreaming &&
2775 ( m_*n_ > ( cacheSize / (
sizeof(Type) * 3UL ) ) ) &&
2776 !(*rhs).isAliased(
this ) )
2778 for(
size_t i=0UL; i<m_; ++i )
2781 Iterator left(
begin(i) );
2784 for( ; j<jpos; j+=SIMDSIZE, left+=SIMDSIZE, right+=SIMDSIZE ) {
2785 left.stream( right.load() );
2787 for( ; remainder && j<n_; ++j, ++left, ++right ) {
2794 for(
size_t i=0UL; i<m_; ++i )
2797 Iterator left(
begin(i) );
2798 ConstIterator_t<MT> right( (*rhs).begin(i) );
2800 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2801 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2802 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2803 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2804 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2806 for( ; j<jpos; j+=SIMDSIZE ) {
2807 left.store( right.load() ); left+=SIMDSIZE, right+=SIMDSIZE;
2809 for( ; remainder && j<n_; ++j ) {
2810 *left = *right; ++left; ++right;
2829template<
typename Type
2833template<
typename MT >
2841 constexpr size_t block( BLOCK_SIZE );
2843 for(
size_t ii=0UL; ii<m_; ii+=block ) {
2844 const size_t iend(
min( m_, ii+block ) );
2845 for(
size_t jj=0UL; jj<n_; jj+=block ) {
2846 const size_t jend(
min( n_, jj+block ) );
2847 for(
size_t i=ii; i<iend; ++i ) {
2848 for(
size_t j=jj; j<jend; ++j ) {
2849 v_[i*nn_+j] = (*rhs)(i,j);
2869template<
typename Type
2873template<
typename MT >
2879 for(
size_t i=0UL; i<m_; ++i )
2880 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
2881 v_[i*nn_+element->index()] = element->value();
2897template<
typename Type
2901template<
typename MT >
2909 for(
size_t j=0UL; j<n_; ++j )
2910 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
2911 v_[element->index()*nn_+j] = element->value();
2927template<
typename Type
2931template<
typename MT >
2938 for(
size_t i=0UL; i<m_; ++i )
2940 if( IsDiagonal_v<MT> )
2942 v_[i*nn_+i] += (*rhs)(i,i);
2946 const size_t jbegin( ( IsUpper_v<MT> )
2947 ?( IsStrictlyUpper_v<MT> ? i+1UL : i )
2949 const size_t jend ( ( IsLower_v<MT> )
2950 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
2956 for( ; (j+2UL) <= jend; j+=2UL ) {
2957 v_[i*nn_+j ] += (*rhs)(i,j );
2958 v_[i*nn_+j+1UL] += (*rhs)(i,j+1UL);
2961 v_[i*nn_+j] += (*rhs)(i,j);
2980template<
typename Type
2984template<
typename MT >
2994 constexpr bool remainder( !usePadding || !IsPadded_v<MT> );
2996 for(
size_t i=0UL; i<m_; ++i )
2998 const size_t jbegin( ( IsUpper_v<MT> )
2999 ?(
prevMultiple( ( IsStrictlyUpper_v<MT> ? i+1UL : i ), SIMDSIZE ) )
3001 const size_t jend ( ( IsLower_v<MT> )
3002 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
3006 const size_t jpos( remainder ?
prevMultiple( jend, SIMDSIZE ) : jend );
3010 Iterator left(
begin(i) + jbegin );
3013 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
3014 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3015 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3016 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3017 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3019 for( ; j<jpos; j+=SIMDSIZE ) {
3020 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3022 for( ; remainder && j<jend; ++j ) {
3023 *left += *right; ++left; ++right;
3041template<
typename Type
3045template<
typename MT >
3053 constexpr size_t block( BLOCK_SIZE );
3055 for(
size_t ii=0UL; ii<m_; ii+=block ) {
3056 const size_t iend(
min( m_, ii+block ) );
3057 for(
size_t jj=0UL; jj<n_; jj+=block )
3059 if( IsLower_v<MT> && ii < jj )
break;
3060 if( IsUpper_v<MT> && ii > jj )
continue;
3062 for(
size_t i=ii; i<iend; ++i )
3064 const size_t jbegin( ( IsUpper_v<MT> )
3065 ?(
max( ( IsStrictlyUpper_v<MT> ? i+1UL : i ), jj ) )
3067 const size_t jend ( ( IsLower_v<MT> )
3068 ?(
min( ( IsStrictlyLower_v<MT> ? i : i+1UL ), n_, jj+block ) )
3069 :(
min( n_, jj+block ) ) );
3072 for(
size_t j=jbegin; j<jend; ++j ) {
3073 v_[i*nn_+j] += (*rhs)(i,j);
3093template<
typename Type
3097template<
typename MT >
3103 for(
size_t i=0UL; i<m_; ++i )
3104 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
3105 v_[i*nn_+element->index()] += element->value();
3121template<
typename Type
3125template<
typename MT >
3133 for(
size_t j=0UL; j<n_; ++j )
3134 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
3135 v_[element->index()*nn_+j] += element->value();
3151template<
typename Type
3155template<
typename MT >
3162 for(
size_t i=0UL; i<m_; ++i )
3164 if( IsDiagonal_v<MT> )
3166 v_[i*nn_+i] -= (*rhs)(i,i);
3170 const size_t jbegin( ( IsUpper_v<MT> )
3171 ?( IsStrictlyUpper_v<MT> ? i+1UL : i )
3173 const size_t jend ( ( IsLower_v<MT> )
3174 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
3180 for( ; (j+2UL) <= jend; j+=2UL ) {
3181 v_[i*nn_+j ] -= (*rhs)(i,j );
3182 v_[i*nn_+j+1UL] -= (*rhs)(i,j+1UL);
3185 v_[i*nn_+j] -= (*rhs)(i,j);
3204template<
typename Type
3208template<
typename MT >
3218 constexpr bool remainder( !usePadding || !IsPadded_v<MT> );
3220 for(
size_t i=0UL; i<m_; ++i )
3222 const size_t jbegin( ( IsUpper_v<MT> )
3223 ?(
prevMultiple( ( IsStrictlyUpper_v<MT> ? i+1UL : i ), SIMDSIZE ) )
3225 const size_t jend ( ( IsLower_v<MT> )
3226 ?( IsStrictlyLower_v<MT> ? i : i+1UL )
3230 const size_t jpos( remainder ?
prevMultiple( jend, SIMDSIZE ) : jend );
3234 Iterator left(
begin(i) + jbegin );
3237 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
3238 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3239 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3240 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3241 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3243 for( ; j<jpos; j+=SIMDSIZE ) {
3244 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3246 for( ; remainder && j<jend; ++j ) {
3247 *left -= *right; ++left; ++right;
3265template<
typename Type
3269template<
typename MT >
3277 constexpr size_t block( BLOCK_SIZE );
3279 for(
size_t ii=0UL; ii<m_; ii+=block ) {
3280 const size_t iend(
min( m_, ii+block ) );
3281 for(
size_t jj=0UL; jj<n_; jj+=block )
3283 if( IsLower_v<MT> && ii < jj )
break;
3284 if( IsUpper_v<MT> && ii > jj )
continue;
3286 for(
size_t i=ii; i<iend; ++i )
3288 const size_t jbegin( ( IsUpper_v<MT> )
3289 ?(
max( ( IsStrictlyUpper_v<MT> ? i+1UL : i ), jj ) )
3291 const size_t jend ( ( IsLower_v<MT> )
3292 ?(
min( ( IsStrictlyLower_v<MT> ? i : i+1UL ), n_, jj+block ) )
3293 :(
min( n_, jj+block ) ) );
3296 for(
size_t j=jbegin; j<jend; ++j ) {
3297 v_[i*nn_+j] -= (*rhs)(i,j);
3317template<
typename Type
3321template<
typename MT >
3327 for(
size_t i=0UL; i<m_; ++i )
3328 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
3329 v_[i*nn_+element->index()] -= element->value();
3345template<
typename Type
3349template<
typename MT >
3357 for(
size_t j=0UL; j<n_; ++j )
3358 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
3359 v_[element->index()*nn_+j] -= element->value();
3375template<
typename Type
3379template<
typename MT >
3389 for(
size_t i=0UL; i<m_; ++i ) {
3390 for(
size_t j=0UL; j<jpos; j+=2UL ) {
3391 v_[i*nn_+j ] *= (*rhs)(i,j );
3392 v_[i*nn_+j+1UL] *= (*rhs)(i,j+1UL);
3395 v_[i*nn_+jpos] *= (*rhs)(i,jpos);
3413template<
typename Type
3417template<
typename MT >
3426 constexpr bool remainder( !usePadding || !IsPadded_v<MT> );
3428 for(
size_t i=0UL; i<m_; ++i )
3430 const size_t jpos( remainder ?
prevMultiple( n_, SIMDSIZE ) : n_ );
3434 Iterator left(
begin(i) );
3437 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
3438 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3439 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3440 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3441 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3443 for( ; j<jpos; j+=SIMDSIZE ) {
3444 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
3446 for( ; remainder && j<n_; ++j ) {
3447 *left *= *right; ++left; ++right;
3465template<
typename Type
3469template<
typename MT >
3477 constexpr size_t block( BLOCK_SIZE );
3479 for(
size_t ii=0UL; ii<m_; ii+=block ) {
3480 const size_t iend(
min( m_, ii+block ) );
3481 for(
size_t jj=0UL; jj<n_; jj+=block ) {
3482 const size_t jend(
min( n_, jj+block ) );
3483 for(
size_t i=ii; i<iend; ++i ) {
3484 for(
size_t j=jj; j<jend; ++j ) {
3485 v_[i*nn_+j] *= (*rhs)(i,j);
3505template<
typename Type
3509template<
typename MT >
3517 for(
size_t i=0UL; i<m_; ++i )
3521 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element ) {
3522 for( ; j<element->index(); ++j )
3523 reset( v_[i*nn_+j] );
3524 v_[i*nn_+j] *= element->value();
3528 for( ; j<n_; ++j ) {
3529 reset( v_[i*nn_+j] );
3547template<
typename Type
3551template<
typename MT >
3561 for(
size_t j=0UL; j<n_; ++j )
3565 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element ) {
3566 for( ; i<element->index(); ++i )
3567 reset( v_[i*nn_+j] );
3568 v_[i*nn_+j] *= element->value();
3572 for( ; i<m_; ++i ) {
3573 reset( v_[i*nn_+j] );
3600template<
typename Type
3604 :
public DenseMatrix< DynamicMatrix<Type,true,Alloc,Tag>, true >
3643 template<
typename NewType >
3647 using NewAlloc =
typename std::allocator_traits<Alloc>::template rebind_alloc<NewType>;
3657 template<
size_t NewM
3661 using Other = DynamicMatrix<Type,true,Alloc,Tag>;
3671 static constexpr bool simdEnabled = IsVectorizable_v<Type>;
3677 static constexpr bool smpAssignable = !IsSMPAssignable_v<Type>;
3683 inline DynamicMatrix(
const Alloc& alloc = Alloc{} )
noexcept;
3684 inline DynamicMatrix(
size_t m,
size_t n,
const Alloc& alloc = Alloc{} );
3685 inline DynamicMatrix(
size_t m,
size_t n,
const Type& init,
const Alloc& alloc = Alloc{} );
3688 template<
typename Other >
3689 inline DynamicMatrix(
size_t m,
size_t n,
const Other* array,
const Alloc& alloc = Alloc{} );
3691 template<
typename Other,
size_t Rows,
size_t Cols >
3692 inline DynamicMatrix(
const Other (&array)[Rows][Cols],
const Alloc& alloc = Alloc{} );
3694 template<
typename Other,
size_t Rows,
size_t Cols >
3695 inline DynamicMatrix(
const std::array<std::array<Other,Cols>,Rows>& array,
const Alloc& alloc = Alloc{} );
3700 template<
typename MT,
bool SO >
3738 template< typename Other,
size_t Rows,
size_t Cols >
3739 inline
DynamicMatrix& operator=( const Other (&array)[Rows][Cols] ) &;
3741 template< typename Other,
size_t Rows,
size_t Cols >
3742 inline
DynamicMatrix& operator=( const std::array<std::array<Other,Cols>,Rows>& array ) &;
3747 template< typename MT,
bool SO > inline
DynamicMatrix& operator= ( const Matrix<MT,SO>& rhs ) &;
3748 template< typename MT,
bool SO > inline
DynamicMatrix& operator+=( const Matrix<MT,SO>& rhs ) &;
3749 template< typename MT,
bool SO > inline
DynamicMatrix& operator-=( const Matrix<MT,SO>& rhs ) &;
3750 template< typename MT,
bool SO > inline
DynamicMatrix& operator%=( const Matrix<MT,SO>& rhs ) &;
3757 inline
size_t rows() const noexcept;
3758 inline
size_t columns() const noexcept;
3759 inline
size_t spacing() const noexcept;
3760 inline
size_t capacity() const noexcept;
3761 inline
size_t capacity(
size_t j ) const noexcept;
3763 inline
size_t nonZeros(
size_t j ) const;
3764 inline
void reset();
3765 inline
void reset(
size_t j );
3766 inline
void clear();
3767 void resize (
size_t m,
size_t n,
bool preserve=true );
3768 inline
void extend (
size_t m,
size_t n,
bool preserve=true );
3781 template< typename Other > inline
DynamicMatrix& scale( const Other& scalar );
3788 template< typename MT >
3789 static constexpr
bool VectorizedAssign_v =
3790 ( useOptimizedKernels &&
3797 template< typename MT >
3798 static constexpr
bool VectorizedAddAssign_v =
3799 ( VectorizedAssign_v<MT> &&
3806 template< typename MT >
3807 static constexpr
bool VectorizedSubAssign_v =
3808 ( VectorizedAssign_v<MT> &&
3815 template< typename MT >
3816 static constexpr
bool VectorizedSchurAssign_v =
3817 ( VectorizedAssign_v<MT> &&
3830 inline
bool isIntact() const noexcept;
3837 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
3838 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
3840 inline
bool isAligned () const noexcept;
3852 template< typename MT >
3853 inline auto
assign( const DenseMatrix<MT,true>& rhs ) ->
DisableIf_t< VectorizedAssign_v<MT> >;
3855 template< typename MT >
3856 inline auto
assign( const DenseMatrix<MT,true>& rhs ) ->
EnableIf_t< VectorizedAssign_v<MT> >;
3858 template< typename MT > inline
void assign( const DenseMatrix<MT,false>& rhs );
3859 template< typename MT > inline
void assign( const SparseMatrix<MT,true>& rhs );
3860 template< typename MT > inline
void assign( const SparseMatrix<MT,false>& rhs );
3862 template< typename MT >
3863 inline auto
addAssign( const DenseMatrix<MT,true>& rhs ) ->
DisableIf_t< VectorizedAddAssign_v<MT> >;
3865 template< typename MT >
3866 inline auto
addAssign( const DenseMatrix<MT,true>& rhs ) ->
EnableIf_t< VectorizedAddAssign_v<MT> >;
3868 template< typename MT > inline
void addAssign( const DenseMatrix<MT,false>& rhs );
3869 template< typename MT > inline
void addAssign( const SparseMatrix<MT,true>& rhs );
3870 template< typename MT > inline
void addAssign( const SparseMatrix<MT,false>& rhs );
3872 template< typename MT >
3873 inline auto
subAssign ( const DenseMatrix<MT,true>& rhs ) ->
DisableIf_t< VectorizedSubAssign_v<MT> >;
3875 template< typename MT >
3876 inline auto
subAssign ( const DenseMatrix<MT,true>& rhs ) ->
EnableIf_t< VectorizedSubAssign_v<MT> >;
3878 template< typename MT > inline
void subAssign( const DenseMatrix<MT,false>& rhs );
3879 template< typename MT > inline
void subAssign( const SparseMatrix<MT,true>& rhs );
3880 template< typename MT > inline
void subAssign( const SparseMatrix<MT,false>& rhs );
3882 template< typename MT >
3883 inline auto
schurAssign ( const DenseMatrix<MT,true>& rhs ) ->
DisableIf_t< VectorizedSchurAssign_v<MT> >;
3885 template< typename MT >
3886 inline auto
schurAssign ( const DenseMatrix<MT,true>& rhs ) ->
EnableIf_t< VectorizedSchurAssign_v<MT> >;
3888 template< typename MT > inline
void schurAssign( const DenseMatrix<MT,false>& rhs );
3889 template< typename MT > inline
void schurAssign( const SparseMatrix<MT,true>& rhs );
3890 template< typename MT > inline
void schurAssign( const SparseMatrix<MT,false>& rhs );
3898 struct Uninitialized {};
3904 inline DynamicMatrix(
size_t m,
size_t mm,
size_t n,
const Alloc& alloc, Uninitialized );
3905 inline DynamicMatrix(
size_t m,
size_t mm,
size_t n,
size_t capa,
const Alloc& alloc, Uninitialized );
3912 inline size_t addPadding(
size_t minRows )
const noexcept;
3928 BLAZE_NO_UNIQUE_ADDRESS Alloc
alloc_;
3957template<
typename Type
3981template<
typename Type
3985 : DynamicMatrix( m, mm, n, mm*n, alloc, Uninitialized{} )
4000template<
typename Type
4033template<
typename Type
4037 : DynamicMatrix( m, addPadding(m), n, alloc, Uninitialized{} )
4043 if( IsVectorizable_v<Type> && IsBuiltin_v<Type> ) {
4044 for(
size_t j=0UL; j<
n_; ++j ) {
4045 for(
size_t i=
m_; i<mm_; ++i ) {
4068template<
typename Type
4072 : DynamicMatrix( m, n, alloc )
4074 for(
size_t j=0UL; j<
n_; ++j ) {
4075 for(
size_t i=0UL; i<
m_; ++i ) {
4108template<
typename Type
4118 for(
const auto& rowList : list ) {
4120 for(
const auto& element : rowList ) {
4121 v_[i+j*mm_] = element;
4124 for( ; j<
n_; ++j ) {
4162template<
typename Type
4165template<
typename Other >
4167 : DynamicMatrix( m, n, alloc )
4169 for(
size_t j=0UL; j<n; ++j ) {
4170 for(
size_t i=0UL; i<m; ++i ) {
4171 v_[i+j*mm_] = array[i+j*m];
4204template<
typename Type
4207template<
typename Other
4211 : DynamicMatrix( Rows, Cols, alloc )
4213 for(
size_t j=0UL; j<Cols; ++j ) {
4214 for(
size_t i=0UL; i<Rows; ++i ) {
4215 v_[i+j*mm_] = array[i][j];
4248template<
typename Type
4251template<
typename Other
4255 : DynamicMatrix( Rows, Cols, alloc )
4257 for(
size_t j=0UL; j<Cols; ++j ) {
4258 for(
size_t i=0UL; i<Rows; ++i ) {
4259 v_[i+j*mm_] = array[i][j];
4278template<
typename Type
4282 : DynamicMatrix( m.m_, m.n_ )
4300template<
typename Type
4307 , capacity_( m.capacity_ )
4326template<
typename Type
4329template<
typename MT
4336 if( IsSparseMatrix_v<MT> && IsBuiltin_v<Type> ) {
4360template<
typename Type
4366 alloc_.deallocate( v_, capacity_ );
4391template<
typename Type
4416template<
typename Type
4442template<
typename Type
4454 return (*
this)(i,j);
4472template<
typename Type
4484 return (*
this)(i,j);
4502template<
typename Type
4526template<
typename Type
4547template<
typename Type
4569template<
typename Type
4589template<
typename Type
4596 return Iterator( v_ + j*mm_ );
4609template<
typename Type
4616 return ConstIterator( v_ + j*mm_ );
4629template<
typename Type
4636 return ConstIterator( v_ + j*mm_ );
4649template<
typename Type
4656 return Iterator( v_ + j*mm_ + m_ );
4669template<
typename Type
4676 return ConstIterator( v_ + j*mm_ + m_ );
4689template<
typename Type
4696 return ConstIterator( v_ + j*mm_ + m_ );
4717template<
typename Type
4720inline DynamicMatrix<Type,true,Alloc,Tag>&
4723 for(
size_t j=0UL; j<n_; ++j )
4724 for(
size_t i=0UL; i<m_; ++i )
4755template<
typename Type
4758inline DynamicMatrix<Type,true,Alloc,Tag>&
4767 for(
const auto& rowList : list ) {
4769 for(
const auto& element : rowList ) {
4770 v_[i+j*mm_] = element;
4773 for( ; j<n_; ++j ) {
4774 clear( v_[i+j*mm_] );
4808template<
typename Type
4811template<
typename Other
4814inline DynamicMatrix<Type,true,Alloc,Tag>&
4817 resize( Rows, Cols,
false );
4819 for(
size_t j=0UL; j<Cols; ++j )
4820 for(
size_t i=0UL; i<Rows; ++i )
4821 v_[i+j*mm_] = array[i][j];
4852template<
typename Type
4855template<
typename Other
4858inline DynamicMatrix<Type,true,Alloc,Tag>&
4861 resize( Rows, Cols,
false );
4863 for(
size_t j=0UL; j<Cols; ++j )
4864 for(
size_t i=0UL; i<Rows; ++i )
4865 v_[i+j*mm_] = array[i][j];
4883template<
typename Type
4886inline DynamicMatrix<Type,true,Alloc,Tag>&
4889 if( &rhs ==
this )
return *
this;
4891 resize( rhs.m_, rhs.n_,
false );
4909template<
typename Type
4912inline DynamicMatrix<Type,true,Alloc,Tag>&
4916 alloc_.deallocate( v_, capacity_ );
4921 capacity_ = rhs.capacity_;
4927 rhs.capacity_ = 0UL;
4946template<
typename Type
4949template<
typename MT
4951inline DynamicMatrix<Type,true,Alloc,Tag>&
4954 using TT =
decltype(
trans( *
this ) );
4955 using CT =
decltype(
ctrans( *
this ) );
4956 using IT =
decltype(
inv( *
this ) );
4960 if( IsSame_v<MT,TT> && (*rhs).isAliased(
this ) ) {
4963 else if( IsSame_v<MT,CT> && (*rhs).isAliased(
this ) ) {
4966 else if( !IsSame_v<MT,IT> && (*rhs).canAlias(
this ) ) {
4967 DynamicMatrix tmp( *rhs );
4971 resize( (*rhs).rows(), (*rhs).columns(),
false );
4972 if( IsSparseMatrix_v<MT> )
4996template<
typename Type
4999template<
typename MT
5001inline DynamicMatrix<Type,true,Alloc,Tag>&
5002 DynamicMatrix<Type,true,Alloc,Tag>::operator+=(
const Matrix<MT,SO>& rhs ) &
5006 if( (*rhs).rows() != m_ || (*rhs).columns() != n_ ) {
5010 if( (*rhs).canAlias(
this ) ) {
5011 const ResultType_t<MT> tmp( *rhs );
5037template<
typename Type
5040template<
typename MT
5042inline DynamicMatrix<Type,true,Alloc,Tag>&
5043 DynamicMatrix<Type,true,Alloc,Tag>::operator-=(
const Matrix<MT,SO>& rhs ) &
5047 if( (*rhs).rows() != m_ || (*rhs).columns() != n_ ) {
5051 if( (*rhs).canAlias(
this ) ) {
5052 const ResultType_t<MT> tmp( *rhs );
5078template<
typename Type
5081template<
typename MT
5083inline DynamicMatrix<Type,true,Alloc,Tag>&
5084 DynamicMatrix<Type,true,Alloc,Tag>::operator%=(
const Matrix<MT,SO>& rhs ) &
5088 if( (*rhs).rows() != m_ || (*rhs).columns() != n_ ) {
5092 if( (*rhs).canAlias(
this ) ) {
5093 const ResultType_t<MT> tmp( *rhs );
5122template<
typename Type
5139template<
typename Type
5159template<
typename Type
5176template<
typename Type
5194template<
typename Type
5217template<
typename Type
5222 size_t nonzeros( 0UL );
5224 for(
size_t j=0UL; j<n_; ++j )
5225 for(
size_t i=0UL; i<m_; ++i )
5226 if( !isDefault<strict>( v_[i+j*mm_] ) )
5245template<
typename Type
5252 const size_t iend( j*mm_ + m_ );
5253 size_t nonzeros( 0UL );
5255 for(
size_t i=j*mm_; i<iend; ++i )
5256 if( !isDefault<strict>( v_[i] ) )
5271template<
typename Type
5278 for(
size_t j=0UL; j<n_; ++j )
5279 for(
size_t i=0UL; i<m_; ++i )
5280 clear( v_[i+j*mm_] );
5296template<
typename Type
5304 for(
size_t i=0UL; i<m_; ++i )
5305 clear( v_[i+j*mm_] );
5319template<
typename Type
5324 resize( 0UL, 0UL,
false );
5366template<
typename Type
5374 if( m == m_ && n == n_ )
return;
5376 const size_t mm( addPadding( m ) );
5380 const size_t min_m(
min( m, m_ ) );
5381 const size_t min_n(
min( n, n_ ) );
5383 DynamicMatrix tmp( m, mm, n, Alloc{}, Uninitialized{} );
5385 for(
size_t j=0UL; j<min_n; ++j ) {
5394 else if( mm*n > capacity_ )
5396 DynamicMatrix tmp( m, mm, n, Alloc{}, Uninitialized{} );
5404 if( IsVectorizable_v<Type> ) {
5405 for(
size_t j=0UL; j<n; ++j )
5406 for(
size_t i=m; i<mm; ++i )
5407 clear( v_[i+j*mm] );
5435template<
typename Type
5440 resize( m_+m, n_+n, preserve );
5456template<
typename Type
5465 DynamicMatrix tmp( m_, mm_, n_,
elements, Alloc{}, Uninitialized{} );
5489template<
typename Type
5494 if( ( mm_ * n_ ) < capacity_ ) {
5495 DynamicMatrix( *this ).swap( *
this );
5509template<
typename Type
5519 swap( capacity_, m.capacity_ );
5536template<
typename Type
5541 if( usePadding && IsVectorizable_v<Type> )
5542 return nextMultiple<size_t>( values, SIMDSIZE );
5563template<
typename Type
5570 constexpr size_t block( BLOCK_SIZE );
5574 for(
size_t jj=0UL; jj<n_; jj+=block ) {
5575 const size_t jend(
min( jj+block, n_ ) );
5576 for(
size_t ii=0UL; ii<=jj; ii+=block ) {
5577 for(
size_t j=jj; j<jend; ++j ) {
5578 const size_t iend(
min( ii+block, m_, j ) );
5579 for(
size_t i=ii; i<iend; ++i ) {
5580 swap( v_[i+j*mm_], v_[j+i*mm_] );
5588 DynamicMatrix tmp(
trans(*
this) );
5604template<
typename Type
5609 constexpr size_t block( BLOCK_SIZE );
5613 for(
size_t jj=0UL; jj<n_; jj+=block ) {
5614 const size_t jend(
min( jj+block, n_ ) );
5615 for(
size_t ii=0UL; ii<jj; ii+=block ) {
5616 const size_t iend(
min( ii+block, m_ ) );
5617 for(
size_t j=jj; j<jend; ++j ) {
5618 for(
size_t i=ii; i<iend; ++i ) {
5619 cswap( v_[i+j*mm_], v_[j+i*mm_] );
5623 for(
size_t j=jj; j<jend; ++j ) {
5624 for(
size_t i=jj; i<j; ++i ) {
5625 cswap( v_[i+j*mm_], v_[j+i*mm_] );
5633 DynamicMatrix tmp(
ctrans(*
this) );
5661template<
typename Type
5664template<
typename Other >
5665inline DynamicMatrix<Type,true,Alloc,Tag>& DynamicMatrix<Type,true,Alloc,Tag>::scale(
const Other& scalar )
5667 for(
size_t j=0UL; j<n_; ++j )
5668 for(
size_t i=0UL; i<m_; ++i )
5669 v_[i+j*mm_] *= scalar;
5695template<
typename Type
5700 if( m_ > mm_ || mm_ * n_ > capacity_ )
5703 if( IsVectorizable_v<Type> ) {
5704 for(
size_t j=0UL; j<n_; ++j ) {
5705 for(
size_t i=m_; i<mm_; ++i ) {
5706 if( !isDefault<strict>( v_[i+j*mm_] ) )
5737template<
typename Type
5740template<
typename Other >
5743 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
5760template<
typename Type
5763template<
typename Other >
5766 return static_cast<const void*
>( this ) ==
static_cast<const void*
>( alias );
5782template<
typename Type
5787 return ( usePadding ||
rows() % SIMDSIZE == 0UL );
5804template<
typename Type
5809 return (
rows() *
columns() >= SMP_DMATASSIGN_THRESHOLD );
5830template<
typename Type
5837 return loada( i, j );
5839 return loadu( i, j );
5860template<
typename Type
5876 return loada( v_+i+j*mm_ );
5897template<
typename Type
5911 return loadu( v_+i+j*mm_ );
5933template<
typename Type
5964template<
typename Type
5980 storea( v_+i+j*mm_, value );
6002template<
typename Type
6016 storeu( v_+i+j*mm_, value );
6039template<
typename Type
6055 stream( v_+i+j*mm_, value );
6073template<
typename Type
6076template<
typename MT >
6078 -> DisableIf_t< VectorizedAssign_v<MT> >
6086 for(
size_t j=0UL; j<n_; ++j ) {
6087 for(
size_t i=0UL; i<ipos; i+=2UL ) {
6088 v_[i +j*mm_] = (*rhs)(i ,j);
6089 v_[i+1UL+j*mm_] = (*rhs)(i+1UL,j);
6092 v_[ipos+j*mm_] = (*rhs)(ipos,j);
6112template<
typename Type
6115template<
typename MT >
6117 -> EnableIf_t< VectorizedAssign_v<MT> >
6124 constexpr bool remainder( !usePadding || !IsPadded_v<MT> );
6126 const size_t ipos( remainder ?
prevMultiple( m_, SIMDSIZE ) : m_ );
6129 if( usePadding && useStreaming &&
6130 ( m_*n_ > ( cacheSize / (
sizeof(Type) * 3UL ) ) ) &&
6131 !(*rhs).isAliased(
this ) )
6133 for(
size_t j=0UL; j<n_; ++j )
6136 Iterator left(
begin(j) );
6137 ConstIterator_t<MT> right( (*rhs).begin(j) );
6139 for( ; i<ipos; i+=SIMDSIZE ) {
6140 left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6142 for( ; remainder && i<m_; ++i ) {
6143 *left = *right; ++left; ++right;
6149 for(
size_t j=0UL; j<n_; ++j )
6152 Iterator left(
begin(j) );
6153 ConstIterator_t<MT> right( (*rhs).begin(j) );
6155 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
6156 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6157 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6158 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6159 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6161 for( ; i<ipos; i+=SIMDSIZE ) {
6162 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6164 for( ; remainder && i<m_; ++i ) {
6165 *left = *right; ++left; ++right;
6186template<
typename Type
6189template<
typename MT >
6197 constexpr size_t block( BLOCK_SIZE );
6199 for(
size_t jj=0UL; jj<n_; jj+=block ) {
6200 const size_t jend(
min( n_, jj+block ) );
6201 for(
size_t ii=0UL; ii<m_; ii+=block ) {
6202 const size_t iend(
min( m_, ii+block ) );
6203 for(
size_t j=jj; j<jend; ++j ) {
6204 for(
size_t i=ii; i<iend; ++i ) {
6205 v_[i+j*mm_] = (*rhs)(i,j);
6227template<
typename Type
6230template<
typename MT >
6236 for(
size_t j=0UL; j<(*rhs).columns(); ++j )
6237 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
6238 v_[element->index()+j*mm_] = element->value();
6256template<
typename Type
6259template<
typename MT >
6267 for(
size_t i=0UL; i<(*rhs).rows(); ++i )
6268 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
6269 v_[i+element->index()*mm_] = element->value();
6287template<
typename Type
6290template<
typename MT >
6292 -> DisableIf_t< VectorizedAddAssign_v<MT> >
6297 for(
size_t j=0UL; j<n_; ++j )
6299 if( IsDiagonal_v<MT> )
6301 v_[j+j*mm_] += (*rhs)(j,j);
6305 const size_t ibegin( ( IsLower_v<MT> )
6306 ?( IsStrictlyLower_v<MT> ? j+1UL : j )
6308 const size_t iend ( ( IsUpper_v<MT> )
6309 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
6315 for( ; (i+2UL) <= iend; i+=2UL ) {
6316 v_[i +j*mm_] += (*rhs)(i ,j);
6317 v_[i+1UL+j*mm_] += (*rhs)(i+1UL,j);
6320 v_[i+j*mm_] += (*rhs)(i,j);
6341template<
typename Type
6344template<
typename MT >
6346 -> EnableIf_t< VectorizedAddAssign_v<MT> >
6354 constexpr bool remainder( !usePadding || !IsPadded_v<MT> );
6356 for(
size_t j=0UL; j<n_; ++j )
6358 const size_t ibegin( ( IsLower_v<MT> )
6359 ?(
prevMultiple( ( IsStrictlyLower_v<MT> ? j+1UL : j ), SIMDSIZE ) )
6361 const size_t iend ( ( IsUpper_v<MT> )
6362 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
6366 const size_t ipos( remainder ?
prevMultiple( iend, SIMDSIZE ) : iend );
6370 Iterator left(
begin(j) + ibegin );
6371 ConstIterator_t<MT> right( (*rhs).begin(j) + ibegin );
6373 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
6374 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6375 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6376 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6377 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6379 for( ; i<ipos; i+=SIMDSIZE ) {
6380 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6382 for( ; remainder && i<iend; ++i ) {
6383 *left += *right; ++left; ++right;
6403template<
typename Type
6406template<
typename MT >
6414 constexpr size_t block( BLOCK_SIZE );
6416 for(
size_t jj=0UL; jj<n_; jj+=block ) {
6417 const size_t jend(
min( n_, jj+block ) );
6418 for(
size_t ii=0UL; ii<m_; ii+=block )
6420 if( IsLower_v<MT> && ii < jj )
continue;
6421 if( IsUpper_v<MT> && ii > jj )
break;
6423 for(
size_t j=jj; j<jend; ++j )
6425 const size_t ibegin( ( IsLower_v<MT> )
6426 ?(
max( ( IsStrictlyLower_v<MT> ? j+1UL : j ), ii ) )
6428 const size_t iend ( ( IsUpper_v<MT> )
6429 ?(
min( ( IsStrictlyUpper_v<MT> ? j : j+1UL ), m_, ii+block ) )
6430 :(
min( m_, ii+block ) ) );
6433 for(
size_t i=ibegin; i<iend; ++i ) {
6434 v_[i+j*mm_] += (*rhs)(i,j);
6456template<
typename Type
6459template<
typename MT >
6465 for(
size_t j=0UL; j<(*rhs).columns(); ++j )
6466 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
6467 v_[element->index()+j*mm_] += element->value();
6485template<
typename Type
6488template<
typename MT >
6496 for(
size_t i=0UL; i<(*rhs).rows(); ++i )
6497 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
6498 v_[i+element->index()*mm_] += element->value();
6516template<
typename Type
6519template<
typename MT >
6521 -> DisableIf_t< VectorizedSubAssign_v<MT> >
6526 for(
size_t j=0UL; j<n_; ++j )
6528 if( IsDiagonal_v<MT> )
6530 v_[j+j*mm_] -= (*rhs)(j,j);
6534 const size_t ibegin( ( IsLower_v<MT> )
6535 ?( IsStrictlyLower_v<MT> ? j+1UL : j )
6537 const size_t iend ( ( IsUpper_v<MT> )
6538 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
6544 for( ; (i+2UL) <= iend; i+=2UL ) {
6545 v_[i +j*mm_] -= (*rhs)(i ,j);
6546 v_[i+1+j*mm_] -= (*rhs)(i+1,j);
6549 v_[i+j*mm_] -= (*rhs)(i,j);
6570template<
typename Type
6573template<
typename MT >
6575 -> EnableIf_t< VectorizedSubAssign_v<MT> >
6583 constexpr bool remainder( !usePadding || !IsPadded_v<MT> );
6585 for(
size_t j=0UL; j<n_; ++j )
6587 const size_t ibegin( ( IsLower_v<MT> )
6588 ?(
prevMultiple( ( IsStrictlyLower_v<MT> ? j+1UL : j ), SIMDSIZE ) )
6590 const size_t iend ( ( IsUpper_v<MT> )
6591 ?( IsStrictlyUpper_v<MT> ? j : j+1UL )
6595 const size_t ipos( remainder ?
prevMultiple( iend, SIMDSIZE ) : iend );
6599 Iterator left(
begin(j) + ibegin );
6600 ConstIterator_t<MT> right( (*rhs).begin(j) + ibegin );
6602 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
6603 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6604 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6605 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6606 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6608 for( ; i<ipos; i+=SIMDSIZE ) {
6609 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6611 for( ; remainder && i<iend; ++i ) {
6612 *left -= *right; ++left; ++right;
6632template<
typename Type
6635template<
typename MT >
6643 constexpr size_t block( BLOCK_SIZE );
6645 for(
size_t jj=0UL; jj<n_; jj+=block ) {
6646 const size_t jend(
min( n_, jj+block ) );
6647 for(
size_t ii=0UL; ii<m_; ii+=block )
6649 if( IsLower_v<MT> && ii < jj )
continue;
6650 if( IsUpper_v<MT> && ii > jj )
break;
6652 for(
size_t j=jj; j<jend; ++j )
6654 const size_t ibegin( ( IsLower_v<MT> )
6655 ?(
max( ( IsStrictlyLower_v<MT> ? j+1UL : j ), ii ) )
6657 const size_t iend ( ( IsUpper_v<MT> )
6658 ?(
min( ( IsStrictlyUpper_v<MT> ? j : j+1UL ), m_, ii+block ) )
6659 :(
min( m_, ii+block ) ) );
6662 for(
size_t i=ibegin; i<iend; ++i ) {
6663 v_[i+j*mm_] -= (*rhs)(i,j);
6685template<
typename Type
6688template<
typename MT >
6694 for(
size_t j=0UL; j<(*rhs).columns(); ++j )
6695 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
6696 v_[element->index()+j*mm_] -= element->value();
6714template<
typename Type
6717template<
typename MT >
6725 for(
size_t i=0UL; i<(*rhs).rows(); ++i )
6726 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
6727 v_[i+element->index()*mm_] -= element->value();
6745template<
typename Type
6748template<
typename MT >
6750 -> DisableIf_t< VectorizedSchurAssign_v<MT> >
6758 for(
size_t j=0UL; j<n_; ++j ) {
6759 for(
size_t i=0UL; (i+2UL) <= ipos; i+=2UL ) {
6760 v_[i +j*mm_] *= (*rhs)(i ,j);
6761 v_[i+1+j*mm_] *= (*rhs)(i+1,j);
6764 v_[ipos+j*mm_] *= (*rhs)(ipos,j);
6784template<
typename Type
6787template<
typename MT >
6789 -> EnableIf_t< VectorizedSchurAssign_v<MT> >
6796 constexpr bool remainder( !usePadding || !IsPadded_v<MT> );
6798 for(
size_t j=0UL; j<n_; ++j )
6800 const size_t ipos( remainder ?
prevMultiple( m_, SIMDSIZE ) : m_ );
6804 Iterator left(
begin(j) );
6805 ConstIterator_t<MT> right( (*rhs).begin(j) );
6807 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
6808 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6809 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6810 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6811 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6813 for( ; i<ipos; i+=SIMDSIZE ) {
6814 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6816 for( ; remainder && i<m_; ++i ) {
6817 *left *= *right; ++left; ++right;
6837template<
typename Type
6840template<
typename MT >
6848 constexpr size_t block( BLOCK_SIZE );
6850 for(
size_t jj=0UL; jj<n_; jj+=block ) {
6851 const size_t jend(
min( n_, jj+block ) );
6852 for(
size_t ii=0UL; ii<m_; ii+=block ) {
6853 const size_t iend(
min( m_, ii+block ) );
6854 for(
size_t j=jj; j<jend; ++j ) {
6855 for(
size_t i=ii; i<iend; ++i ) {
6856 v_[i+j*mm_] *= (*rhs)(i,j);
6878template<
typename Type
6881template<
typename MT >
6889 for(
size_t j=0UL; j<n_; ++j )
6893 for(
auto element=(*rhs).begin(j); element!=(*rhs).end(j); ++element ) {
6894 for( ; i<element->index(); ++i )
6895 reset( v_[i+j*mm_] );
6896 v_[i+j*mm_] *= element->value();
6900 for( ; i<m_; ++i ) {
6901 reset( v_[i+j*mm_] );
6921template<
typename Type
6924template<
typename MT >
6934 for(
size_t i=0UL; i<m_; ++i )
6938 for(
auto element=(*rhs).begin(i); element!=(*rhs).end(i); ++element ) {
6939 for( ; j<element->index(); ++j )
6940 reset( v_[i+j*mm_] );
6941 v_[i+j*mm_] *= element->value();
6945 for( ; j<n_; ++j ) {
6946 reset( v_[i+j*mm_] );
6969template< RelaxationFlag RF,
typename Type,
bool SO,
typename Alloc,
typename Tag >
6970bool isDefault(
const DynamicMatrix<Type,SO,Alloc,Tag>& m );
6972template<
typename Type,
bool SO,
typename Alloc,
typename Tag >
6973bool isIntact(
const DynamicMatrix<Type,SO,Alloc,Tag>& m )
noexcept;
6975template<
typename Type,
bool SO,
typename Alloc,
typename Tag >
6976void swap( DynamicMatrix<Type,SO,Alloc,Tag>& a, DynamicMatrix<Type,SO,Alloc,Tag>& b )
noexcept;
7036template<
typename Type
7042 return m.isIntact();
7055template<
typename Type
7076template<
typename T,
bool SO,
typename Alloc,
typename Tag >
7077struct HasConstDataAccess< DynamicMatrix<T,SO,Alloc,Tag> >
7094template<
typename T,
bool SO,
typename Alloc,
typename Tag >
7095struct HasMutableDataAccess< DynamicMatrix<T,SO,Alloc,Tag> >
7112template<
typename T,
bool SO,
typename Alloc,
typename Tag >
7113struct IsAligned< DynamicMatrix<T,SO,Alloc,Tag> >
7130template<
typename T,
bool SO,
typename Alloc,
typename Tag >
7131struct IsContiguous< DynamicMatrix<T,SO,Alloc,Tag> >
7148template<
typename T,
bool SO,
typename Alloc,
typename Tag >
7149struct IsPadded< DynamicMatrix<T,SO,Alloc,Tag> >
7166template<
typename T1,
typename T2 >
7167struct AddTraitEval2< T1, T2
7170 ( IsDenseMatrix_v<T1> || IsDenseMatrix_v<T2> ) &&
7180 using ET = AddTrait_t< ElementType_t<T1>, ElementType_t<T2> >;
7182 static constexpr bool SO1 = StorageOrder_v<T1>;
7183 static constexpr bool SO2 = StorageOrder_v<T2>;
7185 static constexpr bool SO = ( IsDenseMatrix_v<T1> && IsDenseMatrix_v<T2>
7186 ? ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
7187 ? ( IsSymmetric_v<T1>
7195 using Type = DynamicMatrix< ET
7197 , DynamicAllocator_t< ET, GetAllocator_t<T1>, GetAllocator_t<T2> >
7198 , AddTrait_t< TagType_t<T1>, TagType_t<T2> > >;
7214template<
typename T1,
typename T2 >
7215struct SubTraitEval2< T1, T2
7218 ( IsDenseMatrix_v<T1> || IsDenseMatrix_v<T2> ) &&
7228 using ET = SubTrait_t< ElementType_t<T1>, ElementType_t<T2> >;
7230 static constexpr bool SO1 = StorageOrder_v<T1>;
7231 static constexpr bool SO2 = StorageOrder_v<T2>;
7233 static constexpr bool SO = ( IsDenseMatrix_v<T1> && IsDenseMatrix_v<T2>
7234 ? ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
7235 ? ( IsSymmetric_v<T1>
7243 using Type = DynamicMatrix< ET
7245 , DynamicAllocator_t< ET, GetAllocator_t<T1>, GetAllocator_t<T2> >
7246 , SubTrait_t< TagType_t<T1>, TagType_t<T2> > >;
7262template<
typename T1,
typename T2 >
7263struct SchurTraitEval2< T1, T2
7265 IsDenseMatrix_v<T2> &&
7275 using ET = MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >;
7277 static constexpr bool SO1 = StorageOrder_v<T1>;
7278 static constexpr bool SO2 = StorageOrder_v<T2>;
7280 static constexpr bool SO = ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
7281 ? ( IsSymmetric_v<T1>
7286 using Type = DynamicMatrix< ET
7288 , DynamicAllocator_t< ET, GetAllocator_t<T1>, GetAllocator_t<T2> >
7289 , MultTrait_t< TagType_t<T1>, TagType_t<T2> > >;
7305template<
typename T1,
typename T2 >
7306struct MultTraitEval2< T1, T2
7314 using ET = MultTrait_t< ElementType_t<T1>, T2 >;
7316 using Type = DynamicMatrix< ET
7317 , StorageOrder_v<T1>
7318 , DynamicAllocator_t< ET, GetAllocator_t<T1> >
7319 , MultTrait_t< TagType_t<T1>, T2 > >;
7322template<
typename T1,
typename T2 >
7323struct MultTraitEval2< T1, T2
7325 IsDenseMatrix_v<T2> &&
7331 using ET = MultTrait_t< T1, ElementType_t<T2> >;
7333 using Type = DynamicMatrix< ET
7334 , StorageOrder_v<T2>
7335 , DynamicAllocator_t< ET, GetAllocator_t<T2> >
7336 , MultTrait_t< T1, TagType_t<T2> > >;
7339template<
typename T1,
typename T2 >
7340struct MultTraitEval2< T1, T2
7342 IsDenseVector_v<T2> &&
7343 IsColumnVector_v<T1> &&
7344 IsRowVector_v<T2> &&
7350 using ET = MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >;
7352 using Type = DynamicMatrix< ET
7354 , DynamicAllocator_t< ET, GetAllocator_t<T1>, GetAllocator_t<T2> >
7355 , MultTrait_t< TagType_t<T1>, TagType_t<T2> > >;
7358template<
typename T1,
typename T2 >
7359struct MultTraitEval2< T1, T2
7362 ( IsDenseMatrix_v<T1> || IsDenseMatrix_v<T2> ) &&
7366 ( !IsSquare_v<T2> || Size_v<T1,1UL> ==
DefaultSize_v ) ) ) &&
7372 using M1 = MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >;
7373 using M2 = MultTrait_t< TagType_t<T1>, TagType_t<T2> >;
7374 using ET = AddTrait_t<M1,M1>;
7376 using Type = DynamicMatrix< ET
7377 , ( IsSparseMatrix_v<T1> ? StorageOrder_v<T2> : StorageOrder_v<T1> )
7379 , AddTrait_t<M2,M2> >;
7395template<
typename T1,
typename T2 >
7396struct KronTraitEval2< T1, T2
7398 IsDenseMatrix_v<T2> &&
7408 using ET = MultTrait_t< ElementType_t<T1>, ElementType_t<T2> >;
7410 using Type = DynamicMatrix< ET
7411 , StorageOrder_v<T2>
7412 , DynamicAllocator_t< ET, GetAllocator_t<T1>, GetAllocator_t<T2> >
7413 , MultTrait_t< TagType_t<T1>, TagType_t<T2> > >;
7429template<
typename T1,
typename T2 >
7430struct DivTraitEval2< T1, T2
7438 using ET = DivTrait_t< ElementType_t<T1>, T2 >;
7440 using Type = DynamicMatrix< ET
7441 , StorageOrder_v<T1>
7442 , DynamicAllocator_t< ET, GetAllocator_t<T1> >
7443 , DivTrait_t< TagType_t<T1>, T2 > >;
7459template<
typename T,
typename OP >
7460struct UnaryMapTraitEval2< T, OP
7468 EvaluateTrait_t< decltype( std::declval<OP>()( std::declval< ElementType_t<T> >() ) ) >;
7470 using Type = DynamicMatrix< ET
7472 , DynamicAllocator_t< ET, GetAllocator_t<T> >
7473 , MapTrait_t< TagType_t<T>, OP > >;
7481template<
typename T1,
typename T2,
typename OP >
7482struct BinaryMapTraitEval2< T1, T2, OP
7484 IsRowVector_v<T2> &&
7491 EvaluateTrait_t< decltype( std::declval<OP>()( std::declval< ElementType_t<T1> >()
7492 , std::declval< ElementType_t<T2> >() ) ) >;
7494 using Type = DynamicMatrix< ET
7496 , DynamicAllocator_t< ET, GetAllocator_t<T1>, GetAllocator_t<T2> >
7497 , MapTrait_t< TagType_t<T1>, TagType_t<T2>, OP > >;
7500template<
typename T1,
typename T2,
typename OP >
7501struct BinaryMapTraitEval2< T1, T2, OP
7514 EvaluateTrait_t< decltype( std::declval<OP>()( std::declval< ElementType_t<T1> >()
7515 , std::declval< ElementType_t<T2> >() ) ) >;
7517 static constexpr bool SO1 = StorageOrder_v<T1>;
7518 static constexpr bool SO2 = StorageOrder_v<T2>;
7520 static constexpr bool SO = ( IsDenseMatrix_v<T1> && IsDenseMatrix_v<T2>
7521 ? ( IsSymmetric_v<T1> ^ IsSymmetric_v<T2>
7522 ? ( IsSymmetric_v<T1>
7530 using Type = DynamicMatrix< ET
7532 , DynamicAllocator_t< ET, GetAllocator_t<T1>, GetAllocator_t<T2> >
7533 , MapTrait_t< TagType_t<T1>, TagType_t<T2>, OP > >;
7549template<
typename T,
size_t E >
7550struct ExpandTraitEval2< T, E
7556 using Type = DynamicMatrix< ElementType_t<T>
7575template<
typename T,
size_t R0,
size_t R1 >
7576struct RepeatTraitEval2< T, R0, R1,
inf
7578 ( ( R0 ==
inf && R1 ==
inf ) ||
7584 using Type = DynamicMatrix< ElementType_t<T>
7586 , DynamicAllocator_t< ElementType_t<T>, GetAllocator_t<T> >
7603template<
typename T1,
typename T2 >
7604struct SolveTraitEval2< T1, T2
7606 IsDenseMatrix_v<T2> &&
7616 using Type = DynamicMatrix< ElementType_t<T2>
7617 , StorageOrder_v<T2>
7618 , DynamicAllocator_t< ElementType_t<T2>, GetAllocator_t<T2> >
7635template<
typename T1,
bool SO,
typename Alloc,
typename Tag,
typename T2 >
7636struct HighType< DynamicMatrix<T1,SO,Alloc,Tag>, DynamicMatrix<T2,SO,Alloc,Tag> >
7638 using Type = DynamicMatrix< typename HighType<T1,T2>::Type, SO, Alloc, Tag >;
7654template<
typename T1,
bool SO,
typename Alloc,
typename Tag,
typename T2 >
7655struct LowType< DynamicMatrix<T1,SO,Alloc,Tag>, DynamicMatrix<T2,SO,Alloc,Tag> >
7657 using Type = DynamicMatrix< typename LowType<T1,T2>::Type, SO, Alloc, Tag >;
7673template<
typename MT >
7681 using ET = RemoveConst_t< ElementType_t<MT> >;
7683 using Type = DynamicMatrix< ET
7684 , StorageOrder_v<MT>
7685 , DynamicAllocator_t< ET, GetAllocator_t<MT> >
7702template<
typename MT,
size_t M >
7703struct RowsTraitEval2< MT, M
7708 using ET = RemoveConst_t< ElementType_t<MT> >;
7710 using Type = DynamicMatrix< ET
7712 , DynamicAllocator_t< ET, GetAllocator_t<MT> >
7729template<
typename MT,
size_t N >
7730struct ColumnsTraitEval2< MT, N
7735 using ET = RemoveConst_t< ElementType_t<MT> >;
7737 using Type = DynamicMatrix< ET
7739 , DynamicAllocator_t< ET, GetAllocator_t<MT> >
Header file for the addition trait.
Header file for generic algorithms.
Header file for auxiliary alias declarations.
typename ResultType_t< T >::TagType TagType_t
Alias declaration for nested TagType type definitions.
Definition: Aliases.h:530
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition: Aliases.h:450
typename T::ConstIterator ConstIterator_t
Alias declaration for nested ConstIterator type definitions.
Definition: Aliases.h:130
Header file for the AlignedAllocator implementation.
Header file for the alignment check function.
Header file for the alignment flag enumeration.
Header file for run time assertion macros.
Header file for kernel specific block sizes.
Header file for the columns trait.
Header file for the conjugate shim.
Constraint on the data type.
Header file for the DenseIterator class template.
Constraint on the data type.
Header file for the division trait.
Header file for the DynamicAllocator type trait.
Header file for the EnableIf class template.
Header file for the EvaluateTrait class template.
Header file for the expand trait.
Header file for the GetAllocator type trait.
Header file for the HasConstDataAccess type trait.
Header file for the HasMutableDataAccess type trait.
Header file for the HasSIMDAdd type trait.
Header file for the HasSIMDMult type trait.
Header file for the HasSIMDSub type trait.
Header file for the HighType type trait.
Header file for the IntegralConstant class template.
Header file for the IsAligned type trait.
Header file for the IsBuiltin type trait.
Header file for the IsColumnVector type trait.
Header file for the IsContiguous type trait.
Header file for the isDefault shim.
Header file for the IsDenseMatrix type trait.
Header file for the IsDenseVector type trait.
Header file for the IsDiagonal type trait.
Header file for the IsLower type trait.
Header file for the IsMatrix type trait.
Header file for the IsPadded type trait.
Header file for the IsRowVector type trait.
Header file for the IsSIMDCombinable type trait.
Header file for the IsSMPAssignable type trait.
Header file for the IsSame and IsStrictlySame type traits.
Header file for the IsScalar type trait.
Header file for the IsSparseMatrix type trait.
Header file for the IsSquare type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Header file for the IsUpper type trait.
Header file for the IsVectorizable type trait.
Header file for the Kron product trait.
Header file for the LowType type trait.
Header file for the map trait.
Header file for the MaxSize type trait.
Header file for the MAYBE_UNUSED function template.
Header file for memory allocation and deallocation functionality.
Header file for the multiplication trait.
Header file for the nextMultiple shim.
System settings for the [[no_unique_address]] attribute.
Constraint on the data type.
Header file for the prevMultiple shim.
Constraint on the data type.
Header file for the relaxation flag enumeration.
Header file for the RemoveCV type trait.
Header file for the RemoveConst type trait.
Header file for the repeat trait.
Header file for the rows trait.
Header file for all SIMD functionality.
Header file for the Schur product trait.
Header file for the Solver trait.
Header file for the subtraction trait.
Header file for the submatrix trait.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Allocator for type-specific aligned memory.
Definition: AlignedAllocator.h:72
Implementation of a generic iterator for dense vectors and matrices.
Definition: DenseIterator.h:60
Base class for dense matrices.
Definition: DenseMatrix.h:82
Efficient implementation of a dynamic matrix.
Definition: DynamicMatrix.h:242
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: DynamicMatrix.h:2690
bool isAliased(const Other *alias) const noexcept
Returns whether the matrix is aliased with the given address alias.
Definition: DynamicMatrix.h:2413
BLAZE_ALWAYS_INLINE void store(size_t i, size_t j, const SIMDType &value) noexcept
Store of a SIMD element of the matrix.
Definition: DynamicMatrix.h:2584
const Type & ReturnType
Return type for expression template evaluations.
Definition: DynamicMatrix.h:265
auto addAssign(const DenseMatrix< MT, SO > &rhs) -> DisableIf_t< VectorizedAddAssign_v< MT > >
Default implementation of the addition assignment of a row-major dense matrix.
Definition: DynamicMatrix.h:2932
void reset()
Reset to the default initial values.
Definition: DynamicMatrix.h:1934
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: DynamicMatrix.h:1798
auto schurAssign(const DenseMatrix< MT, SO > &rhs) -> DisableIf_t< VectorizedSchurAssign_v< MT > >
Default implementation of the Schur product assignment of a row-major dense matrix.
Definition: DynamicMatrix.h:3380
AlignedAllocator< Type > AllocatorType
Allocator type of this DynamicMatrix instance.
Definition: DynamicMatrix.h:263
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: DynamicMatrix.h:271
Type *BLAZE_RESTRICT v_
The dynamically allocated matrix elements.
Definition: DynamicMatrix.h:569
size_t spacing() const noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DynamicMatrix.h:1819
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: DynamicMatrix.h:2615
DynamicMatrix & transpose()
In-place transpose of the matrix.
Definition: DynamicMatrix.h:2219
void reserve(size_t elements)
Setting the minimum capacity of the matrix.
Definition: DynamicMatrix.h:2116
Tag TagType
Tag type of this DynamicMatrix instance.
Definition: DynamicMatrix.h:264
size_t capacity_
The maximum capacity of the matrix.
Definition: DynamicMatrix.h:567
Reference operator()(size_t i, size_t j) noexcept
2D-access to the matrix elements.
Definition: DynamicMatrix.h:1053
~DynamicMatrix()
The destructor for DynamicMatrix.
Definition: DynamicMatrix.h:1022
void swap(DynamicMatrix &m) noexcept
Swapping the contents of two matrices.
Definition: DynamicMatrix.h:2167
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: DynamicMatrix.h:1782
BLAZE_ALWAYS_INLINE SIMDType loada(size_t i, size_t j) const noexcept
Aligned load of a SIMD element of the matrix.
Definition: DynamicMatrix.h:2511
bool isAligned() const noexcept
Returns whether the matrix is properly aligned in memory.
Definition: DynamicMatrix.h:2433
DynamicMatrix< Type,!SO, Alloc, Tag > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DynamicMatrix.h:256
Type ElementType
Type of the matrix elements.
Definition: DynamicMatrix.h:261
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: DynamicMatrix.h:314
DenseMatrix< This, SO > BaseType
Base type of this DynamicMatrix instance.
Definition: DynamicMatrix.h:252
auto subAssign(const DenseMatrix< MT, SO > &rhs) -> DisableIf_t< VectorizedSubAssign_v< MT > >
Default implementation of the subtraction assignment of a row-major dense matrix.
Definition: DynamicMatrix.h:3156
size_t nn_
The alignment adjusted number of columns.
Definition: DynamicMatrix.h:566
void resize(size_t m, size_t n, bool preserve=true)
Changing the size of the matrix.
Definition: DynamicMatrix.h:2028
bool isIntact() const noexcept
Returns whether the invariants of the dynamic matrix are intact.
Definition: DynamicMatrix.h:2349
DynamicMatrix & operator=(const Type &rhs) &
Homogenous assignment to all matrix elements.
Definition: DynamicMatrix.h:1397
DynamicMatrix< Type, SO, Alloc, Tag > This
Type of this DynamicMatrix instance.
Definition: DynamicMatrix.h:251
size_t m_
The current number of rows of the matrix.
Definition: DynamicMatrix.h:564
ConstIterator cend(size_t i) const noexcept
Returns an iterator just past the last element of row/column i.
Definition: DynamicMatrix.h:1370
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: DynamicMatrix.h:2653
bool canAlias(const Other *alias) const noexcept
Returns whether the matrix can alias with the given address alias.
Definition: DynamicMatrix.h:2391
static constexpr bool simdEnabled
Compilation flag for SIMD optimization.
Definition: DynamicMatrix.h:308
auto assign(const DenseMatrix< MT, SO > &rhs) -> DisableIf_t< VectorizedAssign_v< MT > >
Default implementation of the assignment of a row-major dense matrix.
Definition: DynamicMatrix.h:2723
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition: DynamicMatrix.h:468
DynamicMatrix< Type,!SO, Alloc, Tag > TransposeType
Transpose type for expression template evaluations.
Definition: DynamicMatrix.h:259
void shrinkToFit()
Requesting the removal of unused capacity.
Definition: DynamicMatrix.h:2148
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: DynamicMatrix.h:1879
DenseIterator< Type, align > Iterator
Iterator over non-constant elements.
Definition: DynamicMatrix.h:273
DenseIterator< const Type, align > ConstIterator
Iterator over constant elements.
Definition: DynamicMatrix.h:274
size_t capacity() const noexcept
Returns the maximum capacity of the matrix.
Definition: DynamicMatrix.h:1835
BLAZE_ALWAYS_INLINE SIMDType load(size_t i, size_t j) const noexcept
Load of a SIMD element of the matrix.
Definition: DynamicMatrix.h:2481
void clear()
Clearing the matrix.
Definition: DynamicMatrix.h:1982
This ResultType
Result type for expression template evaluations.
Definition: DynamicMatrix.h:253
Pointer data() noexcept
Low-level data access to the matrix elements.
Definition: DynamicMatrix.h:1161
Type & Reference
Reference to a non-constant matrix value.
Definition: DynamicMatrix.h:268
bool canSMPAssign() const noexcept
Returns whether the matrix can be used in SMP assignments.
Definition: DynamicMatrix.h:2454
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t i, size_t j) const noexcept
Unaligned load of a SIMD element of the matrix.
Definition: DynamicMatrix.h:2548
Reference at(size_t i, size_t j)
Checked access to the matrix elements.
Definition: DynamicMatrix.h:1102
const Type & ConstReference
Reference to a constant matrix value.
Definition: DynamicMatrix.h:269
size_t addPadding(size_t value) const noexcept
Add the necessary amount of padding to the given value.
Definition: DynamicMatrix.h:2193
DynamicMatrix(const Alloc &alloc=Alloc{}) noexcept
The (default) constructor for DynamicMatrix.
Definition: DynamicMatrix.h:637
BLAZE_NO_UNIQUE_ADDRESS Alloc alloc_
The allocator of the matrix.
Definition: DynamicMatrix.h:580
Iterator begin(size_t i) noexcept
Returns an iterator to the first element of row/column i.
Definition: DynamicMatrix.h:1250
SIMDTrait_t< ElementType > SIMDType
SIMD type of the matrix elements.
Definition: DynamicMatrix.h:262
DynamicMatrix & ctranspose()
In-place conjugate transpose of the matrix.
Definition: DynamicMatrix.h:2259
void extend(size_t m, size_t n, bool preserve=true)
Extending the size of the matrix.
Definition: DynamicMatrix.h:2096
static constexpr AlignmentFlag align
Compilation switch for the choice of alignment.
Definition: DynamicMatrix.h:246
ConstIterator cbegin(size_t i) const noexcept
Returns an iterator to the first element of row/column i.
Definition: DynamicMatrix.h:1298
Iterator end(size_t i) noexcept
Returns an iterator just past the last element of row/column i.
Definition: DynamicMatrix.h:1322
const This & CompositeType
Data type for composite expression templates.
Definition: DynamicMatrix.h:266
Type * Pointer
Pointer to a non-constant matrix value.
Definition: DynamicMatrix.h:270
size_t n_
The current number of columns of the matrix.
Definition: DynamicMatrix.h:565
Base class for matrices.
Definition: Matrix.h:85
SIMD characteristics of data types.
Definition: SIMDTrait.h:297
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Initializer list type of the Blaze library.
Header file for the DenseMatrix base class.
Header file for the SparseMatrix base class.
void uninitialized_value_construct(ForwardIt first, ForwardIt last)
Value constructs elements in the given range.
Definition: UninitializedValueConstruct.h:69
void uninitialized_default_construct_n(ForwardIt first, size_t n)
Default constructs elements in the given range.
Definition: UninitializedDefaultConstruct.h:100
void uninitialized_default_construct(ForwardIt first, ForwardIt last)
Default constructs elements in the given range.
Definition: UninitializedDefaultConstruct.h:69
void destroy_n(ForwardIt first, size_t n)
Destroys the given range of objects .
Definition: Destroy.h:87
ForwardIt uninitialized_transfer(InputIt first, InputIt last, ForwardIt dest)
Transfers the elements from the given source range to the uninitialized destination range.
Definition: UninitializedTransfer.h:73
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.
Definition: Volatile.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.
Definition: Pointer.h:79
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.
Definition: Vectorizable.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.
Definition: Const.h:79
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TAG(A, B)
Data type constraint.
Definition: SameTag.h:68
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.
Definition: Reference.h:79
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1339
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1375
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1501
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
decltype(auto) inv(const DenseMatrix< MT, SO > &dm)
Calculation of the inverse of the given dense matrix.
Definition: DMatInvExpr.h:405
void swap(DynamicMatrix< Type, SO, Alloc, Tag > &a, DynamicMatrix< Type, SO, Alloc, Tag > &b) noexcept
Swapping the contents of two dynamic matrices.
Definition: DynamicMatrix.h:7059
bool isDefault(const DynamicMatrix< Type, SO, Alloc, Tag > &m)
Returns whether the given dynamic matrix is in default state.
Definition: DynamicMatrix.h:7011
bool isIntact(const DynamicMatrix< Type, SO, Alloc, Tag > &m) noexcept
Returns whether the invariants of the given dynamic matrix are intact.
Definition: DynamicMatrix.h:7040
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:143
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_DIAGONAL_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Diagonal.h:79
BLAZE_ALWAYS_INLINE void cswap(T &a, T &b) noexcept(IsNumeric_v< T >)
Swapping two conjugated values/objects.
Definition: Conjugate.h:193
BLAZE_ALWAYS_INLINE void conjugate(T &a) noexcept(IsNumeric_v< T >)
In-place conjugation of the given value/object.
Definition: Conjugate.h:118
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.
Definition: HasSIMDSub.h:187
constexpr ptrdiff_t DefaultMaxSize_v
Default size of the MaxSize type trait.
Definition: MaxSize.h:72
constexpr bool IsScalar_v
Auxiliary variable template for the IsScalar type trait.
Definition: IsScalar.h:104
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.
Definition: IsSIMDCombinable.h:137
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition: Size.h:72
constexpr bool IsDiagonal_v
Auxiliary variable template for the IsDiagonal type trait.
Definition: IsDiagonal.h:148
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.
Definition: IsMatrix.h:124
constexpr bool IsColumnVector_v
Auxiliary variable template for the IsColumnVector type trait.
Definition: IsColumnVector.h:126
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.
Definition: HasSIMDAdd.h:187
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.
Definition: HasSIMDMult.h:188
constexpr bool IsDenseMatrix_v
Auxiliary variable template for the IsDenseMatrix type trait.
Definition: IsDenseMatrix.h:124
constexpr bool IsDenseVector_v
Auxiliary variable template for the IsDenseVector type trait.
Definition: IsDenseVector.h:124
typename DynamicAllocator< As... >::template Type< T > DynamicAllocator_t
Auxiliary alias declaration for the DynamicAllocator type trait.
Definition: DynamicAllocator.h:211
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition: RelaxationFlag.h:66
BLAZE_ALWAYS_INLINE constexpr auto prevMultiple(T1 value, T2 factor) noexcept
Rounds down an integral value to the previous multiple of a given factor.
Definition: PrevMultiple.h:68
constexpr Infinity inf
Global Infinity instance.
Definition: Infinity.h:1080
constexpr size_t determineColumns(initializer_list< initializer_list< Type > > list) noexcept
Determines the maximum number of columns specified by the given initializer list.
Definition: InitializerList.h:107
AlignmentFlag
Alignment flag for (un-)aligned vectors and matrices.
Definition: AlignmentFlag.h:63
@ unaligned
Flag for unaligned vectors and matrices.
Definition: AlignmentFlag.h:64
@ aligned
Flag for aligned vectors and matrices.
Definition: AlignmentFlag.h:65
constexpr void clear(Matrix< MT, SO > &matrix)
Clearing the given matrix.
Definition: Matrix.h:960
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:644
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition: Matrix.h:806
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:660
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:1108
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:1221
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:518
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:676
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:1195
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition: Assert.h:117
typename SIMDTrait< T >::Type SIMDTrait_t
Auxiliary alias declaration for the SIMDTrait class template.
Definition: SIMDTrait.h:315
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:78
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:75
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:74
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
auto smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_RESTRICT
Compiler dependent setup of the [[no_unique_address]] attribute.
Definition: Restrict.h:81
BoolConstant< true > TrueType
Type traits base class.
Definition: IntegralConstant.h:132
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition: IntegralConstant.h:110
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition: Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
BLAZE_ALWAYS_INLINE bool checkAlignment(const T *address)
Checks the alignment of the given address.
Definition: AlignmentCheck.h:68
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:175
#define BLAZE_THROW_BAD_ALLOC
Macro for the emission of a std::bad_alloc exception.
Definition: Exception.h:139
Header file for the exception macros of the math module.
Header file for all forward declarations of the math module.
Header file for the extended initializer_list functionality.
constexpr bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71
constexpr bool columnMajor
Storage order flag for column-major matrices.
Definition: StorageOrder.h:99
Header file for all forward declarations for dense vectors and matrices.
Header file for the Size type trait.
Header file for the StorageOrder type trait.
Header file for the clear shim.
Header file for the reset shim.
Rebind mechanism to obtain a DynamicMatrix with different data/element type.
Definition: DynamicMatrix.h:282
DynamicMatrix< NewType, SO, NewAlloc, Tag > Other
The type of the other DynamicMatrix.
Definition: DynamicMatrix.h:287
typename std::allocator_traits< Alloc >::template rebind_alloc< NewType > NewAlloc
The new type of allocator.
Definition: DynamicMatrix.h:284
Resize mechanism to obtain a DynamicMatrix with different fixed dimensions.
Definition: DynamicMatrix.h:297
DynamicMatrix< Type, SO, Alloc, Tag > Other
The type of the other DynamicMatrix.
Definition: DynamicMatrix.h:298
Definition of the nested auxiliary struct Uninitialized.
Definition: DynamicMatrix.h:543
Header file for the cache size of the target architecture.
System settings for the inline keywords.
System settings for performance optimizations.
System settings for the restrict keyword.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
Header file for basic type definitions.