35#ifndef _BLAZE_MATH_VIEWS_ROWS_DENSE_H_
36#define _BLAZE_MATH_VIEWS_ROWS_DENSE_H_
121class Rows<MT,true,true,SF,CRAs...>
122 :
public View< DenseMatrix< Rows<MT,true,true,SF,CRAs...>, false > >
123 ,
private RowsData<CRAs...>
127 using DataType = RowsData<CRAs...>;
128 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
137 template<
typename MT1,
typename MT2 >
138 static constexpr bool EnforceEvaluation_v =
139 ( IsRestricted_v<MT1> && RequiresEvaluation_v<MT2> );
145 using This = Rows<MT,
true,
true,SF,CRAs...>;
148 using BaseType = View< DenseMatrix<This,false> >;
150 using ViewedType = MT;
151 using ResultType = RowsTrait_t<MT,N>;
152 using OppositeType = OppositeType_t<ResultType>;
153 using TransposeType = TransposeType_t<ResultType>;
154 using ElementType = ElementType_t<MT>;
155 using SIMDType = SIMDTrait_t<ElementType>;
156 using ReturnType = ReturnType_t<MT>;
157 using CompositeType =
const Rows&;
160 using ConstReference = ConstReference_t<MT>;
163 using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
166 using ConstPointer = ConstPointer_t<MT>;
169 using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
172 using ConstIterator = ConstIterator_t<MT>;
175 using Iterator = If_t< IsConst_v<MT>, ConstIterator, Iterator_t<MT> >;
180 static constexpr bool simdEnabled = MT::simdEnabled;
183 static constexpr bool smpAssignable = MT::smpAssignable;
186 static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
192 template<
typename... RRAs >
193 explicit inline Rows( MT& matrix, RRAs... args );
195 Rows(
const Rows& ) =
default;
196 Rows( Rows&& ) =
default;
210 inline Reference operator()(
size_t i,
size_t j );
211 inline ConstReference operator()(
size_t i,
size_t j )
const;
212 inline Reference at(
size_t i,
size_t j );
213 inline ConstReference at(
size_t i,
size_t j )
const;
214 inline Pointer
data () noexcept;
215 inline ConstPointer
data () const noexcept;
216 inline Pointer
data (
size_t i ) noexcept;
217 inline ConstPointer
data (
size_t i ) const noexcept;
218 inline Iterator
begin (
size_t i );
219 inline ConstIterator
begin (
size_t i ) const;
220 inline ConstIterator
cbegin(
size_t i ) const;
221 inline Iterator
end (
size_t i );
222 inline ConstIterator
end (
size_t i ) const;
223 inline ConstIterator
cend (
size_t i ) const;
230 inline Rows& operator=( const ElementType& rhs );
232 inline Rows& operator=( const Rows& rhs );
234 template< typename MT2,
bool SO2 >
235 inline Rows& operator=( const Matrix<MT2,SO2>& rhs );
237 template< typename MT2,
bool SO2 >
238 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
239 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
241 template< typename MT2,
bool SO2 >
242 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
243 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
245 template< typename MT2,
bool SO2 >
246 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
247 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
249 template< typename MT2,
bool SO2 >
250 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
251 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
253 template< typename MT2,
bool SO2 >
254 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
255 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
257 template< typename MT2,
bool SO2 >
258 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
259 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
267 using DataType::idces;
268 using DataType::
rows;
270 inline MT& operand() noexcept;
271 inline const MT& operand() const noexcept;
273 inline
size_t columns() const noexcept;
274 inline
size_t spacing() const noexcept;
275 inline
size_t capacity() const noexcept;
276 inline
size_t capacity(
size_t i ) const noexcept;
278 inline
size_t nonZeros(
size_t i ) const;
280 inline
void reset(
size_t i );
290 template< typename Other > inline Rows& scale( const Other& scalar );
297 template< typename MT2 >
298 static constexpr
bool VectorizedAssign_v =
299 ( useOptimizedKernels &&
300 simdEnabled && MT2::simdEnabled &&
306 template< typename MT2 >
307 static constexpr
bool VectorizedAddAssign_v =
308 ( VectorizedAssign_v<MT2> &&
315 template< typename MT2 >
316 static constexpr
bool VectorizedSubAssign_v =
317 ( VectorizedAssign_v<MT2> &&
324 template< typename MT2 >
325 static constexpr
bool VectorizedSchurAssign_v =
326 ( VectorizedAssign_v<MT2> &&
332 static constexpr
size_t SIMDSIZE = SIMDTrait<ElementType>::
size;
339 template< typename Other >
340 inline
bool canAlias( const Other* alias ) const noexcept;
342 template< typename MT2,
bool SO2,
bool SF2, typename... CRAs2 >
343 inline
bool canAlias( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
345 template< typename Other >
346 inline
bool isAliased( const Other* alias ) const noexcept;
348 template< typename MT2,
bool SO2,
bool SF2, typename... CRAs2 >
349 inline
bool isAliased( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
351 inline
bool isAligned () const noexcept;
352 inline
bool canSMPAssign() const noexcept;
363 template< typename MT2 >
364 inline auto assign( const DenseMatrix<MT2,false>& rhs ) ->
DisableIf_t< VectorizedAssign_v<MT2> >;
366 template< typename MT2 >
367 inline auto assign( const DenseMatrix<MT2,false>& rhs ) ->
EnableIf_t< VectorizedAssign_v<MT2> >;
369 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,true>& rhs );
371 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,false>& rhs );
372 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,true>& rhs );
374 template< typename MT2 >
375 inline auto addAssign( const DenseMatrix<MT2,false>& rhs ) ->
DisableIf_t< VectorizedAddAssign_v<MT2> >;
377 template< typename MT2 >
378 inline auto addAssign( const DenseMatrix<MT2,false>& rhs ) ->
EnableIf_t< VectorizedAddAssign_v<MT2> >;
380 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,true>& rhs );
381 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,false>& rhs );
382 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,true>& rhs );
384 template< typename MT2 >
385 inline auto subAssign( const DenseMatrix<MT2,false>& rhs ) ->
DisableIf_t< VectorizedSubAssign_v<MT2> >;
387 template< typename MT2 >
388 inline auto subAssign( const DenseMatrix<MT2,false>& rhs ) ->
EnableIf_t< VectorizedSubAssign_v<MT2> >;
390 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,true>& rhs );
391 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,false>& rhs );
392 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,true>& rhs );
394 template< typename MT2 >
395 inline auto schurAssign( const DenseMatrix<MT2,false>& rhs ) ->
DisableIf_t< VectorizedSchurAssign_v<MT2> >;
397 template< typename MT2 >
398 inline auto schurAssign( const DenseMatrix<MT2,false>& rhs ) ->
EnableIf_t< VectorizedSchurAssign_v<MT2> >;
400 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,true>& rhs );
401 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,false>& rhs );
402 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,true>& rhs );
415 template< typename MT2,
bool SO2,
bool DF2,
bool SF2, typename... CRAs2 > friend class Rows;
457template< typename... RRAs >
458inline Rows<MT,true,true,SF,CRAs...>::Rows( MT& matrix, RRAs... args )
459 : DataType( args... )
463 for(
size_t i=0UL; i<
rows(); ++i ) {
464 if( matrix_.rows() <= idx(i) ) {
496inline typename Rows<MT,
true,
true,SF,CRAs...>::Reference
497 Rows<MT,true,true,SF,CRAs...>::operator()(
size_t i,
size_t j )
502 return matrix_(idx(i),j);
522inline typename Rows<MT,
true,
true,SF,CRAs...>::ConstReference
523 Rows<MT,true,true,SF,CRAs...>::operator()(
size_t i,
size_t j )
const
528 return const_cast<const MT&
>( matrix_ )(idx(i),j);
549inline typename Rows<MT,
true,
true,SF,CRAs...>::Reference
550 Rows<MT,true,true,SF,CRAs...>::at(
size_t i,
size_t j )
579inline typename Rows<MT,
true,
true,SF,CRAs...>::ConstReference
580 Rows<MT,true,true,SF,CRAs...>::at(
size_t i,
size_t j )
const
607inline typename Rows<MT,
true,
true,SF,CRAs...>::Pointer
610 return matrix_.data( idx(0UL) );
629inline typename Rows<MT,
true,
true,SF,CRAs...>::ConstPointer
632 return matrix_.data( idx(0UL) );
650inline typename Rows<MT,
true,
true,SF,CRAs...>::Pointer
653 return matrix_.data( idx(i) );
671inline typename Rows<MT,
true,
true,SF,CRAs...>::ConstPointer
674 return matrix_.data( idx(i) );
692inline typename Rows<MT,
true,
true,SF,CRAs...>::Iterator
696 return matrix_.begin( idx(i) );
714inline typename Rows<MT,
true,
true,SF,CRAs...>::ConstIterator
718 return matrix_.cbegin( idx(i) );
736inline typename Rows<MT,
true,
true,SF,CRAs...>::ConstIterator
740 return matrix_.cbegin( idx(i) );
758inline typename Rows<MT,
true,
true,SF,CRAs...>::Iterator
762 return matrix_.end( idx(i) );
780inline typename Rows<MT,
true,
true,SF,CRAs...>::ConstIterator
784 return matrix_.cend( idx(i) );
802inline typename Rows<MT,
true,
true,SF,CRAs...>::ConstIterator
806 return matrix_.cend( idx(i) );
834inline Rows<MT,
true,
true,SF,CRAs...>&
835 Rows<MT,true,true,SF,CRAs...>::operator=(
const ElementType& rhs )
837 for(
size_t i=0UL; i<
rows(); ++i ) {
866inline Rows<MT,
true,
true,SF,CRAs...>&
872 if( list.size() !=
rows() ) {
876 if( IsRestricted_v<MT> ) {
878 for(
const auto& rowList : list ) {
879 const InitializerVector<ElementType> tmp( rowList,
columns() );
880 if( !tryAssign(
row( matrix_, idx(i),
unchecked ), tmp, 0UL ) ){
887 decltype(
auto) left( derestrict( *
this ) );
890 for(
const auto& rowList : list ) {
891 std::fill( std::copy( rowList.begin(), rowList.end(), left.begin(i) ), left.end(i), ElementType() );
919inline Rows<MT,
true,
true,SF,CRAs...>&
920 Rows<MT,true,true,SF,CRAs...>::operator=(
const Rows& rhs )
928 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && compareIndices( *
this, rhs ) ) )
931 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
935 if( IsRestricted_v<MT> ) {
936 for(
size_t i=0UL; i<
rows(); ++i ) {
943 decltype(
auto) left( derestrict( *
this ) );
945 if( rhs.canAlias(
this ) ) {
946 const ResultType tmp( rhs );
979template<
typename MT2
981inline Rows<MT,
true,
true,SF,CRAs...>&
982 Rows<MT,true,true,SF,CRAs...>::operator=(
const Matrix<MT2,SO2>& rhs )
989 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
993 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<MT2>,
const MT2& >;
996 if( IsRestricted_v<MT> ) {
997 for(
size_t i=0UL; i<
rows(); ++i ) {
1004 decltype(
auto) left( derestrict( *
this ) );
1006 if( IsSparseMatrix_v<MT2> ) {
1010 if( IsReference_v<Right> && right.canAlias(
this ) ) {
1011 const ResultType_t<MT2> tmp( right );
1040template<
typename MT
1042 ,
typename... CRAs >
1043template<
typename MT2
1046 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
1055 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
1060 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
1064 if( IsRestricted_v<MT> ) {
1065 for(
size_t i=0UL; i<
rows(); ++i ) {
1072 decltype(
auto) left( derestrict( *
this ) );
1074 if( (*rhs).canAlias(
this ) ) {
1075 const AddType tmp( *
this + (*rhs) );
1104template<
typename MT
1106 ,
typename... CRAs >
1107template<
typename MT2
1110 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
1119 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
1124 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
1128 const AddType tmp( *
this + (*rhs) );
1130 if( IsRestricted_v<MT> ) {
1131 for(
size_t i=0UL; i<
rows(); ++i ) {
1138 decltype(
auto) left( derestrict( *
this ) );
1164template<
typename MT
1166 ,
typename... CRAs >
1167template<
typename MT2
1170 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
1179 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
1184 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
1188 if( IsRestricted_v<MT> ) {
1189 for(
size_t i=0UL; i<
rows(); ++i ) {
1196 decltype(
auto) left( derestrict( *
this ) );
1198 if( (*rhs).canAlias(
this ) ) {
1199 const SubType tmp( *
this - (*rhs ) );
1228template<
typename MT
1230 ,
typename... CRAs >
1231template<
typename MT2
1234 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
1243 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
1248 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
1252 const SubType tmp( *
this - (*rhs) );
1254 if( IsRestricted_v<MT> ) {
1255 for(
size_t i=0UL; i<
rows(); ++i ) {
1262 decltype(
auto) left( derestrict( *
this ) );
1288template<
typename MT
1290 ,
typename... CRAs >
1291template<
typename MT2
1293inline auto Rows<MT,true,true,SF,CRAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
1294 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
1303 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
1307 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
1311 if( IsRestricted_v<MT> ) {
1312 for(
size_t i=0UL; i<
rows(); ++i ) {
1319 decltype(
auto) left( derestrict( *
this ) );
1321 if( (*rhs).canAlias(
this ) ) {
1322 const SchurType tmp( *
this % (*rhs) );
1323 if( IsSparseMatrix_v<SchurType> )
1353template<
typename MT
1355 ,
typename... CRAs >
1356template<
typename MT2
1358inline auto Rows<MT,true,true,SF,CRAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
1359 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
1368 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
1372 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
1376 const SchurType tmp( *
this % (*rhs) );
1378 if( IsRestricted_v<MT> ) {
1379 for(
size_t i=0UL; i<
rows(); ++i ) {
1386 decltype(
auto) left( derestrict( *
this ) );
1388 if( IsSparseMatrix_v<SchurType> ) {
1416template<
typename MT
1418 ,
typename... CRAs >
1419inline MT& Rows<MT,true,true,SF,CRAs...>::operand() noexcept
1433template<
typename MT
1435 ,
typename... CRAs >
1436inline const MT& Rows<MT,true,true,SF,CRAs...>::operand() const noexcept
1450template<
typename MT
1452 ,
typename... CRAs >
1455 return matrix_.columns();
1470template<
typename MT
1472 ,
typename... CRAs >
1475 return matrix_.spacing();
1487template<
typename MT
1489 ,
typename... CRAs >
1507template<
typename MT
1509 ,
typename... CRAs >
1528template<
typename MT
1530 ,
typename... CRAs >
1533 size_t nonzeros( 0UL );
1535 for(
size_t i=0UL; i<
rows(); ++i ) {
1536 nonzeros += matrix_.nonZeros( idx(i) );
1554template<
typename MT
1556 ,
typename... CRAs >
1561 return matrix_.nonZeros( idx(i) );
1573template<
typename MT
1575 ,
typename... CRAs >
1578 for(
size_t i=0UL; i<
rows(); ++i ) {
1579 matrix_.reset( idx(i) );
1595template<
typename MT
1597 ,
typename... CRAs >
1600 matrix_.reset( idx(i) );
1627template<
typename MT
1629 ,
typename... CRAs >
1630inline Rows<MT,
true,
true,SF,CRAs...>&
1640 const ResultType tmp(
trans( *
this ) );
1642 if( IsRestricted_v<MT> ) {
1643 for(
size_t i=0UL; i<
rows(); ++i ) {
1644 if( !tryAssign( matrix_,
row( tmp, i ), idx(i), 0UL ) ) {
1650 decltype(
auto) left( derestrict( *
this ) );
1673template<
typename MT
1675 ,
typename... CRAs >
1676inline Rows<MT,
true,
true,SF,CRAs...>&
1686 const ResultType tmp(
ctrans( *
this ) );
1688 if( IsRestricted_v<MT> ) {
1689 for(
size_t i=0UL; i<
rows(); ++i ) {
1690 if( !tryAssign( matrix_,
row( tmp, i ), idx(i), 0UL ) ) {
1696 decltype(
auto) left( derestrict( *
this ) );
1719template<
typename MT
1721 ,
typename... CRAs >
1722template<
typename Other >
1723inline Rows<MT,
true,
true,SF,CRAs...>&
1724 Rows<MT,true,true,SF,CRAs...>::scale(
const Other& scalar )
1730 for(
size_t i=0UL; i<
rows(); ++i )
1732 const size_t index ( idx(i) );
1733 const size_t jbegin( IsUpper<MT>::value ? ( IsStrictlyUpper_v<MT> ? index+1UL : index ) : 0UL );
1734 const size_t jend ( IsLower<MT>::value ? ( IsStrictlyLower_v<MT> ? index : index+1UL ) :
columns() );
1736 for(
size_t j=jbegin; j<jend; ++j ) {
1737 matrix_(index,j) *= scalar;
1766template<
typename MT
1768 ,
typename... CRAs >
1769template<
typename Other >
1770inline bool Rows<MT,true,true,SF,CRAs...>::canAlias(
const Other* alias )
const noexcept
1772 return matrix_.isAliased( &unview( *alias ) );
1790template<
typename MT
1792 ,
typename... CRAs >
1793template<
typename MT2
1796 ,
typename... CRAs2 >
1798 Rows<MT,true,true,SF,CRAs...>::canAlias(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
1800 return matrix_.isAliased( &alias->matrix_ );
1817template<
typename MT
1819 ,
typename... CRAs >
1820template<
typename Other >
1821inline bool Rows<MT,true,true,SF,CRAs...>::isAliased(
const Other* alias )
const noexcept
1823 return matrix_.isAliased( &unview( *alias ) );
1841template<
typename MT
1843 ,
typename... CRAs >
1844template<
typename MT2
1847 ,
typename... CRAs2 >
1849 Rows<MT,true,true,SF,CRAs...>::isAliased(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
1851 return matrix_.isAliased( &alias->matrix_ );
1867template<
typename MT
1869 ,
typename... CRAs >
1870inline bool Rows<MT,true,true,SF,CRAs...>::isAligned() const noexcept
1872 return matrix_.isAligned();
1889template<
typename MT
1891 ,
typename... CRAs >
1892inline bool Rows<MT,true,true,SF,CRAs...>::canSMPAssign() const noexcept
1894 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
1915template<
typename MT
1917 ,
typename... CRAs >
1919 Rows<MT,true,true,SF,CRAs...>::load(
size_t i,
size_t j )
const noexcept
1921 return matrix_.load( idx(i), j );
1942template<
typename MT
1944 ,
typename... CRAs >
1948 return matrix_.loada( idx(i), j );
1969template<
typename MT
1971 ,
typename... CRAs >
1975 return matrix_.loadu( idx(i), j );
1997template<
typename MT
1999 ,
typename... CRAs >
2001 Rows<MT,true,true,SF,CRAs...>::store(
size_t i,
size_t j,
const SIMDType& value )
noexcept
2003 matrix_.store( idx(i), j, value );
2025template<
typename MT
2027 ,
typename... CRAs >
2031 matrix_.storea( idx(i), j, value );
2053template<
typename MT
2055 ,
typename... CRAs >
2059 matrix_.storeu( idx(i), j, value );
2081template<
typename MT
2083 ,
typename... CRAs >
2087 matrix_.stream( idx(i), j, value );
2105template<
typename MT
2107 ,
typename... CRAs >
2108template<
typename MT2 >
2109inline auto Rows<MT,true,true,SF,CRAs...>::assign(
const DenseMatrix<MT2,false>& rhs )
2110 -> DisableIf_t< VectorizedAssign_v<MT2> >
2121 for(
size_t i=0UL; i<
rows(); ++i ) {
2122 const size_t index( idx(i) );
2123 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2124 matrix_(index,j ) = (*rhs)(i,j );
2125 matrix_(index,j+1UL) = (*rhs)(i,j+1UL);
2128 matrix_(index,jpos) = (*rhs)(i,jpos);
2148template<
typename MT
2150 ,
typename... CRAs >
2151template<
typename MT2 >
2152inline auto Rows<MT,true,true,SF,CRAs...>::assign(
const DenseMatrix<MT2,false>& rhs )
2153 -> EnableIf_t< VectorizedAssign_v<MT2> >
2167 rows()*
columns() > ( cacheSize / (
sizeof(ElementType) * 3UL ) ) &&
2168 !(*rhs).isAliased(
this ) )
2170 for(
size_t i=0UL; i<
rows(); ++i )
2173 Iterator left(
begin(i) );
2174 ConstIterator_t<MT2> right( (*rhs).begin(i) );
2176 for( ; j<jpos; j+=SIMDSIZE ) {
2177 left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2186 for(
size_t i=0UL; i<
rows(); ++i )
2189 Iterator left(
begin(i) );
2190 ConstIterator_t<MT2> right( (*rhs).begin(i) );
2192 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2193 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2194 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2195 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2196 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2198 for( ; j<jpos; j+=SIMDSIZE ) {
2199 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2202 *left = *right; ++left; ++right;
2223template<
typename MT
2225 ,
typename... CRAs >
2226template<
typename MT2 >
2227inline void Rows<MT,true,true,SF,CRAs...>::assign(
const DenseMatrix<MT2,true>& rhs )
2237 constexpr size_t block( BLOCK_SIZE );
2241 const size_t jpos(
prevMultiple( (*rhs).columns(), 2UL ) );
2244 for(
size_t i=0UL; i<
rows(); ++i ) {
2245 const size_t index( idx(i) );
2246 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2247 matrix_(index,j ) = (*rhs)(i,j );
2248 matrix_(index,j+1UL) = (*rhs)(i,j+1UL);
2250 if( jpos < (*rhs).columns() ) {
2251 matrix_(index,jpos) = (*rhs)(i,jpos);
2257 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2258 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2259 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2260 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2261 for(
size_t i=ii; i<iend; ++i ) {
2262 const size_t index( idx(i) );
2263 for(
size_t j=jj; j<jend; ++j ) {
2264 matrix_(index,j) = (*rhs)(i,j);
2287template<
typename MT
2289 ,
typename... CRAs >
2290template<
typename MT2 >
2291inline void Rows<MT,true,true,SF,CRAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
2299 for(
size_t i=0UL; i<
rows(); ++i ) {
2300 const size_t index( idx(i) );
2301 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
2302 matrix_(index,element->index()) = element->value();
2321template<
typename MT
2323 ,
typename... CRAs >
2324template<
typename MT2 >
2325inline void Rows<MT,true,true,SF,CRAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
2335 for(
size_t j=0UL; j<
columns(); ++j ) {
2336 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
2337 matrix_(idx(element->index()),j) = element->value();
2356template<
typename MT
2358 ,
typename... CRAs >
2359template<
typename MT2 >
2360inline auto Rows<MT,true,true,SF,CRAs...>::addAssign(
const DenseMatrix<MT2,false>& rhs )
2361 -> DisableIf_t< VectorizedAddAssign_v<MT2> >
2372 for(
size_t i=0UL; i<
rows(); ++i )
2374 const size_t index( idx(i) );
2375 if( IsDiagonal_v<MT2> ) {
2376 matrix_(index,i) += (*rhs)(i,i);
2379 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2380 matrix_(index,j ) += (*rhs)(i,j );
2381 matrix_(index,j+1UL) += (*rhs)(i,j+1UL);
2384 matrix_(index,jpos) += (*rhs)(i,jpos);
2405template<
typename MT
2407 ,
typename... CRAs >
2408template<
typename MT2 >
2409inline auto Rows<MT,true,true,SF,CRAs...>::addAssign(
const DenseMatrix<MT2,false>& rhs )
2410 -> EnableIf_t< VectorizedAddAssign_v<MT2> >
2420 for(
size_t i=0UL; i<
rows(); ++i )
2422 const size_t jbegin( ( IsUpper_v<MT2> )
2423 ?(
prevMultiple( ( IsStrictlyUpper_v<MT2> ? i+1UL : i ), SIMDSIZE ) )
2425 const size_t jend ( ( IsLower_v<MT2> )
2426 ?( IsStrictlyLower_v<MT2> ? i : i+1UL )
2434 Iterator left(
begin(i) + jbegin );
2435 ConstIterator_t<MT2> right( (*rhs).begin(i) + jbegin );
2437 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2438 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
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;
2443 for( ; j<jpos; j+=SIMDSIZE ) {
2444 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2446 for( ; j<jend; ++j ) {
2447 *left += *right; ++left; ++right;
2467template<
typename MT
2469 ,
typename... CRAs >
2470template<
typename MT2 >
2471inline void Rows<MT,true,true,SF,CRAs...>::addAssign(
const DenseMatrix<MT2,true>& rhs )
2481 constexpr size_t block( BLOCK_SIZE );
2485 const size_t jpos(
prevMultiple( (*rhs).columns(), 2UL ) );
2488 for(
size_t i=0UL; i<
rows(); ++i ) {
2489 const size_t index( idx(i) );
2490 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2491 matrix_(index,j ) += (*rhs)(i,j );
2492 matrix_(index,j+1UL) += (*rhs)(i,j+1UL);
2494 if( jpos < (*rhs).columns() ) {
2495 matrix_(index,jpos) += (*rhs)(i,jpos);
2501 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2502 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2503 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2504 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2505 for(
size_t i=ii; i<iend; ++i ) {
2506 const size_t index( idx(i) );
2507 for(
size_t j=jj; j<jend; ++j ) {
2508 matrix_(index,j) += (*rhs)(i,j);
2531template<
typename MT
2533 ,
typename... CRAs >
2534template<
typename MT2 >
2535inline void Rows<MT,true,true,SF,CRAs...>::addAssign(
const SparseMatrix<MT2,false>& rhs )
2543 for(
size_t i=0UL; i<
rows(); ++i ) {
2544 const size_t index( idx(i) );
2545 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
2546 matrix_(index,element->index()) += element->value();
2565template<
typename MT
2567 ,
typename... CRAs >
2568template<
typename MT2 >
2569inline void Rows<MT,true,true,SF,CRAs...>::addAssign(
const SparseMatrix<MT2,true>& rhs )
2579 for(
size_t j=0UL; j<
columns(); ++j ) {
2580 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
2581 matrix_(idx(element->index()),j) += element->value();
2600template<
typename MT
2602 ,
typename... CRAs >
2603template<
typename MT2 >
2604inline auto Rows<MT,true,true,SF,CRAs...>::subAssign(
const DenseMatrix<MT2,false>& rhs )
2605 -> DisableIf_t< VectorizedSubAssign_v<MT2> >
2616 for(
size_t i=0UL; i<
rows(); ++i )
2618 const size_t index( idx(i) );
2620 if( IsDiagonal_v<MT2> ) {
2621 matrix_(index,i) -= (*rhs)(i,i);
2624 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2625 matrix_(index,j ) -= (*rhs)(i,j );
2626 matrix_(index,j+1UL) -= (*rhs)(i,j+1UL);
2629 matrix_(index,jpos) -= (*rhs)(i,jpos);
2650template<
typename MT
2652 ,
typename... CRAs >
2653template<
typename MT2 >
2654inline auto Rows<MT,true,true,SF,CRAs...>::subAssign(
const DenseMatrix<MT2,false>& rhs )
2655 -> EnableIf_t< VectorizedSubAssign_v<MT2> >
2665 for(
size_t i=0UL; i<
rows(); ++i )
2667 const size_t jbegin( ( IsUpper_v<MT2> )
2668 ?(
prevMultiple( ( IsStrictlyUpper_v<MT2> ? i+1UL : i ), SIMDSIZE ) )
2670 const size_t jend ( ( IsLower_v<MT2> )
2671 ?( IsStrictlyLower_v<MT2> ? i : i+1UL )
2679 Iterator left(
begin(i) + jbegin );
2680 ConstIterator_t<MT2> right( (*rhs).begin(i) + jbegin );
2682 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
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;
2686 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2688 for( ; j<jpos; j+=SIMDSIZE ) {
2689 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2691 for( ; j<jend; ++j ) {
2692 *left -= *right; ++left; ++right;
2712template<
typename MT
2714 ,
typename... CRAs >
2715template<
typename MT2 >
2716inline void Rows<MT,true,true,SF,CRAs...>::subAssign(
const DenseMatrix<MT2,true>& rhs )
2726 constexpr size_t block( BLOCK_SIZE );
2730 const size_t jpos(
prevMultiple( (*rhs).columns(), 2UL ) );
2733 for(
size_t i=0UL; i<
rows(); ++i ) {
2734 const size_t index( idx(i) );
2735 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2736 matrix_(index,j ) -= (*rhs)(i,j );
2737 matrix_(index,j+1UL) -= (*rhs)(i,j+1UL);
2739 if( jpos < (*rhs).columns() ) {
2740 matrix_(index,jpos) -= (*rhs)(i,jpos);
2746 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2747 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2748 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2749 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2750 for(
size_t i=ii; i<iend; ++i ) {
2751 const size_t index( idx(i) );
2752 for(
size_t j=jj; j<jend; ++j ) {
2753 matrix_(index,j) -= (*rhs)(i,j);
2776template<
typename MT
2778 ,
typename... CRAs >
2779template<
typename MT2 >
2780inline void Rows<MT,true,true,SF,CRAs...>::subAssign(
const SparseMatrix<MT2,false>& rhs )
2788 for(
size_t i=0UL; i<
rows(); ++i ) {
2789 const size_t index( idx(i) );
2790 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
2791 matrix_(index,element->index()) -= element->value();
2810template<
typename MT
2812 ,
typename... CRAs >
2813template<
typename MT2 >
2814inline void Rows<MT,true,true,SF,CRAs...>::subAssign(
const SparseMatrix<MT2,true>& rhs )
2824 for(
size_t j=0UL; j<
columns(); ++j ) {
2825 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
2826 matrix_(idx(element->index()),j) -= element->value();
2845template<
typename MT
2847 ,
typename... CRAs >
2848template<
typename MT2 >
2849inline auto Rows<MT,true,true,SF,CRAs...>::schurAssign(
const DenseMatrix<MT2,false>& rhs )
2850 -> DisableIf_t< VectorizedSchurAssign_v<MT2> >
2861 for(
size_t i=0UL; i<
rows(); ++i ) {
2862 const size_t index( idx(i) );
2863 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2864 matrix_(index,j ) *= (*rhs)(i,j );
2865 matrix_(index,j+1UL) *= (*rhs)(i,j+1UL);
2868 matrix_(index,jpos) *= (*rhs)(i,jpos);
2888template<
typename MT
2890 ,
typename... CRAs >
2891template<
typename MT2 >
2892inline auto Rows<MT,true,true,SF,CRAs...>::schurAssign(
const DenseMatrix<MT2,false>& rhs )
2893 -> EnableIf_t< VectorizedSchurAssign_v<MT2> >
2903 for(
size_t i=0UL; i<
rows(); ++i )
2909 Iterator left(
begin(i) );
2910 ConstIterator_t<MT2> right( (*rhs).begin(i) );
2912 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2913 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2914 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2915 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2916 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2918 for( ; j<jpos; j+=SIMDSIZE ) {
2919 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2922 *left *= *right; ++left; ++right;
2942template<
typename MT
2944 ,
typename... CRAs >
2945template<
typename MT2 >
2946inline void Rows<MT,true,true,SF,CRAs...>::schurAssign(
const DenseMatrix<MT2,true>& rhs )
2956 constexpr size_t block( BLOCK_SIZE );
2960 const size_t jpos(
prevMultiple( (*rhs).columns(), 2UL ) );
2963 for(
size_t i=0UL; i<
rows(); ++i ) {
2964 const size_t index( idx(i) );
2965 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2966 matrix_(index,j ) *= (*rhs)(i,j );
2967 matrix_(index,j+1UL) *= (*rhs)(i,j+1UL);
2969 if( jpos < (*rhs).columns() ) {
2970 matrix_(index,jpos) *= (*rhs)(i,jpos);
2976 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2977 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2978 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2979 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2980 for(
size_t i=ii; i<iend; ++i ) {
2981 const size_t index( idx(i) );
2982 for(
size_t j=jj; j<jend; ++j ) {
2983 matrix_(index,j) *= (*rhs)(i,j);
3006template<
typename MT
3008 ,
typename... CRAs >
3009template<
typename MT2 >
3010inline void Rows<MT,true,true,SF,CRAs...>::schurAssign(
const SparseMatrix<MT2,false>& rhs )
3020 for(
size_t i=0UL; i<
rows(); ++i )
3022 const size_t index( idx(i) );
3025 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element ) {
3026 for( ; j<element->index(); ++j )
3027 reset( matrix_(index,j) );
3028 matrix_(index,j) *= element->value();
3033 reset( matrix_(index,j) );
3053template<
typename MT
3055 ,
typename... CRAs >
3056template<
typename MT2 >
3057inline void Rows<MT,true,true,SF,CRAs...>::schurAssign(
const SparseMatrix<MT2,true>& rhs )
3069 for(
size_t j=0UL; j<
columns(); ++j )
3073 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element ) {
3074 for( ; i<element->index(); ++i )
3075 reset( matrix_(idx(i),j) );
3076 matrix_(idx(i),j) *= element->value();
3080 for( ; i<
rows(); ++i ) {
3081 reset( matrix_(idx(i),j) );
3109template<
typename MT
3110 ,
typename... CRAs >
3111class Rows<MT,false,true,false,CRAs...>
3112 :
public View< DenseMatrix< Rows<MT,false,true,false,CRAs...>, false > >
3113 ,
private RowsData<CRAs...>
3117 using DataType = RowsData<CRAs...>;
3118 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
3127 template<
typename MT1,
typename MT2 >
3128 static constexpr bool EnforceEvaluation_v =
3129 ( IsRestricted_v<MT1> && RequiresEvaluation_v<MT2> );
3135 using This = Rows<MT,
false,
true,
false,CRAs...>;
3138 using BaseType = View< DenseMatrix<This,false> >;
3140 using ViewedType = MT;
3141 using ResultType = RowsTrait_t<MT,N>;
3142 using OppositeType = OppositeType_t<ResultType>;
3143 using TransposeType = TransposeType_t<ResultType>;
3144 using ElementType = ElementType_t<MT>;
3145 using ReturnType = ReturnType_t<MT>;
3146 using CompositeType =
const Rows&;
3149 using ConstReference = ConstReference_t<MT>;
3152 using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
3155 using ConstPointer = ConstPointer_t<MT>;
3158 using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
3164 template<
typename MatrixType
3165 ,
typename IteratorType >
3171 using IteratorCategory =
typename std::iterator_traits<IteratorType>::iterator_category;
3174 using ValueType =
typename std::iterator_traits<IteratorType>::value_type;
3177 using PointerType =
typename std::iterator_traits<IteratorType>::pointer;
3180 using ReferenceType =
typename std::iterator_traits<IteratorType>::reference;
3183 using DifferenceType =
typename std::iterator_traits<IteratorType>::difference_type;
3186 using iterator_category = IteratorCategory;
3187 using value_type = ValueType;
3188 using pointer = PointerType;
3189 using reference = ReferenceType;
3190 using difference_type = DifferenceType;
3196 inline RowsIterator() noexcept
3197 : matrix_(
nullptr )
3211 inline RowsIterator( MatrixType& matrix,
size_t row,
size_t column ) noexcept
3212 : matrix_( &matrix )
3217 if( column_ != matrix_->columns() )
3218 pos_ = matrix_->begin( column_ ) + row_;
3227 template<
typename MatrixType2,
typename IteratorType2 >
3228 inline RowsIterator(
const RowsIterator<MatrixType2,IteratorType2>& it ) noexcept
3229 : matrix_( it.matrix_ )
3231 , column_( it.column_ )
3242 inline RowsIterator&
operator+=(
size_t inc )
noexcept {
3245 if( column_ != matrix_->columns() )
3246 pos_ = matrix_->begin( column_ ) + row_;
3258 inline RowsIterator&
operator-=(
size_t dec )
noexcept {
3261 if( column_ != matrix_->columns() )
3262 pos_ = matrix_->begin( column_ ) + row_;
3273 inline RowsIterator& operator++() noexcept {
3276 if( column_ != matrix_->columns() )
3277 pos_ = matrix_->begin( column_ ) + row_;
3288 inline const RowsIterator operator++(
int )
noexcept {
3289 const RowsIterator tmp( *
this );
3300 inline RowsIterator& operator--() noexcept {
3303 if( column_ != matrix_->columns() )
3304 pos_ = matrix_->begin( column_ ) + row_;
3315 inline const RowsIterator operator--(
int )
noexcept {
3316 const RowsIterator tmp( *
this );
3328 inline ReferenceType operator[](
size_t index )
const {
3330 const IteratorType pos( matrix_->begin( column_+index ) + row_ );
3340 inline ReferenceType
operator*()
const {
3350 inline PointerType operator->()
const {
3361 template<
typename MatrixType2,
typename IteratorType2 >
3362 inline bool operator==(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3363 return column_ == rhs.column_;
3373 template<
typename MatrixType2,
typename IteratorType2 >
3374 inline bool operator!=(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3375 return !( *
this == rhs );
3385 template<
typename MatrixType2,
typename IteratorType2 >
3386 inline bool operator<(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3387 return column_ < rhs.column_;
3397 template<
typename MatrixType2,
typename IteratorType2 >
3398 inline bool operator>(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3399 return column_ > rhs.column_;
3409 template<
typename MatrixType2,
typename IteratorType2 >
3410 inline bool operator<=(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3411 return column_ <= rhs.column_;
3421 template<
typename MatrixType2,
typename IteratorType2 >
3422 inline bool operator>=(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3423 return column_ >= rhs.column_;
3433 inline DifferenceType
operator-(
const RowsIterator& rhs )
const noexcept {
3434 return column_ - rhs.column_;
3445 friend inline const RowsIterator
operator+(
const RowsIterator& it,
size_t inc )
noexcept {
3446 return RowsIterator( *it.matrix_, it.row_, it.column_+inc );
3457 friend inline const RowsIterator
operator+(
size_t inc,
const RowsIterator& it )
noexcept {
3458 return RowsIterator( *it.matrix_, it.row_, it.column_+inc );
3469 friend inline const RowsIterator
operator-(
const RowsIterator& it,
size_t dec )
noexcept {
3470 return RowsIterator( *it.matrix_, it.row_, it.column_-dec );
3476 MatrixType* matrix_;
3483 template<
typename MatrixType2,
typename IteratorType2 >
friend class RowsIterator;
3490 using ConstIterator = RowsIterator< const MT, ConstIterator_t<MT> >;
3493 using Iterator = If_t< IsConst_v<MT>, ConstIterator, RowsIterator< MT, Iterator_t<MT> > >;
3498 static constexpr bool simdEnabled =
false;
3501 static constexpr bool smpAssignable = MT::smpAssignable;
3504 static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
3510 template<
typename... RRAs >
3511 explicit inline Rows( MT& matrix, RRAs... args );
3513 Rows(
const Rows& ) =
default;
3514 Rows( Rows&& ) =
default;
3528 inline Reference operator()(
size_t i,
size_t j );
3529 inline ConstReference operator()(
size_t i,
size_t j )
const;
3530 inline Reference at(
size_t i,
size_t j );
3531 inline ConstReference at(
size_t i,
size_t j )
const;
3532 inline Pointer
data () noexcept;
3533 inline ConstPointer
data () const noexcept;
3534 inline Pointer
data (
size_t i ) noexcept;
3535 inline ConstPointer
data (
size_t i ) const noexcept;
3536 inline Iterator
begin (
size_t i );
3537 inline ConstIterator
begin (
size_t i ) const;
3538 inline ConstIterator
cbegin(
size_t i ) const;
3539 inline Iterator
end (
size_t i );
3540 inline ConstIterator
end (
size_t i ) const;
3541 inline ConstIterator
cend (
size_t i ) const;
3548 inline Rows& operator=( const ElementType& rhs );
3550 inline Rows& operator=( const Rows& rhs );
3552 template< typename MT2,
bool SO2 >
3553 inline Rows& operator=( const Matrix<MT2,SO2>& rhs );
3555 template< typename MT2,
bool SO2 >
3556 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
3557 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
3559 template< typename MT2,
bool SO2 >
3560 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
3561 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
3563 template< typename MT2,
bool SO2 >
3564 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
3565 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
3567 template< typename MT2,
bool SO2 >
3568 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
3569 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
3571 template< typename MT2,
bool SO2 >
3572 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
3573 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
3575 template< typename MT2,
bool SO2 >
3576 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
3577 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >;
3584 using DataType::idx;
3585 using DataType::idces;
3586 using DataType::
rows;
3588 inline MT& operand() noexcept;
3589 inline const MT& operand() const noexcept;
3591 inline
size_t columns() const noexcept;
3592 inline
size_t spacing() const noexcept;
3593 inline
size_t capacity() const noexcept;
3594 inline
size_t capacity(
size_t i ) const noexcept;
3596 inline
size_t nonZeros(
size_t i ) const;
3597 inline
void reset();
3598 inline
void reset(
size_t i );
3608 template< typename Other > inline Rows& scale( const Other& scalar );
3615 template< typename Other >
3616 inline
bool canAlias( const Other* alias ) const noexcept;
3618 template< typename MT2,
bool SO2,
bool SF2, typename... CRAs2 >
3619 inline
bool canAlias( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
3621 template< typename Other >
3622 inline
bool isAliased( const Other* alias ) const noexcept;
3624 template< typename MT2,
bool SO2,
bool SF2, typename... CRAs2 >
3625 inline
bool isAliased( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
3627 inline
bool isAligned () const noexcept;
3628 inline
bool canSMPAssign() const noexcept;
3630 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,false>& rhs );
3631 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,true>& rhs );
3632 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,false>& rhs );
3633 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,true>& rhs );
3635 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,false>& rhs );
3636 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,true>& rhs );
3637 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,false>& rhs );
3638 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,true>& rhs );
3640 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,false>& rhs );
3641 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,true>& rhs );
3642 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,false>& rhs );
3643 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,true>& rhs );
3645 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,false>& rhs );
3646 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,true>& rhs );
3647 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,false>& rhs );
3648 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,true>& rhs );
3661 template< typename MT2,
bool SO2,
bool DF2,
bool SF2, typename... CRAs2 > friend class Rows;
3701template< typename MT
3702 , typename... CRAs >
3703template< typename... RRAs >
3704inline Rows<MT,false,true,false,CRAs...>::Rows( MT& matrix, RRAs... args )
3705 : DataType( args... )
3706 , matrix_ ( matrix )
3709 for(
size_t i=0UL; i<
rows(); ++i ) {
3710 if( matrix_.rows() <= idx(i) ) {
3739template<
typename MT
3740 ,
typename... CRAs >
3741inline typename Rows<MT,
false,
true,
false,CRAs...>::Reference
3742 Rows<MT,false,true,false,CRAs...>::operator()(
size_t i,
size_t j )
3747 return matrix_(idx(i),j);
3764template<
typename MT
3765 ,
typename... CRAs >
3766inline typename Rows<MT,
false,
true,
false,CRAs...>::ConstReference
3767 Rows<MT,false,true,false,CRAs...>::operator()(
size_t i,
size_t j )
const
3772 return const_cast<const MT&
>( matrix_ )(idx(i),j);
3790template<
typename MT
3791 ,
typename... CRAs >
3792inline typename Rows<MT,
false,
true,
false,CRAs...>::Reference
3793 Rows<MT,false,true,false,CRAs...>::at(
size_t i,
size_t j )
3801 return (*
this)(i,j);
3819template<
typename MT
3820 ,
typename... CRAs >
3821inline typename Rows<MT,
false,
true,
false,CRAs...>::ConstReference
3822 Rows<MT,false,true,false,CRAs...>::at(
size_t i,
size_t j )
const
3830 return (*
this)(i,j);
3846template<
typename MT
3847 ,
typename... CRAs >
3848inline typename Rows<MT,
false,
true,
false,CRAs...>::Pointer
3851 return matrix_.data() + idx(0UL);
3867template<
typename MT
3868 ,
typename... CRAs >
3869inline typename Rows<MT,
false,
true,
false,CRAs...>::ConstPointer
3872 return matrix_.data() + idx(0UL);
3887template<
typename MT
3888 ,
typename... CRAs >
3889inline typename Rows<MT,
false,
true,
false,CRAs...>::Pointer
3892 return matrix_.data() + idx(i);
3907template<
typename MT
3908 ,
typename... CRAs >
3909inline typename Rows<MT,
false,
true,
false,CRAs...>::ConstPointer
3912 return matrix_.data() + idx(i);
3927template<
typename MT
3928 ,
typename... CRAs >
3929inline typename Rows<MT,
false,
true,
false,CRAs...>::Iterator
3933 return Iterator( matrix_, idx(i), 0UL );
3948template<
typename MT
3949 ,
typename... CRAs >
3950inline typename Rows<MT,
false,
true,
false,CRAs...>::ConstIterator
3954 return ConstIterator( matrix_, idx(i), 0UL );
3969template<
typename MT
3970 ,
typename... CRAs >
3971inline typename Rows<MT,
false,
true,
false,CRAs...>::ConstIterator
3975 return ConstIterator( matrix_, idx(i), 0UL );
3990template<
typename MT
3991 ,
typename... CRAs >
3992inline typename Rows<MT,
false,
true,
false,CRAs...>::Iterator
3996 return Iterator( matrix_, idx(i),
columns() );
4011template<
typename MT
4012 ,
typename... CRAs >
4013inline typename Rows<MT,
false,
true,
false,CRAs...>::ConstIterator
4017 return ConstIterator( matrix_, idx(i),
columns() );
4032template<
typename MT
4033 ,
typename... CRAs >
4034inline typename Rows<MT,
false,
true,
false,CRAs...>::ConstIterator
4038 return ConstIterator( matrix_, idx(i),
columns() );
4063template<
typename MT
4064 ,
typename... CRAs >
4065inline Rows<MT,
false,
true,
false,CRAs...>&
4066 Rows<MT,false,true,false,CRAs...>::operator=(
const ElementType& rhs )
4068 for(
size_t i=0UL; i<
rows(); ++i ) {
4094template<
typename MT
4095 ,
typename... CRAs >
4096inline Rows<MT,
false,
true,
false,CRAs...>&
4102 if( list.size() !=
rows() ) {
4106 if( IsRestricted_v<MT> ) {
4108 for(
const auto& rowList : list ) {
4109 const InitializerVector<ElementType> tmp( rowList,
columns() );
4110 if( !tryAssign(
row( matrix_, idx(i),
unchecked ), tmp, 0UL ) ){
4117 decltype(
auto) left( derestrict( *
this ) );
4120 for(
const auto& rowList : list ) {
4121 std::fill( std::copy( rowList.begin(), rowList.end(), left.begin(i) ), left.end(i), ElementType() );
4146template<
typename MT
4147 ,
typename... CRAs >
4148inline Rows<MT,
false,
true,
false,CRAs...>&
4149 Rows<MT,false,true,false,CRAs...>::operator=(
const Rows& rhs )
4157 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && compareIndices( *
this, rhs ) ) )
4160 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
4164 if( IsRestricted_v<MT> ) {
4165 for(
size_t i=0UL; i<
rows(); ++i ) {
4172 decltype(
auto) left( derestrict( *
this ) );
4174 if( rhs.canAlias(
this ) ) {
4175 const ResultType tmp( rhs );
4205template<
typename MT
4206 ,
typename... CRAs >
4207template<
typename MT2
4209inline Rows<MT,
false,
true,
false,CRAs...>&
4210 Rows<MT,false,true,false,CRAs...>::operator=(
const Matrix<MT2,SO2>& rhs )
4217 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
4221 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<MT2>,
const MT2& >;
4222 Right right( *rhs );
4224 if( IsRestricted_v<MT> ) {
4225 for(
size_t i=0UL; i<
rows(); ++i ) {
4232 decltype(
auto) left( derestrict( *
this ) );
4234 if( IsSparseMatrix_v<MT2> ) {
4238 if( IsReference_v<Right> && right.canAlias(
this ) ) {
4239 const ResultType_t<MT2> tmp( right );
4268template<
typename MT
4269 ,
typename... CRAs >
4270template<
typename MT2
4273 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
4282 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
4287 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
4291 if( IsRestricted_v<MT> ) {
4292 for(
size_t i=0UL; i<
rows(); ++i ) {
4299 decltype(
auto) left( derestrict( *
this ) );
4301 if( (*rhs).canAlias(
this ) ) {
4302 const AddType tmp( *
this + (*rhs) );
4331template<
typename MT
4332 ,
typename... CRAs >
4333template<
typename MT2
4336 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
4345 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
4350 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
4354 const AddType tmp( *
this + (*rhs) );
4356 if( IsRestricted_v<MT> ) {
4357 for(
size_t i=0UL; i<
rows(); ++i ) {
4364 decltype(
auto) left( derestrict( *
this ) );
4390template<
typename MT
4391 ,
typename... CRAs >
4392template<
typename MT2
4395 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
4404 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
4409 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
4413 if( IsRestricted_v<MT> ) {
4414 for(
size_t i=0UL; i<
rows(); ++i ) {
4421 decltype(
auto) left( derestrict( *
this ) );
4423 if( (*rhs).canAlias(
this ) ) {
4424 const SubType tmp( *
this - (*rhs ) );
4453template<
typename MT
4454 ,
typename... CRAs >
4455template<
typename MT2
4458 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
4467 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
4472 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
4476 const SubType tmp( *
this - (*rhs) );
4478 if( IsRestricted_v<MT> ) {
4479 for(
size_t i=0UL; i<
rows(); ++i ) {
4486 decltype(
auto) left( derestrict( *
this ) );
4512template<
typename MT
4513 ,
typename... CRAs >
4514template<
typename MT2
4516inline auto Rows<MT,false,true,false,CRAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
4517 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
4526 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
4530 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
4534 if( IsRestricted_v<MT> ) {
4535 for(
size_t i=0UL; i<
rows(); ++i ) {
4542 decltype(
auto) left( derestrict( *
this ) );
4544 if( (*rhs).canAlias(
this ) ) {
4545 const SchurType tmp( *
this % (*rhs) );
4546 if( IsSparseMatrix_v<SchurType> )
4576template<
typename MT
4577 ,
typename... CRAs >
4578template<
typename MT2
4580inline auto Rows<MT,false,true,false,CRAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
4581 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Rows& >
4590 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
4594 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
4598 const SchurType tmp( *
this % (*rhs) );
4600 if( IsRestricted_v<MT> ) {
4601 for(
size_t i=0UL; i<
rows(); ++i ) {
4608 decltype(
auto) left( derestrict( *
this ) );
4610 if( IsSparseMatrix_v<SchurType> ) {
4638template<
typename MT
4639 ,
typename... CRAs >
4640inline MT& Rows<MT,false,true,false,CRAs...>::operand() noexcept
4654template<
typename MT
4655 ,
typename... CRAs >
4656inline const MT& Rows<MT,false,true,false,CRAs...>::operand() const noexcept
4670template<
typename MT
4671 ,
typename... CRAs >
4674 return matrix_.columns();
4689template<
typename MT
4690 ,
typename... CRAs >
4693 return matrix_.columns();
4705template<
typename MT
4706 ,
typename... CRAs >
4724template<
typename MT
4725 ,
typename... CRAs >
4744template<
typename MT
4745 ,
typename... CRAs >
4748 size_t nonzeros( 0UL );
4750 for(
size_t i=0UL; i<
rows(); ++i ) {
4769template<
typename MT
4770 ,
typename... CRAs >
4775 size_t nonzeros( 0UL );
4777 const size_t index( idx(i) );
4778 for(
size_t j=0UL; j<
columns(); ++j ) {
4795template<
typename MT
4796 ,
typename... CRAs >
4799 for(
size_t i=0UL; i<
rows(); ++i ) {
4816template<
typename MT
4817 ,
typename... CRAs >
4822 const size_t index( idx(i) );
4823 for(
size_t j=0UL; j<
columns(); ++j ) {
4824 reset( matrix_( index, j ) );
4852template<
typename MT
4853 ,
typename... CRAs >
4854inline Rows<MT,
false,
true,
false,CRAs...>&
4864 const ResultType tmp(
trans( *
this ) );
4866 if( IsRestricted_v<MT> ) {
4867 for(
size_t i=0UL; i<
rows(); ++i ) {
4868 if( !tryAssign( matrix_,
row( tmp, i ), idx(i), 0UL ) ) {
4874 decltype(
auto) left( derestrict( *
this ) );
4897template<
typename MT
4898 ,
typename... CRAs >
4899inline Rows<MT,
false,
true,
false,CRAs...>&
4909 const ResultType tmp(
ctrans( *
this ) );
4911 if( IsRestricted_v<MT> ) {
4912 for(
size_t i=0UL; i<
rows(); ++i ) {
4913 if( !tryAssign( matrix_,
row( tmp, i ), idx(i), 0UL ) ) {
4919 decltype(
auto) left( derestrict( *
this ) );
4942template<
typename MT
4943 ,
typename... CRAs >
4944template<
typename Other >
4945inline Rows<MT,
false,
true,
false,CRAs...>&
4946 Rows<MT,false,true,false,CRAs...>::scale(
const Other& scalar )
4952 for(
size_t i=0UL; i<
rows(); ++i )
4954 const size_t index ( idx(i) );
4955 const size_t jbegin( IsUpper<MT>::value ? ( IsStrictlyUpper_v<MT> ? index+1UL : index ) : 0UL );
4956 const size_t jend ( IsLower<MT>::value ? ( IsStrictlyLower_v<MT> ? index : index+1UL ) :
columns() );
4958 for(
size_t j=jbegin; j<jend; ++j ) {
4959 matrix_(index,j) *= scalar;
4988template<
typename MT
4989 ,
typename... CRAs >
4990template<
typename Other >
4991inline bool Rows<MT,false,true,false,CRAs...>::canAlias(
const Other* alias )
const noexcept
4993 return matrix_.isAliased( &unview( *alias ) );
5011template<
typename MT
5012 ,
typename... CRAs >
5013template<
typename MT2
5016 ,
typename... CRAs2 >
5018 Rows<MT,false,true,false,CRAs...>::canAlias(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
5020 return matrix_.isAliased( &alias->matrix_ );
5037template<
typename MT
5038 ,
typename... CRAs >
5039template<
typename Other >
5040inline bool Rows<MT,false,true,false,CRAs...>::isAliased(
const Other* alias )
const noexcept
5042 return matrix_.isAliased( &unview( *alias ) );
5060template<
typename MT
5061 ,
typename... CRAs >
5062template<
typename MT2
5065 ,
typename... CRAs2 >
5067 Rows<MT,false,true,false,CRAs...>::isAliased(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
5069 return matrix_.isAliased( &alias->matrix_ );
5085template<
typename MT
5086 ,
typename... CRAs >
5087inline bool Rows<MT,false,true,false,CRAs...>::isAligned() const noexcept
5106template<
typename MT
5107 ,
typename... CRAs >
5108inline bool Rows<MT,false,true,false,CRAs...>::canSMPAssign() const noexcept
5110 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
5128template<
typename MT
5129 ,
typename... CRAs >
5130template<
typename MT2 >
5131inline void Rows<MT,false,true,false,CRAs...>::assign(
const DenseMatrix<MT2,false>& rhs )
5142 for(
size_t i=0UL; i<
rows(); ++i ) {
5143 const size_t index( idx(i) );
5144 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5145 matrix_(index,j ) = (*rhs)(i,j );
5146 matrix_(index,j+1UL) = (*rhs)(i,j+1UL);
5149 matrix_(index,jpos) = (*rhs)(i,jpos);
5169template<
typename MT
5170 ,
typename... CRAs >
5171template<
typename MT2 >
5172inline void Rows<MT,false,true,false,CRAs...>::assign(
const DenseMatrix<MT2,true>& rhs )
5182 constexpr size_t block( BLOCK_SIZE );
5186 const size_t jpos(
prevMultiple( (*rhs).columns(), 2UL ) );
5189 for(
size_t i=0UL; i<
rows(); ++i ) {
5190 const size_t index( idx(i) );
5191 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5192 matrix_(index,j ) = (*rhs)(i,j );
5193 matrix_(index,j+1UL) = (*rhs)(i,j+1UL);
5195 if( jpos < (*rhs).columns() )
5196 matrix_(index,jpos) = (*rhs)(i,jpos);
5201 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5202 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5203 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5204 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5205 for(
size_t i=ii; i<iend; ++i ) {
5206 const size_t index( idx(i) );
5207 for(
size_t j=jj; j<jend; ++j ) {
5208 matrix_(index,j) = (*rhs)(i,j);
5231template<
typename MT
5232 ,
typename... CRAs >
5233template<
typename MT2 >
5234inline void Rows<MT,false,true,false,CRAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
5242 for(
size_t i=0UL; i<
rows(); ++i ) {
5243 const size_t index( idx(i) );
5244 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
5245 matrix_(index,element->index()) = element->value();
5264template<
typename MT
5265 ,
typename... CRAs >
5266template<
typename MT2 >
5267inline void Rows<MT,false,true,false,CRAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
5277 for(
size_t j=0UL; j<
columns(); ++j ) {
5278 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
5279 matrix_(idx(element->index()),j) = element->value();
5298template<
typename MT
5299 ,
typename... CRAs >
5300template<
typename MT2 >
5301inline void Rows<MT,false,true,false,CRAs...>::addAssign(
const DenseMatrix<MT2,false>& rhs )
5312 for(
size_t i=0UL; i<
rows(); ++i )
5314 const size_t index( idx(i) );
5315 if( IsDiagonal_v<MT2> ) {
5316 matrix_(index,i) += (*rhs)(i,i);
5319 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5320 matrix_(index,j ) += (*rhs)(i,j );
5321 matrix_(index,j+1UL) += (*rhs)(i,j+1UL);
5324 matrix_(index,jpos) += (*rhs)(i,jpos);
5345template<
typename MT
5346 ,
typename... CRAs >
5347template<
typename MT2 >
5348inline void Rows<MT,false,true,false,CRAs...>::addAssign(
const DenseMatrix<MT2,true>& rhs )
5358 constexpr size_t block( BLOCK_SIZE );
5362 const size_t jpos(
prevMultiple( (*rhs).columns(), 2UL ) );
5365 for(
size_t i=0UL; i<
rows(); ++i ) {
5366 const size_t index( idx(i) );
5367 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5368 matrix_(index,j ) += (*rhs)(i,j );
5369 matrix_(index,j+1UL) += (*rhs)(i,j+1UL);
5371 if( jpos < (*rhs).columns() )
5372 matrix_(index,jpos) += (*rhs)(i,jpos);
5377 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5378 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5379 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5380 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5381 for(
size_t i=ii; i<iend; ++i ) {
5382 const size_t index( idx(i) );
5383 for(
size_t j=jj; j<jend; ++j ) {
5384 matrix_(index,j) += (*rhs)(i,j);
5407template<
typename MT
5408 ,
typename... CRAs >
5409template<
typename MT2 >
5410inline void Rows<MT,false,true,false,CRAs...>::addAssign(
const SparseMatrix<MT2,false>& rhs )
5418 for(
size_t i=0UL; i<
rows(); ++i ) {
5419 const size_t index( idx(i) );
5420 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
5421 matrix_(index,element->index()) += element->value();
5440template<
typename MT
5441 ,
typename... CRAs >
5442template<
typename MT2 >
5443inline void Rows<MT,false,true,false,CRAs...>::addAssign(
const SparseMatrix<MT2,true>& rhs )
5453 for(
size_t j=0UL; j<
columns(); ++j ) {
5454 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
5455 matrix_(idx(element->index()),j) += element->value();
5474template<
typename MT
5475 ,
typename... CRAs >
5476template<
typename MT2 >
5477inline void Rows<MT,false,true,false,CRAs...>::subAssign(
const DenseMatrix<MT2,false>& rhs )
5488 for(
size_t i=0UL; i<
rows(); ++i )
5490 const size_t index( idx(i) );
5492 if( IsDiagonal_v<MT2> ) {
5493 matrix_(index,i) -= (*rhs)(i,i);
5496 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5497 matrix_(index,j ) -= (*rhs)(i,j );
5498 matrix_(index,j+1UL) -= (*rhs)(i,j+1UL);
5501 matrix_(index,jpos) -= (*rhs)(i,jpos);
5522template<
typename MT
5523 ,
typename... CRAs >
5524template<
typename MT2 >
5525inline void Rows<MT,false,true,false,CRAs...>::subAssign(
const DenseMatrix<MT2,true>& rhs )
5535 constexpr size_t block( BLOCK_SIZE );
5539 const size_t jpos(
prevMultiple( (*rhs).columns(), 2UL ) );
5542 for(
size_t i=0UL; i<
rows(); ++i ) {
5543 const size_t index( idx(i) );
5544 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5545 matrix_(index,j ) -= (*rhs)(i,j );
5546 matrix_(index,j+1UL) -= (*rhs)(i,j+1UL);
5548 if( jpos < (*rhs).columns() )
5549 matrix_(index,jpos) -= (*rhs)(i,jpos);
5554 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5555 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5556 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5557 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5558 for(
size_t i=ii; i<iend; ++i ) {
5559 const size_t index( idx(i) );
5560 for(
size_t j=jj; j<jend; ++j ) {
5561 matrix_(index,j) -= (*rhs)(i,j);
5584template<
typename MT
5585 ,
typename... CRAs >
5586template<
typename MT2 >
5587inline void Rows<MT,false,true,false,CRAs...>::subAssign(
const SparseMatrix<MT2,false>& rhs )
5595 for(
size_t i=0UL; i<
rows(); ++i ) {
5596 const size_t index( idx(i) );
5597 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
5598 matrix_(index,element->index()) -= element->value();
5617template<
typename MT
5618 ,
typename... CRAs >
5619template<
typename MT2 >
5620inline void Rows<MT,false,true,false,CRAs...>::subAssign(
const SparseMatrix<MT2,true>& rhs )
5630 for(
size_t j=0UL; j<
columns(); ++j ) {
5631 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
5632 matrix_(idx(element->index()),j) -= element->value();
5651template<
typename MT
5652 ,
typename... CRAs >
5653template<
typename MT2 >
5654inline void Rows<MT,false,true,false,CRAs...>::schurAssign(
const DenseMatrix<MT2,false>& rhs )
5665 for(
size_t i=0UL; i<
rows(); ++i ) {
5666 const size_t index( idx(i) );
5667 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5668 matrix_(index,j ) *= (*rhs)(i,j );
5669 matrix_(index,j+1UL) *= (*rhs)(i,j+1UL);
5672 matrix_(index,jpos) *= (*rhs)(i,jpos);
5692template<
typename MT
5693 ,
typename... CRAs >
5694template<
typename MT2 >
5695inline void Rows<MT,false,true,false,CRAs...>::schurAssign(
const DenseMatrix<MT2,true>& rhs )
5705 constexpr size_t block( BLOCK_SIZE );
5709 const size_t jpos(
prevMultiple( (*rhs).columns(), 2UL ) );
5712 for(
size_t i=0UL; i<
rows(); ++i ) {
5713 const size_t index( idx(i) );
5714 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5715 matrix_(index,j ) *= (*rhs)(i,j );
5716 matrix_(index,j+1UL) *= (*rhs)(i,j+1UL);
5718 if( jpos < (*rhs).columns() )
5719 matrix_(index,jpos) *= (*rhs)(i,jpos);
5724 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5725 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5726 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5727 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5728 for(
size_t i=ii; i<iend; ++i ) {
5729 const size_t index( idx(i) );
5730 for(
size_t j=jj; j<jend; ++j ) {
5731 matrix_(index,j) *= (*rhs)(i,j);
5754template<
typename MT
5755 ,
typename... CRAs >
5756template<
typename MT2 >
5757inline void Rows<MT,false,true,false,CRAs...>::schurAssign(
const SparseMatrix<MT2,false>& rhs )
5767 for(
size_t i=0UL; i<
rows(); ++i )
5769 const size_t index( idx(i) );
5772 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element ) {
5773 for( ; j<element->index(); ++j )
5774 reset( matrix_(index,j) );
5775 matrix_(index,j) *= element->value();
5780 reset( matrix_(index,j) );
5800template<
typename MT
5801 ,
typename... CRAs >
5802template<
typename MT2 >
5803inline void Rows<MT,false,true,false,CRAs...>::schurAssign(
const SparseMatrix<MT2,true>& rhs )
5815 for(
size_t j=0UL; j<
columns(); ++j )
5819 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element ) {
5820 for( ; i<element->index(); ++i )
5821 reset( matrix_(idx(i),j) );
5822 matrix_(idx(i),j) *= element->value();
5826 for( ; i<
rows(); ++i ) {
5827 reset( matrix_(idx(i),j) );
5855template<
typename MT
5856 ,
typename... CRAs >
5857class Rows<MT,false,true,true,CRAs...>
5858 :
public View< DenseMatrix< Rows<MT,false,true,true,CRAs...>, false > >
5859 ,
private RowsData<CRAs...>
5863 using DataType = RowsData<CRAs...>;
5864 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
5874 using This = Rows<MT,
false,
true,
true,CRAs...>;
5877 using BaseType = View< DenseMatrix<This,false> >;
5879 using ViewedType = MT;
5880 using ResultType = RowsTrait_t<MT,N>;
5881 using OppositeType = OppositeType_t<ResultType>;
5882 using TransposeType = TransposeType_t<ResultType>;
5883 using ElementType = ElementType_t<MT>;
5884 using SIMDType = SIMDTrait_t<ElementType>;
5885 using ReturnType = ReturnType_t<MT>;
5886 using CompositeType =
const Rows&;
5889 using ConstReference = ConstReference_t<MT>;
5892 using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
5895 using ConstPointer = ConstPointer_t<MT>;
5898 using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
5901 using ConstIterator = ConstIterator_t<MT>;
5904 using Iterator = If_t< IsConst_v<MT>, ConstIterator, Iterator_t<MT> >;
5909 static constexpr bool simdEnabled = MT::simdEnabled;
5912 static constexpr bool smpAssignable = MT::smpAssignable;
5915 static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
5921 template<
typename... RRAs >
5922 explicit inline Rows( MT& matrix, RRAs... args );
5924 Rows(
const Rows& ) =
default;
5925 Rows( Rows&& ) =
default;
5939 inline Reference operator()(
size_t i,
size_t j );
5940 inline ConstReference operator()(
size_t i,
size_t j )
const;
5941 inline Reference at(
size_t i,
size_t j );
5942 inline ConstReference at(
size_t i,
size_t j )
const;
5943 inline Pointer
data () noexcept;
5944 inline ConstPointer
data () const noexcept;
5945 inline Pointer
data (
size_t i ) noexcept;
5946 inline ConstPointer
data (
size_t i ) const noexcept;
5947 inline Iterator
begin (
size_t i );
5948 inline ConstIterator
begin (
size_t i ) const;
5949 inline ConstIterator
cbegin(
size_t i ) const;
5950 inline Iterator
end (
size_t i );
5951 inline ConstIterator
end (
size_t i ) const;
5952 inline ConstIterator
cend (
size_t i ) const;
5959 inline Rows& operator=( const ElementType& rhs );
5961 Rows& operator=( const Rows& ) = delete;
5968 using DataType::idx;
5969 using DataType::idces;
5970 using DataType::
rows;
5972 inline MT& operand() noexcept;
5973 inline const MT& operand() const noexcept;
5975 inline
size_t columns() const noexcept;
5976 inline
size_t spacing() const noexcept;
5977 inline
size_t capacity() const noexcept;
5978 inline
size_t capacity(
size_t i ) const noexcept;
5980 inline
size_t nonZeros(
size_t i ) const;
5981 inline
void reset();
5982 inline
void reset(
size_t i );
5989 template< typename Other >
5990 inline
bool canAlias( const Other* alias ) const noexcept;
5992 template< typename MT2,
bool SO2,
bool SF2, typename... CRAs2 >
5993 inline
bool canAlias( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
5995 template< typename Other >
5996 inline
bool isAliased( const Other* alias ) const noexcept;
5998 template< typename MT2,
bool SO2,
bool SF2, typename... CRAs2 >
5999 inline
bool isAliased( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
6001 inline
bool isAligned () const noexcept;
6002 inline
bool canSMPAssign() const noexcept;
6019 template< typename MT2,
bool SO2,
bool DF2,
bool SF2, typename... CRAs2 > friend class Rows;
6059template< typename MT
6060 , typename... CRAs >
6061template< typename... RRAs >
6062inline Rows<MT,false,true,true,CRAs...>::Rows( MT& matrix, RRAs... args )
6063 : DataType( args... )
6064 , matrix_ ( matrix )
6067 for(
size_t i=0UL; i<
rows(); ++i ) {
6068 if( matrix_.rows() <= idx(i) ) {
6097template<
typename MT
6098 ,
typename... CRAs >
6099inline typename Rows<MT,
false,
true,
true,CRAs...>::Reference
6100 Rows<MT,false,true,true,CRAs...>::operator()(
size_t i,
size_t j )
6105 return matrix_(j,idx(i));
6122template<
typename MT
6123 ,
typename... CRAs >
6124inline typename Rows<MT,
false,
true,
true,CRAs...>::ConstReference
6125 Rows<MT,false,true,true,CRAs...>::operator()(
size_t i,
size_t j )
const
6130 return const_cast<const MT&
>( matrix_ )(j,idx(i));
6148template<
typename MT
6149 ,
typename... CRAs >
6150inline typename Rows<MT,
false,
true,
true,CRAs...>::Reference
6151 Rows<MT,false,true,true,CRAs...>::at(
size_t i,
size_t j )
6159 return (*
this)(i,j);
6177template<
typename MT
6178 ,
typename... CRAs >
6179inline typename Rows<MT,
false,
true,
true,CRAs...>::ConstReference
6180 Rows<MT,false,true,true,CRAs...>::at(
size_t i,
size_t j )
const
6188 return (*
this)(i,j);
6204template<
typename MT
6205 ,
typename... CRAs >
6206inline typename Rows<MT,
false,
true,
true,CRAs...>::Pointer
6209 return matrix_.data( idx(0UL) );
6225template<
typename MT
6226 ,
typename... CRAs >
6227inline typename Rows<MT,
false,
true,
true,CRAs...>::ConstPointer
6230 return matrix_.data( idx(0UL) );
6245template<
typename MT
6246 ,
typename... CRAs >
6247inline typename Rows<MT,
false,
true,
true,CRAs...>::Pointer
6250 return matrix_.data( idx(i) );
6265template<
typename MT
6266 ,
typename... CRAs >
6267inline typename Rows<MT,
false,
true,
true,CRAs...>::ConstPointer
6270 return matrix_.data( idx(i) );
6285template<
typename MT
6286 ,
typename... CRAs >
6287inline typename Rows<MT,
false,
true,
true,CRAs...>::Iterator
6291 return matrix_.begin( idx(i) );
6306template<
typename MT
6307 ,
typename... CRAs >
6308inline typename Rows<MT,
false,
true,
true,CRAs...>::ConstIterator
6312 return matrix_.cbegin( idx(i) );
6327template<
typename MT
6328 ,
typename... CRAs >
6329inline typename Rows<MT,
false,
true,
true,CRAs...>::ConstIterator
6333 return matrix_.cbegin( idx(i) );
6348template<
typename MT
6349 ,
typename... CRAs >
6350inline typename Rows<MT,
false,
true,
true,CRAs...>::Iterator
6354 return matrix_.end( idx(i) );
6369template<
typename MT
6370 ,
typename... CRAs >
6371inline typename Rows<MT,
false,
true,
true,CRAs...>::ConstIterator
6375 return matrix_.cend( idx(i) );
6390template<
typename MT
6391 ,
typename... CRAs >
6392inline typename Rows<MT,
false,
true,
true,CRAs...>::ConstIterator
6396 return matrix_.cend( idx(i) );
6421template<
typename MT
6422 ,
typename... CRAs >
6423inline Rows<MT,
false,
true,
true,CRAs...>&
6424 Rows<MT,false,true,true,CRAs...>::operator=(
const ElementType& rhs )
6426 for(
size_t i=0UL; i<
rows(); ++i ) {
6450template<
typename MT
6451 ,
typename... CRAs >
6452inline MT& Rows<MT,false,true,true,CRAs...>::operand() noexcept
6466template<
typename MT
6467 ,
typename... CRAs >
6468inline const MT& Rows<MT,false,true,true,CRAs...>::operand() const noexcept
6482template<
typename MT
6483 ,
typename... CRAs >
6486 return matrix_.columns();
6501template<
typename MT
6502 ,
typename... CRAs >
6505 return matrix_.spacing();
6517template<
typename MT
6518 ,
typename... CRAs >
6536template<
typename MT
6537 ,
typename... CRAs >
6556template<
typename MT
6557 ,
typename... CRAs >
6560 size_t nonzeros( 0UL );
6562 for(
size_t i=0UL; i<
rows(); ++i ) {
6563 nonzeros += matrix_.nonZeros( idx(i) );
6581template<
typename MT
6582 ,
typename... CRAs >
6587 return matrix_.nonZeros( idx(i) );
6599template<
typename MT
6600 ,
typename... CRAs >
6603 for(
size_t i=0UL; i<
rows(); ++i ) {
6604 matrix_.reset( idx(i) );
6620template<
typename MT
6621 ,
typename... CRAs >
6624 matrix_.reset( idx(i) );
6649template<
typename MT
6650 ,
typename... CRAs >
6651template<
typename Other >
6652inline bool Rows<MT,false,true,true,CRAs...>::canAlias(
const Other* alias )
const noexcept
6654 return matrix_.isAliased( &unview( *alias ) );
6672template<
typename MT
6673 ,
typename... CRAs >
6674template<
typename MT2
6677 ,
typename... CRAs2 >
6679 Rows<MT,false,true,true,CRAs...>::canAlias(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
6681 return matrix_.isAliased( &alias->matrix_ );
6698template<
typename MT
6699 ,
typename... CRAs >
6700template<
typename Other >
6701inline bool Rows<MT,false,true,true,CRAs...>::isAliased(
const Other* alias )
const noexcept
6703 return matrix_.isAliased( &unview( *alias ) );
6721template<
typename MT
6722 ,
typename... CRAs >
6723template<
typename MT2
6726 ,
typename... CRAs2 >
6728 Rows<MT,false,true,true,CRAs...>::isAliased(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
6730 return matrix_.isAliased( &alias->matrix_ );
6746template<
typename MT
6747 ,
typename... CRAs >
6748inline bool Rows<MT,false,true,true,CRAs...>::isAligned() const noexcept
6750 return matrix_.isAligned();
6767template<
typename MT
6768 ,
typename... CRAs >
6769inline bool Rows<MT,false,true,true,CRAs...>::canSMPAssign() const noexcept
6771 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
6792template<
typename MT
6793 ,
typename... CRAs >
6795 Rows<MT,false,true,true,CRAs...>::load(
size_t i,
size_t j )
const noexcept
6797 return matrix_.load( j, idx(i) );
6818template<
typename MT
6819 ,
typename... CRAs >
6823 return matrix_.loada( j, idx(i) );
6844template<
typename MT
6845 ,
typename... CRAs >
6849 return matrix_.loadu( j, idx(i) );
Header file for the addition trait.
Header file for auxiliary alias declarations.
Header file for run time assertion macros.
Header file for kernel specific block sizes.
Header file for the blaze::checked and blaze::unchecked instances.
Constraints on the storage order of matrix types.
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:751
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:719
Header file for the EnableIf class template.
Header file for the HasMutableDataAccess type trait.
Header file for the HasSIMDAdd type trait.
Header file for the HasSIMDMult type trait.
Header file for the HasSIMDSub type trait.
Constraint on the data type.
Header file for the If class template.
Header file for the IsConst type trait.
Header file for the IsDiagonal type trait.
Header file for the IsExpression type trait class.
Header file for the IsLower type trait.
Header file for the IsReference type trait.
Header file for the IsRestricted type trait.
Header file for the IsSIMDCombinable type trait.
Header file for the IsSparseMatrix type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsUpper type trait.
Header file for the MAYBE_UNUSED function template.
Constraint on the data type.
Header file for the prevMultiple shim.
Constraint on the data type.
Constraints on the storage order of matrix types.
Header file for the implementation of the RowsData class template.
Header file for the rows trait.
Header file for all SIMD functionality.
Header file for the Schur product trait.
Header file for the subtraction trait.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Initializer list type of the Blaze library.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of a vector representation of an initializer list.
Header file for the DenseMatrix base class.
Header file for the View base class.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:137
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.
Definition: Pointer.h:79
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.
Definition: Vectorizable.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.
Definition: Reference.h:79
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1501
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:182
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:386
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:265
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:9640
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:448
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:207
bool isDefault(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the given diagonal matrix is in default state.
Definition: DiagonalMatrix.h:169
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: RowMajorMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition: RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Hermitian.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.
Definition: TransExpr.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SUBMATRIX_TYPE(T)
Constraint on the data type.
Definition: Submatrix.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:60
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: DenseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ROWS_TYPE(T)
Constraint on the data type.
Definition: Rows.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: UniTriangular.h:81
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: ColumnMajorMatrix.h:61
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.
Definition: HasSIMDSub.h:187
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.
Definition: IsSIMDCombinable.h:137
constexpr bool IsDiagonal_v
Auxiliary variable template for the IsDiagonal type trait.
Definition: IsDiagonal.h:148
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.
Definition: HasSIMDAdd.h:187
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.
Definition: HasSIMDMult.h:188
BLAZE_ALWAYS_INLINE constexpr auto prevMultiple(T1 value, T2 factor) noexcept
Rounds down an integral value to the previous multiple of a given factor.
Definition: PrevMultiple.h:68
constexpr 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 > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:253
constexpr bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:332
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
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
constexpr bool operator<=(const NegativeAccuracy< A > &, const T &rhs)
Less-or-equal-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:408
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:628
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:644
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:730
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:562
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:692
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition: Matrix.h:806
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:660
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:584
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:1221
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:518
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:676
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:1195
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:137
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition: Assert.h:117
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:78
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:75
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:74
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
auto smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition: Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
#define BLAZE_THROW_LOGIC_ERROR(MESSAGE)
Macro for the emission of a std::logic_error exception.
Definition: Exception.h:187
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:175
constexpr bool isChecked(const Ts &... args)
Extracting blaze::Check arguments from a given list of arguments.
Definition: Check.h:225
constexpr Unchecked unchecked
Global Unchecked instance.
Definition: Check.h:146
Header file for the exception macros of the math module.
Header file for the extended initializer_list functionality.
Header file for the reset shim.
Header file for the cache size of the target architecture.
System settings for the inline keywords.
System settings for performance optimizations.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.
Header file for the implementation of the Rows base template.