35 #ifndef _BLAZE_MATH_DENSE_STATICMATRIX_H_
36 #define _BLAZE_MATH_DENSE_STATICMATRIX_H_
180 template<
typename Type
184 class StaticMatrix :
public DenseMatrix< StaticMatrix<Type,M,N,SO>, SO >
217 template<
typename ET >
235 enum { smpAssignable = 0 };
244 template<
typename Other >
explicit inline StaticMatrix(
size_t m,
size_t n,
const Other* array );
245 template<
typename Other >
explicit inline StaticMatrix(
const Other (&array)[M][N] );
248 template<
typename Other,
bool SO2 >
inline StaticMatrix(
const StaticMatrix<Other,M,N,SO2>& m );
249 template<
typename MT ,
bool SO2 >
inline StaticMatrix(
const Matrix<MT,SO2>& m );
252 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3 );
253 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4 );
254 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5 );
255 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
257 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
258 const Type& v6,
const Type& v7 );
259 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
260 const Type& v6,
const Type& v7,
const Type& v8 );
261 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
262 const Type& v6,
const Type& v7,
const Type& v8,
const Type& v9 );
263 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
264 const Type& v6,
const Type& v7,
const Type& v8,
const Type& v9,
const Type& v10 );
293 template<
typename Other >
294 inline StaticMatrix& operator=(
const Other (&array)[M][N] );
298 template<
typename Other,
bool SO2 >
inline StaticMatrix& operator= (
const StaticMatrix<Other,M,N,SO2>& rhs );
299 template<
typename MT ,
bool SO2 >
inline StaticMatrix& operator= (
const Matrix<MT,SO2>& rhs );
300 template<
typename MT ,
bool SO2 >
inline StaticMatrix& operator+=(
const Matrix<MT,SO2>& rhs );
301 template<
typename MT ,
bool SO2 >
inline StaticMatrix& operator-=(
const Matrix<MT,SO2>& rhs );
302 template<
typename MT ,
bool SO2 >
inline StaticMatrix& operator*=(
const Matrix<MT,SO2>& rhs );
304 template<
typename Other >
305 inline typename EnableIf< IsNumeric<Other>,
StaticMatrix >::Type&
306 operator*=( Other rhs );
308 template<
typename Other >
309 inline typename EnableIf< IsNumeric<Other>,
StaticMatrix >::Type&
310 operator/=( Other rhs );
317 inline size_t rows()
const;
321 inline size_t capacity(
size_t i )
const;
323 inline size_t nonZeros(
size_t i )
const;
325 inline void reset(
size_t i );
327 template<
typename Other >
inline StaticMatrix& scale(
const Other& scalar );
335 static inline void*
operator new ( std::size_t
size );
336 static inline void*
operator new[]( std::size_t
size );
337 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
338 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
340 static inline void operator delete (
void* ptr );
341 static inline void operator delete[](
void* ptr );
342 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
343 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
350 template<
typename MT >
352 struct VectorizedAssign {
353 enum { value = vectorizable && MT::vectorizable &&
354 IsSame<Type,typename MT::ElementType>::value &&
355 IsRowMajorMatrix<MT>::value };
362 template<
typename MT >
364 struct VectorizedAddAssign {
365 enum { value = vectorizable && MT::vectorizable &&
366 IsSame<Type,typename MT::ElementType>::value &&
367 IntrinsicTrait<Type>::addition &&
368 IsRowMajorMatrix<MT>::value };
375 template<
typename MT >
377 struct VectorizedSubAssign {
378 enum { value = vectorizable && MT::vectorizable &&
379 IsSame<Type,typename MT::ElementType>::value &&
380 IntrinsicTrait<Type>::subtraction &&
381 IsRowMajorMatrix<MT>::value };
390 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
391 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
401 template<
typename MT,
bool SO2 >
402 inline typename DisableIf< VectorizedAssign<MT> >::Type
403 assign(
const DenseMatrix<MT,SO2>& rhs );
405 template<
typename MT,
bool SO2 >
406 inline typename EnableIf< VectorizedAssign<MT> >::Type
407 assign(
const DenseMatrix<MT,SO2>& rhs );
409 template<
typename MT >
inline void assign(
const SparseMatrix<MT,SO>& rhs );
410 template<
typename MT >
inline void assign(
const SparseMatrix<MT,!SO>& rhs );
412 template<
typename MT,
bool SO2 >
413 inline typename DisableIf< VectorizedAddAssign<MT> >::Type
414 addAssign(
const DenseMatrix<MT,SO2>& rhs );
416 template<
typename MT,
bool SO2 >
417 inline typename EnableIf< VectorizedAddAssign<MT> >::Type
418 addAssign(
const DenseMatrix<MT,SO2>& rhs );
420 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,SO>& rhs );
421 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,!SO>& rhs );
423 template<
typename MT,
bool SO2 >
424 inline typename DisableIf< VectorizedSubAssign<MT> >::Type
425 subAssign(
const DenseMatrix<MT,SO2>& rhs );
427 template<
typename MT,
bool SO2 >
428 inline typename EnableIf< VectorizedSubAssign<MT> >::Type
429 subAssign(
const DenseMatrix<MT,SO2>& rhs );
431 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,SO>& rhs );
432 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,!SO>& rhs );
480 template<
typename Type
490 for(
size_t i=0UL; i<M*
NN; ++i )
502 template<
typename Type
511 for(
size_t i=0UL; i<M; ++i ) {
512 for(
size_t j=0UL; j<N; ++j )
515 for(
size_t j=N; j<
NN; ++j )
548 template<
typename Type
552 template<
typename Other >
559 throw std::invalid_argument(
"Invalid setup of static matrix" );
561 for(
size_t i=0UL; i<m; ++i ) {
562 for(
size_t j=0UL; j<n; ++j )
563 v_[i*
NN+j] = array[i*n+j];
566 for(
size_t j=n; j<
NN; ++j )
572 for(
size_t i=m; i<M; ++i ) {
573 for(
size_t j=0UL; j<
NN; ++j )
601 template<
typename Type
605 template<
typename Other >
611 for(
size_t i=0UL; i<M; ++i ) {
612 for(
size_t j=0UL; j<N; ++j )
613 v_[i*
NN+j] = array[i][j];
615 for(
size_t j=N; j<
NN; ++j )
629 template<
typename Type
638 for(
size_t i=0UL; i<M*
NN; ++i )
649 template<
typename Type
653 template<
typename Other
660 for(
size_t i=0UL; i<M; ++i ) {
661 for(
size_t j=0UL; j<N; ++j )
664 for(
size_t j=N; j<
NN; ++j )
681 template<
typename Type
685 template<
typename MT
695 throw std::invalid_argument(
"Invalid setup of static matrix" );
697 for(
size_t i=0UL; i<M; ++i ) {
725 template<
typename Type
747 for(
size_t i=0UL; i<M; ++i ) {
748 for(
size_t j=N; j<
NN; ++j )
773 template<
typename Type
797 for(
size_t i=0UL; i<M; ++i ) {
798 for(
size_t j=N; j<
NN; ++j )
826 template<
typename Type
831 const Type& v3,
const Type& v4 )
846 else if( M == 2UL ) {
861 for(
size_t i=0UL; i<M; ++i ) {
862 for(
size_t j=N; j<
NN; ++j )
889 template<
typename Type
894 const Type& v4,
const Type& v5 )
918 for(
size_t i=0UL; i<M; ++i ) {
919 for(
size_t j=N; j<
NN; ++j )
950 template<
typename Type
955 const Type& v4,
const Type& v5,
const Type& v6 )
972 else if( M == 2UL ) {
982 else if( M == 3UL ) {
1001 for(
size_t i=0UL; i<M; ++i ) {
1002 for(
size_t j=N; j<
NN; ++j )
1003 v_[i*NN+j] = Type();
1031 template<
typename Type
1036 const Type& v4,
const Type& v5,
const Type& v6,
1065 for(
size_t i=0UL; i<M; ++i ) {
1066 for(
size_t j=N; j<
NN; ++j )
1067 v_[i*NN+j] = Type();
1098 template<
typename Type
1103 const Type& v4,
const Type& v5,
const Type& v6,
1104 const Type& v7,
const Type& v8 )
1123 else if( M == 2UL ) {
1135 else if( M == 4UL ) {
1141 v_[2UL*
NN+1UL] = v6;
1143 v_[3UL*
NN+1UL] = v8;
1158 for(
size_t i=0UL; i<M; ++i ) {
1159 for(
size_t j=N; j<
NN; ++j )
1160 v_[i*NN+j] = Type();
1193 template<
typename Type
1198 const Type& v4,
const Type& v5,
const Type& v6,
1199 const Type& v7,
const Type& v8,
const Type& v9 )
1219 else if( M == 3UL ) {
1227 v_[2UL*
NN+1UL] = v8;
1228 v_[2UL*
NN+2UL] = v9;
1244 for(
size_t i=0UL; i<M; ++i ) {
1245 for(
size_t j=N; j<
NN; ++j )
1246 v_[i*NN+j] = Type();
1280 template<
typename Type
1285 const Type& v4,
const Type& v5,
const Type& v6,
1286 const Type& v7,
const Type& v8,
const Type& v9,
1308 else if( M == 2UL ) {
1322 else if( M == 5UL ) {
1328 v_[2UL*
NN+1UL] = v6;
1330 v_[3UL*
NN+1UL] = v8;
1332 v_[4UL*
NN+1UL] = v10;
1349 for(
size_t i=0UL; i<M; ++i ) {
1350 for(
size_t j=N; j<
NN; ++j )
1351 v_[i*NN+j] = Type();
1372 template<
typename Type
1393 template<
typename Type
1419 template<
typename Type
1443 template<
typename Type
1463 template<
typename Type
1484 template<
typename Type
1508 template<
typename Type
1532 template<
typename Type
1556 template<
typename Type
1580 template<
typename Type
1604 template<
typename Type
1628 template<
typename Type
1670 template<
typename Type
1674 template<
typename Other >
1677 for(
size_t i=0UL; i<M; ++i )
1678 for(
size_t j=0UL; j<N; ++j )
1679 v_[i*NN+j] = array[i][j];
1692 template<
typename Type
1698 for(
size_t i=0UL; i<M; ++i )
1699 for(
size_t j=0UL; j<N; ++j )
1715 template<
typename Type
1735 template<
typename Type
1739 template<
typename Other
1763 template<
typename Type
1767 template<
typename MT
1774 throw std::invalid_argument(
"Invalid assignment to static matrix" );
1776 if( (~rhs).canAlias(
this ) ) {
1801 template<
typename Type
1805 template<
typename MT
1812 throw std::invalid_argument(
"Matrix sizes do not match" );
1814 if( (~rhs).canAlias(
this ) ) {
1837 template<
typename Type
1841 template<
typename MT
1848 throw std::invalid_argument(
"Matrix sizes do not match" );
1850 if( (~rhs).canAlias(
this ) ) {
1873 template<
typename Type
1877 template<
typename MT
1881 if( M != N || (~rhs).
rows() != M || (~rhs).
columns() != M )
1882 throw std::invalid_argument(
"Matrix sizes do not match" );
1885 return this->operator=( tmp );
1897 template<
typename Type
1901 template<
typename Other >
1907 assign( *
this, (*
this) * rhs );
1922 template<
typename Type
1926 template<
typename Other >
1934 assign( *
this, (*
this) / rhs );
1953 template<
typename Type
1969 template<
typename Type
1988 template<
typename Type
2004 template<
typename Type
2026 template<
typename Type
2046 template<
typename Type
2052 size_t nonzeros( 0UL );
2054 for(
size_t i=0UL; i<M; ++i )
2055 for(
size_t j=0UL; j<N; ++j )
2075 template<
typename Type
2083 const size_t jend( (i+1UL)*NN );
2084 size_t nonzeros( 0UL );
2086 for(
size_t j=i*NN; j<jend; ++j )
2100 template<
typename Type
2108 for(
size_t i=0UL; i<M; ++i )
2109 for(
size_t j=0UL; j<N; ++j )
2110 clear( v_[i*NN+j] );
2126 template<
typename Type
2135 for(
size_t j=0UL; j<N; ++j )
2136 clear( v_[i*NN+j] );
2149 template<
typename Type
2159 for(
size_t i=1UL; i<M; ++i )
2160 for(
size_t j=0UL; j<i; ++j )
2161 swap( v_[i*NN+j], v_[j*NN+i] );
2174 template<
typename Type
2178 template<
typename Other >
2181 for(
size_t i=0UL; i<M; ++i )
2182 for(
size_t j=0UL; j<N; ++j )
2183 v_[i*NN+j] *= scalar;
2197 template<
typename Type
2205 for(
size_t i=0UL; i<M; ++i ) {
2206 for(
size_t j=0UL; j<N; ++j ) {
2207 swap( v_[i*NN+j], m(i,j) );
2232 template<
typename Type
2242 return allocate<StaticMatrix>( 1UL );
2257 template<
typename Type
2281 template<
typename Type
2291 return allocate<StaticMatrix>( 1UL );
2306 template<
typename Type
2326 template<
typename Type
2332 deallocate( static_cast<StaticMatrix*>( ptr ) );
2343 template<
typename Type
2349 deallocate( static_cast<StaticMatrix*>( ptr ) );
2360 template<
typename Type
2366 deallocate( static_cast<StaticMatrix*>( ptr ) );
2377 template<
typename Type
2383 deallocate( static_cast<StaticMatrix*>( ptr ) );
2406 template<
typename Type
2410 template<
typename Other >
2413 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2428 template<
typename Type
2432 template<
typename Other >
2435 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
2449 template<
typename Type
2475 template<
typename Type
2491 return load( &v_[i*NN+j] );
2511 template<
typename Type
2526 return loadu( &v_[i*NN+j] );
2547 template<
typename Type
2562 store( &v_[i*NN+j], value );
2583 template<
typename Type
2597 storeu( &v_[i*NN+j], value );
2618 template<
typename Type
2633 stream( &v_[i*NN+j], value );
2649 template<
typename Type
2653 template<
typename MT
2660 for(
size_t i=0UL; i<M; ++i ) {
2661 for(
size_t j=0UL; j<N; ++j ) {
2662 v_[i*NN+j] = (~rhs)(i,j);
2680 template<
typename Type
2684 template<
typename MT
2695 for(
size_t i=0UL; i<M; ++i ) {
2696 for(
size_t j=0UL; j<N; j+=
IT::size ) {
2715 template<
typename Type
2719 template<
typename MT >
2726 for(
size_t i=0UL; i<M; ++i )
2727 for( RhsConstIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2728 v_[i*NN+element->index()] = element->value();
2744 template<
typename Type
2748 template<
typename MT >
2757 for(
size_t j=0UL; j<N; ++j )
2758 for( RhsConstIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2759 v_[element->index()*NN+j] = element->value();
2775 template<
typename Type
2779 template<
typename MT
2786 for(
size_t i=0UL; i<M; ++i ) {
2787 for(
size_t j=0UL; j<N; ++j ) {
2788 v_[i*NN+j] += (~rhs)(i,j);
2806 template<
typename Type
2810 template<
typename MT
2822 for(
size_t i=0UL; i<M; ++i ) {
2823 for(
size_t j=0UL; j<N; j+=
IT::size ) {
2824 store( &v_[i*NN+j],
load( &v_[i*NN+j] ) + (~rhs).
load(i,j) );
2842 template<
typename Type
2846 template<
typename MT >
2853 for(
size_t i=0UL; i<M; ++i )
2854 for( RhsConstIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2855 v_[i*NN+element->index()] += element->value();
2871 template<
typename Type
2875 template<
typename MT >
2884 for(
size_t j=0UL; j<N; ++j )
2885 for( RhsConstIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2886 v_[element->index()*NN+j] += element->value();
2902 template<
typename Type
2906 template<
typename MT
2913 for(
size_t i=0UL; i<M; ++i ) {
2914 for(
size_t j=0UL; j<N; ++j ) {
2915 v_[i*NN+j] -= (~rhs)(i,j);
2933 template<
typename Type
2937 template<
typename MT
2949 for(
size_t i=0UL; i<M; ++i ) {
2950 for(
size_t j=0UL; j<N; j+=
IT::size ) {
2951 store( &v_[i*NN+j],
load( &v_[i*NN+j] ) - (~rhs).
load(i,j) );
2969 template<
typename Type
2973 template<
typename MT >
2980 for(
size_t i=0UL; i<M; ++i )
2981 for( RhsConstIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2982 v_[i*NN+element->index()] -= element->value();
2998 template<
typename Type
3002 template<
typename MT >
3011 for(
size_t j=0UL; j<N; ++j )
3012 for( RhsConstIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
3013 v_[element->index()*NN+j] -= element->value();
3038 template<
typename Type
3074 template<
typename ET >
3086 enum { vectorizable = IsVectorizable<Type>::value };
3092 enum { smpAssignable = 0 };
3101 template<
typename Other >
explicit inline StaticMatrix(
size_t m,
size_t n,
const Other* array );
3102 template<
typename Other >
explicit inline StaticMatrix(
const Other (&array)[M][N] );
3105 template<
typename Other,
bool SO >
inline StaticMatrix(
const StaticMatrix<Other,M,N,SO>& m );
3106 template<
typename MT ,
bool SO >
inline StaticMatrix(
const Matrix<MT,SO>& m );
3109 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3 );
3110 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4 );
3111 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5 );
3112 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
3114 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
3115 const Type& v6,
const Type& v7 );
3116 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
3117 const Type& v6,
const Type& v7,
const Type& v8 );
3118 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
3119 const Type& v6,
const Type& v7,
const Type& v8,
const Type& v9 );
3120 inline StaticMatrix(
const Type& v1,
const Type& v2,
const Type& v3,
const Type& v4,
const Type& v5,
3121 const Type& v6,
const Type& v7,
const Type& v8,
const Type& v9,
const Type& v10 );
3150 template<
typename Other >
3151 inline StaticMatrix& operator=(
const Other (&array)[M][N] );
3155 template<
typename Other,
bool SO >
inline StaticMatrix& operator= (
const StaticMatrix<Other,M,N,SO>& rhs );
3156 template<
typename MT ,
bool SO >
inline StaticMatrix& operator= (
const Matrix<MT,SO>& rhs );
3157 template<
typename MT ,
bool SO >
inline StaticMatrix& operator+=(
const Matrix<MT,SO>& rhs );
3158 template<
typename MT ,
bool SO >
inline StaticMatrix& operator-=(
const Matrix<MT,SO>& rhs );
3159 template<
typename MT ,
bool SO >
inline StaticMatrix& operator*=(
const Matrix<MT,SO>& rhs );
3161 template<
typename Other >
3162 inline typename EnableIf< IsNumeric<Other>,
StaticMatrix >::Type&
3163 operator*=( Other rhs );
3165 template<
typename Other >
3166 inline typename EnableIf< IsNumeric<Other>,
StaticMatrix >::Type&
3167 operator/=( Other rhs );
3174 inline size_t rows()
const;
3175 inline size_t columns()
const;
3176 inline size_t spacing()
const;
3178 inline size_t capacity(
size_t j )
const;
3180 inline size_t nonZeros(
size_t j )
const;
3181 inline void reset();
3182 inline void reset(
size_t i );
3184 template<
typename Other >
inline StaticMatrix& scale(
const Other& scalar );
3192 static inline void*
operator new ( std::size_t
size );
3193 static inline void*
operator new[]( std::size_t
size );
3194 static inline void*
operator new ( std::size_t
size,
const std::nothrow_t& );
3195 static inline void*
operator new[]( std::size_t
size,
const std::nothrow_t& );
3197 static inline void operator delete (
void* ptr );
3198 static inline void operator delete[](
void* ptr );
3199 static inline void operator delete (
void* ptr,
const std::nothrow_t& );
3200 static inline void operator delete[](
void* ptr,
const std::nothrow_t& );
3207 template<
typename MT >
3208 struct VectorizedAssign {
3209 enum { value = vectorizable && MT::vectorizable &&
3210 IsSame<Type,typename MT::ElementType>::value &&
3211 IsColumnMajorMatrix<MT>::value };
3217 template<
typename MT >
3218 struct VectorizedAddAssign {
3219 enum { value = vectorizable && MT::vectorizable &&
3220 IsSame<Type,typename MT::ElementType>::value &&
3221 IntrinsicTrait<Type>::addition &&
3222 IsColumnMajorMatrix<MT>::value };
3228 template<
typename MT >
3229 struct VectorizedSubAssign {
3230 enum { value = vectorizable && MT::vectorizable &&
3231 IsSame<Type,typename MT::ElementType>::value &&
3232 IntrinsicTrait<Type>::subtraction &&
3233 IsColumnMajorMatrix<MT>::value };
3241 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
3242 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
3252 template<
typename MT,
bool SO >
3253 inline typename DisableIf< VectorizedAssign<MT> >::Type
3254 assign(
const DenseMatrix<MT,SO>& rhs );
3256 template<
typename MT,
bool SO >
3257 inline typename EnableIf< VectorizedAssign<MT> >::Type
3258 assign(
const DenseMatrix<MT,SO>& rhs );
3260 template<
typename MT >
inline void assign(
const SparseMatrix<MT,true>& rhs );
3261 template<
typename MT >
inline void assign(
const SparseMatrix<MT,false>& rhs );
3263 template<
typename MT,
bool SO >
3264 inline typename DisableIf< VectorizedAddAssign<MT> >::Type
3265 addAssign(
const DenseMatrix<MT,SO>& rhs );
3267 template<
typename MT,
bool SO >
3268 inline typename EnableIf< VectorizedAddAssign<MT> >::Type
3269 addAssign(
const DenseMatrix<MT,SO>& rhs );
3271 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,true>& rhs );
3272 template<
typename MT >
inline void addAssign(
const SparseMatrix<MT,false>& rhs );
3274 template<
typename MT,
bool SO >
3275 inline typename DisableIf< VectorizedSubAssign<MT> >::Type
3276 subAssign(
const DenseMatrix<MT,SO>& rhs );
3278 template<
typename MT,
bool SO >
3279 inline typename EnableIf< VectorizedSubAssign<MT> >::Type
3280 subAssign(
const DenseMatrix<MT,SO>& rhs );
3282 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,true>& rhs );
3283 template<
typename MT >
inline void subAssign(
const SparseMatrix<MT,false>& rhs );
3291 AlignedArray<Type,MM*N>
v_;
3324 template<
typename Type
3332 if( IsNumeric<Type>::value ) {
3333 for(
size_t i=0UL; i<MM*N; ++i )
3347 template<
typename Type
3355 for(
size_t j=0UL; j<N; ++j ) {
3356 for(
size_t i=0UL; i<M; ++i )
3359 for(
size_t i=M; i<MM; ++i )
3360 v_[i+j*MM] = Type();
3394 template<
typename Type
3397 template<
typename Other >
3403 if( m > M || n > N )
3404 throw std::invalid_argument(
"Invalid setup of static matrix" );
3406 for(
size_t j=0UL; j<n; ++j ) {
3407 for(
size_t i=0UL; i<m; ++i )
3408 v_[i+j*MM] = array[i+j*m];
3410 if( IsNumeric<Type>::value ) {
3411 for(
size_t i=m; i<MM; ++i )
3412 v_[i+j*MM] = Type();
3416 if( IsNumeric<Type>::value ) {
3417 for(
size_t j=n; j<N; ++j ) {
3418 for(
size_t i=0UL; i<M; ++i )
3419 v_[i+j*MM] = Type();
3448 template<
typename Type
3451 template<
typename Other >
3457 for(
size_t j=0UL; j<N; ++j ) {
3458 for(
size_t i=0UL; i<M; ++i )
3459 v_[i+j*MM] = array[i][j];
3461 for(
size_t i=M; i<MM; ++i )
3462 v_[i+j*MM] = Type();
3477 template<
typename Type
3485 for(
size_t i=0UL; i<MM*N; ++i )
3498 template<
typename Type
3501 template<
typename Other
3508 for(
size_t j=0UL; j<N; ++j ) {
3509 for(
size_t i=0UL; i<M; ++i )
3510 v_[i+j*MM] = m(i,j);
3512 for(
size_t i=M; i<MM; ++i )
3513 v_[i+j*MM] = Type();
3531 template<
typename Type
3534 template<
typename MT
3544 throw std::invalid_argument(
"Invalid setup of static matrix" );
3546 for(
size_t j=0UL; j<N; ++j ) {
3547 for(
size_t i=( IsSparseMatrix<MT>::value ? 0UL : M ); i<MM; ++i ) {
3548 v_[i+j*MM] = Type();
3552 assign( *
this, ~m );
3576 template<
typename Type
3597 for(
size_t j=0UL; j<N; ++j )
3598 for(
size_t i=M; i<MM; ++i ) {
3599 v_[i+j*MM] = Type();
3625 template<
typename Type
3648 for(
size_t j=0UL; j<N; ++j )
3649 for(
size_t i=M; i<MM; ++i ) {
3650 v_[i+j*MM] = Type();
3679 template<
typename Type
3698 else if( N == 2UL ) {
3713 for(
size_t j=0UL; j<N; ++j )
3714 for(
size_t i=M; i<MM; ++i ) {
3715 v_[i+j*MM] = Type();
3743 template<
typename Type
3747 const Type& v4,
const Type& v5 )
3771 for(
size_t j=0UL; j<N; ++j )
3772 for(
size_t i=M; i<MM; ++i ) {
3773 v_[i+j*MM] = Type();
3805 template<
typename Type
3809 const Type& v4,
const Type& v5,
const Type& v6 )
3826 else if( N == 2UL ) {
3836 else if( N == 3UL ) {
3842 v_[2UL*MM+1UL] = v6;
3855 for(
size_t j=0UL; j<N; ++j )
3856 for(
size_t i=M; i<MM; ++i ) {
3857 v_[i+j*MM] = Type();
3887 template<
typename Type
3891 const Type& v4,
const Type& v5,
const Type& v6,
3920 for(
size_t j=0UL; j<N; ++j )
3921 for(
size_t i=M; i<MM; ++i ) {
3922 v_[i+j*MM] = Type();
3956 template<
typename Type
3960 const Type& v4,
const Type& v5,
const Type& v6,
3961 const Type& v7,
const Type& v8 )
3980 else if( N == 2UL ) {
3992 else if( N == 4UL ) {
3998 v_[2UL*MM+1UL] = v6;
4000 v_[3UL*MM+1UL] = v8;
4015 for(
size_t j=0UL; j<N; ++j )
4016 for(
size_t i=M; i<MM; ++i ) {
4017 v_[i+j*MM] = Type();
4052 template<
typename Type
4056 const Type& v4,
const Type& v5,
const Type& v6,
4057 const Type& v7,
const Type& v8,
const Type& v9 )
4077 else if( N == 3UL ) {
4085 v_[2UL*MM+1UL] = v8;
4086 v_[2UL*MM+2UL] = v9;
4102 for(
size_t j=0UL; j<N; ++j )
4103 for(
size_t i=M; i<MM; ++i ) {
4104 v_[i+j*MM] = Type();
4140 template<
typename Type
4144 const Type& v4,
const Type& v5,
const Type& v6,
4145 const Type& v7,
const Type& v8,
const Type& v9,
4167 else if( N == 2UL ) {
4181 else if( N == 5UL ) {
4187 v_[2UL*MM+1UL] = v6;
4189 v_[3UL*MM+1UL] = v8;
4191 v_[4UL*MM+1UL] = v10;
4208 for(
size_t j=0UL; j<N; ++j )
4209 for(
size_t i=M; i<MM; ++i ) {
4210 v_[i+j*MM] = Type();
4233 template<
typename Type
4255 template<
typename Type
4281 template<
typename Type
4284 inline typename StaticMatrix<Type,M,N,true>::Pointer
4305 template<
typename Type
4308 inline typename StaticMatrix<Type,M,N,true>::ConstPointer
4326 template<
typename Type
4329 inline typename StaticMatrix<Type,M,N,true>::Pointer
4348 template<
typename Type
4351 inline typename StaticMatrix<Type,M,N,true>::ConstPointer
4368 template<
typename Type
4388 template<
typename Type
4408 template<
typename Type
4428 template<
typename Type
4448 template<
typename Type
4468 template<
typename Type
4511 template<
typename Type
4514 template<
typename Other >
4515 inline StaticMatrix<Type,M,N,true>&
4516 StaticMatrix<Type,M,N,true>::operator=(
const Other (&array)[M][N] )
4518 for(
size_t j=0UL; j<N; ++j )
4519 for(
size_t i=0UL; i<M; ++i )
4520 v_[i+j*MM] = array[i][j];
4535 template<
typename Type
4538 inline StaticMatrix<Type,M,N,true>&
4539 StaticMatrix<Type,M,N,true>::operator=(
const Type&
set )
4541 for(
size_t j=0UL; j<N; ++j )
4542 for(
size_t i=0UL; i<M; ++i )
4560 template<
typename Type
4563 inline StaticMatrix<Type,M,N,true>&
4564 StaticMatrix<Type,M,N,true>::operator=(
const StaticMatrix& rhs )
4582 template<
typename Type
4585 template<
typename Other
4587 inline StaticMatrix<Type,M,N,true>&
4588 StaticMatrix<Type,M,N,true>::operator=(
const StaticMatrix<Other,M,N,SO>& rhs )
4611 template<
typename Type
4614 template<
typename MT
4616 inline StaticMatrix<Type,M,N,true>& StaticMatrix<Type,M,N,true>::operator=(
const Matrix<MT,SO>& rhs )
4621 throw std::invalid_argument(
"Invalid assignment to static matrix" );
4623 if( (~rhs).canAlias(
this ) ) {
4624 StaticMatrix tmp( ~rhs );
4628 if( IsSparseMatrix<MT>::value )
4650 template<
typename Type
4653 template<
typename MT
4655 inline StaticMatrix<Type,M,N,true>& StaticMatrix<Type,M,N,true>::operator+=(
const Matrix<MT,SO>& rhs )
4660 throw std::invalid_argument(
"Matrix sizes do not match" );
4662 if( (~rhs).canAlias(
this ) ) {
4687 template<
typename Type
4690 template<
typename MT
4692 inline StaticMatrix<Type,M,N,true>& StaticMatrix<Type,M,N,true>::operator-=(
const Matrix<MT,SO>& rhs )
4697 throw std::invalid_argument(
"Matrix sizes do not match" );
4699 if( (~rhs).canAlias(
this ) ) {
4724 template<
typename Type
4727 template<
typename MT
4729 inline StaticMatrix<Type,M,N,true>& StaticMatrix<Type,M,N,true>::operator*=(
const Matrix<MT,SO>& rhs )
4731 if( M != N || (~rhs).
rows() != M || (~rhs).
columns() != M )
4732 throw std::invalid_argument(
"Matrix sizes do not match" );
4734 StaticMatrix tmp( *
this * (~rhs) );
4735 return this->operator=( tmp );
4749 template<
typename Type
4752 template<
typename Other >
4753 inline typename EnableIf< IsNumeric<Other>, StaticMatrix<Type,M,N,true> >::Type&
4754 StaticMatrix<Type,M,N,true>::operator*=( Other rhs )
4758 assign( *
this, (*
this) * rhs );
4775 template<
typename Type
4778 template<
typename Other >
4779 inline typename EnableIf< IsNumeric<Other>, StaticMatrix<Type,M,N,true> >::Type&
4780 StaticMatrix<Type,M,N,true>::operator/=( Other rhs )
4786 assign( *
this, (*
this) / rhs );
4807 template<
typename Type
4824 template<
typename Type
4844 template<
typename Type
4861 template<
typename Type
4879 template<
typename Type
4900 template<
typename Type
4905 size_t nonzeros( 0UL );
4907 for(
size_t j=0UL; j<N; ++j )
4908 for(
size_t i=0UL; i<M; ++i )
4925 template<
typename Type
4932 const size_t iend( (j+1UL)*MM );
4933 size_t nonzeros( 0UL );
4935 for(
size_t i=j*MM; i<iend; ++i )
4951 template<
typename Type
4958 for(
size_t j=0UL; j<N; ++j )
4959 for(
size_t i=0UL; i<M; ++i )
4960 clear( v_[i+j*MM] );
4976 template<
typename Type
4984 for(
size_t i=0UL; i<M; ++i )
4985 clear( v_[i+j*MM] );
5000 template<
typename Type
5009 for(
size_t j=1UL; j<N; ++j )
5010 for(
size_t i=0UL; i<j; ++i )
5011 swap( v_[i+j*MM], v_[j+i*MM] );
5026 template<
typename Type
5029 template<
typename Other >
5030 inline StaticMatrix<Type,M,N,true>&
5031 StaticMatrix<Type,M,N,true>::scale(
const Other& scalar )
5033 for(
size_t j=0UL; j<N; ++j )
5034 for(
size_t i=0UL; i<M; ++i )
5035 v_[i+j*MM] *= scalar;
5051 template<
typename Type
5058 for(
size_t j=0UL; j<N; ++j ) {
5059 for(
size_t i=0UL; i<M; ++i ) {
5060 swap( v_[i+j*MM], m(i,j) );
5087 template<
typename Type
5090 inline void* StaticMatrix<Type,M,N,true>::operator
new( std::size_t
size )
5096 return allocate<StaticMatrix>( 1UL );
5113 template<
typename Type
5116 inline void* StaticMatrix<Type,M,N,true>::operator
new[]( std::size_t
size )
5121 return allocate<StaticMatrix>(
size/
sizeof(StaticMatrix) );
5138 template<
typename Type
5141 inline void* StaticMatrix<Type,M,N,true>::operator
new( std::size_t
size,
const std::nothrow_t& )
5147 return allocate<StaticMatrix>( 1UL );
5164 template<
typename Type
5167 inline void* StaticMatrix<Type,M,N,true>::operator
new[]( std::size_t
size,
const std::nothrow_t& )
5172 return allocate<StaticMatrix>(
size/
sizeof(StaticMatrix) );
5185 template<
typename Type
5188 inline void StaticMatrix<Type,M,N,true>::operator
delete(
void* ptr )
5190 deallocate( static_cast<StaticMatrix*>( ptr ) );
5203 template<
typename Type
5206 inline void StaticMatrix<Type,M,N,true>::operator
delete[](
void* ptr )
5208 deallocate( static_cast<StaticMatrix*>( ptr ) );
5221 template<
typename Type
5224 inline void StaticMatrix<Type,M,N,true>::operator
delete(
void* ptr,
const std::nothrow_t& )
5226 deallocate( static_cast<StaticMatrix*>( ptr ) );
5239 template<
typename Type
5242 inline void StaticMatrix<Type,M,N,true>::operator
delete[](
void* ptr,
const std::nothrow_t& )
5244 deallocate( static_cast<StaticMatrix*>( ptr ) );
5269 template<
typename Type
5272 template<
typename Other >
5275 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5292 template<
typename Type
5295 template<
typename Other >
5298 return static_cast<const void*
>( this ) == static_cast<const void*>( alias );
5314 template<
typename Type
5340 template<
typename Type
5343 inline typename StaticMatrix<Type,M,N,true>::IntrinsicType
5355 return load( &v_[i+j*MM] );
5376 template<
typename Type
5379 inline typename StaticMatrix<Type,M,N,true>::IntrinsicType
5390 return loadu( &v_[i+j*MM] );
5412 template<
typename Type
5426 store( &v_[i+j*MM], value );
5448 template<
typename Type
5461 storeu( &v_[i+j*MM], value );
5484 template<
typename Type
5498 stream( &v_[i+j*MM], value );
5516 template<
typename Type
5519 template<
typename MT
5521 inline typename DisableIf< typename StaticMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAssign<MT> >::Type
5526 for(
size_t j=0UL; j<N; ++j ) {
5527 for(
size_t i=0UL; i<M; ++i ) {
5528 v_[i+j*MM] = (~rhs)(i,j);
5548 template<
typename Type
5551 template<
typename MT
5553 inline typename EnableIf< typename StaticMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAssign<MT> >::Type
5562 for(
size_t j=0UL; j<N; ++j ) {
5563 for(
size_t i=0UL; i<M; i+=
IT::size ) {
5584 template<
typename Type
5587 template<
typename MT >
5594 for(
size_t j=0UL; j<N; ++j )
5595 for( RhsConstIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5596 v_[element->index()+j*MM] = element->value();
5614 template<
typename Type
5617 template<
typename MT >
5626 for(
size_t i=0UL; i<M; ++i )
5627 for( RhsConstIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5628 v_[i+element->index()*MM] = element->value();
5646 template<
typename Type
5649 template<
typename MT
5651 inline typename DisableIf< typename StaticMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >::Type
5656 for(
size_t j=0UL; j<N; ++j ) {
5657 for(
size_t i=0UL; i<M; ++i ) {
5658 v_[i+j*MM] += (~rhs)(i,j);
5678 template<
typename Type
5681 template<
typename MT
5683 inline typename EnableIf< typename StaticMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT> >::Type
5693 for(
size_t j=0UL; j<N; ++j ) {
5694 for(
size_t i=0UL; i<M; i+=
IT::size ) {
5695 store( &v_[i+j*MM],
load( &v_[i+j*MM] ) + (~rhs).
load(i,j) );
5715 template<
typename Type
5718 template<
typename MT >
5725 for(
size_t j=0UL; j<N; ++j )
5726 for( RhsConstIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5727 v_[element->index()+j*MM] += element->value();
5745 template<
typename Type
5748 template<
typename MT >
5757 for(
size_t i=0UL; i<M; ++i )
5758 for( RhsConstIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5759 v_[i+element->index()*MM] += element->value();
5777 template<
typename Type
5780 template<
typename MT
5782 inline typename DisableIf< typename StaticMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >::Type
5787 for(
size_t j=0UL; j<N; ++j ) {
5788 for(
size_t i=0UL; i<M; ++i ) {
5789 v_[i+j*MM] -= (~rhs)(i,j);
5809 template<
typename Type
5812 template<
typename MT
5814 inline typename EnableIf< typename StaticMatrix<Type,M,N,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT> >::Type
5824 for(
size_t j=0UL; j<N; ++j ) {
5825 for(
size_t i=0UL; i<M; i+=
IT::size ) {
5826 store( &v_[i+j*MM],
load( &v_[i+j*MM] ) - (~rhs).
load(i,j) );
5846 template<
typename Type
5849 template<
typename MT >
5856 for(
size_t j=0UL; j<N; ++j )
5857 for( RhsConstIterator element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5858 v_[element->index()+j*MM] -= element->value();
5876 template<
typename Type
5879 template<
typename MT >
5888 for(
size_t i=0UL; i<M; ++i )
5889 for( RhsConstIterator element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5890 v_[i+element->index()*MM] -= element->value();
5916 template<
typename Type
5919 class StaticMatrix<Type,M,0UL,SO>;
5932 template<
typename Type
5935 class StaticMatrix<Type,0UL,N,SO>;
5948 template<
typename Type
5950 class StaticMatrix<Type,0UL,0UL,SO>;
5970 template<
typename Type,
size_t M,
size_t N,
bool SO >
5971 inline void reset( StaticMatrix<Type,M,N,SO>& m );
5973 template<
typename Type,
size_t M,
size_t N,
bool SO >
5974 inline void reset( StaticMatrix<Type,M,N,SO>& m,
size_t i );
5976 template<
typename Type,
size_t M,
size_t N,
bool SO >
5977 inline void clear( StaticMatrix<Type,M,N,SO>& m );
5979 template<
typename Type,
size_t M,
size_t N,
bool SO >
5980 inline bool isDefault(
const StaticMatrix<Type,M,N,SO>& m );
5982 template<
typename Type,
size_t M,
size_t N,
bool SO >
5983 inline void swap( StaticMatrix<Type,M,N,SO>& a, StaticMatrix<Type,M,N,SO>& b ) ;
5985 template<
typename Type,
size_t M,
size_t N,
bool SO >
5986 inline void move( StaticMatrix<Type,M,N,SO>& dst, StaticMatrix<Type,M,N,SO>& src ) ;
5998 template<
typename Type
6022 template<
typename Type
6042 template<
typename Type
6060 template<
typename Type
6067 for(
size_t i=0UL; i<M; ++i )
6068 for(
size_t j=0UL; j<N; ++j )
6069 if( !
isDefault( m(i,j) ) )
return false;
6072 for(
size_t j=0UL; j<N; ++j )
6073 for(
size_t i=0UL; i<M; ++i )
6074 if( !
isDefault( m(i,j) ) )
return false;
6091 template<
typename Type
6111 template<
typename Type
6132 template<
typename T,
size_t N,
bool SO >
6133 struct IsSquare< StaticMatrix<T,N,N,SO> > :
public TrueType
6152 template<
typename T,
size_t M,
size_t N,
bool SO >
6153 struct Rows< StaticMatrix<T,M,N,SO> >
6155 static const size_t value = M;
6171 template<
typename T,
size_t M,
size_t N,
bool SO >
6172 struct Columns< StaticMatrix<T,M,N,SO> >
6174 static const size_t value = N;
6190 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6191 struct AddTrait< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
6193 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M, N, SO > Type;
6196 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
6197 struct AddTrait< StaticMatrix<T1,M,N,SO1>, StaticMatrix<T2,M,N,SO2> >
6199 typedef StaticMatrix< typename AddTrait<T1,T2>::Type, M, N,
false > Type;
6215 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6216 struct SubTrait< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
6218 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M, N, SO > Type;
6221 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
6222 struct SubTrait< StaticMatrix<T1,M,N,SO1>, StaticMatrix<T2,M,N,SO2> >
6224 typedef StaticMatrix< typename SubTrait<T1,T2>::Type, M, N,
false > Type;
6240 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6241 struct MultTrait< StaticMatrix<T1,M,N,SO>, T2 >
6243 typedef StaticMatrix< typename MultTrait<T1,T2>::Type, M, N, SO > Type;
6247 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6248 struct MultTrait< T1, StaticMatrix<T2,M,N,SO> >
6250 typedef StaticMatrix< typename MultTrait<T1,T2>::Type, M, N, SO > Type;
6254 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6255 struct MultTrait< StaticMatrix<T1,M,N,SO>, StaticVector<T2,N,false> >
6257 typedef StaticVector< typename MultTrait<T1,T2>::Type, M,
false > Type;
6260 template<
typename T1,
size_t M,
typename T2,
size_t N,
bool SO >
6261 struct MultTrait< StaticVector<T1,M,true>, StaticMatrix<T2,M,N,SO> >
6263 typedef StaticVector< typename MultTrait<T1,T2>::Type, N,
true > Type;
6266 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2,
size_t L >
6267 struct MultTrait< StaticMatrix<T1,M,N,SO>, HybridVector<T2,L,false> >
6269 typedef StaticVector< typename MultTrait<T1,T2>::Type, M,
false > Type;
6272 template<
typename T1,
size_t L,
typename T2,
size_t M,
size_t N,
bool SO >
6273 struct MultTrait< HybridVector<T1,L,true>, StaticMatrix<T2,M,N,SO> >
6275 typedef StaticVector< typename MultTrait<T1,T2>::Type, N,
true > Type;
6278 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6279 struct MultTrait< StaticMatrix<T1,M,N,SO>, DynamicVector<T2,false> >
6281 typedef StaticVector< typename MultTrait<T1,T2>::Type, M,
false > Type;
6284 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6285 struct MultTrait< DynamicVector<T1,true>, StaticMatrix<T2,M,N,SO> >
6287 typedef StaticVector< typename MultTrait<T1,T2>::Type, N,
true > Type;
6290 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6291 struct MultTrait< StaticMatrix<T1,M,N,SO>, CompressedVector<T2,false> >
6293 typedef StaticVector< typename MultTrait<T1,T2>::Type, M,
false > Type;
6296 template<
typename T1,
typename T2,
size_t M,
size_t N,
bool SO >
6297 struct MultTrait< CompressedVector<T1,true>, StaticMatrix<T2,M,N,SO> >
6299 typedef StaticVector< typename MultTrait<T1,T2>::Type, N,
true > Type;
6302 template<
typename T1,
size_t M,
size_t K,
bool SO1,
typename T2,
size_t N,
bool SO2 >
6303 struct MultTrait< StaticMatrix<T1,M,K,SO1>, StaticMatrix<T2,K,N,SO2> >
6305 typedef StaticMatrix< typename MultTrait<T1,T2>::Type, M, N, SO1 > Type;
6321 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6322 struct DivTrait< StaticMatrix<T1,M,N,SO>, T2 >
6324 typedef StaticMatrix< typename DivTrait<T1,T2>::Type, M, N, SO > Type;
6341 template<
typename T1,
size_t M,
size_t N,
bool SO,
typename T2 >
6342 struct MathTrait< StaticMatrix<T1,M,N,SO>, StaticMatrix<T2,M,N,SO> >
6344 typedef StaticMatrix< typename MathTrait<T1,T2>::HighType, M, N, SO > HighType;
6345 typedef StaticMatrix< typename MathTrait<T1,T2>::LowType , M, N, SO > LowType;
6361 template<
typename T1,
size_t M,
size_t N,
bool SO >
6362 struct SubmatrixTrait< StaticMatrix<T1,M,N,SO> >
6364 typedef HybridMatrix<T1,M,N,SO> Type;
6380 template<
typename T1,
size_t M,
size_t N,
bool SO >
6381 struct RowTrait< StaticMatrix<T1,M,N,SO> >
6383 typedef StaticVector<T1,N,true> Type;
6399 template<
typename T1,
size_t M,
size_t N,
bool SO >
6400 struct ColumnTrait< StaticMatrix<T1,M,N,SO> >
6402 typedef StaticVector<T1,M,false> Type;
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:108
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:199
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 swap(SymmetricMatrix< MT, SO, DF, NF > &a, SymmetricMatrix< MT, SO, DF, NF > &b)
Swapping the contents of two matrices.
Definition: SymmetricMatrix.h:195
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the Rows type trait.
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
size_t nonZeros() const
Returns the total number of non-zero elements in the matrix.
Definition: StaticMatrix.h:2050
const bool defaultStorageOrder
The default storage order for all matrices of the Blaze library.This value specifies the default stor...
Definition: StorageOrder.h:56
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
Header file for the row trait.
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:258
bool canAlias(const Other *alias) const
Returns whether the matrix can alias with the given address alias.
Definition: StaticMatrix.h:2411
Header file for the IsSparseMatrix type trait.
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
const Type & ConstReference
Reference to a constant matrix value.
Definition: StaticMatrix.h:207
StaticMatrix()
The default constructor for StaticMatrix.
Definition: StaticMatrix.h:484
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T > >::Type stream(T *address, const typename Stream< T, sizeof(T)>::Type &value)
Aligned, non-temporal store of a vector of integral values.
Definition: Stream.h:220
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:2587
Header file for the IsColumnMajorMatrix type trait.
StaticMatrix< Type, N, M,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: StaticMatrix.h:201
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:316
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T >, Load< T, sizeof(T)> >::Type::Type load(const T *address)
Loads a vector of integral values.
Definition: Load.h:224
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
static const size_t NN
Alignment adjustment.
Definition: StaticMatrix.h:193
Type ElementType
Type of the matrix elements.
Definition: StaticMatrix.h:202
AlignedArray< Type, M *NN > v_
The statically allocated matrix elements.
Definition: StaticMatrix.h:440
#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
Type * Pointer
Pointer to a non-constant matrix value.
Definition: StaticMatrix.h:208
Iterator end(size_t i)
Returns an iterator just past the last element of row/column i.
Definition: StaticMatrix.h:1585
Header file for memory allocation and deallocation functionality.
const Type * ConstPointer
Pointer to a constant matrix value.
Definition: StaticMatrix.h:209
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:107
Constraint on the data type.
bool isAligned() const
Returns whether the matrix is properly aligned in memory.
Definition: StaticMatrix.h:2453
Header file for the SparseMatrix base class.
Header file for the IsSquare type trait.
ConstIterator cend(size_t i) const
Returns an iterator just past the last element of row/column i.
Definition: StaticMatrix.h:1633
Header file for the DisableIf class template.
StaticMatrix & transpose()
Transposing the matrix.
Definition: StaticMatrix.h:2153
void swap(StaticMatrix &m)
Swapping the contents of two static matrices.
Definition: StaticMatrix.h:2201
Header file for the multiplication trait.
Header file for the clear shim.
Header file for nested template disabiguation.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:4754
DenseIterator< Type > Iterator
Iterator over non-constant elements.
Definition: StaticMatrix.h:210
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
#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:58
Header file for the DenseMatrix base class.
BLAZE_ALWAYS_INLINE 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:635
Header file for the Columns type trait.
EnableIf< IsBuiltin< T > >::Type deallocate(T *address)
Deallocation of memory for built-in data types.
Definition: Memory.h:226
Header file for the DenseIterator class template.
BLAZE_ALWAYS_INLINE void clear(const NonNumericProxy< MT > &proxy)
Clearing the represented element.
Definition: NonNumericProxy.h:854
void reset()
Reset to the default initial values.
Definition: StaticMatrix.h:2104
Constraint on the data type.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: StaticMatrix.h:1973
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T >, Loadu< T, sizeof(T)> >::Type::Type loadu(const T *address)
Loads a vector of integral values.
Definition: Loadu.h:221
IntrinsicType loadu(size_t i, size_t j) const
Unaligned load of an intrinsic element of the matrix.
Definition: StaticMatrix.h:2516
const This & CompositeType
Data type for composite expression templates.
Definition: StaticMatrix.h:205
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:2008
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:195
StaticMatrix< ET, M, N, SO > Other
The type of the other StaticMatrix.
Definition: StaticMatrix.h:219
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2480
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:2433
ConstIterator cbegin(size_t i) const
Returns an iterator to the first element of row/column i.
Definition: StaticMatrix.h:1561
Iterator begin(size_t i)
Returns an iterator to the first element of row/column i.
Definition: StaticMatrix.h:1513
Reference operator()(size_t i, size_t j)
2D-access to the matrix elements.
Definition: StaticMatrix.h:1377
Header file for the IsVectorizable type trait.
StaticMatrix< Type, M, N, SO > This
Type of this StaticMatrix instance.
Definition: StaticMatrix.h:198
Header file for the IsNumeric type trait.
IntrinsicTrait< Type > IT
Intrinsic trait for the matrix element type.
Definition: StaticMatrix.h:188
IT::Type IntrinsicType
Intrinsic type of the matrix elements.
Definition: StaticMatrix.h:203
BLAZE_ALWAYS_INLINE 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:211
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:116
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
Header file for run time assertion macros.
Pointer data()
Low-level data access to the matrix elements.
Definition: StaticMatrix.h:1424
Header file for the addition trait.
BLAZE_ALWAYS_INLINE 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:742
Header file for the division trait.
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
void move(DynamicMatrix< Type, SO > &dst, DynamicMatrix< Type, SO > &src)
Moving the contents of one dynamic matrix to another.
Definition: DynamicMatrix.h:4769
Header file for the AlignedArray implementation.
#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:2481
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:87
BLAZE_ALWAYS_INLINE bool isDefault(const NonNumericProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: NonNumericProxy.h:874
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE void reset(const NonNumericProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: NonNumericProxy.h:833
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:2551
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:1992
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:1957
const Type & ReturnType
Return type for expression template evaluations.
Definition: StaticMatrix.h:204
DenseIterator< const Type > ConstIterator
Iterator over constant elements.
Definition: StaticMatrix.h:211
Type & Reference
Reference to a non-constant matrix value.
Definition: StaticMatrix.h:206
Rebind mechanism to obtain a StaticMatrix with different data/element type.
Definition: StaticMatrix.h:218
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:332
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T > >::Type storeu(T *address, const typename Storeu< T, sizeof(T)>::Type &value)
Unaligned store of a vector of integral values.
Definition: Storeu.h:218
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:2479
Rebind mechanism to obtain a CompressedMatrix with different data/element type.
Definition: CompressedMatrix.h:2489
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:2622
boost::true_type TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
#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
BLAZE_ALWAYS_INLINE EnableIf< IsIntegral< T > >::Type store(T *address, const typename Store< T, sizeof(T)>::Type &value)
Aligned store of a vector of integral values.
Definition: Store.h:225
StaticMatrix< Type, M, N,!SO > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: StaticMatrix.h:200
#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:2480
BLAZE_ALWAYS_INLINE 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:849