35 #ifndef _BLAZE_MATH_DENSE_STATICMATRIX_H_
36 #define _BLAZE_MATH_DENSE_STATICMATRIX_H_
175 template<
typename Type
179 class StaticMatrix :
public DenseMatrix< StaticMatrix<Type,M,N,SO>, SO >
188 enum { NN = N + ( IT::size - ( N % IT::size ) ) % IT::size };
222 template<
typename Other >
explicit inline StaticMatrix(
size_t m,
size_t n,
const Other* array );
223 template<
typename Other >
explicit inline StaticMatrix(
const Other (&array)[M][N] );
230 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3 );
231 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4 );
232 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5 );
233 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
235 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
236 const Type& v6,
const Type& v7 );
237 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
238 const Type& v6,
const Type& v7,
const Type& v8 );
239 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
240 const Type& v6,
const Type& v7,
const Type& v8,
const Type& v9 );
241 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
242 const Type& v6,
const Type& v7,
const Type& v8,
const Type& v9,
const Type& v10 );
255 inline Type*
data ();
256 inline const Type*
data ()
const;
257 inline Type*
data (
size_t i );
258 inline const Type*
data (
size_t i )
const;
271 template<
typename Other >
272 inline StaticMatrix& operator=(
const Other (&array)[M][N] );
282 template<
typename Other >
284 operator*=( Other rhs );
286 template<
typename Other >
288 operator/=( Other rhs );
295 inline size_t rows()
const;
299 inline size_t capacity(
size_t i )
const;
301 inline size_t nonZeros(
size_t i )
const;
303 inline void reset(
size_t i );
305 template<
typename Other >
inline StaticMatrix& scale(
const Other& scalar );
313 template<
typename MT >
315 struct VectorizedAssign {
316 enum { value = vectorizable && MT::vectorizable &&
325 template<
typename MT >
327 struct VectorizedAddAssign {
328 enum { value = vectorizable && MT::vectorizable &&
329 IsSame<Type,typename MT::ElementType>::value &&
330 IntrinsicTrait<Type>::addition &&
331 IsRowMajorMatrix<MT>::value };
338 template<
typename MT >
340 struct VectorizedSubAssign {
341 enum { value = vectorizable && MT::vectorizable &&
342 IsSame<Type,typename MT::ElementType>::value &&
343 IntrinsicTrait<Type>::subtraction &&
344 IsRowMajorMatrix<MT>::value };
353 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
354 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
362 template<
typename MT,
bool SO2 >
363 inline typename DisableIf< VectorizedAssign<MT> >::Type
364 assign(
const DenseMatrix<MT,SO2>& rhs );
366 template<
typename MT,
bool SO2 >
367 inline typename EnableIf< VectorizedAssign<MT> >::Type
368 assign(
const DenseMatrix<MT,SO2>& rhs );
370 template<
typename MT >
inline void assign(
const SparseMatrix<MT,SO>& rhs );
371 template<
typename MT >
inline void assign(
const SparseMatrix<MT,!SO>& rhs );
373 template<
typename MT,
bool SO2 >
374 inline typename DisableIf< VectorizedAddAssign<MT> >::Type
375 addAssign(
const DenseMatrix<MT,SO2>& rhs );
377 template<
typename MT,
bool SO2 >
378 inline typename EnableIf< VectorizedAddAssign<MT> >::Type
379 addAssign(
const DenseMatrix<MT,SO2>& rhs );
381 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,SO>& rhs );
382 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,!SO>& rhs );
384 template<
typename MT,
bool SO2 >
385 inline typename DisableIf< VectorizedSubAssign<MT> >::Type
386 subAssign(
const DenseMatrix<MT,SO2>& rhs );
388 template<
typename MT,
bool SO2 >
389 inline typename EnableIf< VectorizedSubAssign<MT> >::Type
390 subAssign(
const DenseMatrix<MT,SO2>& rhs );
392 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,SO>& rhs );
393 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,!SO>& rhs );
441 template<
typename Type
448 for(
size_t i=0UL; i<M*NN; ++i )
460 template<
typename Type
466 for(
size_t i=0UL; i<M; ++i ) {
467 for(
size_t j=0UL; j<N; ++j )
471 for(
size_t j=N; j<NN; ++j )
505 template<
typename Type
509 template<
typename Other >
513 throw std::invalid_argument(
"Invalid setup of static matrix" );
515 for(
size_t i=0UL; i<m; ++i ) {
516 for(
size_t j=0UL; j<n; ++j )
517 v_[i*NN+j] = array[i*n+j];
520 for(
size_t j=n; j<NN; ++j )
525 for(
size_t i=m; i<M; ++i ) {
526 for(
size_t j=0UL; j<NN; ++j )
553 template<
typename Type
557 template<
typename Other >
560 for(
size_t i=0UL; i<M; ++i ) {
561 for(
size_t j=0UL; j<N; ++j )
562 v_[i*NN+j] = array[i][j];
565 for(
size_t j=N; j<NN; ++j )
580 template<
typename Type
586 for(
size_t i=0UL; i<M*NN; ++i )
597 template<
typename Type
601 template<
typename Other
605 for(
size_t i=0UL; i<M; ++i ) {
606 for(
size_t j=0UL; j<N; ++j )
610 for(
size_t j=N; j<NN; ++j )
628 template<
typename Type
632 template<
typename MT
639 throw std::invalid_argument(
"Invalid setup of static matrix" );
642 for(
size_t i=0UL; i<M; ++i ) {
670 template<
typename Type
691 for(
size_t i=0UL; i<M; ++i ) {
692 for(
size_t j=N; j<NN; ++j )
718 template<
typename Type
741 for(
size_t i=0UL; i<M; ++i ) {
742 for(
size_t j=N; j<NN; ++j )
771 template<
typename Type
776 const Type& v3,
const Type& v4 )
789 else if( M == 2UL ) {
805 for(
size_t i=0UL; i<M; ++i ) {
806 for(
size_t j=N; j<NN; ++j )
834 template<
typename Type
839 const Type& v4,
const Type& v5 )
862 for(
size_t i=0UL; i<M; ++i ) {
863 for(
size_t j=N; j<NN; ++j )
895 template<
typename Type
900 const Type& v4,
const Type& v5,
const Type& v6 )
915 else if( M == 2UL ) {
925 else if( M == 3UL ) {
945 for(
size_t i=0UL; i<M; ++i ) {
946 for(
size_t j=N; j<NN; ++j )
976 template<
typename Type
981 const Type& v4,
const Type& v5,
const Type& v6,
1009 for(
size_t i=0UL; i<M; ++i ) {
1010 for(
size_t j=N; j<NN; ++j )
1011 v_[i*NN+j] = Type();
1043 template<
typename Type
1048 const Type& v4,
const Type& v5,
const Type& v6,
1049 const Type& v7,
const Type& v8 )
1066 else if( M == 2UL ) {
1078 else if( M == 4UL ) {
1084 v_[2UL*NN+1UL] = v6;
1086 v_[3UL*NN+1UL] = v8;
1102 for(
size_t i=0UL; i<M; ++i ) {
1103 for(
size_t j=N; j<NN; ++j )
1104 v_[i*NN+j] = Type();
1138 template<
typename Type
1143 const Type& v4,
const Type& v5,
const Type& v6,
1144 const Type& v7,
const Type& v8,
const Type& v9 )
1162 else if( M == 3UL ) {
1170 v_[2UL*NN+1UL] = v8;
1171 v_[2UL*NN+2UL] = v9;
1188 for(
size_t i=0UL; i<M; ++i ) {
1189 for(
size_t j=N; j<NN; ++j )
1190 v_[i*NN+j] = Type();
1225 template<
typename Type
1230 const Type& v4,
const Type& v5,
const Type& v6,
1231 const Type& v7,
const Type& v8,
const Type& v9,
1251 else if( M == 2UL ) {
1265 else if( M == 5UL ) {
1271 v_[2UL*NN+1UL] = v6;
1273 v_[3UL*NN+1UL] = v8;
1275 v_[4UL*NN+1UL] = v10;
1293 for(
size_t i=0UL; i<M; ++i ) {
1294 for(
size_t j=N; j<NN; ++j )
1295 v_[i*NN+j] = Type();
1317 template<
typename Type
1338 template<
typename Type
1361 template<
typename Type
1381 template<
typename Type
1400 template<
typename Type
1420 template<
typename Type
1443 template<
typename Type
1467 template<
typename Type
1491 template<
typename Type
1515 template<
typename Type
1539 template<
typename Type
1563 template<
typename Type
1605 template<
typename Type
1609 template<
typename Other >
1612 for(
size_t i=0UL; i<M; ++i )
1613 for(
size_t j=0UL; j<N; ++j )
1614 v_[i*NN+j] = array[i][j];
1627 template<
typename Type
1633 for(
size_t i=0UL; i<M; ++i )
1634 for(
size_t j=0UL; j<N; ++j )
1650 template<
typename Type
1656 for(
size_t i=0UL; i<M; ++i )
1657 for(
size_t j=0UL; j<N; ++j )
1658 v_[i*NN+j] = rhs(i,j);
1671 template<
typename Type
1675 template<
typename Other
1680 for(
size_t i=0UL; i<M; ++i )
1681 for(
size_t j=0UL; j<N; ++j )
1682 v_[i*NN+j] = rhs(i,j);
1700 template<
typename Type
1704 template<
typename MT
1711 throw std::invalid_argument(
"Invalid assignment to static matrix" );
1713 if( (~rhs).canAlias(
this ) ) {
1738 template<
typename Type
1742 template<
typename MT
1749 throw std::invalid_argument(
"Matrix sizes do not match" );
1751 if( (~rhs).canAlias(
this ) ) {
1774 template<
typename Type
1778 template<
typename MT
1785 throw std::invalid_argument(
"Matrix sizes do not match" );
1787 if( (~rhs).canAlias(
this ) ) {
1810 template<
typename Type
1814 template<
typename MT
1818 if( M != N || (~rhs).
rows() != M || (~rhs).
columns() != M )
1819 throw std::invalid_argument(
"Matrix sizes do not match" );
1822 return this->operator=( tmp );
1834 template<
typename Type
1838 template<
typename Other >
1844 assign( *
this, (*
this) * rhs );
1859 template<
typename Type
1863 template<
typename Other >
1871 assign( *
this, (*
this) / rhs );
1890 template<
typename Type
1906 template<
typename Type
1925 template<
typename Type
1941 template<
typename Type
1963 template<
typename Type
1980 template<
typename Type
1986 size_t nonzeros( 0UL );
1988 for(
size_t i=0UL; i<M; ++i )
1989 for(
size_t j=0UL; j<N; ++j )
2009 template<
typename Type
2017 const size_t jend( (i+1UL)*NN );
2018 size_t nonzeros( 0UL );
2020 for(
size_t j=i*NN; j<jend; ++j )
2034 template<
typename Type
2042 for(
size_t i=0UL; i<M; ++i )
2043 for(
size_t j=0UL; j<N; ++j )
2044 reset( v_[i*NN+j] );
2060 template<
typename Type
2069 for(
size_t j=0UL; j<N; ++j )
2070 reset( v_[i*NN+j] );
2080 template<
typename Type
2088 for(
size_t i=1UL; i<M; ++i )
2089 for(
size_t j=0UL; j<i; ++j )
2090 swap( v_[i*NN+j], v_[j*NN+i] );
2103 template<
typename Type
2107 template<
typename Other >
2110 for(
size_t i=0UL; i<M; ++i )
2111 for(
size_t j=0UL; j<N; ++j )
2112 v_[i*NN+j] *= scalar;
2126 template<
typename Type
2134 for(
size_t i=0UL; i<M; ++i ) {
2135 for(
size_t j=0UL; j<N; ++j ) {
2136 swap( v_[i*NN+j], m(i,j) );
2161 template<
typename Type
2165 template<
typename Other >
2168 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2183 template<
typename Type
2187 template<
typename Other >
2190 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2210 template<
typename Type
2226 return load( &v_[i*NN+j] );
2246 template<
typename Type
2261 return loadu( &v_[i*NN+j] );
2282 template<
typename Type
2297 store( &v_[i*NN+j], value );
2318 template<
typename Type
2332 storeu( &v_[i*NN+j], value );
2353 template<
typename Type
2368 stream( &v_[i*NN+j], value );
2384 template<
typename Type
2388 template<
typename MT
2395 for(
size_t i=0UL; i<M; ++i ) {
2396 for(
size_t j=0UL; j<N; ++j ) {
2397 v_[i*NN+j] = (~rhs)(i,j);
2415 template<
typename Type
2419 template<
typename MT
2430 for(
size_t i=0UL; i<M; ++i ) {
2431 for(
size_t j=0UL; j<N; j+=IT::size ) {
2450 template<
typename Type
2454 template<
typename MT >
2461 for(
size_t i=0UL; i<M; ++i )
2462 for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
2463 v_[i*NN+element->index()] = element->value();
2479 template<
typename Type
2483 template<
typename MT >
2490 for(
size_t j=0UL; j<N; ++j )
2491 for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
2492 v_[element->index()*NN+j] = element->value();
2508 template<
typename Type
2512 template<
typename MT
2519 for(
size_t i=0UL; i<M; ++i ) {
2520 for(
size_t j=0UL; j<N; ++j ) {
2521 v_[i*NN+j] += (~rhs)(i,j);
2539 template<
typename Type
2543 template<
typename MT
2555 for(
size_t i=0UL; i<M; ++i ) {
2556 for(
size_t j=0UL; j<N; j+=IT::size ) {
2557 store( &v_[i*NN+j],
load( &v_[i*NN+j] ) + (~rhs).
load(i,j) );
2575 template<
typename Type
2579 template<
typename MT >
2586 for(
size_t i=0UL; i<M; ++i )
2587 for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
2588 v_[i*NN+element->index()] += element->value();
2604 template<
typename Type
2608 template<
typename MT >
2615 for(
size_t j=0UL; j<N; ++j )
2616 for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
2617 v_[element->index()*NN+j] += element->value();
2633 template<
typename Type
2637 template<
typename MT
2644 for(
size_t i=0UL; i<M; ++i ) {
2645 for(
size_t j=0UL; j<N; ++j ) {
2646 v_[i*NN+j] -= (~rhs)(i,j);
2664 template<
typename Type
2668 template<
typename MT
2680 for(
size_t i=0UL; i<M; ++i ) {
2681 for(
size_t j=0UL; j<N; j+=IT::size ) {
2682 store( &v_[i*NN+j],
load( &v_[i*NN+j] ) - (~rhs).
load(i,j) );
2700 template<
typename Type
2704 template<
typename MT >
2711 for(
size_t i=0UL; i<M; ++i )
2712 for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
2713 v_[i*NN+element->index()] -= element->value();
2729 template<
typename Type
2733 template<
typename MT >
2740 for(
size_t j=0UL; j<N; ++j )
2741 for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
2742 v_[element->index()*NN+j] -= element->value();
2767 template<
typename Type
2779 enum { MM = M + ( IT::size - ( M % IT::size ) ) % IT::size };
2784 typedef StaticMatrix<Type,M,N,true>
This;
2794 typedef DenseIterator<Type>
Iterator;
2804 enum { vectorizable = IsVectorizable<Type>::value };
2813 template<
typename Other >
explicit inline StaticMatrix(
size_t m,
size_t n,
const Other* array );
2814 template<
typename Other >
explicit inline StaticMatrix(
const Other (&array)[M][N] );
2817 template<
typename Other,
bool SO >
inline StaticMatrix(
const StaticMatrix<Other,M,N,SO>& m );
2818 template<
typename MT ,
bool SO >
inline StaticMatrix(
const Matrix<MT,SO>& m );
2821 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3 );
2822 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4 );
2823 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5 );
2824 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
2826 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
2827 const Type& v6,
const Type& v7 );
2828 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
2829 const Type& v6,
const Type& v7,
const Type& v8 );
2830 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
2831 const Type& v6,
const Type& v7,
const Type& v8,
const Type& v9 );
2832 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
2833 const Type& v6,
const Type& v7,
const Type& v8,
const Type& v9,
const Type& v10 );
2846 inline Type*
data ();
2847 inline const Type*
data ()
const;
2848 inline Type*
data (
size_t j );
2849 inline const Type*
data (
size_t j )
const;
2862 template<
typename Other >
2863 inline StaticMatrix& operator=(
const Other (&array)[M][N] );
2867 template<
typename Other,
bool SO >
inline StaticMatrix& operator= (
const StaticMatrix<Other,M,N,SO>& rhs );
2868 template<
typename MT ,
bool SO >
inline StaticMatrix& operator= (
const Matrix<MT,SO>& rhs );
2869 template<
typename MT ,
bool SO >
inline StaticMatrix& operator+=(
const Matrix<MT,SO>& rhs );
2870 template<
typename MT ,
bool SO >
inline StaticMatrix& operator-=(
const Matrix<MT,SO>& rhs );
2871 template<
typename MT ,
bool SO >
inline StaticMatrix& operator*=(
const Matrix<MT,SO>& rhs );
2873 template<
typename Other >
2874 inline typename EnableIf< IsNumeric<Other>,
StaticMatrix >::Type&
2875 operator*=( Other rhs );
2877 template<
typename Other >
2878 inline typename EnableIf< IsNumeric<Other>,
StaticMatrix >::Type&
2879 operator/=( Other rhs );
2886 inline size_t rows()
const;
2887 inline size_t columns()
const;
2888 inline size_t spacing()
const;
2890 inline size_t capacity(
size_t j )
const;
2892 inline size_t nonZeros(
size_t j )
const;
2893 inline void reset();
2894 inline void reset(
size_t i );
2896 template<
typename Other >
inline StaticMatrix& scale(
const Other& scalar );
2904 template<
typename MT >
2905 struct VectorizedAssign {
2906 enum { value = vectorizable && MT::vectorizable &&
2907 IsSame<Type,typename MT::ElementType>::value &&
2908 IsColumnMajorMatrix<MT>::value };
2914 template<
typename MT >
2915 struct VectorizedAddAssign {
2916 enum { value = vectorizable && MT::vectorizable &&
2917 IsSame<Type,typename MT::ElementType>::value &&
2918 IntrinsicTrait<Type>::addition &&
2919 IsColumnMajorMatrix<MT>::value };
2925 template<
typename MT >
2926 struct VectorizedSubAssign {
2927 enum { value = vectorizable && MT::vectorizable &&
2928 IsSame<Type,typename MT::ElementType>::value &&
2929 IntrinsicTrait<Type>::subtraction &&
2930 IsColumnMajorMatrix<MT>::value };
2938 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
2939 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
2947 template<
typename MT,
bool SO >
2948 inline typename DisableIf< VectorizedAssign<MT> >::Type
2949 assign(
const DenseMatrix<MT,SO>& rhs );
2951 template<
typename MT,
bool SO >
2952 inline typename EnableIf< VectorizedAssign<MT> >::Type
2953 assign(
const DenseMatrix<MT,SO>& rhs );
2955 template<
typename MT >
inline void assign(
const SparseMatrix<MT,true>& rhs );
2956 template<
typename MT >
inline void assign(
const SparseMatrix<MT,false>& rhs );
2958 template<
typename MT,
bool SO >
2959 inline typename DisableIf< VectorizedAddAssign<MT> >::Type
2960 addAssign(
const DenseMatrix<MT,SO>& rhs );
2962 template<
typename MT,
bool SO >
2963 inline typename EnableIf< VectorizedAddAssign<MT> >::Type
2964 addAssign(
const DenseMatrix<MT,SO>& rhs );
2966 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,true>& rhs );
2967 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,false>& rhs );
2969 template<
typename MT,
bool SO >
2970 inline typename DisableIf< VectorizedSubAssign<MT> >::Type
2971 subAssign(
const DenseMatrix<MT,SO>& rhs );
2973 template<
typename MT,
bool SO >
2974 inline typename EnableIf< VectorizedSubAssign<MT> >::Type
2975 subAssign(
const DenseMatrix<MT,SO>& rhs );
2977 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,true>& rhs );
2978 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,false>& rhs );
2986 AlignedArray<Type,MM*N>
v_;
3019 template<
typename Type
3024 if( IsNumeric<Type>::value ) {
3025 for(
size_t i=0UL; i<MM*N; ++i )
3039 template<
typename Type
3044 for(
size_t j=0UL; j<N; ++j ) {
3045 for(
size_t i=0UL; i<M; ++i )
3048 if( IsNumeric<Type>::value ) {
3049 for(
size_t i=M; i<MM; ++i )
3050 v_[i+j*MM] = Type();
3085 template<
typename Type
3088 template<
typename Other >
3091 if( m > M || n > N )
3092 throw std::invalid_argument(
"Invalid setup of static matrix" );
3094 for(
size_t j=0UL; j<n; ++j ) {
3095 for(
size_t i=0UL; i<m; ++i )
3096 v_[i+j*MM] = array[i+j*m];
3098 if( IsNumeric<Type>::value ) {
3099 for(
size_t i=m; i<MM; ++i )
3100 v_[i+j*MM] = Type();
3104 for(
size_t j=n; j<N; ++j ) {
3105 for(
size_t i=0UL; i<M; ++i )
3106 v_[i+j*MM] = Type();
3134 template<
typename Type
3137 template<
typename Other >
3140 for(
size_t j=0UL; j<N; ++j ) {
3141 for(
size_t i=0UL; i<M; ++i )
3142 v_[i+j*MM] = array[i][j];
3144 if( IsNumeric<Type>::value ) {
3145 for(
size_t i=M; i<MM; ++i )
3146 v_[i+j*MM] = Type();
3162 template<
typename Type
3167 for(
size_t i=0UL; i<MM*N; ++i )
3180 template<
typename Type
3183 template<
typename Other
3187 for(
size_t j=0UL; j<N; ++j ) {
3188 for(
size_t i=0UL; i<M; ++i )
3189 v_[i+j*MM] = m(i,j);
3191 if( IsNumeric<Type>::value ) {
3192 for(
size_t i=M; i<MM; ++i )
3193 v_[i+j*MM] = Type();
3212 template<
typename Type
3215 template<
typename MT
3222 throw std::invalid_argument(
"Invalid setup of static matrix" );
3224 if( IsNumeric<Type>::value ) {
3225 for(
size_t j=0UL; j<N; ++j )
3226 for(
size_t i=( IsSparseMatrix<MT>::value )?( 0UL ):( M ); i<MM; ++i ) {
3227 v_[i+j*MM] = Type();
3255 template<
typename Type
3274 if( IsNumeric<Type>::value ) {
3275 for(
size_t j=0UL; j<N; ++j )
3276 for(
size_t i=M; i<MM; ++i ) {
3277 v_[i+j*MM] = Type();
3304 template<
typename Type
3325 if( IsNumeric<Type>::value ) {
3326 for(
size_t j=0UL; j<N; ++j )
3327 for(
size_t i=M; i<MM; ++i ) {
3328 v_[i+j*MM] = Type();
3358 template<
typename Type
3375 else if( N == 2UL ) {
3390 if( IsNumeric<Type>::value ) {
3391 for(
size_t j=0UL; j<N; ++j )
3392 for(
size_t i=M; i<MM; ++i ) {
3393 v_[i+j*MM] = Type();
3422 template<
typename Type
3426 const Type& v4,
const Type& v5 )
3448 if( IsNumeric<Type>::value ) {
3449 for(
size_t j=0UL; j<N; ++j )
3450 for(
size_t i=M; i<MM; ++i ) {
3451 v_[i+j*MM] = Type();
3484 template<
typename Type
3488 const Type& v4,
const Type& v5,
const Type& v6 )
3503 else if( N == 2UL ) {
3513 else if( N == 3UL ) {
3519 v_[2UL*MM+1UL] = v6;
3532 if( IsNumeric<Type>::value ) {
3533 for(
size_t j=0UL; j<N; ++j )
3534 for(
size_t i=M; i<MM; ++i ) {
3535 v_[i+j*MM] = Type();
3566 template<
typename Type
3570 const Type& v4,
const Type& v5,
const Type& v6,
3597 if( IsNumeric<Type>::value ) {
3598 for(
size_t j=0UL; j<N; ++j )
3599 for(
size_t i=M; i<MM; ++i ) {
3600 v_[i+j*MM] = Type();
3635 template<
typename Type
3639 const Type& v4,
const Type& v5,
const Type& v6,
3640 const Type& v7,
const Type& v8 )
3657 else if( N == 2UL ) {
3669 else if( N == 4UL ) {
3675 v_[2UL*MM+1UL] = v6;
3677 v_[3UL*MM+1UL] = v8;
3692 if( IsNumeric<Type>::value ) {
3693 for(
size_t j=0UL; j<N; ++j )
3694 for(
size_t i=M; i<MM; ++i ) {
3695 v_[i+j*MM] = Type();
3731 template<
typename Type
3735 const Type& v4,
const Type& v5,
const Type& v6,
3736 const Type& v7,
const Type& v8,
const Type& v9 )
3754 else if( N == 3UL ) {
3762 v_[2UL*MM+1UL] = v8;
3763 v_[2UL*MM+2UL] = v9;
3779 if( IsNumeric<Type>::value ) {
3780 for(
size_t j=0UL; j<N; ++j )
3781 for(
size_t i=M; i<MM; ++i ) {
3782 v_[i+j*MM] = Type();
3819 template<
typename Type
3823 const Type& v4,
const Type& v5,
const Type& v6,
3824 const Type& v7,
const Type& v8,
const Type& v9,
3844 else if( N == 2UL ) {
3858 else if( N == 5UL ) {
3864 v_[2UL*MM+1UL] = v6;
3866 v_[3UL*MM+1UL] = v8;
3868 v_[4UL*MM+1UL] = v10;
3885 if( IsNumeric<Type>::value ) {
3886 for(
size_t j=0UL; j<N; ++j )
3887 for(
size_t i=M; i<MM; ++i ) {
3888 v_[i+j*MM] = Type();
3912 template<
typename Type
3934 template<
typename Type
3958 template<
typename Type
3979 template<
typename Type
3999 template<
typename Type
4020 template<
typename Type
4039 template<
typename Type
4059 template<
typename Type
4079 template<
typename Type
4099 template<
typename Type
4119 template<
typename Type
4139 template<
typename Type
4182 template<
typename Type
4185 template<
typename Other >
4186 inline StaticMatrix<Type,M,N,true>&
4187 StaticMatrix<Type,M,N,true>::operator=(
const Other (&array)[M][N] )
4189 for(
size_t j=0UL; j<N; ++j )
4190 for(
size_t i=0UL; i<M; ++i )
4191 v_[i+j*MM] = array[i][j];
4206 template<
typename Type
4209 inline StaticMatrix<Type,M,N,true>&
4210 StaticMatrix<Type,M,N,true>::operator=(
const Type&
set )
4212 for(
size_t j=0UL; j<N; ++j )
4213 for(
size_t i=0UL; i<M; ++i )
4231 template<
typename Type
4234 inline StaticMatrix<Type,M,N,true>&
4235 StaticMatrix<Type,M,N,true>::operator=(
const StaticMatrix& rhs )
4237 for(
size_t j=0UL; j<N; ++j )
4238 for(
size_t i=0UL; i<M; ++i )
4239 v_[i+j*MM] = rhs(i,j);
4254 template<
typename Type
4257 template<
typename Other
4259 inline StaticMatrix<Type,M,N,true>&
4260 StaticMatrix<Type,M,N,true>::operator=(
const StaticMatrix<Other,M,N,SO>& rhs )
4262 for(
size_t j=0UL; j<N; ++j )
4263 for(
size_t i=0UL; i<M; ++i )
4264 v_[i+j*MM] = rhs(i,j);
4284 template<
typename Type
4287 template<
typename MT
4289 inline StaticMatrix<Type,M,N,true>& StaticMatrix<Type,M,N,true>::operator=(
const Matrix<MT,SO>& rhs )
4294 throw std::invalid_argument(
"Invalid assignment to static matrix" );
4296 if( (~rhs).canAlias(
this ) ) {
4297 StaticMatrix tmp( ~rhs );
4301 if( IsSparseMatrix<MT>::value )
4323 template<
typename Type
4326 template<
typename MT
4328 inline StaticMatrix<Type,M,N,true>& StaticMatrix<Type,M,N,true>::operator+=(
const Matrix<MT,SO>& rhs )
4333 throw std::invalid_argument(
"Matrix sizes do not match" );
4335 if( (~rhs).canAlias(
this ) ) {
4336 StaticMatrix tmp( ~rhs );
4360 template<
typename Type
4363 template<
typename MT
4365 inline StaticMatrix<Type,M,N,true>& StaticMatrix<Type,M,N,true>::operator-=(
const Matrix<MT,SO>& rhs )
4370 throw std::invalid_argument(
"Matrix sizes do not match" );
4372 if( (~rhs).canAlias(
this ) ) {
4373 StaticMatrix tmp( ~rhs );
4397 template<
typename Type
4400 template<
typename MT
4402 inline StaticMatrix<Type,M,N,true>& StaticMatrix<Type,M,N,true>::operator*=(
const Matrix<MT,SO>& rhs )
4404 if( M != N || (~rhs).
rows() != M || (~rhs).
columns() != M )
4405 throw std::invalid_argument(
"Matrix sizes do not match" );
4407 StaticMatrix tmp( *
this * (~rhs) );
4408 return this->operator=( tmp );
4422 template<
typename Type
4425 template<
typename Other >
4426 inline typename EnableIf< IsNumeric<Other>, StaticMatrix<Type,M,N,true> >::Type&
4427 StaticMatrix<Type,M,N,true>::operator*=( Other rhs )
4431 assign( *
this, (*
this) * rhs );
4448 template<
typename Type
4451 template<
typename Other >
4452 inline typename EnableIf< IsNumeric<Other>, StaticMatrix<Type,M,N,true> >::Type&
4453 StaticMatrix<Type,M,N,true>::operator/=( Other rhs )
4459 assign( *
this, (*
this) / rhs );
4480 template<
typename Type
4497 template<
typename Type
4517 template<
typename Type
4534 template<
typename Type
4552 template<
typename Type
4570 template<
typename Type
4575 size_t nonzeros( 0UL );
4577 for(
size_t j=0UL; j<N; ++j )
4578 for(
size_t i=0UL; i<M; ++i )
4595 template<
typename Type
4602 const size_t iend( (j+1UL)*MM );
4603 size_t nonzeros( 0UL );
4605 for(
size_t i=j*MM; i<iend; ++i )
4621 template<
typename Type
4628 for(
size_t j=0UL; j<N; ++j )
4629 for(
size_t i=0UL; i<M; ++i )
4630 reset( v_[i+j*MM] );
4646 template<
typename Type
4654 for(
size_t i=0UL; i<M; ++i )
4655 reset( v_[i+j*MM] );
4667 template<
typename Type
4674 for(
size_t j=1UL; j<N; ++j )
4675 for(
size_t i=0UL; i<j; ++i )
4676 swap( v_[i+j*MM], v_[j+i*MM] );
4691 template<
typename Type
4694 template<
typename Other >
4695 inline StaticMatrix<Type,M,N,true>&
4696 StaticMatrix<Type,M,N,true>::scale(
const Other& scalar )
4698 for(
size_t j=0UL; j<N; ++j )
4699 for(
size_t i=0UL; i<M; ++i )
4700 v_[i+j*MM] *= scalar;
4716 template<
typename Type
4723 for(
size_t j=0UL; j<N; ++j ) {
4724 for(
size_t i=0UL; i<M; ++i ) {
4725 swap( v_[i+j*MM], m(i,j) );
4752 template<
typename Type
4755 template<
typename Other >
4758 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
4775 template<
typename Type
4778 template<
typename Other >
4781 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
4802 template<
typename Type
4805 inline typename StaticMatrix<Type,M,N,true>::IntrinsicType
4817 return load( &v_[i+j*MM] );
4838 template<
typename Type
4841 inline typename StaticMatrix<Type,M,N,true>::IntrinsicType
4852 return loadu( &v_[i+j*MM] );
4874 template<
typename Type
4888 store( &v_[i+j*MM], value );
4910 template<
typename Type
4923 storeu( &v_[i+j*MM], value );
4946 template<
typename Type
4960 stream( &v_[i+j*MM], value );
4978 template<
typename Type
4981 template<
typename MT
4983 inline typename DisableIf< typename StaticMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAssign<MT> >::Type
4988 for(
size_t j=0UL; j<N; ++j ) {
4989 for(
size_t i=0UL; i<M; ++i ) {
4990 v_[i+j*MM] = (~rhs)(i,j);
5010 template<
typename Type
5013 template<
typename MT
5015 inline typename EnableIf< typename StaticMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAssign<MT> >::Type
5024 for(
size_t j=0UL; j<N; ++j ) {
5025 for(
size_t i=0UL; i<M; i+=IT::size ) {
5046 template<
typename Type
5049 template<
typename MT >
5056 for(
size_t j=0UL; j<N; ++j )
5057 for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
5058 v_[element->index()+j*MM] = element->value();
5076 template<
typename Type
5079 template<
typename MT >
5086 for(
size_t i=0UL; i<M; ++i )
5087 for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
5088 v_[i+element->index()*MM] = element->value();
5106 template<
typename Type
5109 template<
typename MT
5111 inline typename DisableIf< typename StaticMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >::Type
5116 for(
size_t j=0UL; j<N; ++j ) {
5117 for(
size_t i=0UL; i<M; ++i ) {
5118 v_[i+j*MM] += (~rhs)(i,j);
5138 template<
typename Type
5141 template<
typename MT
5143 inline typename EnableIf< typename StaticMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >::Type
5153 for(
size_t j=0UL; j<N; ++j ) {
5154 for(
size_t i=0UL; i<M; i+=IT::size ) {
5155 store( &v_[i+j*MM],
load( &v_[i+j*MM] ) + (~rhs).
load(i,j) );
5175 template<
typename Type
5178 template<
typename MT >
5185 for(
size_t j=0UL; j<N; ++j )
5186 for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
5187 v_[element->index()+j*MM] += element->value();
5205 template<
typename Type
5208 template<
typename MT >
5215 for(
size_t i=0UL; i<M; ++i )
5216 for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
5217 v_[i+element->index()*MM] += element->value();
5235 template<
typename Type
5238 template<
typename MT
5240 inline typename DisableIf< typename StaticMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >::Type
5245 for(
size_t j=0UL; j<N; ++j ) {
5246 for(
size_t i=0UL; i<M; ++i ) {
5247 v_[i+j*MM] -= (~rhs)(i,j);
5267 template<
typename Type
5270 template<
typename MT
5272 inline typename EnableIf< typename StaticMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >::Type
5282 for(
size_t j=0UL; j<N; ++j ) {
5283 for(
size_t i=0UL; i<M; i+=IT::size ) {
5284 store( &v_[i+j*MM],
load( &v_[i+j*MM] ) - (~rhs).
load(i,j) );
5304 template<
typename Type
5307 template<
typename MT >
5314 for(
size_t j=0UL; j<N; ++j )
5315 for( RhsConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
5316 v_[element->index()+j*MM] -= element->value();
5334 template<
typename Type
5337 template<
typename MT >
5344 for(
size_t i=0UL; i<M; ++i )
5345 for( RhsConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
5346 v_[i+element->index()*MM] -= element->value();
5372 template<
typename Type
5375 class StaticMatrix<Type,M,0UL,SO>;
5388 template<
typename Type
5391 class StaticMatrix<Type,0UL,N,SO>;
5404 template<
typename Type
5406 class StaticMatrix<Type,0UL,0UL,SO>;
5426 template<
typename Type,
size_t M,
size_t N,
bool SO >
5427 inline void reset( StaticMatrix<Type,M,N,SO>& m );
5429 template<
typename Type,
size_t M,
size_t N,
bool SO >
5430 inline void clear( StaticMatrix<Type,M,N,SO>& m );
5432 template<
typename Type,
size_t M,
size_t N,
bool SO >
5433 inline bool isDefault(
const StaticMatrix<Type,M,N,SO>& m );
5435 template<
typename Type,
size_t M,
size_t N,
bool SO >
5436 inline void swap( StaticMatrix<Type,M,N,SO>& a, StaticMatrix<Type,M,N,SO>& b ) ;
5448 template<
typename Type
5468 template<
typename Type
5486 template<
typename Type
5493 for(
size_t i=0UL; i<M; ++i )
5494 for(
size_t j=0UL; j<N; ++j )
5495 if( !
isDefault( m(i,j) ) )
return false;
5498 for(
size_t j=0UL; j<N; ++j )
5499 for(
size_t i=0UL; i<M; ++i )
5500 if( !
isDefault( m(i,j) ) )
return false;
5517 template<
typename Type
5538 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
5539 struct AddTrait< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
5541 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M, N, SO > Type;
5544 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
5545 struct AddTrait< StaticMatrix<T1,M,N,SO1>, StaticMatrix<T2,M,N,SO2> >
5547 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M, N,
false > Type;
5563 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
5564 struct SubTrait< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
5566 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M, N, SO > Type;
5569 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
5570 struct SubTrait< StaticMatrix<T1,M,N,SO1>, StaticMatrix<T2,M,N,SO2> >
5572 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M, N,
false > Type;
5588 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
5589 struct MultTrait< StaticMatrix<T1,M,N,SO>, T2 >
5591 typedef StaticMatrix< typename MultTrait<T1,T2>::Type, M, N, SO > Type;
5595 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
5596 struct MultTrait< T1, StaticMatrix<T2,M,N,SO> >
5598 typedef StaticMatrix< typename MultTrait<T1,T2>::Type, M, N, SO > Type;
5602 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
5603 struct MultTrait< StaticMatrix<T1,M,N,SO>, StaticVector<T2,N,false> >
5605 typedef StaticVector< typename MultTrait<T1,T2>::Type, M,
false > Type;
5608 template<
typename T1,
size_t M,
typename T2,
size_t N,
bool SO >
5609 struct MultTrait< StaticVector<T1,M,true>, StaticMatrix<T2,M,N,SO> >
5611 typedef StaticVector< typename MultTrait<T1,T2>::Type, N,
true > Type;
5614 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
size_t L >
5615 struct MultTrait< StaticMatrix<T1,M,N,SO>, HybridVector<T2,L,false> >
5617 typedef StaticVector< typename MultTrait<T1,T2>::Type, M,
false > Type;
5620 template<
typename T1,
size_t L,
typename T2,
size_t M,
size_t N,
bool SO >
5621 struct MultTrait< HybridVector<T1,L,true>, StaticMatrix<T2,M,N,SO> >
5623 typedef StaticVector< typename MultTrait<T1,T2>::Type, N,
true > Type;
5626 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
5627 struct MultTrait< StaticMatrix<T1,M,N,SO>, DynamicVector<T2,false> >
5629 typedef StaticVector< typename MultTrait<T1,T2>::Type, M,
false > Type;
5632 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
5633 struct MultTrait< DynamicVector<T1,true>, StaticMatrix<T2,M,N,SO> >
5635 typedef StaticVector< typename MultTrait<T1,T2>::Type, N,
true > Type;
5638 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
5639 struct MultTrait< StaticMatrix<T1,M,N,SO>, CompressedVector<T2,false> >
5641 typedef StaticVector< typename MultTrait<T1,T2>::Type, M,
false > Type;
5644 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
5645 struct MultTrait< CompressedVector<T1,true>, StaticMatrix<T2,M,N,SO> >
5647 typedef StaticVector< typename MultTrait<T1,T2>::Type, N,
true > Type;
5650 template<
typename T1,
size_t M,
size_t K,
bool SO1,
typename T2,
size_t N,
bool SO2 >
5651 struct MultTrait< StaticMatrix<T1,M,K,SO1>, StaticMatrix<T2,K,N,SO2> >
5653 typedef StaticMatrix< typename MultTrait<T1,T2>::Type, M, N, SO1 > Type;
5669 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
5670 struct DivTrait< StaticMatrix<T1,M,N,SO>, T2 >
5672 typedef StaticMatrix< typename DivTrait<T1,T2>::Type, M, N, SO > Type;
5689 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
5690 struct MathTrait< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
5692 typedef StaticMatrix< typename MathTrait<T1,T2>::HighType, M, N, SO > HighType;
5693 typedef StaticMatrix< typename MathTrait<T1,T2>::LowType , M, N, SO > LowType;
5709 template<
typename T1,
size_t M,
size_t N,
bool SO >
5710 struct SubmatrixTrait< StaticMatrix<T1,M,N,SO> >
5712 typedef DynamicMatrix<T1,SO> Type;
5728 template<
typename T1,
size_t M,
size_t N,
bool SO >
5729 struct RowTrait< StaticMatrix<T1,M,N,SO> >
5731 typedef StaticVector<T1,N,true> Type;
5747 template<
typename T1,
size_t M,
size_t N,
bool SO >
5748 struct ColumnTrait< StaticMatrix<T1,M,N,SO> >
5750 typedef StaticVector<T1,M,false> Type;
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:107
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:116
This ResultType
Result type for expression template evaluations.
Definition: StaticMatrix.h:194
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:98
Constraint on the data type.
void reset(DynamicMatrix< Type, SO > &m)
Resetting the given dense matrix.
Definition: DynamicMatrix.h:4512
#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
EnableIf< IsIntegral< T >, Load< T, sizeof(T)> >::Type::Type load(const T *address)
Loads a vector of integral values.
Definition: Load.h:222
Header file for the subtraction trait.
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: StaticMatrix.h:1984
const bool defaultStorageOrder
The default storage order for all matrices of the Blaze library.This value specifies the default stor...
Definition: StorageOrder.h:56
Header file for the row trait.
bool canAlias(const Other *alias) const
Returns whether the matrix can alias with the given address alias.
Definition: StaticMatrix.h:2166
Header file for the IsSparseMatrix type trait.
bool isDefault(const DynamicMatrix< Type, SO > &m)
Returns whether the given dense matrix is in default state.
Definition: DynamicMatrix.h:4555
const Type & ConstReference
Reference to a constant matrix value.
Definition: StaticMatrix.h:202
StaticMatrix()
The default constructor for StaticMatrix.
Definition: StaticMatrix.h:445
EnableIf< IsIntegral< T >, Loadu< T, sizeof(T)> >::Type::Type loadu(const T *address)
Loads a vector of integral values.
Definition: Loadu.h:219
Header file for the IsSame and IsStrictlySame type traits.
void storeu(size_t i, size_t j, const IntrinsicType &value)
Unaligned store of an intrinsic element of the matrix.
Definition: StaticMatrix.h:2322
Header file for the IsColumnMajorMatrix type trait.
StaticMatrix< Type, N, M,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: StaticMatrix.h:196
void storeu(float *address, const sse_float_t &value)
Unaligned store of a vector of 'float' values.
Definition: Storeu.h:234
Type ElementType
Type of the matrix elements.
Definition: StaticMatrix.h:197
AlignedArray< Type, M *NN > v_
The statically allocated matrix elements.
Definition: StaticMatrix.h:401
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:116
Access proxy for sparse, matrices.The MatrixAccessProxy provides safe access to the elements of a no...
Definition: MatrixAccessProxy.h:86
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:158
Iterator end(size_t i)
Returns an iterator just past the last element of row/column i.
Definition: StaticMatrix.h:1520
void clear(DynamicMatrix< Type, SO > &m)
Clearing the given dense matrix.
Definition: DynamicMatrix.h:4528
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:104
Constraint on the data type.
Header file for the SparseMatrix base class.
void stream(float *address, const sse_float_t &value)
Aligned, non-temporal store of a vector of 'float' values.
Definition: Stream.h:233
ConstIterator cend(size_t i) const
Returns an iterator just past the last element of row/column i.
Definition: StaticMatrix.h:1568
Header file for the DisableIf class template.
StaticMatrix & transpose()
Transposing the matrix.
Definition: StaticMatrix.h:2084
void swap(StaticMatrix &m)
Swapping the contents of two static matrices.
Definition: StaticMatrix.h:2130
Header file for the multiplication trait.
Header file for nested template disabiguation.
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:104
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two sparse matrices.
Definition: CompressedMatrix.h:4541
DenseIterator< Type > Iterator
Iterator over non-constant elements.
Definition: StaticMatrix.h:203
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2379
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:116
Efficient implementation of a fixed-sized matrix.The StaticMatrix class template is the representatio...
Definition: Forward.h:50
Header file for the DenseMatrix base class.
Header file for the DenseIterator class template.
void reset()
Reset to the default initial values.
Definition: StaticMatrix.h:2038
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:179
Constraint on the data type.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: StaticMatrix.h:1910
IntrinsicType loadu(size_t i, size_t j) const
Unaligned load of an intrinsic element of the matrix.
Definition: StaticMatrix.h:2251
const This & CompositeType
Data type for composite expression templates.
Definition: StaticMatrix.h:200
Header file for the default storage order for all vectors of the Blaze library.
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a vectorizable data type...
Definition: Vectorizable.h:79
size_t capacity() const
Returns the maximum capacity of the matrix.
Definition: StaticMatrix.h:1945
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2377
Header file for the EnableIf class template.
bool isAliased(const Other *alias) const
Returns whether the matrix is aliased with the given address alias.
Definition: StaticMatrix.h:2188
ConstIterator cbegin(size_t i) const
Returns an iterator to the first element of row/column i.
Definition: StaticMatrix.h:1496
Iterator begin(size_t i)
Returns an iterator to the first element of row/column i.
Definition: StaticMatrix.h:1448
Header file for the equal shim.
Reference operator()(size_t i, size_t j)
2D-access to the matrix elements.
Definition: StaticMatrix.h:1322
Header file for the IsVectorizable type trait.
StaticMatrix< Type, M, N, SO > This
Type of this StaticMatrix instance.
Definition: StaticMatrix.h:193
ColumnIterator< const MT > ConstIterator
Iterator over constant elements.
Definition: DenseColumn.h:1972
Header file for the IsNumeric type trait.
Type * data()
Low-level data access to the matrix elements.
Definition: StaticMatrix.h:1365
IntrinsicTrait< Type > IT
Intrinsic trait for the vector element type.
Definition: StaticMatrix.h:183
IT::Type IntrinsicType
Intrinsic type of the matrix elements.
Definition: StaticMatrix.h:198
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:648
Header file for run time assertion macros.
Header file for the addition trait.
Header file for the division trait.
void swap(DynamicMatrix< Type, SO > &a, DynamicMatrix< Type, SO > &b)
Swapping the contents of two matrices.
Definition: DynamicMatrix.h:4584
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:209
Header file for the submatrix trait.
Constraint on the data type.
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:79
Header file for the reset shim.
Header file for the AlignedArray implementation.
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:239
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:116
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2378
Header file for the column trait.
Header file for the isDefault shim.
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:85
Constraint on the data type.
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
void store(size_t i, size_t j, const IntrinsicType &value)
Aligned store of an intrinsic element of the matrix.
Definition: StaticMatrix.h:2286
Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a ge...
Definition: DenseIterator.h:58
Header file for all intrinsic functionality.
Header file for the mathematical trait.
Header file for the IsRowMajorMatrix type trait.
size_t spacing() const
Returns the spacing between the beginning of two rows.
Definition: StaticMatrix.h:1929
const bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71
size_t rows() const
Returns the current number of rows of the matrix.
Definition: StaticMatrix.h:1894
const Type & ReturnType
Return type for expression template evaluations.
Definition: StaticMatrix.h:199
DenseIterator< const Type > ConstIterator
Iterator over constant elements.
Definition: StaticMatrix.h:204
Type & Reference
Reference to a non-constant matrix value.
Definition: StaticMatrix.h:201
size_t columns(const Matrix< MT, SO > &m)
Returns the current number of columns of the matrix.
Definition: Matrix.h:154
Header file for basic type definitions.
Compile time check for sparse matrix types.This type trait tests whether or not the given template pa...
Definition: IsSparseMatrix.h:103
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2376
SelectType< useConst, ConstIterator, ColumnIterator< MT > >::Type Iterator
Iterator over non-constant elements.
Definition: DenseColumn.h:1980
void stream(size_t i, size_t j, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the matrix.
Definition: StaticMatrix.h:2357
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:143
StaticMatrix< Type, M, N,!SO > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: StaticMatrix.h:195
size_t rows(const Matrix< MT, SO > &m)
Returns the current number of rows of the matrix.
Definition: Matrix.h:138
#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
IntrinsicType load(size_t i, size_t j) const
Aligned load of an intrinsic element of the matrix.
Definition: StaticMatrix.h:2215
EnableIf< IsIntegral< T >, Set< T, sizeof(T)> >::Type::Type set(T value)
Sets all values in the vector to the given integral value.
Definition: Set.h:209
void store(float *address, const sse_float_t &value)
Aligned store of a vector of 'float' values.
Definition: Store.h:242