35 #ifndef _BLAZE_MATH_VIEWS_DENSESUBMATRIX_H_
36 #define _BLAZE_MATH_VIEWS_DENSESUBMATRIX_H_
288 template<
typename MT
289 ,
bool SO = IsColumnMajorMatrix<MT>::value >
340 template<
typename IteratorType >
349 typedef typename std::iterator_traits<IteratorType>::value_type
ValueType;
352 typedef typename std::iterator_traits<IteratorType>::pointer
PointerType;
355 typedef typename std::iterator_traits<IteratorType>::reference
ReferenceType;
358 typedef typename std::iterator_traits<IteratorType>::difference_type
DifferenceType;
376 explicit inline SubmatrixIterator( IteratorType iterator, IteratorType
final,
size_t rest,
bool aligned )
494 for(
size_t j=0UL; j<
rest_; ++j )
634 enum { vectorizable = MT::vectorizable };
675 template<
typename Other >
677 operator*=( Other rhs );
679 template<
typename Other >
681 operator/=( Other rhs );
688 inline size_t rows()
const;
692 inline size_t capacity(
size_t i )
const;
694 inline size_t nonZeros(
size_t i )
const;
696 inline void reset(
size_t i );
697 template<
typename Other >
inline DenseSubmatrix& scale( Other scalar );
704 template<
typename MT2 >
706 struct VectorizedAssign {
707 enum { value = vectorizable && MT2::vectorizable &&
715 template<
typename MT2 >
717 struct VectorizedAddAssign {
718 enum { value = vectorizable && MT2::vectorizable &&
719 IsSame<ElementType,typename MT2::ElementType>::value &&
720 IntrinsicTrait<ElementType>::addition };
727 template<
typename MT2 >
729 struct VectorizedSubAssign {
730 enum { value = vectorizable && MT2::vectorizable &&
731 IsSame<ElementType,typename MT2::ElementType>::value &&
732 IntrinsicTrait<ElementType>::subtraction };
741 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
742 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
750 template<
typename MT2 >
751 inline typename DisableIf< VectorizedAssign<MT2> >::Type
752 assign(
const DenseMatrix<MT2,SO>& rhs );
754 template<
typename MT2 >
755 inline typename EnableIf< VectorizedAssign<MT2> >::Type
756 assign(
const DenseMatrix<MT2,SO>& rhs );
758 template<
typename MT2 >
inline void assign(
const DenseMatrix<MT2,!SO>& rhs );
759 template<
typename MT2 >
inline void assign(
const SparseMatrix<MT2,SO>& rhs );
760 template<
typename MT2 >
inline void assign(
const SparseMatrix<MT2,!SO>& rhs );
762 template<
typename MT2 >
763 inline typename DisableIf< VectorizedAddAssign<MT2> >::Type
764 addAssign(
const DenseMatrix<MT2,SO>& rhs );
766 template<
typename MT2 >
767 inline typename EnableIf< VectorizedAddAssign<MT2> >::Type
768 addAssign(
const DenseMatrix<MT2,SO>& rhs );
770 template<
typename MT2 >
inline void addAssign(
const DenseMatrix<MT2,!SO>& rhs );
771 template<
typename MT2 >
inline void addAssign(
const SparseMatrix<MT2,SO>& rhs );
772 template<
typename MT2 >
inline void addAssign(
const SparseMatrix<MT2,!SO>& rhs );
774 template<
typename MT2 >
775 inline typename DisableIf< VectorizedSubAssign<MT2> >::Type
776 subAssign(
const DenseMatrix<MT2,SO>& rhs );
778 template<
typename MT2 >
779 inline typename EnableIf< VectorizedSubAssign<MT2> >::Type
780 subAssign(
const DenseMatrix<MT2,SO>& rhs );
782 template<
typename MT2 >
inline void subAssign(
const DenseMatrix<MT2,!SO>& rhs );
783 template<
typename MT2 >
inline void subAssign(
const SparseMatrix<MT2,SO>& rhs );
784 template<
typename MT2 >
inline void subAssign(
const SparseMatrix<MT2,!SO>& rhs );
818 template<
typename MT2,
bool SO2 >
857 template<
typename MT
868 ( column + n == matrix.
columns() || n %
IT::size == 0UL ) )
870 if( ( row + m > matrix.rows() ) || ( column + n > matrix.columns() ) )
871 throw std::invalid_argument(
"Invalid submatrix specification" );
891 template<
typename MT
911 template<
typename MT
933 template<
typename MT
951 template<
typename MT
971 template<
typename MT
993 template<
typename MT
1015 template<
typename MT
1037 template<
typename MT
1059 template<
typename MT
1081 template<
typename MT
1106 template<
typename MT
1110 const size_t iend(
row_ +
m_ );
1113 for(
size_t i=
row_; i<iend; ++i )
1114 for(
size_t j=
column_; j<jend; ++j )
1133 template<
typename MT
1146 throw std::invalid_argument(
"Submatrix sizes do not match" );
1173 template<
typename MT
1175 template<
typename MT2
1184 throw std::invalid_argument(
"Matrix sizes do not match" );
1189 if( (~rhs).canAlias( &
matrix_ ) ) {
1212 template<
typename MT
1214 template<
typename MT2
1224 throw std::invalid_argument(
"Matrix sizes do not match" );
1226 if( (~rhs).canAlias( &
matrix_ ) ) {
1249 template<
typename MT
1251 template<
typename MT2
1260 throw std::invalid_argument(
"Matrix sizes do not match" );
1262 if( (~rhs).canAlias( &
matrix_ ) ) {
1285 template<
typename MT
1287 template<
typename MT2
1292 throw std::invalid_argument(
"Matrix sizes do not match" );
1299 const MultType tmp( *
this * (~rhs) );
1316 template<
typename MT
1318 template<
typename Other >
1322 return operator=( (*
this) * rhs );
1334 template<
typename MT
1336 template<
typename Other >
1342 return operator=( (*
this) / rhs );
1360 template<
typename MT
1374 template<
typename MT
1393 template<
typename MT
1407 template<
typename MT
1427 template<
typename MT
1442 template<
typename MT
1446 const size_t iend(
row_ +
m_ );
1448 size_t nonzeros( 0UL );
1450 for(
size_t i=
row_; i<iend; ++i )
1451 for(
size_t j=
column_; j<jend; ++j )
1471 template<
typename MT
1478 size_t nonzeros( 0UL );
1480 for(
size_t j=
column_; j<jend; ++j )
1494 template<
typename MT
1500 const size_t iend(
row_ +
m_ );
1503 for(
size_t i=
row_; i<iend; ++i )
1504 for(
size_t j=
column_; j<jend; ++j )
1521 template<
typename MT
1530 for(
size_t j=
column_; j<jend; ++j )
1542 template<
typename MT
1544 template<
typename Other >
1547 const size_t iend(
row_ +
m_ );
1550 for(
size_t i=
row_; i<iend; ++i )
1551 for(
size_t j=
column_; j<jend; ++j )
1577 template<
typename MT
1579 template<
typename Other >
1582 return static_cast<const void*
>( &
matrix_ ) == static_cast<const void*>( alias );
1597 template<
typename MT
1599 template<
typename Other >
1602 return static_cast<const void*
>( &
matrix_ ) == static_cast<const void*>( alias );
1623 template<
typename MT
1628 return loadu( i, j );
1649 template<
typename MT
1665 for(
size_t k=0UL; k<
rest_; ++k )
1689 template<
typename MT
1714 template<
typename MT
1730 for(
size_t k=0UL; k<
rest_; ++k )
1754 template<
typename MT
1774 template<
typename MT
1776 template<
typename MT2 >
1783 const size_t jend(
n_ &
size_t(-2) );
1786 for(
size_t i=0UL; i<
m_; ++i ) {
1787 for(
size_t j=0UL; j<jend; j+=2UL ) {
1810 template<
typename MT
1812 template<
typename MT2 >
1823 !(~rhs).isAliased( &
matrix_ ) )
1825 for(
size_t i=0UL; i<
m_; ++i )
1826 for(
size_t j=0UL; j<
n_; j+=IT::size )
1831 const size_t jend(
n_ &
size_t(-IT::size*4) );
1834 for(
size_t i=0UL; i<
m_; ++i ) {
1836 for(
size_t j=0UL; j<jend; j+=IT::size*4UL ) {
1842 for(
size_t j=jend; j<
n_; j+=IT::size, it+=IT::size ) {
1843 storeu( i, j, it.load() );
1862 template<
typename MT
1864 template<
typename MT2 >
1870 const size_t block( 16UL );
1872 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
1873 const size_t iend( ( m_<(ii+block) )?( m_ ):( ii+block ) );
1874 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
1875 const size_t jend( ( n_<(jj+block) )?( n_ ):( jj+block ) );
1876 for(
size_t i=ii; i<iend; ++i ) {
1877 for(
size_t j=jj; j<jend; ++j ) {
1898 template<
typename MT
1900 template<
typename MT2 >
1906 for(
size_t i=0UL; i<
m_; ++i )
1907 for(
typename MT2::ConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
1924 template<
typename MT
1926 template<
typename MT2 >
1932 for(
size_t j=0UL; j<
n_; ++j )
1933 for(
typename MT2::ConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
1950 template<
typename MT
1952 template<
typename MT2 >
1959 const size_t jend(
n_ &
size_t(-2) );
1962 for(
size_t i=0UL; i<
m_; ++i ) {
1963 for(
size_t j=0UL; j<jend; j+=2UL ) {
1986 template<
typename MT
1988 template<
typename MT2 >
1997 const size_t jend(
n_ &
size_t(-IT::size*4) );
2000 for(
size_t i=0UL; i<
m_; ++i ) {
2002 for(
size_t j=0UL; j<jend; j+=IT::size*4UL ) {
2008 for(
size_t j=jend; j<
n_; j+=IT::size, it+=IT::size ) {
2027 template<
typename MT
2029 template<
typename MT2 >
2035 const size_t block( 16UL );
2037 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
2038 const size_t iend( ( m_<(ii+block) )?( m_ ):( ii+block ) );
2039 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
2040 const size_t jend( ( n_<(jj+block) )?( n_ ):( jj+block ) );
2041 for(
size_t i=ii; i<iend; ++i ) {
2042 for(
size_t j=jj; j<jend; ++j ) {
2063 template<
typename MT
2065 template<
typename MT2 >
2071 for(
size_t i=0UL; i<
m_; ++i )
2072 for(
typename MT2::ConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
2089 template<
typename MT
2091 template<
typename MT2 >
2097 for(
size_t j=0UL; j<
n_; ++j )
2098 for(
typename MT2::ConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
2115 template<
typename MT
2117 template<
typename MT2 >
2124 const size_t jend(
n_ &
size_t(-2) );
2127 for(
size_t i=0UL; i<
m_; ++i ) {
2128 for(
size_t j=0UL; j<jend; j+=2UL ) {
2151 template<
typename MT
2153 template<
typename MT2 >
2162 const size_t jend(
n_ &
size_t(-IT::size*4) );
2165 for(
size_t i=0UL; i<
m_; ++i ) {
2167 for(
size_t j=0UL; j<jend; j+=IT::size*4UL ) {
2173 for(
size_t j=jend; j<
n_; j+=IT::size, it+=IT::size ) {
2192 template<
typename MT
2194 template<
typename MT2 >
2200 const size_t block( 16UL );
2202 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
2203 const size_t iend( ( m_<(ii+block) )?( m_ ):( ii+block ) );
2204 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
2205 const size_t jend( ( n_<(jj+block) )?( n_ ):( jj+block ) );
2206 for(
size_t i=ii; i<iend; ++i ) {
2207 for(
size_t j=jj; j<jend; ++j ) {
2228 template<
typename MT
2230 template<
typename MT2 >
2236 for(
size_t i=0UL; i<
m_; ++i )
2237 for(
typename MT2::ConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
2254 template<
typename MT
2256 template<
typename MT2 >
2262 for(
size_t j=0UL; j<
n_; ++j )
2263 for(
typename MT2::ConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
2289 template<
typename MT >
2315 typedef DenseSubmatrix<MT,true>
This;
2316 typedef typename SubmatrixTrait<MT>::Type
ResultType;
2328 typedef typename SelectType< useConst, ConstReference, typename MT::Reference >::Type
Reference;
2334 typedef typename SelectType< useConst, ConstPointer, ElementType* >::Type
Pointer;
2340 template<
typename IteratorType >
2341 class SubmatrixIterator
2346 typedef typename std::iterator_traits<IteratorType>::iterator_category
IteratorCategory;
2349 typedef typename std::iterator_traits<IteratorType>::value_type
ValueType;
2352 typedef typename std::iterator_traits<IteratorType>::pointer
PointerType;
2355 typedef typename std::iterator_traits<IteratorType>::reference
ReferenceType;
2358 typedef typename std::iterator_traits<IteratorType>::difference_type
DifferenceType;
2376 explicit inline SubmatrixIterator( IteratorType iterator, IteratorType
final,
size_t rest,
bool aligned )
2494 for(
size_t j=0UL; j<
rest_; ++j )
2586 return SubmatrixIterator( it.iterator_ + inc, it.final_, it.rest_, it.aligned_ );
2598 return SubmatrixIterator( it.iterator_ + inc, it.final_, it.rest_, it.aligned_ );
2610 return SubmatrixIterator( it.iterator_ - dec, it.final_, it.rest_, it.aligned_ );
2626 typedef SubmatrixIterator<typename MT::ConstIterator>
ConstIterator;
2629 typedef typename SelectType< useConst, ConstIterator, SubmatrixIterator<typename MT::Iterator> >::Type
Iterator;
2634 enum { vectorizable = MT::vectorizable };
2671 template<
typename MT2,
bool SO >
inline DenseSubmatrix& operator+=(
const Matrix<MT2,SO>& rhs );
2672 template<
typename MT2,
bool SO >
inline DenseSubmatrix& operator-=(
const Matrix<MT2,SO>& rhs );
2673 template<
typename MT2,
bool SO >
inline DenseSubmatrix& operator*=(
const Matrix<MT2,SO>& rhs );
2675 template<
typename Other >
2676 inline typename EnableIf< IsNumeric<Other>,
DenseSubmatrix >::Type&
2677 operator*=( Other rhs );
2679 template<
typename Other >
2680 inline typename EnableIf< IsNumeric<Other>,
DenseSubmatrix >::Type&
2681 operator/=( Other rhs );
2688 inline size_t rows()
const;
2689 inline size_t columns()
const;
2690 inline size_t spacing()
const;
2692 inline size_t capacity(
size_t i )
const;
2694 inline size_t nonZeros(
size_t i )
const;
2695 inline void reset();
2696 inline void reset(
size_t i );
2697 template<
typename Other >
inline DenseSubmatrix& scale( Other scalar );
2704 template<
typename MT2 >
2706 struct VectorizedAssign {
2707 enum { value = vectorizable && MT2::vectorizable &&
2708 IsSame<ElementType,typename MT2::ElementType>::value };
2715 template<
typename MT2 >
2717 struct VectorizedAddAssign {
2718 enum { value = vectorizable && MT2::vectorizable &&
2719 IsSame<ElementType,typename MT2::ElementType>::value &&
2720 IntrinsicTrait<ElementType>::addition };
2727 template<
typename MT2 >
2729 struct VectorizedSubAssign {
2730 enum { value = vectorizable && MT2::vectorizable &&
2731 IsSame<ElementType,typename MT2::ElementType>::value &&
2732 IntrinsicTrait<ElementType>::subtraction };
2741 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
2742 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
2750 template<
typename MT2 >
2751 inline typename DisableIf< VectorizedAssign<MT2> >::Type
2752 assign(
const DenseMatrix<MT2,true>& rhs );
2754 template<
typename MT2 >
2755 inline typename EnableIf< VectorizedAssign<MT2> >::Type
2756 assign(
const DenseMatrix<MT2,true>& rhs );
2758 template<
typename MT2 >
inline void assign(
const DenseMatrix<MT2,false>& rhs );
2759 template<
typename MT2 >
inline void assign(
const SparseMatrix<MT2,true>& rhs );
2760 template<
typename MT2 >
inline void assign(
const SparseMatrix<MT2,false>& rhs );
2762 template<
typename MT2 >
2763 inline typename DisableIf< VectorizedAddAssign<MT2> >::Type
2764 addAssign(
const DenseMatrix<MT2,true>& rhs );
2766 template<
typename MT2 >
2767 inline typename EnableIf< VectorizedAddAssign<MT2> >::Type
2768 addAssign(
const DenseMatrix<MT2,true>& rhs );
2770 template<
typename MT2 >
inline void addAssign(
const DenseMatrix<MT2,false>& rhs );
2771 template<
typename MT2 >
inline void addAssign(
const SparseMatrix<MT2,true>& rhs );
2772 template<
typename MT2 >
inline void addAssign(
const SparseMatrix<MT2,false>& rhs );
2774 template<
typename MT2 >
2775 inline typename DisableIf< VectorizedSubAssign<MT2> >::Type
2776 subAssign(
const DenseMatrix<MT2,true>& rhs );
2778 template<
typename MT2 >
2779 inline typename EnableIf< VectorizedSubAssign<MT2> >::Type
2780 subAssign(
const DenseMatrix<MT2,true>& rhs );
2782 template<
typename MT2 >
inline void subAssign(
const DenseMatrix<MT2,false>& rhs );
2783 template<
typename MT2 >
inline void subAssign(
const SparseMatrix<MT2,true>& rhs );
2784 template<
typename MT2 >
inline void subAssign(
const SparseMatrix<MT2,false>& rhs );
2818 template<
typename MT2,
bool SO2 >
2859 template<
typename MT >
2866 ,
rest_ ( m % IT::size )
2868 ,
aligned_( ( row % IT::size == 0UL ) &&
2869 ( row + m == matrix.
rows() || m % IT::size == 0UL ) )
2871 if( ( row + m > matrix.rows() ) || ( column + n > matrix.columns() ) )
2872 throw std::invalid_argument(
"Invalid submatrix specification" );
2894 template<
typename MT >
2896 DenseSubmatrix<MT,true>::operator()(
size_t i,
size_t j )
2915 template<
typename MT >
2917 DenseSubmatrix<MT,true>::operator()(
size_t i,
size_t j )
const
2938 template<
typename MT >
2939 inline typename DenseSubmatrix<MT,true>::Pointer DenseSubmatrix<MT,true>::data()
2957 template<
typename MT >
2958 inline typename DenseSubmatrix<MT,true>::ConstPointer DenseSubmatrix<MT,true>::data()
const
2973 template<
typename MT >
2991 template<
typename MT >
3009 template<
typename MT >
3027 template<
typename MT >
3045 template<
typename MT >
3063 template<
typename MT >
3089 template<
typename MT >
3090 inline DenseSubmatrix<MT,true>& DenseSubmatrix<MT,true>::operator=(
const ElementType& rhs )
3092 const size_t iend(
row_ +
m_ );
3095 for(
size_t j=
column_; j<jend; ++j )
3096 for(
size_t i=
row_; i<iend; ++i )
3117 template<
typename MT >
3118 inline DenseSubmatrix<MT,true>& DenseSubmatrix<MT,true>::operator=(
const DenseSubmatrix& rhs )
3125 if(
this == &rhs || ( &
matrix_ == &rhs.matrix_ &&
row_ == rhs.row_ &&
column_ == rhs.column_ ) )
3128 if(
rows() != rhs.rows() ||
columns() != rhs.columns() )
3129 throw std::invalid_argument(
"Submatrix sizes do not match" );
3131 if( rhs.canAlias( &
matrix_ ) ) {
3136 if( IsSparseMatrix<MT>::value )
3158 template<
typename MT >
3159 template<
typename MT2
3161 inline DenseSubmatrix<MT,true>& DenseSubmatrix<MT,true>::operator=(
const Matrix<MT2,SO>& rhs )
3168 throw std::invalid_argument(
"Matrix sizes do not match" );
3170 if( IsSparseMatrix<MT2>::value )
3173 if( (~rhs).canAlias( &
matrix_ ) ) {
3198 template<
typename MT >
3199 template<
typename MT2
3201 inline DenseSubmatrix<MT,true>& DenseSubmatrix<MT,true>::operator+=(
const Matrix<MT2,SO>& rhs )
3208 throw std::invalid_argument(
"Matrix sizes do not match" );
3210 if( (~rhs).canAlias( &
matrix_ ) ) {
3235 template<
typename MT >
3236 template<
typename MT2
3238 inline DenseSubmatrix<MT,true>& DenseSubmatrix<MT,true>::operator-=(
const Matrix<MT2,SO>& rhs )
3245 throw std::invalid_argument(
"Matrix sizes do not match" );
3247 if( (~rhs).canAlias( &
matrix_ ) ) {
3272 template<
typename MT >
3273 template<
typename MT2
3275 inline DenseSubmatrix<MT,true>& DenseSubmatrix<MT,true>::operator*=(
const Matrix<MT2,SO>& rhs )
3278 throw std::invalid_argument(
"Matrix sizes do not match" );
3280 typedef typename MultTrait<ResultType,typename MT2::ResultType>::Type MultType;
3285 const MultType tmp( *
this * (~rhs) );
3286 if( IsSparseMatrix<MultType>::value )
3304 template<
typename MT >
3305 template<
typename Other >
3306 inline typename EnableIf< IsNumeric<Other>, DenseSubmatrix<MT,true> >::Type&
3307 DenseSubmatrix<MT,true>::operator*=( Other rhs )
3309 return operator=( (*
this) * rhs );
3323 template<
typename MT >
3324 template<
typename Other >
3325 inline typename EnableIf< IsNumeric<Other>, DenseSubmatrix<MT,true> >::Type&
3326 DenseSubmatrix<MT,true>::operator/=( Other rhs )
3330 return operator=( (*
this) / rhs );
3350 template<
typename MT >
3365 template<
typename MT >
3383 template<
typename MT >
3398 template<
typename MT >
3399 inline size_t DenseSubmatrix<MT,true>::capacity()
const
3414 template<
typename MT >
3415 inline size_t DenseSubmatrix<MT,true>::capacity(
size_t j )
const
3430 template<
typename MT >
3431 inline size_t DenseSubmatrix<MT,true>::nonZeros()
const
3433 const size_t iend(
row_ +
m_ );
3435 size_t nonzeros( 0UL );
3437 for(
size_t j=
column_; j<jend; ++j )
3438 for(
size_t i=
row_; i<iend; ++i )
3455 template<
typename MT >
3456 inline size_t DenseSubmatrix<MT,true>::nonZeros(
size_t j )
const
3460 const size_t iend(
row_ +
m_ );
3461 size_t nonzeros( 0UL );
3463 for(
size_t i=
row_; i<iend; ++i )
3479 template<
typename MT >
3484 const size_t iend(
row_ +
m_ );
3487 for(
size_t j=
column_; j<jend; ++j )
3488 for(
size_t i=
row_; i<iend; ++i )
3502 template<
typename MT >
3509 const size_t iend(
row_ +
m_ );
3510 for(
size_t i=
row_; i<iend; ++i )
3524 template<
typename MT >
3525 template<
typename Other >
3526 inline DenseSubmatrix<MT,true>& DenseSubmatrix<MT,true>::scale( Other scalar )
3528 const size_t iend(
row_ +
m_ );
3531 for(
size_t j=
column_; j<jend; ++j )
3532 for(
size_t i=
row_; i<iend; ++i )
3560 template<
typename MT >
3561 template<
typename Other >
3562 inline bool DenseSubmatrix<MT,true>::canAlias(
const Other* alias )
const
3564 return static_cast<const void*
>( &
matrix_ ) == static_cast<const void*>( alias );
3581 template<
typename MT >
3582 template<
typename Other >
3583 inline bool DenseSubmatrix<MT,true>::isAliased(
const Other* alias )
const
3585 return static_cast<const void*
>( &
matrix_ ) == static_cast<const void*>( alias );
3607 template<
typename MT >
3608 inline typename DenseSubmatrix<MT,true>::IntrinsicType
3611 return loadu( i, j );
3633 template<
typename MT >
3634 inline typename DenseSubmatrix<MT,true>::IntrinsicType
3647 IntrinsicType value;
3648 for(
size_t k=0UL; k<
rest_; ++k )
3673 template<
typename MT >
3699 template<
typename MT >
3714 for(
size_t k=0UL; k<
rest_; ++k )
3739 template<
typename MT >
3760 template<
typename MT >
3761 template<
typename MT2 >
3762 inline typename DisableIf< typename DenseSubmatrix<MT,true>::BLAZE_TEMPLATE VectorizedAssign<MT2> >::Type
3768 const size_t iend(
m_ &
size_t(-2) );
3771 for(
size_t j=0UL; j<
n_; ++j ) {
3772 for(
size_t i=0UL; i<iend; i+=2UL ) {
3797 template<
typename MT >
3798 template<
typename MT2 >
3799 inline typename EnableIf< typename DenseSubmatrix<MT,true>::BLAZE_TEMPLATE VectorizedAssign<MT2> >::Type
3809 !(~rhs).isAliased( &
matrix_ ) )
3811 for(
size_t j=0UL; j<
n_; ++j )
3812 for(
size_t i=0UL; i<
m_; i+=IT::size )
3817 const size_t iend(
m_ &
size_t(-IT::size*4) );
3820 for(
size_t j=0UL; j<
n_; ++j ) {
3822 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
3828 for(
size_t i=iend; i<
m_; i+=IT::size, it+=IT::size ) {
3829 storeu( i, j, it.load() );
3850 template<
typename MT >
3851 template<
typename MT2 >
3857 const size_t block( 16UL );
3859 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
3860 const size_t jend( ( n_<(jj+block) )?( n_ ):( jj+block ) );
3861 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
3862 const size_t iend( ( m_<(ii+block) )?( m_ ):( ii+block ) );
3863 for(
size_t j=jj; j<jend; ++j ) {
3864 for(
size_t i=ii; i<iend; ++i ) {
3887 template<
typename MT >
3888 template<
typename MT2 >
3894 for(
size_t j=0UL; j<
n_; ++j )
3895 for(
typename MT2::ConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
3914 template<
typename MT >
3915 template<
typename MT2 >
3921 for(
size_t i=0UL; i<
m_; ++i )
3922 for(
typename MT2::ConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
3941 template<
typename MT >
3942 template<
typename MT2 >
3943 inline typename DisableIf< typename DenseSubmatrix<MT,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT2> >::Type
3949 const size_t iend( m_ &
size_t(-2) );
3952 for(
size_t j=0UL; j<
n_; ++j ) {
3953 for(
size_t i=0UL; i<iend; i+=2UL ) {
3978 template<
typename MT >
3979 template<
typename MT2 >
3980 inline typename EnableIf< typename DenseSubmatrix<MT,true>::BLAZE_TEMPLATE VectorizedAddAssign<MT2> >::Type
3988 const size_t iend( m_ &
size_t(-IT::size*4) );
3991 for(
size_t j=0UL; j<
n_; ++j ) {
3993 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
3999 for(
size_t i=iend; i<
m_; i+=IT::size, it+=IT::size ) {
4020 template<
typename MT >
4021 template<
typename MT2 >
4027 const size_t block( 16UL );
4029 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
4030 const size_t jend( ( n_<(jj+block) )?( n_ ):( jj+block ) );
4031 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
4032 const size_t iend( ( m_<(ii+block) )?( m_ ):( ii+block ) );
4033 for(
size_t j=jj; j<jend; ++j ) {
4034 for(
size_t i=ii; i<iend; ++i ) {
4057 template<
typename MT >
4058 template<
typename MT2 >
4064 for(
size_t j=0UL; j<
n_; ++j )
4065 for(
typename MT2::ConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
4084 template<
typename MT >
4085 template<
typename MT2 >
4091 for(
size_t i=0UL; i<
m_; ++i )
4092 for(
typename MT2::ConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
4111 template<
typename MT >
4112 template<
typename MT2 >
4113 inline typename DisableIf< typename DenseSubmatrix<MT,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT2> >::Type
4119 const size_t iend( m_ &
size_t(-2) );
4122 for(
size_t j=0UL; j<
n_; ++j ) {
4123 for(
size_t i=0UL; i<iend; i+=2UL ) {
4148 template<
typename MT >
4149 template<
typename MT2 >
4150 inline typename EnableIf< typename DenseSubmatrix<MT,true>::BLAZE_TEMPLATE VectorizedSubAssign<MT2> >::Type
4158 const size_t iend( m_ &
size_t(-IT::size*4) );
4161 for(
size_t j=0UL; j<
n_; ++j ) {
4163 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
4169 for(
size_t i=iend; i<
m_; i+=IT::size, it+=IT::size ) {
4190 template<
typename MT >
4191 template<
typename MT2 >
4197 const size_t block( 16UL );
4199 for(
size_t jj=0UL; jj<
n_; jj+=block ) {
4200 const size_t jend( ( n_<(jj+block) )?( n_ ):( jj+block ) );
4201 for(
size_t ii=0UL; ii<
m_; ii+=block ) {
4202 const size_t iend( ( m_<(ii+block) )?( m_ ):( ii+block ) );
4203 for(
size_t j=jj; j<jend; ++j ) {
4204 for(
size_t i=ii; i<iend; ++i ) {
4227 template<
typename MT >
4228 template<
typename MT2 >
4234 for(
size_t j=0UL; j<
n_; ++j )
4235 for(
typename MT2::ConstIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element )
4254 template<
typename MT >
4255 template<
typename MT2 >
4261 for(
size_t i=0UL; i<
m_; ++i )
4262 for(
typename MT2::ConstIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element )
4284 template<
typename MT,
bool SO >
4285 inline void reset( DenseSubmatrix<MT,SO>& dm );
4287 template<
typename MT,
bool SO >
4288 inline void clear( DenseSubmatrix<MT,SO>& dm );
4290 template<
typename MT,
bool SO >
4291 inline bool isDefault(
const DenseSubmatrix<MT,SO>& dm );
4303 template<
typename MT
4305 inline void reset( DenseSubmatrix<MT,SO>& dm )
4321 template<
typename MT
4323 inline void clear( DenseSubmatrix<MT,SO>& dm )
4348 template<
typename MT
4355 for(
size_t i=0UL; i<(~dm).
rows(); ++i )
4356 for(
size_t j=0UL; j<(~dm).
columns(); ++j )
4361 for(
size_t j=0UL; j<(~dm).
columns(); ++j )
4362 for(
size_t i=0UL; i<(~dm).
rows(); ++i )
4409 template<
typename MT
4411 inline typename DisableIf< Or< IsComputation<MT>, IsTransExpr<MT> >, DenseSubmatrix<MT> >::Type
4412 submatrix( DenseMatrix<MT,SO>& dm,
size_t row,
size_t column,
size_t m,
size_t n )
4416 return DenseSubmatrix<MT>( ~dm,
row,
column, m, n );
4450 template<
typename MT
4452 inline typename DisableIf< Or< IsComputation<MT>, IsTransExpr<MT> >, DenseSubmatrix<const MT> >::Type
4453 submatrix(
const DenseMatrix<MT,SO>& dm,
size_t row,
size_t column,
size_t m,
size_t n )
4457 return DenseSubmatrix<const MT>( ~dm,
row,
column, m, n );
4485 template<
typename MT
4487 inline DenseSubmatrix<MT,SO>
4488 submatrix(
const DenseSubmatrix<MT,SO>& dm,
size_t row,
size_t column,
size_t m,
size_t n )
4492 return DenseSubmatrix<MT,SO>( dm.matrix_, dm.row_ +
row, dm.column_ +
column, m, n );
4508 template<
typename MT,
bool SO >
4509 struct SubmatrixTrait< DenseSubmatrix<MT,SO> >
4527 template<
typename MT,
bool SO >
4528 struct SubmatrixExprTrait< DenseSubmatrix<MT,SO> >
4530 typedef DenseSubmatrix<MT,SO> Type;
4538 template<
typename MT,
bool SO >
4539 struct SubmatrixExprTrait< const DenseSubmatrix<MT,SO> >
4541 typedef DenseSubmatrix<MT,SO> Type;
4549 template<
typename MT,
bool SO >
4550 struct SubmatrixExprTrait< volatile DenseSubmatrix<MT,SO> >
4552 typedef DenseSubmatrix<MT,SO> Type;
4560 template<
typename MT,
bool SO >
4561 struct SubmatrixExprTrait< const volatile DenseSubmatrix<MT,SO> >
4563 typedef DenseSubmatrix<MT,SO> Type;
4579 template<
typename MT,
bool SO >
4580 struct RowTrait< DenseSubmatrix<MT,SO> >
4598 template<
typename MT,
bool SO >
4599 struct ColumnTrait< DenseSubmatrix<MT,SO> >
Constraint on the data type.
const size_t rest_
The number of remaining elements in an unaligned intrinsic operation.
Definition: DenseSubmatrix.h:2797
DenseSubmatrix & operator=(const ElementType &rhs)
Homogenous assignment to all submatrix elements.
Definition: DenseSubmatrix.h:1108
Constraint on the data type.
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, DenseColumn< MT > >::Type column(DenseMatrix< MT, SO > &dm, size_t index)
Creating a view on a specific column of the given dense matrix.
Definition: DenseColumn.h:3026
Operand matrix_
The dense matrix containing the submatrix.
Definition: DenseSubmatrix.h:792
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.
IteratorCategory iterator_category
The iterator category.
Definition: DenseSubmatrix.h:361
SubmatrixIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DenseSubmatrix.h:390
std::iterator_traits< IteratorType >::reference ReferenceType
Reference return type.
Definition: DenseSubmatrix.h:355
IteratorType iterator_
Iterator to the current submatrix element.
Definition: DenseSubmatrix.h:616
Header file for the View base class.
Header file for the row trait.
const size_t final_
The final index for unaligned intrinsic operations.
Definition: DenseSubmatrix.h:798
Base template for the SubmatrixTrait class.
Definition: SubmatrixTrait.h:117
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
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:196
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i...
Definition: Computation.h:118
bool aligned_
Memory alignment flag.
Definition: DenseSubmatrix.h:619
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:79
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.
const bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Streaming.h:50
Header file for the IsColumnMajorMatrix type trait.
const DenseSubmatrix & CompositeType
Data type for composite expression templates.
Definition: DenseSubmatrix.h:322
bool operator>=(const SubmatrixIterator &rhs) const
Greater-than comparison between two SubmatrixIterator objects.
Definition: DenseSubmatrix.h:562
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DenseSubmatrix.h:321
IT::Type IntrinsicType
Intrinsic type of the subvector elements.
Definition: DenseSubmatrix.h:320
size_t nonZeros() const
Returns the number of non-zero elements in the dense submatrix.
Definition: DenseSubmatrix.h:1444
IntrinsicType load() const
Aligned load of an intrinsic element of the dense submatrix.
Definition: DenseSubmatrix.h:470
void storeu(float *address, const sse_float_t &value)
Unaligned store of a vector of 'float' values.
Definition: Storeu.h:234
std::iterator_traits< IteratorType >::value_type ValueType
Type of the underlying elements.
Definition: DenseSubmatrix.h:349
Reference operator()(size_t i, size_t j)
2D-access to the dense submatrix elements.
Definition: DenseSubmatrix.h:894
bool isAliased(const Other *alias) const
Returns whether the submatrix is aliased with the given address alias.
Definition: DenseSubmatrix.h:1600
IntrinsicType loadu() const
Unaligned load of an intrinsic element of the dense submatrix.
Definition: DenseSubmatrix.h:485
CompressedMatrix< Type,!SO > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:246
size_t rows() const
Returns the number of rows of the dense submatrix.
Definition: DenseSubmatrix.h:1362
Header file for the IsTransExpr type trait class.
Access proxy for sparse, matrices.The MatrixAccessProxy provides safe access to the elements of a no...
Definition: MatrixAccessProxy.h:86
SubmatrixTrait< MT >::Type ResultType
Result type for expression template evaluations.
Definition: DenseSubmatrix.h:316
bool canAlias(const Other *alias) const
Returns whether the submatrix can alias with the given address alias.
Definition: DenseSubmatrix.h:1580
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
IteratorType final_
The final iterator for intrinsic operations.
Definition: DenseSubmatrix.h:617
const size_t final_
The final index for unaligned intrinsic operations.
Definition: DenseSubmatrix.h:2798
const size_t row_
The first row of the submatrix.
Definition: DenseSubmatrix.h:2793
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a transposition expression (i...
Definition: TransExpr.h:118
MT::ConstReference ConstReference
Reference to a constant submatrix value.
Definition: DenseSubmatrix.h:325
ReferenceType reference
Reference return type.
Definition: DenseSubmatrix.h:364
bool operator<=(const SubmatrixIterator &rhs) const
Less-than comparison between two SubmatrixIterator objects.
Definition: DenseSubmatrix.h:551
SubmatrixIterator(IteratorType iterator, IteratorType final, size_t rest, bool aligned)
Constructor for the SubmatrixIterator class.
Definition: DenseSubmatrix.h:376
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
friend const SubmatrixIterator operator+(size_t inc, const SubmatrixIterator &it)
Addition between an integral value and a SubmatrixIterator.
Definition: DenseSubmatrix.h:597
MT::ElementType ElementType
Type of the submatrix elements.
Definition: DenseSubmatrix.h:319
std::iterator_traits< IteratorType >::difference_type DifferenceType
Difference between two iterators.
Definition: DenseSubmatrix.h:358
const size_t row_
The first row of the submatrix.
Definition: DenseSubmatrix.h:793
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DenseSubmatrix.h:317
Constraint on the data type.
Header file for the matrix storage order types.
Constraint on the data type.
void stream(float *address, const sse_float_t &value)
Aligned, non-temporal store of a vector of 'float' values.
Definition: Stream.h:233
const size_t column_
The first column of the submatrix.
Definition: SparseSubmatrix.h:2654
size_t capacity() const
Returns the maximum capacity of the dense submatrix.
Definition: DenseSubmatrix.h:1409
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the DisableIf class template.
void stream(size_t i, size_t j, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the submatrix.
Definition: DenseSubmatrix.h:1756
Header file for the multiplication trait.
std::iterator_traits< IteratorType >::iterator_category IteratorCategory
The iterator category.
Definition: DenseSubmatrix.h:346
const size_t n_
The number of columns of the submatrix.
Definition: DenseSubmatrix.h:796
SubmatrixIterator< typename MT::ConstIterator > ConstIterator
Iterator over constant elements.
Definition: DenseSubmatrix.h:626
SubmatrixIterator & operator++()
Pre-increment operator.
Definition: DenseSubmatrix.h:413
Header file for nested template disabiguation.
SubmatrixIterator & operator--()
Pre-decrement operator.
Definition: DenseSubmatrix.h:434
Header file for the If class template.
Header file for the IsFloatingPoint type trait.
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: StorageOrder.h:161
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2379
Header file for the Or class template.
Constraint on the data type.
Header file for the DenseMatrix base class.
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
bool operator!=(const SubmatrixIterator &rhs) const
Inequality comparison between two SubmatrixIterator objects.
Definition: DenseSubmatrix.h:518
const ElementType * ConstPointer
Pointer to a constant row value.
Definition: DenseSubmatrix.h:331
ConstIterator cend(size_t i) const
Returns an iterator just past the last non-zero element of row/column i.
Definition: DenseSubmatrix.h:1083
size_t n_
The current number of columns of the sparse matrix.
Definition: CompressedMatrix.h:2512
SelectType< useConst, ConstReference, typename MT::Reference >::Type Reference
Reference to a non-constant submatrix value.
Definition: DenseSubmatrix.h:328
PointerType pointer
Pointer return type.
Definition: DenseSubmatrix.h:363
Constraint on the data type.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DenseSubmatrix.h:318
Operand matrix_
The dense matrix containing the column.
Definition: DenseColumn.h:2069
#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
const size_t m_
The number of rows of the submatrix.
Definition: DenseSubmatrix.h:795
Pointer data()
Low-level data access to the submatrix elements.
Definition: DenseSubmatrix.h:935
Constraints on the storage order of matrix types.
const SubmatrixIterator operator--(int)
Post-decrement operator.
Definition: DenseSubmatrix.h:445
const SubmatrixIterator operator++(int)
Post-increment operator.
Definition: DenseSubmatrix.h:424
DenseSubmatrix< MT, SO > This
Type of this DenseSubmatrix instance.
Definition: DenseSubmatrix.h:315
void storeu(size_t i, size_t j, const IntrinsicType &value)
Unaligned store of an intrinsic element of the submatrix.
Definition: DenseSubmatrix.h:1716
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2373
Constraint on the data type.
Header file for the SelectType class template.
const size_t column_
The first column of the submatrix.
Definition: DenseSubmatrix.h:2794
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2377
const size_t m_
The number of rows of the submatrix.
Definition: SparseSubmatrix.h:2655
System settings for streaming (non-temporal stores)
Header file for the EnableIf class template.
SelectType< useConst, ConstIterator, SubmatrixIterator< typename MT::Iterator > >::Type Iterator
Iterator over non-constant elements.
Definition: DenseSubmatrix.h:629
ColumnIterator< const MT > ConstIterator
Iterator over constant elements.
Definition: DenseColumn.h:1972
Header file for the IsNumeric type trait.
const bool spacing
Adding an additional spacing line between two log messages.This setting gives the opportunity to add ...
Definition: Logging.h:70
bool operator<(const SubmatrixIterator &rhs) const
Less-than comparison between two SubmatrixIterator objects.
Definition: DenseSubmatrix.h:529
ReferenceType operator*() const
Direct access to the element at the current iterator position.
Definition: DenseSubmatrix.h:455
SelectType< IsExpression< MT >::value, MT, MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: DenseSubmatrix.h:296
const size_t row_
The index of the row in the matrix.
Definition: DenseRow.h:2069
Header file for the SubmatrixExprTrait class template.
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: StorageOrder.h:81
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2374
Header file for the IsConst type trait.
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:648
const bool aligned_
Memory alignment flag.
Definition: DenseSubmatrix.h:803
Header file for run time assertion macros.
void reset()
Reset to the default initial values.
Definition: DenseSubmatrix.h:1496
Base template for the MultTrait class.
Definition: MultTrait.h:141
Header file for the addition trait.
IntrinsicType loadu(size_t i, size_t j) const
Unaligned load of an intrinsic element of the submatrix.
Definition: DenseSubmatrix.h:1652
DenseSubmatrix(MT &matrix, size_t row, size_t column, size_t m, size_t n)
The constructor for DenseSubmatrix.
Definition: DenseSubmatrix.h:859
Header file for the division trait.
const size_t column_
The first column of the submatrix.
Definition: DenseSubmatrix.h:794
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.
DifferenceType difference_type
Difference between two iterators.
Definition: DenseSubmatrix.h:365
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Iterator over the elements of the sparse submatrix.
Definition: DenseSubmatrix.h:341
Header file for the reset shim.
Iterator begin(size_t i)
Returns an iterator to the first non-zero element of row/column i.
Definition: DenseSubmatrix.h:973
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, DenseRow< MT > >::Type row(DenseMatrix< MT, SO > &dm, size_t index)
Creating a view on a specific row of the given dense matrix.
Definition: DenseRow.h:3025
Header file for the cache size of the target architecture.
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
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
size_t m_
The current number of rows of the sparse matrix.
Definition: CompressedMatrix.h:2511
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
DifferenceType operator-(const SubmatrixIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DenseSubmatrix.h:573
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
Compile time check for constant data types.The IsConst type trait tests whether or not the given temp...
Definition: IsConst.h:94
bool operator>(const SubmatrixIterator &rhs) const
Greater-than comparison between two SubmatrixIterator objects.
Definition: DenseSubmatrix.h:540
std::iterator_traits< IteratorType >::pointer PointerType
Pointer return type.
Definition: DenseSubmatrix.h:352
Header file for all intrinsic functionality.
IntrinsicType load(size_t i, size_t j) const
Aligned load of an intrinsic element of the submatrix.
Definition: DenseSubmatrix.h:1626
ConstIterator cbegin(size_t i) const
Returns an iterator to the first non-zero element of row/column i.
Definition: DenseSubmatrix.h:1017
IntrinsicTrait< typename MT::ElementType > IT
Intrinsic trait for the matrix element type.
Definition: DenseSubmatrix.h:299
size_t columns() const
Returns the number of columns of the dense submatrix.
Definition: DenseSubmatrix.h:1376
Base class for all views.The View class serves as a tag for all views (subvectors, submatrices, rows, columns, ...). All classes that represent a view and that are used within the expression template environment of the Blaze library have to derive from this class in order to qualify as a view. Only in case a class is derived from the View base class, the IsView type trait recognizes the class as valid view.
Definition: View.h:64
const bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71
Header file for the IsComputation type trait class.
bool operator==(const SubmatrixIterator &rhs) const
Equality comparison between two SubmatrixIterator objects.
Definition: DenseSubmatrix.h:507
CompressedMatrix< Type,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:247
const bool aligned_
Memory alignment flag.
Definition: DenseSubmatrix.h:2803
Iterator end(size_t i)
Returns an iterator just past the last non-zero element of row/column i.
Definition: DenseSubmatrix.h:1039
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2370
View on a specific submatrix of a dense matrix.The DenseSubmatrix template represents a view on a spe...
Definition: DenseSubmatrix.h:290
const size_t n_
The number of columns of the submatrix.
Definition: SparseSubmatrix.h:2656
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
size_t spacing() const
Returns the spacing between the beginning of two rows/columns.
Definition: DenseSubmatrix.h:1395
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, DenseSubmatrix< MT > >::Type submatrix(DenseMatrix< MT, SO > &dm, size_t row, size_t column, size_t m, size_t n)
Creating a view on a specific submatrix of the given dense matrix.
Definition: DenseSubmatrix.h:4412
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a N-dimensional matrix type...
Definition: Matrix.h:79
SelectType< useConst, ConstIterator, ColumnIterator< MT > >::Type Iterator
Iterator over non-constant elements.
Definition: DenseColumn.h:1980
const size_t rest_
The number of remaining elements in an unaligned intrinsic operation.
Definition: DenseSubmatrix.h:797
friend const SubmatrixIterator operator-(const SubmatrixIterator &it, size_t dec)
Subtraction between a SubmatrixIterator and an integral value.
Definition: DenseSubmatrix.h:609
const size_t cacheSize
Cache size of the target architecture.This setting specifies the available cache size in Byte of the ...
Definition: CacheSize.h:48
SubmatrixIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DenseSubmatrix.h:402
void store(size_t i, size_t j, const IntrinsicType &value)
Aligned store of an intrinsic element of the submatrix.
Definition: DenseSubmatrix.h:1691
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
Operand matrix_
The dense matrix containing the submatrix.
Definition: DenseSubmatrix.h:2792
SelectType< useConst, ConstPointer, ElementType * >::Type Pointer
Pointer to a constant row value.
Definition: DenseSubmatrix.h:334
ValueType value_type
Type of the underlying elements.
Definition: DenseSubmatrix.h:362
void store(float *address, const sse_float_t &value)
Aligned store of a vector of 'float' values.
Definition: Store.h:242
size_t rest_
The number of remaining elements beyond the final iterator.
Definition: DenseSubmatrix.h:618
Header file for the IsExpression type trait class.
friend const SubmatrixIterator operator+(const SubmatrixIterator &it, size_t inc)
Addition between a SubmatrixIterator and an integral value.
Definition: DenseSubmatrix.h:585
Header file for the FunctionTrace class.