35 #ifndef _BLAZE_MATH_VIEWS_ROWS_DENSE_H_ 36 #define _BLAZE_MATH_VIEWS_ROWS_DENSE_H_ 120 template<
typename MT
123 class Rows<MT,true,true,SF,CRAs...>
124 :
public View< DenseMatrix< Rows<MT,true,true,SF,CRAs...>, false > >
125 ,
private RowsData<CRAs...>
129 using DataType = RowsData<CRAs...>;
130 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
139 template<
typename MT1,
typename MT2 >
140 static constexpr
bool EnforceEvaluation_v =
141 ( IsRestricted_v<MT1> && RequiresEvaluation_v<MT2> );
147 using This = Rows<MT,
true,
true,SF,CRAs...>;
149 using BaseType = DenseMatrix<This,false>;
150 using ViewedType = MT;
155 using SIMDType = SIMDTrait_t<ElementType>;
166 using ConstPointer = ConstPointer_t<MT>;
169 using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
180 static constexpr
bool simdEnabled = MT::simdEnabled;
189 template<
typename... RRAs >
190 explicit inline Rows( MT& matrix, RRAs... args );
192 Rows(
const Rows& ) =
default;
193 Rows( Rows&& ) =
default;
207 inline Reference operator()(
size_t i,
size_t j );
209 inline Reference at(
size_t i,
size_t j );
211 inline Pointer
data () noexcept;
212 inline ConstPointer
data () const noexcept;
213 inline Pointer
data (
size_t i ) noexcept;
214 inline ConstPointer
data (
size_t i ) const noexcept;
228 inline Rows& operator=( initializer_list< initializer_list<
ElementType> > list );
229 inline Rows& operator=( const Rows& rhs );
231 template< typename MT2,
bool SO2 >
232 inline Rows& operator=( const Matrix<MT2,SO2>& rhs );
234 template< typename MT2,
bool SO2 >
235 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
236 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
238 template< typename MT2,
bool SO2 >
239 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
240 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
242 template< typename MT2,
bool SO2 >
243 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
244 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
246 template< typename MT2,
bool SO2 >
247 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
248 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
250 template< typename MT2,
bool SO2 >
251 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
252 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
254 template< typename MT2,
bool SO2 >
255 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
256 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
264 using DataType::idces;
265 using DataType::
rows;
267 inline MT& operand() noexcept;
268 inline const MT& operand() const noexcept;
270 inline
size_t columns() const noexcept;
271 inline
size_t spacing() const noexcept;
272 inline
size_t capacity() const noexcept;
273 inline
size_t capacity(
size_t i ) const noexcept;
275 inline
size_t nonZeros(
size_t i ) const;
277 inline
void reset(
size_t i );
287 template< typename Other > inline Rows& scale( const Other& scalar );
294 template< typename MT2 >
295 static constexpr
bool VectorizedAssign_v =
296 ( useOptimizedKernels &&
297 simdEnabled && MT2::simdEnabled &&
303 template< typename MT2 >
304 static constexpr
bool VectorizedAddAssign_v =
305 ( useOptimizedKernels &&
306 simdEnabled && MT2::simdEnabled &&
314 template< typename MT2 >
315 static constexpr
bool VectorizedSubAssign_v =
316 ( useOptimizedKernels &&
317 simdEnabled && MT2::simdEnabled &&
325 template< typename MT2 >
326 static constexpr
bool VectorizedSchurAssign_v =
327 ( useOptimizedKernels &&
328 simdEnabled && MT2::simdEnabled &&
342 template< typename Other >
343 inline
bool canAlias( const Other* alias ) const noexcept;
345 template< typename MT2,
bool SO2,
bool SF2, typename... CRAs2 >
346 inline
bool canAlias( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
348 template< typename Other >
349 inline
bool isAliased( const Other* alias ) const noexcept;
351 template< typename MT2,
bool SO2,
bool SF2, typename... CRAs2 >
352 inline
bool isAliased( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
354 inline
bool isAligned () const noexcept;
355 inline
bool canSMPAssign() const noexcept;
366 template< typename MT2 >
367 inline auto assign( const DenseMatrix<MT2,false>& rhs ) ->
DisableIf_t< VectorizedAssign_v<MT2> >;
369 template< typename MT2 >
370 inline auto assign( const DenseMatrix<MT2,false>& rhs ) ->
EnableIf_t< VectorizedAssign_v<MT2> >;
372 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,true>& rhs );
374 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,false>& rhs );
375 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,true>& rhs );
377 template< typename MT2 >
378 inline auto addAssign( const DenseMatrix<MT2,false>& rhs ) ->
DisableIf_t< VectorizedAddAssign_v<MT2> >;
380 template< typename MT2 >
381 inline auto addAssign( const DenseMatrix<MT2,false>& rhs ) ->
EnableIf_t< VectorizedAddAssign_v<MT2> >;
383 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,true>& rhs );
384 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,false>& rhs );
385 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,true>& rhs );
387 template< typename MT2 >
388 inline auto subAssign( const DenseMatrix<MT2,false>& rhs ) ->
DisableIf_t< VectorizedSubAssign_v<MT2> >;
390 template< typename MT2 >
391 inline auto subAssign( const DenseMatrix<MT2,false>& rhs ) ->
EnableIf_t< VectorizedSubAssign_v<MT2> >;
393 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,true>& rhs );
394 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,false>& rhs );
395 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,true>& rhs );
397 template< typename MT2 >
398 inline auto schurAssign( const DenseMatrix<MT2,false>& rhs ) ->
DisableIf_t< VectorizedSchurAssign_v<MT2> >;
400 template< typename MT2 >
401 inline auto schurAssign( const DenseMatrix<MT2,false>& rhs ) ->
EnableIf_t< VectorizedSchurAssign_v<MT2> >;
403 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,true>& rhs );
404 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,false>& rhs );
405 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,true>& rhs );
418 template< typename MT2,
bool SO2,
bool DF2,
bool SF2, typename... CRAs2 > friend class Rows;
457 template< typename MT
460 template< typename... RRAs >
461 inline Rows<MT,true,true,SF,CRAs...>::Rows( MT& matrix, RRAs... args )
462 : DataType( args... )
466 for(
size_t i=0UL; i<
rows(); ++i ) {
467 if( matrix_.rows() <= idx(i) ) {
496 template<
typename MT
499 inline typename Rows<MT,
true,
true,SF,CRAs...>
::Reference 500 Rows<MT,true,true,SF,CRAs...>::operator()(
size_t i,
size_t j )
505 return matrix_(idx(i),j);
522 template<
typename MT
526 Rows<MT,true,true,SF,CRAs...>::operator()(
size_t i,
size_t j )
const 531 return const_cast<const MT&
>( matrix_ )(idx(i),j);
549 template<
typename MT
552 inline typename Rows<MT,
true,
true,SF,CRAs...>
::Reference 553 Rows<MT,true,true,SF,CRAs...>::at(
size_t i,
size_t j )
579 template<
typename MT
583 Rows<MT,true,true,SF,CRAs...>::at(
size_t i,
size_t j )
const 607 template<
typename MT
610 inline typename Rows<MT,
true,
true,SF,CRAs...>::Pointer
613 return matrix_.data( idx(0UL) );
629 template<
typename MT
632 inline typename Rows<MT,
true,
true,SF,CRAs...>::ConstPointer
635 return matrix_.data( idx(0UL) );
650 template<
typename MT
653 inline typename Rows<MT,
true,
true,SF,CRAs...>::Pointer
656 return matrix_.data( idx(i) );
671 template<
typename MT
674 inline typename Rows<MT,
true,
true,SF,CRAs...>::ConstPointer
677 return matrix_.data( idx(i) );
692 template<
typename MT
695 inline typename Rows<MT,
true,
true,SF,CRAs...>
::Iterator 699 return matrix_.begin( idx(i) );
714 template<
typename MT
721 return matrix_.cbegin( idx(i) );
736 template<
typename MT
743 return matrix_.cbegin( idx(i) );
758 template<
typename MT
761 inline typename Rows<MT,
true,
true,SF,CRAs...>
::Iterator 765 return matrix_.end( idx(i) );
780 template<
typename MT
787 return matrix_.cend( idx(i) );
802 template<
typename MT
809 return matrix_.cend( idx(i) );
834 template<
typename MT
837 inline Rows<MT,
true,
true,SF,CRAs...>&
838 Rows<MT,true,true,SF,CRAs...>::operator=(
const ElementType& rhs )
840 for(
size_t i=0UL; i<
rows(); ++i ) {
866 template<
typename MT
869 inline Rows<MT,
true,
true,SF,CRAs...>&
870 Rows<MT,true,true,SF,CRAs...>::operator=( initializer_list< initializer_list<ElementType> > list )
875 if( list.size() !=
rows() ) {
879 if( IsRestricted_v<MT> ) {
881 for(
const auto& rowList : list ) {
882 const InitializerVector<ElementType> tmp( rowList,
columns() );
883 if( !tryAssign(
row( matrix_, idx(i),
unchecked ), tmp, 0UL ) ){
890 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
893 for(
const auto& rowList : list ) {
894 std::fill( std::copy( rowList.begin(), rowList.end(), left.begin(i) ), left.end(i),
ElementType() );
919 template<
typename MT
922 inline Rows<MT,
true,
true,SF,CRAs...>&
923 Rows<MT,true,true,SF,CRAs...>::operator=(
const Rows& rhs )
931 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && compareIndices( *
this, rhs ) ) )
934 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
938 if( IsRestricted_v<MT> ) {
939 for(
size_t i=0UL; i<
rows(); ++i ) {
946 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
948 if( rhs.canAlias( &matrix_ ) ) {
979 template<
typename MT
982 template<
typename MT2
984 inline Rows<MT,
true,
true,SF,CRAs...>&
985 Rows<MT,true,true,SF,CRAs...>::operator=(
const Matrix<MT2,SO2>& rhs )
996 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<MT2>,
const MT2& >;
999 if( IsRestricted_v<MT> ) {
1000 for(
size_t i=0UL; i<
rows(); ++i ) {
1007 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1009 if( IsSparseMatrix_v<MT2> ) {
1013 if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
1014 const ResultType_t<MT2> tmp( right );
1043 template<
typename MT
1045 ,
typename... CRAs >
1046 template<
typename MT2
1049 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
1058 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
1067 if( IsRestricted_v<MT> ) {
1068 for(
size_t i=0UL; i<
rows(); ++i ) {
1075 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1077 if( (~rhs).canAlias( &matrix_ ) ) {
1078 const AddType tmp( *
this + (~rhs) );
1107 template<
typename MT
1109 ,
typename... CRAs >
1110 template<
typename MT2
1113 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
1122 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
1131 const AddType tmp( *
this + (~rhs) );
1133 if( IsRestricted_v<MT> ) {
1134 for(
size_t i=0UL; i<
rows(); ++i ) {
1141 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1167 template<
typename MT
1169 ,
typename... CRAs >
1170 template<
typename MT2
1173 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
1182 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
1191 if( IsRestricted_v<MT> ) {
1192 for(
size_t i=0UL; i<
rows(); ++i ) {
1199 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1201 if( (~rhs).canAlias( &matrix_ ) ) {
1202 const SubType tmp( *
this - (~rhs ) );
1231 template<
typename MT
1233 ,
typename... CRAs >
1234 template<
typename MT2
1237 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
1246 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
1255 const SubType tmp( *
this - (~rhs) );
1257 if( IsRestricted_v<MT> ) {
1258 for(
size_t i=0UL; i<
rows(); ++i ) {
1265 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1291 template<
typename MT
1293 ,
typename... CRAs >
1294 template<
typename MT2
1296 inline auto Rows<MT,true,true,SF,CRAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
1297 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
1306 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
1314 if( IsRestricted_v<MT> ) {
1315 for(
size_t i=0UL; i<
rows(); ++i ) {
1322 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1324 if( (~rhs).canAlias( &matrix_ ) ) {
1325 const SchurType tmp( *
this % (~rhs) );
1326 if( IsSparseMatrix_v<SchurType> )
1356 template<
typename MT
1358 ,
typename... CRAs >
1359 template<
typename MT2
1361 inline auto Rows<MT,true,true,SF,CRAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
1362 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
1371 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
1379 const SchurType tmp( *
this % (~rhs) );
1381 if( IsRestricted_v<MT> ) {
1382 for(
size_t i=0UL; i<
rows(); ++i ) {
1389 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1391 if( IsSparseMatrix_v<SchurType> ) {
1419 template<
typename MT
1421 ,
typename... CRAs >
1422 inline MT& Rows<MT,true,true,SF,CRAs...>::operand() noexcept
1436 template<
typename MT
1438 ,
typename... CRAs >
1439 inline const MT& Rows<MT,true,true,SF,CRAs...>::operand() const noexcept
1453 template<
typename MT
1455 ,
typename... CRAs >
1458 return matrix_.columns();
1473 template<
typename MT
1475 ,
typename... CRAs >
1478 return matrix_.spacing();
1490 template<
typename MT
1492 ,
typename... CRAs >
1510 template<
typename MT
1512 ,
typename... CRAs >
1531 template<
typename MT
1533 ,
typename... CRAs >
1536 size_t nonzeros( 0UL );
1538 for(
size_t i=0UL; i<
rows(); ++i ) {
1539 nonzeros += matrix_.nonZeros( idx(i) );
1557 template<
typename MT
1559 ,
typename... CRAs >
1564 return matrix_.nonZeros( idx(i) );
1576 template<
typename MT
1578 ,
typename... CRAs >
1581 for(
size_t i=0UL; i<
rows(); ++i ) {
1582 matrix_.reset( idx(i) );
1598 template<
typename MT
1600 ,
typename... CRAs >
1603 matrix_.reset( idx(i) );
1630 template<
typename MT
1632 ,
typename... CRAs >
1633 inline Rows<MT,
true,
true,SF,CRAs...>&
1645 if( IsRestricted_v<MT> ) {
1646 for(
size_t i=0UL; i<
rows(); ++i ) {
1647 if( !tryAssign( matrix_,
row( tmp, i ), idx(i), 0UL ) ) {
1653 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1676 template<
typename MT
1678 ,
typename... CRAs >
1679 inline Rows<MT,
true,
true,SF,CRAs...>&
1691 if( IsRestricted_v<MT> ) {
1692 for(
size_t i=0UL; i<
rows(); ++i ) {
1693 if( !tryAssign( matrix_,
row( tmp, i ), idx(i), 0UL ) ) {
1699 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1722 template<
typename MT
1724 ,
typename... CRAs >
1725 template<
typename Other >
1726 inline Rows<MT,
true,
true,SF,CRAs...>&
1727 Rows<MT,true,true,SF,CRAs...>::scale(
const Other& scalar )
1733 for(
size_t i=0UL; i<
rows(); ++i )
1735 const size_t index ( idx(i) );
1736 const size_t jbegin( IsUpper<MT>::value ? ( IsStrictlyUpper_v<MT> ? index+1UL : index ) : 0UL );
1737 const size_t jend ( IsLower<MT>::value ? ( IsStrictlyLower_v<MT> ? index : index+1UL ) :
columns() );
1739 for(
size_t j=jbegin; j<jend; ++j ) {
1740 matrix_(index,j) *= scalar;
1769 template<
typename MT
1771 ,
typename... CRAs >
1772 template<
typename Other >
1773 inline bool Rows<MT,true,true,SF,CRAs...>::canAlias(
const Other* alias )
const noexcept
1775 return matrix_.isAliased( alias );
1793 template<
typename MT
1795 ,
typename... CRAs >
1796 template<
typename MT2
1799 ,
typename... CRAs2 >
1801 Rows<MT,true,true,SF,CRAs...>::canAlias(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
1803 return matrix_.isAliased( &alias->matrix_ );
1820 template<
typename MT
1822 ,
typename... CRAs >
1823 template<
typename Other >
1824 inline bool Rows<MT,true,true,SF,CRAs...>::isAliased(
const Other* alias )
const noexcept
1826 return matrix_.isAliased( alias );
1844 template<
typename MT
1846 ,
typename... CRAs >
1847 template<
typename MT2
1850 ,
typename... CRAs2 >
1852 Rows<MT,true,true,SF,CRAs...>::isAliased(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
1854 return matrix_.isAliased( &alias->matrix_ );
1870 template<
typename MT
1872 ,
typename... CRAs >
1873 inline bool Rows<MT,true,true,SF,CRAs...>::isAligned() const noexcept
1875 return matrix_.isAligned();
1892 template<
typename MT
1894 ,
typename... CRAs >
1895 inline bool Rows<MT,true,true,SF,CRAs...>::canSMPAssign() const noexcept
1897 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
1918 template<
typename MT
1920 ,
typename... CRAs >
1922 Rows<MT,true,true,SF,CRAs...>::load(
size_t i,
size_t j )
const noexcept
1924 return matrix_.load( idx(i), j );
1945 template<
typename MT
1947 ,
typename... CRAs >
1951 return matrix_.loada( idx(i), j );
1972 template<
typename MT
1974 ,
typename... CRAs >
1978 return matrix_.loadu( idx(i), j );
2000 template<
typename MT
2002 ,
typename... CRAs >
2004 Rows<MT,true,true,SF,CRAs...>::store(
size_t i,
size_t j,
const SIMDType& value ) noexcept
2006 matrix_.store( idx(i), j, value );
2028 template<
typename MT
2030 ,
typename... CRAs >
2034 matrix_.storea( idx(i), j, value );
2056 template<
typename MT
2058 ,
typename... CRAs >
2062 matrix_.storeu( idx(i), j, value );
2084 template<
typename MT
2086 ,
typename... CRAs >
2090 matrix_.stream( idx(i), j, value );
2108 template<
typename MT
2110 ,
typename... CRAs >
2111 template<
typename MT2 >
2112 inline auto Rows<MT,true,true,SF,CRAs...>::assign(
const DenseMatrix<MT2,false>& rhs )
2113 -> DisableIf_t< VectorizedAssign_v<MT2> >
2121 const size_t jpos(
columns() &
size_t(-2) );
2124 for(
size_t i=0UL; i<
rows(); ++i ) {
2125 const size_t index( idx(i) );
2126 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2127 matrix_(index,j ) = (~rhs)(i,j );
2128 matrix_(index,j+1UL) = (~rhs)(i,j+1UL);
2131 matrix_(index,jpos) = (~rhs)(i,jpos);
2151 template<
typename MT
2153 ,
typename... CRAs >
2154 template<
typename MT2 >
2155 inline auto Rows<MT,true,true,SF,CRAs...>::assign(
const DenseMatrix<MT2,false>& rhs )
2156 -> EnableIf_t< VectorizedAssign_v<MT2> >
2166 const size_t jpos(
columns() &
size_t(-SIMDSIZE) );
2171 !(~rhs).isAliased( &matrix_ ) )
2173 for(
size_t i=0UL; i<
rows(); ++i )
2177 ConstIterator_t<MT2> right( (~rhs).
begin(i) );
2179 for( ; j<jpos; j+=SIMDSIZE ) {
2180 left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2189 for(
size_t i=0UL; i<
rows(); ++i )
2193 ConstIterator_t<MT2> right( (~rhs).
begin(i) );
2195 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2196 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2197 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2198 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2199 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2201 for( ; j<jpos; j+=SIMDSIZE ) {
2202 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2205 *left = *right; ++left; ++right;
2226 template<
typename MT
2228 ,
typename... CRAs >
2229 template<
typename MT2 >
2230 inline void Rows<MT,true,true,SF,CRAs...>::assign(
const DenseMatrix<MT2,true>& rhs )
2240 constexpr
size_t block( BLOCK_SIZE );
2244 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
2245 for(
size_t i=0UL; i<
rows(); ++i ) {
2246 const size_t index( idx(i) );
2247 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2248 matrix_(index,j ) = (~rhs)(i,j );
2249 matrix_(index,j+1UL) = (~rhs)(i,j+1UL);
2251 if( jpos < (~rhs).columns() ) {
2252 matrix_(index,jpos) = (~rhs)(i,jpos);
2258 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2259 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2260 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2261 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2262 for(
size_t i=ii; i<iend; ++i ) {
2263 const size_t index( idx(i) );
2264 for(
size_t j=jj; j<jend; ++j ) {
2265 matrix_(index,j) = (~rhs)(i,j);
2288 template<
typename MT
2290 ,
typename... CRAs >
2291 template<
typename MT2 >
2292 inline void Rows<MT,true,true,SF,CRAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
2300 for(
size_t i=0UL; i<
rows(); ++i ) {
2301 const size_t index( idx(i) );
2302 for( ConstIterator_t<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2303 matrix_(index,element->index()) = element->value();
2322 template<
typename MT
2324 ,
typename... CRAs >
2325 template<
typename MT2 >
2326 inline void Rows<MT,true,true,SF,CRAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
2336 for(
size_t j=0UL; j<
columns(); ++j ) {
2337 for( ConstIterator_t<MT2> element=(~rhs).begin(j); element!=(~rhs).
end(j); ++element )
2338 matrix_(idx(element->index()),j) = element->value();
2357 template<
typename MT
2359 ,
typename... CRAs >
2360 template<
typename MT2 >
2361 inline auto Rows<MT,true,true,SF,CRAs...>::addAssign(
const DenseMatrix<MT2,false>& rhs )
2362 -> DisableIf_t< VectorizedAddAssign_v<MT2> >
2370 const size_t jpos(
columns() &
size_t(-2) );
2373 for(
size_t i=0UL; i<
rows(); ++i )
2375 const size_t index( idx(i) );
2376 if( IsDiagonal_v<MT2> ) {
2377 matrix_(index,i) += (~rhs)(i,i);
2380 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2381 matrix_(index,j ) += (~rhs)(i,j );
2382 matrix_(index,j+1UL) += (~rhs)(i,j+1UL);
2385 matrix_(index,jpos) += (~rhs)(i,jpos);
2406 template<
typename MT
2408 ,
typename... CRAs >
2409 template<
typename MT2 >
2410 inline auto Rows<MT,true,true,SF,CRAs...>::addAssign(
const DenseMatrix<MT2,false>& rhs )
2411 -> EnableIf_t< VectorizedAddAssign_v<MT2> >
2421 for(
size_t i=0UL; i<
rows(); ++i )
2423 const size_t jbegin( ( IsUpper_v<MT2> )
2424 ?( ( IsStrictlyUpper_v<MT2> ? i+1UL : i ) &
size_t(-SIMDSIZE) )
2426 const size_t jend ( ( IsLower_v<MT2> )
2427 ?( IsStrictlyLower_v<MT2> ? i : i+1UL )
2431 const size_t jpos( jend &
size_t(-SIMDSIZE) );
2436 ConstIterator_t<MT2> right( (~rhs).
begin(i) + jbegin );
2438 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2439 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2440 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2441 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2442 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2444 for( ; j<jpos; j+=SIMDSIZE ) {
2445 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2447 for( ; j<jend; ++j ) {
2448 *left += *right; ++left; ++right;
2468 template<
typename MT
2470 ,
typename... CRAs >
2471 template<
typename MT2 >
2472 inline void Rows<MT,true,true,SF,CRAs...>::addAssign(
const DenseMatrix<MT2,true>& rhs )
2482 constexpr
size_t block( BLOCK_SIZE );
2486 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
2487 for(
size_t i=0UL; i<
rows(); ++i ) {
2488 const size_t index( idx(i) );
2489 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2490 matrix_(index,j ) += (~rhs)(i,j );
2491 matrix_(index,j+1UL) += (~rhs)(i,j+1UL);
2493 if( jpos < (~rhs).columns() ) {
2494 matrix_(index,jpos) += (~rhs)(i,jpos);
2500 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2501 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2502 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2503 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2504 for(
size_t i=ii; i<iend; ++i ) {
2505 const size_t index( idx(i) );
2506 for(
size_t j=jj; j<jend; ++j ) {
2507 matrix_(index,j) += (~rhs)(i,j);
2530 template<
typename MT
2532 ,
typename... CRAs >
2533 template<
typename MT2 >
2534 inline void Rows<MT,true,true,SF,CRAs...>::addAssign(
const SparseMatrix<MT2,false>& rhs )
2542 for(
size_t i=0UL; i<
rows(); ++i ) {
2543 const size_t index( idx(i) );
2544 for( ConstIterator_t<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2545 matrix_(index,element->index()) += element->value();
2564 template<
typename MT
2566 ,
typename... CRAs >
2567 template<
typename MT2 >
2568 inline void Rows<MT,true,true,SF,CRAs...>::addAssign(
const SparseMatrix<MT2,true>& rhs )
2578 for(
size_t j=0UL; j<
columns(); ++j ) {
2579 for( ConstIterator_t<MT2> element=(~rhs).begin(j); element!=(~rhs).
end(j); ++element )
2580 matrix_(idx(element->index()),j) += element->value();
2599 template<
typename MT
2601 ,
typename... CRAs >
2602 template<
typename MT2 >
2603 inline auto Rows<MT,true,true,SF,CRAs...>::subAssign(
const DenseMatrix<MT2,false>& rhs )
2604 -> DisableIf_t< VectorizedSubAssign_v<MT2> >
2612 const size_t jpos(
columns() &
size_t(-2) );
2615 for(
size_t i=0UL; i<
rows(); ++i )
2617 const size_t index( idx(i) );
2619 if( IsDiagonal_v<MT2> ) {
2620 matrix_(index,i) -= (~rhs)(i,i);
2623 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2624 matrix_(index,j ) -= (~rhs)(i,j );
2625 matrix_(index,j+1UL) -= (~rhs)(i,j+1UL);
2628 matrix_(index,jpos) -= (~rhs)(i,jpos);
2649 template<
typename MT
2651 ,
typename... CRAs >
2652 template<
typename MT2 >
2653 inline auto Rows<MT,true,true,SF,CRAs...>::subAssign(
const DenseMatrix<MT2,false>& rhs )
2654 -> EnableIf_t< VectorizedSubAssign_v<MT2> >
2664 for(
size_t i=0UL; i<
rows(); ++i )
2666 const size_t jbegin( ( IsUpper_v<MT2> )
2667 ?( ( IsStrictlyUpper_v<MT2> ? i+1UL : i ) &
size_t(-SIMDSIZE) )
2669 const size_t jend ( ( IsLower_v<MT2> )
2670 ?( IsStrictlyLower_v<MT2> ? i : i+1UL )
2674 const size_t jpos( jend &
size_t(-SIMDSIZE) );
2679 ConstIterator_t<MT2> right( (~rhs).
begin(i) + jbegin );
2681 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2682 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2683 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2684 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2685 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2687 for( ; j<jpos; j+=SIMDSIZE ) {
2688 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2690 for( ; j<jend; ++j ) {
2691 *left -= *right; ++left; ++right;
2711 template<
typename MT
2713 ,
typename... CRAs >
2714 template<
typename MT2 >
2715 inline void Rows<MT,true,true,SF,CRAs...>::subAssign(
const DenseMatrix<MT2,true>& rhs )
2725 constexpr
size_t block( BLOCK_SIZE );
2729 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
2730 for(
size_t i=0UL; i<
rows(); ++i ) {
2731 const size_t index( idx(i) );
2732 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2733 matrix_(index,j ) -= (~rhs)(i,j );
2734 matrix_(index,j+1UL) -= (~rhs)(i,j+1UL);
2736 if( jpos < (~rhs).columns() ) {
2737 matrix_(index,jpos) -= (~rhs)(i,jpos);
2743 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2744 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2745 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2746 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2747 for(
size_t i=ii; i<iend; ++i ) {
2748 const size_t index( idx(i) );
2749 for(
size_t j=jj; j<jend; ++j ) {
2750 matrix_(index,j) -= (~rhs)(i,j);
2773 template<
typename MT
2775 ,
typename... CRAs >
2776 template<
typename MT2 >
2777 inline void Rows<MT,true,true,SF,CRAs...>::subAssign(
const SparseMatrix<MT2,false>& rhs )
2785 for(
size_t i=0UL; i<
rows(); ++i ) {
2786 const size_t index( idx(i) );
2787 for( ConstIterator_t<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2788 matrix_(index,element->index()) -= element->value();
2807 template<
typename MT
2809 ,
typename... CRAs >
2810 template<
typename MT2 >
2811 inline void Rows<MT,true,true,SF,CRAs...>::subAssign(
const SparseMatrix<MT2,true>& rhs )
2821 for(
size_t j=0UL; j<
columns(); ++j ) {
2822 for( ConstIterator_t<MT2> element=(~rhs).begin(j); element!=(~rhs).
end(j); ++element )
2823 matrix_(idx(element->index()),j) -= element->value();
2842 template<
typename MT
2844 ,
typename... CRAs >
2845 template<
typename MT2 >
2846 inline auto Rows<MT,true,true,SF,CRAs...>::schurAssign(
const DenseMatrix<MT2,false>& rhs )
2847 -> DisableIf_t< VectorizedSchurAssign_v<MT2> >
2855 const size_t jpos(
columns() &
size_t(-2) );
2858 for(
size_t i=0UL; i<
rows(); ++i ) {
2859 const size_t index( idx(i) );
2860 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2861 matrix_(index,j ) *= (~rhs)(i,j );
2862 matrix_(index,j+1UL) *= (~rhs)(i,j+1UL);
2865 matrix_(index,jpos) *= (~rhs)(i,jpos);
2885 template<
typename MT
2887 ,
typename... CRAs >
2888 template<
typename MT2 >
2889 inline auto Rows<MT,true,true,SF,CRAs...>::schurAssign(
const DenseMatrix<MT2,false>& rhs )
2890 -> EnableIf_t< VectorizedSchurAssign_v<MT2> >
2900 for(
size_t i=0UL; i<
rows(); ++i )
2902 const size_t jpos(
columns() &
size_t(-SIMDSIZE) );
2907 ConstIterator_t<MT2> right( (~rhs).
begin(i) );
2909 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2910 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2911 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2912 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2913 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2915 for( ; j<jpos; j+=SIMDSIZE ) {
2916 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2919 *left *= *right; ++left; ++right;
2939 template<
typename MT
2941 ,
typename... CRAs >
2942 template<
typename MT2 >
2943 inline void Rows<MT,true,true,SF,CRAs...>::schurAssign(
const DenseMatrix<MT2,true>& rhs )
2953 constexpr
size_t block( BLOCK_SIZE );
2957 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
2958 for(
size_t i=0UL; i<
rows(); ++i ) {
2959 const size_t index( idx(i) );
2960 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2961 matrix_(index,j ) *= (~rhs)(i,j );
2962 matrix_(index,j+1UL) *= (~rhs)(i,j+1UL);
2964 if( jpos < (~rhs).columns() ) {
2965 matrix_(index,jpos) *= (~rhs)(i,jpos);
2971 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2972 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2973 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2974 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2975 for(
size_t i=ii; i<iend; ++i ) {
2976 const size_t index( idx(i) );
2977 for(
size_t j=jj; j<jend; ++j ) {
2978 matrix_(index,j) *= (~rhs)(i,j);
3001 template<
typename MT
3003 ,
typename... CRAs >
3004 template<
typename MT2 >
3005 inline void Rows<MT,true,true,SF,CRAs...>::schurAssign(
const SparseMatrix<MT2,false>& rhs )
3015 for(
size_t i=0UL; i<
rows(); ++i )
3017 const size_t index( idx(i) );
3020 for( ConstIterator_t<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element ) {
3021 for( ; j<element->index(); ++j )
3022 reset( matrix_(index,j) );
3023 matrix_(index,j) *= element->value();
3028 reset( matrix_(index,j) );
3048 template<
typename MT
3050 ,
typename... CRAs >
3051 template<
typename MT2 >
3052 inline void Rows<MT,true,true,SF,CRAs...>::schurAssign(
const SparseMatrix<MT2,true>& rhs )
3064 for(
size_t j=0UL; j<
columns(); ++j )
3068 for( ConstIterator_t<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element ) {
3069 for( ; i<element->index(); ++i )
3070 reset( matrix_(idx(i),j) );
3071 matrix_(idx(i),j) *= element->value();
3075 for( ; i<
rows(); ++i ) {
3076 reset( matrix_(idx(i),j) );
3104 template<
typename MT
3105 ,
typename... CRAs >
3106 class Rows<MT,false,true,false,CRAs...>
3107 :
public View< DenseMatrix< Rows<MT,false,true,false,CRAs...>, false > >
3108 ,
private RowsData<CRAs...>
3112 using DataType = RowsData<CRAs...>;
3113 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
3122 template<
typename MT1,
typename MT2 >
3123 static constexpr
bool EnforceEvaluation_v =
3124 ( IsRestricted_v<MT1> && RequiresEvaluation_v<MT2> );
3130 using This = Rows<MT,
false,
true,
false,CRAs...>;
3132 using BaseType = DenseMatrix<This,false>;
3133 using ViewedType = MT;
3148 using ConstPointer = ConstPointer_t<MT>;
3151 using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
3157 template<
typename MatrixType
3158 ,
typename IteratorType >
3164 using IteratorCategory =
typename std::iterator_traits<IteratorType>::iterator_category;
3167 using ValueType =
typename std::iterator_traits<IteratorType>::value_type;
3170 using PointerType =
typename std::iterator_traits<IteratorType>::pointer;
3173 using ReferenceType =
typename std::iterator_traits<IteratorType>::reference;
3176 using DifferenceType =
typename std::iterator_traits<IteratorType>::difference_type;
3179 using iterator_category = IteratorCategory;
3180 using value_type = ValueType;
3181 using pointer = PointerType;
3182 using reference = ReferenceType;
3183 using difference_type = DifferenceType;
3189 inline RowsIterator() noexcept
3190 : matrix_(
nullptr )
3204 inline RowsIterator( MatrixType& matrix,
size_t row,
size_t column ) noexcept
3205 : matrix_( &matrix )
3210 if( column_ != matrix_->columns() )
3211 pos_ = matrix_->begin( column_ ) + row_;
3220 template<
typename MatrixType2,
typename IteratorType2 >
3221 inline RowsIterator(
const RowsIterator<MatrixType2,IteratorType2>& it ) noexcept
3222 : matrix_( it.matrix_ )
3224 , column_( it.column_ )
3235 inline RowsIterator&
operator+=(
size_t inc ) noexcept {
3238 if( column_ != matrix_->columns() )
3239 pos_ = matrix_->begin( column_ ) + row_;
3251 inline RowsIterator&
operator-=(
size_t dec ) noexcept {
3254 if( column_ != matrix_->columns() )
3255 pos_ = matrix_->begin( column_ ) + row_;
3266 inline RowsIterator& operator++() noexcept {
3269 if( column_ != matrix_->columns() )
3270 pos_ = matrix_->begin( column_ ) + row_;
3281 inline const RowsIterator operator++(
int ) noexcept {
3282 const RowsIterator tmp( *
this );
3293 inline RowsIterator& operator--() noexcept {
3296 if( column_ != matrix_->columns() )
3297 pos_ = matrix_->begin( column_ ) + row_;
3308 inline const RowsIterator operator--(
int ) noexcept {
3309 const RowsIterator tmp( *
this );
3321 inline ReferenceType operator[](
size_t index )
const {
3323 const IteratorType pos( matrix_->begin( column_+index ) + row_ );
3333 inline ReferenceType
operator*()
const {
3343 inline PointerType operator->()
const {
3354 template<
typename MatrixType2,
typename IteratorType2 >
3355 inline bool operator==(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3356 return column_ == rhs.column_;
3366 template<
typename MatrixType2,
typename IteratorType2 >
3367 inline bool operator!=(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3368 return !( *
this == rhs );
3378 template<
typename MatrixType2,
typename IteratorType2 >
3379 inline bool operator<( const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3380 return column_ < rhs.column_;
3390 template<
typename MatrixType2,
typename IteratorType2 >
3391 inline bool operator>(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3392 return column_ > rhs.column_;
3402 template<
typename MatrixType2,
typename IteratorType2 >
3403 inline bool operator<=( const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3404 return column_ <= rhs.column_;
3414 template<
typename MatrixType2,
typename IteratorType2 >
3415 inline bool operator>=(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3416 return column_ >= rhs.column_;
3426 inline DifferenceType
operator-(
const RowsIterator& rhs )
const noexcept {
3427 return column_ - rhs.column_;
3438 friend inline const RowsIterator
operator+(
const RowsIterator& it,
size_t inc ) noexcept {
3439 return RowsIterator( *it.matrix_, it.row_, it.column_+inc );
3450 friend inline const RowsIterator
operator+(
size_t inc,
const RowsIterator& it ) noexcept {
3451 return RowsIterator( *it.matrix_, it.row_, it.column_+inc );
3462 friend inline const RowsIterator
operator-(
const RowsIterator& it,
size_t dec ) noexcept {
3463 return RowsIterator( *it.matrix_, it.row_, it.column_-dec );
3469 MatrixType* matrix_;
3476 template<
typename MatrixType2,
typename IteratorType2 >
friend class RowsIterator;
3483 using ConstIterator = RowsIterator< const MT, ConstIterator_t<MT> >;
3491 static constexpr
bool simdEnabled =
false;
3500 template<
typename... RRAs >
3501 explicit inline Rows( MT& matrix, RRAs... args );
3503 Rows(
const Rows& ) =
default;
3504 Rows( Rows&& ) =
default;
3518 inline Reference operator()(
size_t i,
size_t j );
3520 inline Reference at(
size_t i,
size_t j );
3522 inline Pointer
data () noexcept;
3523 inline ConstPointer
data () const noexcept;
3524 inline Pointer
data (
size_t i ) noexcept;
3525 inline ConstPointer
data (
size_t i ) const noexcept;
3539 inline Rows& operator=( initializer_list< initializer_list<
ElementType> > list );
3540 inline Rows& operator=( const Rows& rhs );
3542 template< typename MT2,
bool SO2 >
3543 inline Rows& operator=( const Matrix<MT2,SO2>& rhs );
3545 template< typename MT2,
bool SO2 >
3546 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
3547 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
3549 template< typename MT2,
bool SO2 >
3550 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
3551 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
3553 template< typename MT2,
bool SO2 >
3554 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
3555 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
3557 template< typename MT2,
bool SO2 >
3558 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
3559 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
3561 template< typename MT2,
bool SO2 >
3562 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
3563 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
3565 template< typename MT2,
bool SO2 >
3566 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
3567 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
3574 using DataType::idx;
3575 using DataType::idces;
3576 using DataType::
rows;
3578 inline MT& operand() noexcept;
3579 inline const MT& operand() const noexcept;
3581 inline
size_t columns() const noexcept;
3582 inline
size_t spacing() const noexcept;
3583 inline
size_t capacity() const noexcept;
3584 inline
size_t capacity(
size_t i ) const noexcept;
3586 inline
size_t nonZeros(
size_t i ) const;
3587 inline
void reset();
3588 inline
void reset(
size_t i );
3598 template< typename Other > inline Rows& scale( const Other& scalar );
3605 template< typename Other >
3606 inline
bool canAlias( const Other* alias ) const noexcept;
3608 template< typename MT2,
bool SO2,
bool SF2, typename... CRAs2 >
3609 inline
bool canAlias( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
3611 template< typename Other >
3612 inline
bool isAliased( const Other* alias ) const noexcept;
3614 template< typename MT2,
bool SO2,
bool SF2, typename... CRAs2 >
3615 inline
bool isAliased( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
3617 inline
bool isAligned () const noexcept;
3618 inline
bool canSMPAssign() const noexcept;
3620 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,false>& rhs );
3621 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,true>& rhs );
3622 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,false>& rhs );
3623 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,true>& rhs );
3625 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,false>& rhs );
3626 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,true>& rhs );
3627 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,false>& rhs );
3628 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,true>& rhs );
3630 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,false>& rhs );
3631 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,true>& rhs );
3632 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,false>& rhs );
3633 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,true>& rhs );
3635 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,false>& rhs );
3636 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,true>& rhs );
3637 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,false>& rhs );
3638 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,true>& rhs );
3651 template< typename MT2,
bool SO2,
bool DF2,
bool SF2, typename... CRAs2 > friend class Rows;
3691 template< typename MT
3692 , typename... CRAs >
3693 template< typename... RRAs >
3694 inline Rows<MT,false,true,false,CRAs...>::Rows( MT& matrix, RRAs... args )
3695 : DataType( args... )
3696 , matrix_ ( matrix )
3699 for(
size_t i=0UL; i<
rows(); ++i ) {
3700 if( matrix_.rows() <= idx(i) ) {
3729 template<
typename MT
3730 ,
typename... CRAs >
3731 inline typename Rows<MT,
false,
true,
false,CRAs...>
::Reference 3732 Rows<MT,false,true,false,CRAs...>::operator()(
size_t i,
size_t j )
3737 return matrix_(idx(i),j);
3754 template<
typename MT
3755 ,
typename... CRAs >
3757 Rows<MT,false,true,false,CRAs...>::operator()(
size_t i,
size_t j )
const 3762 return const_cast<const MT&
>( matrix_ )(idx(i),j);
3780 template<
typename MT
3781 ,
typename... CRAs >
3782 inline typename Rows<MT,
false,
true,
false,CRAs...>
::Reference 3783 Rows<MT,false,true,false,CRAs...>::at(
size_t i,
size_t j )
3791 return (*
this)(i,j);
3809 template<
typename MT
3810 ,
typename... CRAs >
3812 Rows<MT,false,true,false,CRAs...>::at(
size_t i,
size_t j )
const 3820 return (*
this)(i,j);
3836 template<
typename MT
3837 ,
typename... CRAs >
3838 inline typename Rows<MT,
false,
true,
false,CRAs...>::Pointer
3841 return matrix_.data() + idx(0UL);
3857 template<
typename MT
3858 ,
typename... CRAs >
3859 inline typename Rows<MT,
false,
true,
false,CRAs...>::ConstPointer
3862 return matrix_.data() + idx(0UL);
3877 template<
typename MT
3878 ,
typename... CRAs >
3879 inline typename Rows<MT,
false,
true,
false,CRAs...>::Pointer
3882 return matrix_.data() + idx(i);
3897 template<
typename MT
3898 ,
typename... CRAs >
3899 inline typename Rows<MT,
false,
true,
false,CRAs...>::ConstPointer
3902 return matrix_.data() + idx(i);
3917 template<
typename MT
3918 ,
typename... CRAs >
3919 inline typename Rows<MT,
false,
true,
false,CRAs...>
::Iterator 3923 return Iterator( matrix_, idx(i), 0UL );
3938 template<
typename MT
3939 ,
typename... CRAs >
3959 template<
typename MT
3960 ,
typename... CRAs >
3980 template<
typename MT
3981 ,
typename... CRAs >
3982 inline typename Rows<MT,
false,
true,
false,CRAs...>
::Iterator 4001 template<
typename MT
4002 ,
typename... CRAs >
4022 template<
typename MT
4023 ,
typename... CRAs >
4053 template<
typename MT
4054 ,
typename... CRAs >
4055 inline Rows<MT,
false,
true,
false,CRAs...>&
4056 Rows<MT,false,true,false,CRAs...>::operator=(
const ElementType& rhs )
4058 for(
size_t i=0UL; i<
rows(); ++i ) {
4084 template<
typename MT
4085 ,
typename... CRAs >
4086 inline Rows<MT,
false,
true,
false,CRAs...>&
4087 Rows<MT,false,true,false,CRAs...>::operator=( initializer_list< initializer_list<ElementType> > list )
4092 if( list.size() !=
rows() ) {
4096 if( IsRestricted_v<MT> ) {
4098 for(
const auto& rowList : list ) {
4099 const InitializerVector<ElementType> tmp( rowList,
columns() );
4100 if( !tryAssign(
row( matrix_, idx(i),
unchecked ), tmp, 0UL ) ){
4107 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4110 for(
const auto& rowList : list ) {
4111 std::fill( std::copy( rowList.begin(), rowList.end(), left.begin(i) ), left.end(i),
ElementType() );
4136 template<
typename MT
4137 ,
typename... CRAs >
4138 inline Rows<MT,
false,
true,
false,CRAs...>&
4139 Rows<MT,false,true,false,CRAs...>::operator=(
const Rows& rhs )
4147 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && compareIndices( *
this, rhs ) ) )
4150 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
4154 if( IsRestricted_v<MT> ) {
4155 for(
size_t i=0UL; i<
rows(); ++i ) {
4162 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4164 if( rhs.canAlias( &matrix_ ) ) {
4195 template<
typename MT
4196 ,
typename... CRAs >
4197 template<
typename MT2
4199 inline Rows<MT,
false,
true,
false,CRAs...>&
4200 Rows<MT,false,true,false,CRAs...>::operator=(
const Matrix<MT2,SO2>& rhs )
4211 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<MT2>,
const MT2& >;
4212 Right right( ~rhs );
4214 if( IsRestricted_v<MT> ) {
4215 for(
size_t i=0UL; i<
rows(); ++i ) {
4222 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4224 if( IsSparseMatrix_v<MT2> ) {
4228 if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
4229 const ResultType_t<MT2> tmp( right );
4258 template<
typename MT
4259 ,
typename... CRAs >
4260 template<
typename MT2
4263 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
4272 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
4281 if( IsRestricted_v<MT> ) {
4282 for(
size_t i=0UL; i<
rows(); ++i ) {
4289 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4291 if( (~rhs).canAlias( &matrix_ ) ) {
4292 const AddType tmp( *
this + (~rhs) );
4321 template<
typename MT
4322 ,
typename... CRAs >
4323 template<
typename MT2
4326 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
4335 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
4344 const AddType tmp( *
this + (~rhs) );
4346 if( IsRestricted_v<MT> ) {
4347 for(
size_t i=0UL; i<
rows(); ++i ) {
4354 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4380 template<
typename MT
4381 ,
typename... CRAs >
4382 template<
typename MT2
4385 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
4394 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
4403 if( IsRestricted_v<MT> ) {
4404 for(
size_t i=0UL; i<
rows(); ++i ) {
4411 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4413 if( (~rhs).canAlias( &matrix_ ) ) {
4414 const SubType tmp( *
this - (~rhs ) );
4443 template<
typename MT
4444 ,
typename... CRAs >
4445 template<
typename MT2
4448 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
4457 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
4466 const SubType tmp( *
this - (~rhs) );
4468 if( IsRestricted_v<MT> ) {
4469 for(
size_t i=0UL; i<
rows(); ++i ) {
4476 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4502 template<
typename MT
4503 ,
typename... CRAs >
4504 template<
typename MT2
4506 inline auto Rows<MT,false,true,false,CRAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
4507 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
4516 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
4524 if( IsRestricted_v<MT> ) {
4525 for(
size_t i=0UL; i<
rows(); ++i ) {
4532 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4534 if( (~rhs).canAlias( &matrix_ ) ) {
4535 const SchurType tmp( *
this % (~rhs) );
4536 if( IsSparseMatrix_v<SchurType> )
4566 template<
typename MT
4567 ,
typename... CRAs >
4568 template<
typename MT2
4570 inline auto Rows<MT,false,true,false,CRAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
4571 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
4580 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
4588 const SchurType tmp( *
this % (~rhs) );
4590 if( IsRestricted_v<MT> ) {
4591 for(
size_t i=0UL; i<
rows(); ++i ) {
4598 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4600 if( IsSparseMatrix_v<SchurType> ) {
4628 template<
typename MT
4629 ,
typename... CRAs >
4630 inline MT& Rows<MT,false,true,false,CRAs...>::operand() noexcept
4644 template<
typename MT
4645 ,
typename... CRAs >
4646 inline const MT& Rows<MT,false,true,false,CRAs...>::operand() const noexcept
4660 template<
typename MT
4661 ,
typename... CRAs >
4664 return matrix_.columns();
4679 template<
typename MT
4680 ,
typename... CRAs >
4683 return matrix_.columns();
4695 template<
typename MT
4696 ,
typename... CRAs >
4714 template<
typename MT
4715 ,
typename... CRAs >
4734 template<
typename MT
4735 ,
typename... CRAs >
4738 size_t nonzeros( 0UL );
4740 for(
size_t i=0UL; i<
rows(); ++i ) {
4759 template<
typename MT
4760 ,
typename... CRAs >
4765 size_t nonzeros( 0UL );
4767 const size_t index( idx(i) );
4768 for(
size_t j=0UL; j<
columns(); ++j ) {
4785 template<
typename MT
4786 ,
typename... CRAs >
4789 for(
size_t i=0UL; i<
rows(); ++i ) {
4806 template<
typename MT
4807 ,
typename... CRAs >
4812 const size_t index( idx(i) );
4813 for(
size_t j=0UL; j<
columns(); ++j ) {
4814 reset( matrix_( index, j ) );
4842 template<
typename MT
4843 ,
typename... CRAs >
4844 inline Rows<MT,
false,
true,
false,CRAs...>&
4856 if( IsRestricted_v<MT> ) {
4857 for(
size_t i=0UL; i<
rows(); ++i ) {
4858 if( !tryAssign( matrix_,
row( tmp, i ), idx(i), 0UL ) ) {
4864 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4887 template<
typename MT
4888 ,
typename... CRAs >
4889 inline Rows<MT,
false,
true,
false,CRAs...>&
4901 if( IsRestricted_v<MT> ) {
4902 for(
size_t i=0UL; i<
rows(); ++i ) {
4903 if( !tryAssign( matrix_,
row( tmp, i ), idx(i), 0UL ) ) {
4909 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4932 template<
typename MT
4933 ,
typename... CRAs >
4934 template<
typename Other >
4935 inline Rows<MT,
false,
true,
false,CRAs...>&
4936 Rows<MT,false,true,false,CRAs...>::scale(
const Other& scalar )
4942 for(
size_t i=0UL; i<
rows(); ++i )
4944 const size_t index ( idx(i) );
4945 const size_t jbegin( IsUpper<MT>::value ? ( IsStrictlyUpper_v<MT> ? index+1UL : index ) : 0UL );
4946 const size_t jend ( IsLower<MT>::value ? ( IsStrictlyLower_v<MT> ? index : index+1UL ) :
columns() );
4948 for(
size_t j=jbegin; j<jend; ++j ) {
4949 matrix_(index,j) *= scalar;
4978 template<
typename MT
4979 ,
typename... CRAs >
4980 template<
typename Other >
4981 inline bool Rows<MT,false,true,false,CRAs...>::canAlias(
const Other* alias )
const noexcept
4983 return matrix_.isAliased( alias );
5001 template<
typename MT
5002 ,
typename... CRAs >
5003 template<
typename MT2
5006 ,
typename... CRAs2 >
5008 Rows<MT,false,true,false,CRAs...>::canAlias(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
5010 return matrix_.isAliased( &alias->matrix_ );
5027 template<
typename MT
5028 ,
typename... CRAs >
5029 template<
typename Other >
5030 inline bool Rows<MT,false,true,false,CRAs...>::isAliased(
const Other* alias )
const noexcept
5032 return matrix_.isAliased( alias );
5050 template<
typename MT
5051 ,
typename... CRAs >
5052 template<
typename MT2
5055 ,
typename... CRAs2 >
5057 Rows<MT,false,true,false,CRAs...>::isAliased(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
5059 return matrix_.isAliased( &alias->matrix_ );
5075 template<
typename MT
5076 ,
typename... CRAs >
5077 inline bool Rows<MT,false,true,false,CRAs...>::isAligned() const noexcept
5096 template<
typename MT
5097 ,
typename... CRAs >
5098 inline bool Rows<MT,false,true,false,CRAs...>::canSMPAssign() const noexcept
5100 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
5118 template<
typename MT
5119 ,
typename... CRAs >
5120 template<
typename MT2 >
5121 inline void Rows<MT,false,true,false,CRAs...>::assign(
const DenseMatrix<MT2,false>& rhs )
5129 const size_t jpos(
columns() &
size_t(-2) );
5132 for(
size_t i=0UL; i<
rows(); ++i ) {
5133 const size_t index( idx(i) );
5134 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5135 matrix_(index,j ) = (~rhs)(i,j );
5136 matrix_(index,j+1UL) = (~rhs)(i,j+1UL);
5139 matrix_(index,jpos) = (~rhs)(i,jpos);
5159 template<
typename MT
5160 ,
typename... CRAs >
5161 template<
typename MT2 >
5162 inline void Rows<MT,false,true,false,CRAs...>::assign(
const DenseMatrix<MT2,true>& rhs )
5172 constexpr
size_t block( BLOCK_SIZE );
5176 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
5177 for(
size_t i=0UL; i<
rows(); ++i ) {
5178 const size_t index( idx(i) );
5179 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5180 matrix_(index,j ) = (~rhs)(i,j );
5181 matrix_(index,j+1UL) = (~rhs)(i,j+1UL);
5183 if( jpos < (~rhs).columns() )
5184 matrix_(index,jpos) = (~rhs)(i,jpos);
5189 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5190 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5191 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5192 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5193 for(
size_t i=ii; i<iend; ++i ) {
5194 const size_t index( idx(i) );
5195 for(
size_t j=jj; j<jend; ++j ) {
5196 matrix_(index,j) = (~rhs)(i,j);
5219 template<
typename MT
5220 ,
typename... CRAs >
5221 template<
typename MT2 >
5222 inline void Rows<MT,false,true,false,CRAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
5230 for(
size_t i=0UL; i<
rows(); ++i ) {
5231 const size_t index( idx(i) );
5232 for( ConstIterator_t<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5233 matrix_(index,element->index()) = element->value();
5252 template<
typename MT
5253 ,
typename... CRAs >
5254 template<
typename MT2 >
5255 inline void Rows<MT,false,true,false,CRAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
5265 for(
size_t j=0UL; j<
columns(); ++j ) {
5266 for( ConstIterator_t<MT2> element=(~rhs).begin(j); element!=(~rhs).
end(j); ++element )
5267 matrix_(idx(element->index()),j) = element->value();
5286 template<
typename MT
5287 ,
typename... CRAs >
5288 template<
typename MT2 >
5289 inline void Rows<MT,false,true,false,CRAs...>::addAssign(
const DenseMatrix<MT2,false>& rhs )
5297 const size_t jpos(
columns() &
size_t(-2) );
5300 for(
size_t i=0UL; i<
rows(); ++i )
5302 const size_t index( idx(i) );
5303 if( IsDiagonal_v<MT2> ) {
5304 matrix_(index,i) += (~rhs)(i,i);
5307 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5308 matrix_(index,j ) += (~rhs)(i,j );
5309 matrix_(index,j+1UL) += (~rhs)(i,j+1UL);
5312 matrix_(index,jpos) += (~rhs)(i,jpos);
5333 template<
typename MT
5334 ,
typename... CRAs >
5335 template<
typename MT2 >
5336 inline void Rows<MT,false,true,false,CRAs...>::addAssign(
const DenseMatrix<MT2,true>& rhs )
5346 constexpr
size_t block( BLOCK_SIZE );
5350 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
5351 for(
size_t i=0UL; i<
rows(); ++i ) {
5352 const size_t index( idx(i) );
5353 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5354 matrix_(index,j ) += (~rhs)(i,j );
5355 matrix_(index,j+1UL) += (~rhs)(i,j+1UL);
5357 if( jpos < (~rhs).columns() )
5358 matrix_(index,jpos) += (~rhs)(i,jpos);
5363 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5364 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5365 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5366 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5367 for(
size_t i=ii; i<iend; ++i ) {
5368 const size_t index( idx(i) );
5369 for(
size_t j=jj; j<jend; ++j ) {
5370 matrix_(index,j) += (~rhs)(i,j);
5393 template<
typename MT
5394 ,
typename... CRAs >
5395 template<
typename MT2 >
5396 inline void Rows<MT,false,true,false,CRAs...>::addAssign(
const SparseMatrix<MT2,false>& rhs )
5404 for(
size_t i=0UL; i<
rows(); ++i ) {
5405 const size_t index( idx(i) );
5406 for( ConstIterator_t<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5407 matrix_(index,element->index()) += element->value();
5426 template<
typename MT
5427 ,
typename... CRAs >
5428 template<
typename MT2 >
5429 inline void Rows<MT,false,true,false,CRAs...>::addAssign(
const SparseMatrix<MT2,true>& rhs )
5439 for(
size_t j=0UL; j<
columns(); ++j ) {
5440 for( ConstIterator_t<MT2> element=(~rhs).begin(j); element!=(~rhs).
end(j); ++element )
5441 matrix_(idx(element->index()),j) += element->value();
5460 template<
typename MT
5461 ,
typename... CRAs >
5462 template<
typename MT2 >
5463 inline void Rows<MT,false,true,false,CRAs...>::subAssign(
const DenseMatrix<MT2,false>& rhs )
5471 const size_t jpos(
columns() &
size_t(-2) );
5474 for(
size_t i=0UL; i<
rows(); ++i )
5476 const size_t index( idx(i) );
5478 if( IsDiagonal_v<MT2> ) {
5479 matrix_(index,i) -= (~rhs)(i,i);
5482 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5483 matrix_(index,j ) -= (~rhs)(i,j );
5484 matrix_(index,j+1UL) -= (~rhs)(i,j+1UL);
5487 matrix_(index,jpos) -= (~rhs)(i,jpos);
5508 template<
typename MT
5509 ,
typename... CRAs >
5510 template<
typename MT2 >
5511 inline void Rows<MT,false,true,false,CRAs...>::subAssign(
const DenseMatrix<MT2,true>& rhs )
5521 constexpr
size_t block( BLOCK_SIZE );
5525 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
5526 for(
size_t i=0UL; i<
rows(); ++i ) {
5527 const size_t index( idx(i) );
5528 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5529 matrix_(index,j ) -= (~rhs)(i,j );
5530 matrix_(index,j+1UL) -= (~rhs)(i,j+1UL);
5532 if( jpos < (~rhs).columns() )
5533 matrix_(index,jpos) -= (~rhs)(i,jpos);
5538 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5539 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5540 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5541 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5542 for(
size_t i=ii; i<iend; ++i ) {
5543 const size_t index( idx(i) );
5544 for(
size_t j=jj; j<jend; ++j ) {
5545 matrix_(index,j) -= (~rhs)(i,j);
5568 template<
typename MT
5569 ,
typename... CRAs >
5570 template<
typename MT2 >
5571 inline void Rows<MT,false,true,false,CRAs...>::subAssign(
const SparseMatrix<MT2,false>& rhs )
5579 for(
size_t i=0UL; i<
rows(); ++i ) {
5580 const size_t index( idx(i) );
5581 for( ConstIterator_t<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5582 matrix_(index,element->index()) -= element->value();
5601 template<
typename MT
5602 ,
typename... CRAs >
5603 template<
typename MT2 >
5604 inline void Rows<MT,false,true,false,CRAs...>::subAssign(
const SparseMatrix<MT2,true>& rhs )
5614 for(
size_t j=0UL; j<
columns(); ++j ) {
5615 for( ConstIterator_t<MT2> element=(~rhs).begin(j); element!=(~rhs).
end(j); ++element )
5616 matrix_(idx(element->index()),j) -= element->value();
5635 template<
typename MT
5636 ,
typename... CRAs >
5637 template<
typename MT2 >
5638 inline void Rows<MT,false,true,false,CRAs...>::schurAssign(
const DenseMatrix<MT2,false>& rhs )
5646 const size_t jpos(
columns() &
size_t(-2) );
5649 for(
size_t i=0UL; i<
rows(); ++i ) {
5650 const size_t index( idx(i) );
5651 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5652 matrix_(index,j ) *= (~rhs)(i,j );
5653 matrix_(index,j+1UL) *= (~rhs)(i,j+1UL);
5656 matrix_(index,jpos) *= (~rhs)(i,jpos);
5676 template<
typename MT
5677 ,
typename... CRAs >
5678 template<
typename MT2 >
5679 inline void Rows<MT,false,true,false,CRAs...>::schurAssign(
const DenseMatrix<MT2,true>& rhs )
5689 constexpr
size_t block( BLOCK_SIZE );
5693 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
5694 for(
size_t i=0UL; i<
rows(); ++i ) {
5695 const size_t index( idx(i) );
5696 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5697 matrix_(index,j ) *= (~rhs)(i,j );
5698 matrix_(index,j+1UL) *= (~rhs)(i,j+1UL);
5700 if( jpos < (~rhs).columns() )
5701 matrix_(index,jpos) *= (~rhs)(i,jpos);
5706 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5707 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5708 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5709 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5710 for(
size_t i=ii; i<iend; ++i ) {
5711 const size_t index( idx(i) );
5712 for(
size_t j=jj; j<jend; ++j ) {
5713 matrix_(index,j) *= (~rhs)(i,j);
5736 template<
typename MT
5737 ,
typename... CRAs >
5738 template<
typename MT2 >
5739 inline void Rows<MT,false,true,false,CRAs...>::schurAssign(
const SparseMatrix<MT2,false>& rhs )
5749 for(
size_t i=0UL; i<
rows(); ++i )
5751 const size_t index( idx(i) );
5754 for( ConstIterator_t<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element ) {
5755 for( ; j<element->index(); ++j )
5756 reset( matrix_(index,j) );
5757 matrix_(index,j) *= element->value();
5762 reset( matrix_(index,j) );
5782 template<
typename MT
5783 ,
typename... CRAs >
5784 template<
typename MT2 >
5785 inline void Rows<MT,false,true,false,CRAs...>::schurAssign(
const SparseMatrix<MT2,true>& rhs )
5797 for(
size_t j=0UL; j<
columns(); ++j )
5801 for( ConstIterator_t<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element ) {
5802 for( ; i<element->index(); ++i )
5803 reset( matrix_(idx(i),j) );
5804 matrix_(idx(i),j) *= element->value();
5808 for( ; i<
rows(); ++i ) {
5809 reset( matrix_(idx(i),j) );
5837 template<
typename MT
5838 ,
typename... CRAs >
5839 class Rows<MT,false,true,true,CRAs...>
5840 :
public View< DenseMatrix< Rows<MT,false,true,true,CRAs...>, false > >
5841 ,
private RowsData<CRAs...>
5845 using DataType = RowsData<CRAs...>;
5846 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
5856 using This = Rows<MT,
false,
true,
true,CRAs...>;
5858 using BaseType = DenseMatrix<This,false>;
5859 using ViewedType = MT;
5864 using SIMDType = SIMDTrait_t<ElementType>;
5875 using ConstPointer = ConstPointer_t<MT>;
5878 using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
5889 static constexpr
bool simdEnabled = MT::simdEnabled;
5898 template<
typename... RRAs >
5899 explicit inline Rows( MT& matrix, RRAs... args );
5901 Rows(
const Rows& ) =
default;
5902 Rows( Rows&& ) =
default;
5916 inline Reference operator()(
size_t i,
size_t j );
5918 inline Reference at(
size_t i,
size_t j );
5920 inline Pointer
data () noexcept;
5921 inline ConstPointer
data () const noexcept;
5922 inline Pointer
data (
size_t i ) noexcept;
5923 inline ConstPointer
data (
size_t i ) const noexcept;
5938 Rows& operator=( const Rows& ) = delete;
5945 using DataType::idx;
5946 using DataType::idces;
5947 using DataType::
rows;
5949 inline MT& operand() noexcept;
5950 inline const MT& operand() const noexcept;
5952 inline
size_t columns() const noexcept;
5953 inline
size_t spacing() const noexcept;
5954 inline
size_t capacity() const noexcept;
5955 inline
size_t capacity(
size_t i ) const noexcept;
5957 inline
size_t nonZeros(
size_t i ) const;
5958 inline
void reset();
5959 inline
void reset(
size_t i );
5966 template< typename Other >
5967 inline
bool canAlias( const Other* alias ) const noexcept;
5969 template< typename MT2,
bool SO2,
bool SF2, typename... CRAs2 >
5970 inline
bool canAlias( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
5972 template< typename Other >
5973 inline
bool isAliased( const Other* alias ) const noexcept;
5975 template< typename MT2,
bool SO2,
bool SF2, typename... CRAs2 >
5976 inline
bool isAliased( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
5978 inline
bool isAligned () const noexcept;
5979 inline
bool canSMPAssign() const noexcept;
5996 template< typename MT2,
bool SO2,
bool DF2,
bool SF2, typename... CRAs2 > friend class Rows;
6036 template< typename MT
6037 , typename... CRAs >
6038 template< typename... RRAs >
6039 inline Rows<MT,false,true,true,CRAs...>::Rows( MT& matrix, RRAs... args )
6040 : DataType( args... )
6041 , matrix_ ( matrix )
6044 for(
size_t i=0UL; i<
rows(); ++i ) {
6045 if( matrix_.rows() <= idx(i) ) {
6074 template<
typename MT
6075 ,
typename... CRAs >
6076 inline typename Rows<MT,
false,
true,
true,CRAs...>
::Reference 6077 Rows<MT,false,true,true,CRAs...>::operator()(
size_t i,
size_t j )
6082 return matrix_(j,idx(i));
6099 template<
typename MT
6100 ,
typename... CRAs >
6102 Rows<MT,false,true,true,CRAs...>::operator()(
size_t i,
size_t j )
const 6107 return const_cast<const MT&
>( matrix_ )(j,idx(i));
6125 template<
typename MT
6126 ,
typename... CRAs >
6127 inline typename Rows<MT,
false,
true,
true,CRAs...>
::Reference 6128 Rows<MT,false,true,true,CRAs...>::at(
size_t i,
size_t j )
6136 return (*
this)(i,j);
6154 template<
typename MT
6155 ,
typename... CRAs >
6157 Rows<MT,false,true,true,CRAs...>::at(
size_t i,
size_t j )
const 6165 return (*
this)(i,j);
6181 template<
typename MT
6182 ,
typename... CRAs >
6183 inline typename Rows<MT,
false,
true,
true,CRAs...>::Pointer
6186 return matrix_.data( idx(0UL) );
6202 template<
typename MT
6203 ,
typename... CRAs >
6204 inline typename Rows<MT,
false,
true,
true,CRAs...>::ConstPointer
6207 return matrix_.data( idx(0UL) );
6222 template<
typename MT
6223 ,
typename... CRAs >
6224 inline typename Rows<MT,
false,
true,
true,CRAs...>::Pointer
6227 return matrix_.data( idx(i) );
6242 template<
typename MT
6243 ,
typename... CRAs >
6244 inline typename Rows<MT,
false,
true,
true,CRAs...>::ConstPointer
6247 return matrix_.data( idx(i) );
6262 template<
typename MT
6263 ,
typename... CRAs >
6264 inline typename Rows<MT,
false,
true,
true,CRAs...>
::Iterator 6268 return matrix_.begin( idx(i) );
6283 template<
typename MT
6284 ,
typename... CRAs >
6289 return matrix_.cbegin( idx(i) );
6304 template<
typename MT
6305 ,
typename... CRAs >
6310 return matrix_.cbegin( idx(i) );
6325 template<
typename MT
6326 ,
typename... CRAs >
6327 inline typename Rows<MT,
false,
true,
true,CRAs...>
::Iterator 6331 return matrix_.end( idx(i) );
6346 template<
typename MT
6347 ,
typename... CRAs >
6352 return matrix_.cend( idx(i) );
6367 template<
typename MT
6368 ,
typename... CRAs >
6373 return matrix_.cend( idx(i) );
6398 template<
typename MT
6399 ,
typename... CRAs >
6400 inline Rows<MT,
false,
true,
true,CRAs...>&
6401 Rows<MT,false,true,true,CRAs...>::operator=(
const ElementType& rhs )
6403 for(
size_t i=0UL; i<
rows(); ++i ) {
6427 template<
typename MT
6428 ,
typename... CRAs >
6429 inline MT& Rows<MT,false,true,true,CRAs...>::operand() noexcept
6443 template<
typename MT
6444 ,
typename... CRAs >
6445 inline const MT& Rows<MT,false,true,true,CRAs...>::operand() const noexcept
6459 template<
typename MT
6460 ,
typename... CRAs >
6463 return matrix_.columns();
6478 template<
typename MT
6479 ,
typename... CRAs >
6482 return matrix_.spacing();
6494 template<
typename MT
6495 ,
typename... CRAs >
6513 template<
typename MT
6514 ,
typename... CRAs >
6533 template<
typename MT
6534 ,
typename... CRAs >
6537 size_t nonzeros( 0UL );
6539 for(
size_t i=0UL; i<
rows(); ++i ) {
6540 nonzeros += matrix_.nonZeros( idx(i) );
6558 template<
typename MT
6559 ,
typename... CRAs >
6564 return matrix_.nonZeros( idx(i) );
6576 template<
typename MT
6577 ,
typename... CRAs >
6580 for(
size_t i=0UL; i<
rows(); ++i ) {
6581 matrix_.reset( idx(i) );
6597 template<
typename MT
6598 ,
typename... CRAs >
6601 matrix_.reset( idx(i) );
6626 template<
typename MT
6627 ,
typename... CRAs >
6628 template<
typename Other >
6629 inline bool Rows<MT,false,true,true,CRAs...>::canAlias(
const Other* alias )
const noexcept
6631 return matrix_.isAliased( alias );
6649 template<
typename MT
6650 ,
typename... CRAs >
6651 template<
typename MT2
6654 ,
typename... CRAs2 >
6656 Rows<MT,false,true,true,CRAs...>::canAlias(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
6658 return matrix_.isAliased( &alias->matrix_ );
6675 template<
typename MT
6676 ,
typename... CRAs >
6677 template<
typename Other >
6678 inline bool Rows<MT,false,true,true,CRAs...>::isAliased(
const Other* alias )
const noexcept
6680 return matrix_.isAliased( alias );
6698 template<
typename MT
6699 ,
typename... CRAs >
6700 template<
typename MT2
6703 ,
typename... CRAs2 >
6705 Rows<MT,false,true,true,CRAs...>::isAliased(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
6707 return matrix_.isAliased( &alias->matrix_ );
6723 template<
typename MT
6724 ,
typename... CRAs >
6725 inline bool Rows<MT,false,true,true,CRAs...>::isAligned() const noexcept
6727 return matrix_.isAligned();
6744 template<
typename MT
6745 ,
typename... CRAs >
6746 inline bool Rows<MT,false,true,true,CRAs...>::canSMPAssign() const noexcept
6748 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
6769 template<
typename MT
6770 ,
typename... CRAs >
6772 Rows<MT,false,true,true,CRAs...>::load(
size_t i,
size_t j )
const noexcept
6774 return matrix_.load( j, idx(i) );
6795 template<
typename MT
6796 ,
typename... CRAs >
6800 return matrix_.loada( j, idx(i) );
6821 template<
typename MT
6822 ,
typename... CRAs >
6826 return matrix_.loadu( j, idx(i) );
Constraint on the data type.
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Constraint on the data type.
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
Header file for the blaze::checked and blaze::unchecked instances.
Header file for kernel specific block sizes.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3078
Header file for the Schur product trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ROWS_TYPE(T)
Constraint on the data type.In case the given data type T is a row selection type (i...
Definition: Rows.h:81
#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 UNUSED_PARAMETER function template.
Header file for the subtraction trait.
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
Header file for basic type definitions.
constexpr const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:750
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:169
Header file for the View base class.
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.The HasSIMDSub_v variable template provides...
Definition: HasSIMDSub.h:188
Header file for the IsSparseMatrix type trait.
Header file for the IsDiagonal type trait.
#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:81
#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:61
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3077
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3079
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SUBMATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a submatrix type (i.e. a dense or sparse submatrix), a compilation error is created.
Definition: Submatrix.h:81
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:851
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower or upper unitriangular matrix ty...
Definition: UniTriangular.h:81
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
#define BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a symmetric matrix type...
Definition: Symmetric.h:60
Header file for the reset shim.
Header file for the decltype(auto) workaround.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
Constraints on the storage order of matrix types.
#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:81
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:75
Header file for the RequiresEvaluation type trait.
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:482
MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:416
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
Constraint on the data type.
Constraint on the data type.
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:252
Constraint on the data type.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the DisableIf class template.
Header file for the IsStrictlyUpper type trait.
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.The IsSIMDCombinable_v variable templ...
Definition: IsSIMDCombinable.h:137
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3083
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1364
Header file for the If class template.
Header file for the implementation of a vector representation of an initializer list.
#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: ColumnMajorMatrix.h:61
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.The HasSIMDMult_v variable template provid...
Definition: HasSIMDMult.h:189
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3080
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the HasSIMDAdd type trait.
Header file for the DenseMatrix base class.
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:370
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:446
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:253
Header file for all SIMD functionality.
constexpr bool Contains_v
Auxiliary variable template for the Contains type trait.The Contains_v variable template provides a c...
Definition: Contains.h:139
Header file for the IsLower type trait.
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:78
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a vectorizable data type...
Definition: Vectorizable.h:61
Header file for the exception macros of the math module.
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:438
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8908
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Constraint on the data type.
Header file for the IsSIMDCombinable type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
#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: RowMajorMatrix.h:61
Header file for the HasSIMDMult type trait.
Header file for the IsConst type trait.
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Header file for the addition trait.
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
Header file for the Unique class template.
Check< false > Unchecked
Type of the blaze::unchecked instance.blaze::Unchecked is the type of the blaze::unchecked instance...
Definition: Check.h:96
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
Header file for the cache size of the target architecture.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
Constraint on the data type.
Constraint on the data type.
Header file for the HasSIMDSub type trait.
Constraints on the storage order of matrix types.
Header file for the HasMutableDataAccess type trait.
#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:81
Header file for the IsReference type trait.
auto smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
constexpr bool IsDiagonal_v
Auxiliary variable template for the IsDiagonal type trait.The IsDiagonal_v variable template provides...
Definition: IsDiagonal.h:148
constexpr const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:718
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
Header file for the rows trait.
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:74
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
Constraint on the data type.
Header file for the implementation of the RowsData class template.
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3082
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.The HasSIMDAdd_v variable template provides...
Definition: HasSIMDAdd.h:188
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
#define BLAZE_THROW_LOGIC_ERROR(MESSAGE)
Macro for the emission of a std::logic_error exception.This macro encapsulates the default way of Bla...
Definition: Exception.h:187
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
Header file for the IsUpper type trait.
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
Header file for the implementation of the Rows base template.
Header file for the IsRestricted type trait.
System settings for the inline keywords.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the IsExpression type trait class.
Constraint on the data type.
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:825