35 #ifndef _BLAZE_MATH_VIEWS_ROWS_DENSE_H_ 36 #define _BLAZE_MATH_VIEWS_ROWS_DENSE_H_ 126 template<
typename MT
129 class Rows<MT,true,true,SF,CRAs...>
130 :
public View< DenseMatrix< Rows<MT,true,true,SF,CRAs...>, false > >
131 ,
private RowsData<CRAs...>
135 using DataType = RowsData<CRAs...>;
136 using Operand = If_< IsExpression<MT>, MT, MT& >;
142 using This = Rows<MT,
true,
true,SF,CRAs...>;
144 using BaseType = DenseMatrix<This,false>;
145 using ViewedType = MT;
150 using SIMDType = SIMDTrait_<ElementType>;
161 using ConstPointer = ConstPointer_<MT>;
164 using Pointer = If_< Or< IsConst<MT>, Not< HasMutableDataAccess<MT> > >, ConstPointer, Pointer_<MT> >;
175 enum :
bool { simdEnabled = MT::simdEnabled };
178 enum :
bool { smpAssignable = MT::smpAssignable };
184 template<
typename... RRAs >
185 explicit inline Rows( MT& matrix, RRAs... args );
187 inline Rows(
const Rows& ) =
default;
188 inline Rows( Rows&& ) =
default;
199 inline Reference operator()(
size_t i,
size_t j );
200 inline ConstReference operator()(
size_t i,
size_t j )
const;
201 inline Reference at(
size_t i,
size_t j );
202 inline ConstReference at(
size_t i,
size_t j )
const;
203 inline Pointer
data () noexcept;
204 inline ConstPointer
data () const noexcept;
205 inline Pointer
data (
size_t i ) noexcept;
206 inline ConstPointer
data (
size_t i ) const noexcept;
208 inline ConstIterator
begin (
size_t i ) const;
209 inline ConstIterator
cbegin(
size_t i ) const;
211 inline ConstIterator
end (
size_t i ) const;
212 inline ConstIterator
cend (
size_t i ) const;
220 inline Rows& operator=( initializer_list< initializer_list<
ElementType> > list );
221 inline Rows& operator=( const Rows& rhs );
223 template< typename MT2,
bool SO2 >
224 inline Rows& operator=( const Matrix<MT2,SO2>& rhs );
226 template< typename MT2,
bool SO2 >
227 inline
DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows& >
228 operator+=( const Matrix<MT2,SO2>& rhs );
230 template< typename MT2,
bool SO2 >
231 inline
EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows& >
232 operator+=( const Matrix<MT2,SO2>& rhs );
234 template< typename MT2,
bool SO2 >
235 inline
DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows& >
236 operator-=( const Matrix<MT2,SO2>& rhs );
238 template< typename MT2,
bool SO2 >
239 inline
EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows& >
240 operator-=( const Matrix<MT2,SO2>& rhs );
242 template< typename MT2,
bool SO2 >
243 inline
DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows& >
244 operator%=( const Matrix<MT2,SO2>& rhs );
246 template< typename MT2,
bool SO2 >
247 inline
EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows& >
248 operator%=( const Matrix<MT2,SO2>& rhs );
256 using DataType::idces;
257 using DataType::
rows;
259 inline MT& operand() noexcept;
260 inline const MT& operand() const noexcept;
262 inline
size_t columns() const noexcept;
263 inline
size_t spacing() const noexcept;
264 inline
size_t capacity() const noexcept;
265 inline
size_t capacity(
size_t i ) const noexcept;
267 inline
size_t nonZeros(
size_t i ) const;
269 inline
void reset(
size_t i );
279 template< typename Other > inline Rows& scale( const Other& scalar );
286 template< typename MT2 >
287 struct VectorizedAssign {
288 enum :
bool { value = useOptimizedKernels &&
289 simdEnabled && MT2::simdEnabled &&
290 IsSIMDCombinable< ElementType, ElementType_<MT2> >::value };
296 template<
typename MT2 >
297 struct VectorizedAddAssign {
298 enum :
bool { value = useOptimizedKernels &&
299 simdEnabled && MT2::simdEnabled &&
300 IsSIMDCombinable< ElementType, ElementType_<MT2> >::value &&
301 HasSIMDAdd< ElementType, ElementType_<MT2> >::value &&
302 !IsDiagonal<MT2>::value };
308 template<
typename MT2 >
309 struct VectorizedSubAssign {
310 enum :
bool { value = useOptimizedKernels &&
311 simdEnabled && MT2::simdEnabled &&
312 IsSIMDCombinable< ElementType, ElementType_<MT2> >::value &&
313 HasSIMDSub< ElementType, ElementType_<MT2> >::value &&
314 !IsDiagonal<MT2>::value };
320 template<
typename MT2 >
321 struct VectorizedSchurAssign {
322 enum :
bool { value = useOptimizedKernels &&
323 simdEnabled && MT2::simdEnabled &&
324 IsSIMDCombinable< ElementType, ElementType_<MT2> >::value &&
325 HasSIMDMult< ElementType, ElementType_<MT2> >::value };
338 template<
typename Other >
339 inline bool canAlias(
const Other* alias )
const noexcept;
341 template<
typename MT2,
bool SO2,
bool SF2,
size_t... CRAs2 >
342 inline bool canAlias(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept;
344 template<
typename Other >
345 inline bool isAliased(
const Other* alias )
const noexcept;
347 template<
typename MT2,
bool SO2,
bool SF2,
size_t... CRAs2 >
348 inline bool isAliased(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept;
350 inline bool isAligned () const noexcept;
351 inline
bool canSMPAssign() const noexcept;
362 template< typename MT2 >
363 inline
DisableIf_< VectorizedAssign<MT2> > assign( const DenseMatrix<MT2,false>& rhs );
365 template< typename MT2 >
366 inline
EnableIf_< VectorizedAssign<MT2> > assign( const DenseMatrix<MT2,false>& rhs );
368 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,true>& rhs );
370 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,false>& rhs );
371 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,true>& rhs );
373 template< typename MT2 >
374 inline
DisableIf_< VectorizedAddAssign<MT2> > addAssign( const DenseMatrix<MT2,false>& rhs );
376 template< typename MT2 >
377 inline
EnableIf_< VectorizedAddAssign<MT2> > addAssign( const DenseMatrix<MT2,false>& rhs );
379 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,true>& rhs );
380 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,false>& rhs );
381 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,true>& rhs );
383 template< typename MT2 >
384 inline
DisableIf_< VectorizedSubAssign<MT2> > subAssign( const DenseMatrix<MT2,false>& rhs );
386 template< typename MT2 >
387 inline
EnableIf_< VectorizedSubAssign<MT2> > subAssign( const DenseMatrix<MT2,false>& rhs );
389 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,true>& rhs );
390 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,false>& rhs );
391 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,true>& rhs );
393 template< typename MT2 >
394 inline
DisableIf_< VectorizedSchurAssign<MT2> > schurAssign( const DenseMatrix<MT2,false>& rhs );
396 template< typename MT2 >
397 inline
EnableIf_< VectorizedSchurAssign<MT2> > schurAssign( const DenseMatrix<MT2,false>& rhs );
399 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,true>& rhs );
400 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,false>& rhs );
401 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,true>& rhs );
414 template< typename MT2,
bool SO2,
bool DF2,
bool SF2,
size_t... CRAs2 > friend class Rows;
453 template< typename MT
456 template< typename... RRAs >
457 inline Rows<MT,true,true,SF,CRAs...>::Rows( MT& matrix, RRAs... args )
458 : DataType( args... )
461 if( !Contains< TypeList<RRAs...>,
Unchecked >::value ) {
462 for(
size_t i=0UL; i<
rows(); ++i ) {
463 if( matrix_.rows() <= idx(i) ) {
492 template<
typename MT
495 inline typename Rows<MT,
true,
true,SF,CRAs...>
::Reference 496 Rows<MT,true,true,SF,CRAs...>::operator()(
size_t i,
size_t j )
501 return matrix_(idx(i),j);
518 template<
typename MT
522 Rows<MT,true,true,SF,CRAs...>::operator()(
size_t i,
size_t j )
const 527 return const_cast<const MT&
>( matrix_ )(idx(i),j);
545 template<
typename MT
548 inline typename Rows<MT,
true,
true,SF,CRAs...>
::Reference 549 Rows<MT,true,true,SF,CRAs...>::at(
size_t i,
size_t j )
575 template<
typename MT
579 Rows<MT,true,true,SF,CRAs...>::at(
size_t i,
size_t j )
const 603 template<
typename MT
606 inline typename Rows<MT,
true,
true,SF,CRAs...>::Pointer
609 return matrix_.data( idx(0UL) );
625 template<
typename MT
628 inline typename Rows<MT,
true,
true,SF,CRAs...>::ConstPointer
631 return matrix_.data( idx(0UL) );
646 template<
typename MT
649 inline typename Rows<MT,
true,
true,SF,CRAs...>::Pointer
652 return matrix_.data( idx(i) );
667 template<
typename MT
670 inline typename Rows<MT,
true,
true,SF,CRAs...>::ConstPointer
673 return matrix_.data( idx(i) );
688 template<
typename MT
691 inline typename Rows<MT,
true,
true,SF,CRAs...>
::Iterator 695 return matrix_.begin( idx(i) );
710 template<
typename MT
717 return matrix_.cbegin( idx(i) );
732 template<
typename MT
739 return matrix_.cbegin( idx(i) );
754 template<
typename MT
757 inline typename Rows<MT,
true,
true,SF,CRAs...>
::Iterator 761 return matrix_.end( idx(i) );
776 template<
typename MT
783 return matrix_.cend( idx(i) );
798 template<
typename MT
805 return matrix_.cend( idx(i) );
830 template<
typename MT
833 inline Rows<MT,
true,
true,SF,CRAs...>&
834 Rows<MT,true,true,SF,CRAs...>::operator=(
const ElementType& rhs )
836 for(
size_t i=0UL; i<
rows(); ++i ) {
862 template<
typename MT
865 inline Rows<MT,
true,
true,SF,CRAs...>&
866 Rows<MT,true,true,SF,CRAs...>::operator=( initializer_list< initializer_list<ElementType> > list )
871 if( list.size() !=
rows() ) {
875 if( IsRestricted<MT>::value ) {
877 for(
const auto& rowList : list ) {
878 const InitializerVector<ElementType> tmp( rowList,
columns() );
879 if( !tryAssign(
row( matrix_, idx(i),
unchecked ), tmp, 0UL ) ){
886 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
889 for(
const auto& rowList : list ) {
890 std::fill( std::copy( rowList.begin(), rowList.end(), left.begin(i) ), left.end(i),
ElementType() );
915 template<
typename MT
918 inline Rows<MT,
true,
true,SF,CRAs...>&
919 Rows<MT,true,true,SF,CRAs...>::operator=(
const Rows& rhs )
927 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && idces() == rhs.idces() ) )
930 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
934 if( IsRestricted<MT>::value ) {
935 for(
size_t i=0UL; i<
rows(); ++i ) {
942 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
944 if( rhs.canAlias( &matrix_ ) ) {
975 template<
typename MT
978 template<
typename MT2
980 inline Rows<MT,
true,
true,SF,CRAs...>&
981 Rows<MT,true,true,SF,CRAs...>::operator=(
const Matrix<MT2,SO2>& rhs )
992 using Right = If_< IsRestricted<MT>, CompositeType_<MT2>,
const MT2& >;
995 if( IsRestricted<MT>::value ) {
996 for(
size_t i=0UL; i<
rows(); ++i ) {
1003 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1005 if( IsSparseMatrix<MT2>::value ) {
1009 if( IsReference<Right>::value && right.canAlias( &matrix_ ) ) {
1010 const ResultType_<MT2> tmp( right );
1039 template<
typename MT
1042 template<
typename MT2
1044 inline DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows<MT,
true,
true,SF,CRAs...>& >
1054 using AddType = AddTrait_< ResultType, ResultType_<MT2> >;
1063 if( IsRestricted<MT>::value ) {
1064 for(
size_t i=0UL; i<
rows(); ++i ) {
1071 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1073 if( (~rhs).canAlias( &matrix_ ) ) {
1074 const AddType tmp( *
this + (~rhs) );
1103 template<
typename MT
1106 template<
typename MT2
1108 inline EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows<MT,
true,
true,SF,CRAs...>& >
1118 using AddType = AddTrait_< ResultType, ResultType_<MT2> >;
1127 const AddType tmp( *
this + (~rhs) );
1129 if( IsRestricted<MT>::value ) {
1130 for(
size_t i=0UL; i<
rows(); ++i ) {
1137 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1163 template<
typename MT
1166 template<
typename MT2
1168 inline DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows<MT,
true,
true,SF,CRAs...>& >
1178 using SubType = SubTrait_< ResultType, ResultType_<MT2> >;
1187 if( IsRestricted<MT>::value ) {
1188 for(
size_t i=0UL; i<
rows(); ++i ) {
1195 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1197 if( (~rhs).canAlias( &matrix_ ) ) {
1198 const SubType tmp( *
this - (~rhs ) );
1227 template<
typename MT
1230 template<
typename MT2
1232 inline EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows<MT,
true,
true,SF,CRAs...>& >
1242 using SubType = SubTrait_< ResultType, ResultType_<MT2> >;
1251 const SubType tmp( *
this - (~rhs) );
1253 if( IsRestricted<MT>::value ) {
1254 for(
size_t i=0UL; i<
rows(); ++i ) {
1261 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1287 template<
typename MT
1290 template<
typename MT2
1292 inline DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows<MT,
true,
true,SF,CRAs...>& >
1293 Rows<MT,true,true,SF,CRAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
1302 using SchurType = SchurTrait_< ResultType, ResultType_<MT2> >;
1310 if( IsRestricted<MT>::value ) {
1311 for(
size_t i=0UL; i<
rows(); ++i ) {
1318 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1320 if( (~rhs).canAlias( &matrix_ ) ) {
1321 const SchurType tmp( *
this % (~rhs) );
1322 if( IsSparseMatrix<SchurType>::value )
1352 template<
typename MT
1355 template<
typename MT2
1357 inline EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows<MT,
true,
true,SF,CRAs...>& >
1358 Rows<MT,true,true,SF,CRAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
1367 using SchurType = SchurTrait_< ResultType, ResultType_<MT2> >;
1375 const SchurType tmp( *
this % (~rhs) );
1377 if( IsRestricted<MT>::value ) {
1378 for(
size_t i=0UL; i<
rows(); ++i ) {
1385 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1387 if( IsSparseMatrix<SchurType>::value ) {
1415 template<
typename MT
1418 inline MT& Rows<MT,true,true,SF,CRAs...>::operand() noexcept
1432 template<
typename MT
1435 inline const MT& Rows<MT,true,true,SF,CRAs...>::operand() const noexcept
1449 template<
typename MT
1454 return matrix_.columns();
1469 template<
typename MT
1474 return matrix_.spacing();
1486 template<
typename MT
1506 template<
typename MT
1527 template<
typename MT
1532 size_t nonzeros( 0UL );
1534 for(
size_t i=0UL; i<
rows(); ++i ) {
1535 nonzeros += matrix_.nonZeros( idx(i) );
1553 template<
typename MT
1560 return matrix_.nonZeros( idx(i) );
1572 template<
typename MT
1577 for(
size_t i=0UL; i<
rows(); ++i ) {
1578 matrix_.reset( idx(i) );
1594 template<
typename MT
1599 matrix_.reset( idx(i) );
1626 template<
typename MT
1629 inline Rows<MT,
true,
true,SF,CRAs...>&
1641 if( IsRestricted<MT>::value ) {
1642 for(
size_t i=0UL; i<
rows(); ++i ) {
1643 if( !tryAssign( matrix_,
row( tmp, i ), idx(i), 0UL ) ) {
1649 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1672 template<
typename MT
1675 inline Rows<MT,
true,
true,SF,CRAs...>&
1687 if( IsRestricted<MT>::value ) {
1688 for(
size_t i=0UL; i<
rows(); ++i ) {
1689 if( !tryAssign( matrix_,
row( tmp, i ), idx(i), 0UL ) ) {
1695 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1718 template<
typename MT
1721 template<
typename Other >
1722 inline Rows<MT,
true,
true,SF,CRAs...>&
1723 Rows<MT,true,true,SF,CRAs...>::scale(
const Other& scalar )
1729 for(
size_t i=0UL; i<
rows(); ++i )
1731 const size_t index ( idx(i) );
1732 const size_t jbegin( IsUpper<MT>::value ? ( IsStrictlyUpper<MT>::value ? index+1UL : index ) : 0UL );
1733 const size_t jend ( IsLower<MT>::value ? ( IsStrictlyLower<MT>::value ? index : index+1UL ) :
columns() );
1735 for(
size_t j=jbegin; j<jend; ++j ) {
1736 matrix_(index,j) *= scalar;
1765 template<
typename MT
1768 template<
typename Other >
1769 inline bool Rows<MT,true,true,SF,CRAs...>::canAlias(
const Other* alias )
const noexcept
1771 return matrix_.isAliased( alias );
1789 template<
typename MT
1792 template<
typename MT2
1797 Rows<MT,true,true,SF,CRAs...>::canAlias(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
1799 return matrix_.isAliased( &alias->matrix_ );
1816 template<
typename MT
1819 template<
typename Other >
1820 inline bool Rows<MT,true,true,SF,CRAs...>::isAliased(
const Other* alias )
const noexcept
1822 return matrix_.isAliased( alias );
1840 template<
typename MT
1843 template<
typename MT2
1848 Rows<MT,true,true,SF,CRAs...>::isAliased(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
1850 return matrix_.isAliased( &alias->matrix_ );
1866 template<
typename MT
1869 inline bool Rows<MT,true,true,SF,CRAs...>::isAligned() const noexcept
1871 return matrix_.isAligned();
1888 template<
typename MT
1891 inline bool Rows<MT,true,true,SF,CRAs...>::canSMPAssign() const noexcept
1893 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
1914 template<
typename MT
1918 Rows<MT,true,true,SF,CRAs...>::load(
size_t i,
size_t j )
const noexcept
1920 return matrix_.load( idx(i), j );
1941 template<
typename MT
1947 return matrix_.loada( idx(i), j );
1968 template<
typename MT
1974 return matrix_.loadu( idx(i), j );
1996 template<
typename MT
2000 Rows<MT,true,true,SF,CRAs...>::store(
size_t i,
size_t j,
const SIMDType& value ) noexcept
2002 matrix_.store( idx(i), j, value );
2024 template<
typename MT
2030 matrix_.storea( idx(i), j, value );
2052 template<
typename MT
2058 matrix_.storeu( idx(i), j, value );
2080 template<
typename MT
2086 matrix_.stream( idx(i), j, value );
2104 template<
typename MT
2107 template<
typename MT2 >
2108 inline DisableIf_<
typename Rows<MT,
true,
true,SF,CRAs...>::BLAZE_TEMPLATE VectorizedAssign<MT2> >
2109 Rows<MT,true,true,SF,CRAs...>::assign(
const DenseMatrix<MT2,false>& rhs )
2117 const size_t jpos(
columns() &
size_t(-2) );
2120 for(
size_t i=0UL; i<
rows(); ++i ) {
2121 const size_t index( idx(i) );
2122 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2123 matrix_(index,j ) = (~rhs)(i,j );
2124 matrix_(index,j+1UL) = (~rhs)(i,j+1UL);
2127 matrix_(index,jpos) = (~rhs)(i,jpos);
2147 template<
typename MT
2150 template<
typename MT2 >
2151 inline EnableIf_<
typename Rows<MT,
true,
true,SF,CRAs...>::BLAZE_TEMPLATE VectorizedAssign<MT2> >
2152 Rows<MT,true,true,SF,CRAs...>::assign(
const DenseMatrix<MT2,false>& rhs )
2162 const size_t jpos(
columns() &
size_t(-SIMDSIZE) );
2167 !(~rhs).isAliased( &matrix_ ) )
2169 for(
size_t i=0UL; i<
rows(); ++i )
2173 ConstIterator_<MT2> right( (~rhs).
begin(i) );
2175 for( ; j<jpos; j+=SIMDSIZE ) {
2176 left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2185 for(
size_t i=0UL; i<
rows(); ++i )
2189 ConstIterator_<MT2> right( (~rhs).
begin(i) );
2191 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2192 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
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;
2197 for( ; j<jpos; j+=SIMDSIZE ) {
2198 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2201 *left = *right; ++left; ++right;
2222 template<
typename MT
2225 template<
typename MT2 >
2226 inline void Rows<MT,true,true,SF,CRAs...>::assign(
const DenseMatrix<MT2,true>& rhs )
2236 constexpr
size_t block( BLOCK_SIZE );
2240 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
2241 for(
size_t i=0UL; i<
rows(); ++i ) {
2242 const size_t index( idx(i) );
2243 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2244 matrix_(index,j ) = (~rhs)(i,j );
2245 matrix_(index,j+1UL) = (~rhs)(i,j+1UL);
2247 if( jpos < (~rhs).columns() ) {
2248 matrix_(index,jpos) = (~rhs)(i,jpos);
2254 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2255 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2256 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2257 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2258 for(
size_t i=ii; i<iend; ++i ) {
2259 const size_t index( idx(i) );
2260 for(
size_t j=jj; j<jend; ++j ) {
2261 matrix_(index,j) = (~rhs)(i,j);
2284 template<
typename MT
2287 template<
typename MT2 >
2288 inline void Rows<MT,true,true,SF,CRAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
2296 for(
size_t i=0UL; i<
rows(); ++i ) {
2297 const size_t index( idx(i) );
2298 for( ConstIterator_<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2299 matrix_(index,element->index()) = element->value();
2318 template<
typename MT
2321 template<
typename MT2 >
2322 inline void Rows<MT,true,true,SF,CRAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
2332 for(
size_t j=0UL; j<
columns(); ++j ) {
2333 for( ConstIterator_<MT2> element=(~rhs).begin(j); element!=(~rhs).
end(j); ++element )
2334 matrix_(idx(element->index()),j) = element->value();
2353 template<
typename MT
2356 template<
typename MT2 >
2357 inline DisableIf_<
typename Rows<MT,
true,
true,SF,CRAs...>::BLAZE_TEMPLATE VectorizedAddAssign<MT2> >
2358 Rows<MT,true,true,SF,CRAs...>::addAssign(
const DenseMatrix<MT2,false>& rhs )
2366 const size_t jpos(
columns() &
size_t(-2) );
2369 for(
size_t i=0UL; i<
rows(); ++i )
2371 const size_t index( idx(i) );
2372 if( IsDiagonal<MT2>::value ) {
2373 matrix_(index,i) += (~rhs)(i,i);
2376 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2377 matrix_(index,j ) += (~rhs)(i,j );
2378 matrix_(index,j+1UL) += (~rhs)(i,j+1UL);
2381 matrix_(index,jpos) += (~rhs)(i,jpos);
2402 template<
typename MT
2405 template<
typename MT2 >
2406 inline EnableIf_<
typename Rows<MT,
true,
true,SF,CRAs...>::BLAZE_TEMPLATE VectorizedAddAssign<MT2> >
2407 Rows<MT,true,true,SF,CRAs...>::addAssign(
const DenseMatrix<MT2,false>& rhs )
2417 for(
size_t i=0UL; i<
rows(); ++i )
2419 const size_t jbegin( ( IsUpper<MT2>::value )
2420 ?( ( IsStrictlyUpper<MT2>::value ? i+1UL : i ) &
size_t(-SIMDSIZE) )
2422 const size_t jend ( ( IsLower<MT2>::value )
2423 ?( IsStrictlyLower<MT2>::value ? i : i+1UL )
2427 const size_t jpos( jend &
size_t(-SIMDSIZE) );
2432 ConstIterator_<MT2> right( (~rhs).
begin(i) + jbegin );
2434 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2435 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2436 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2437 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2438 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2440 for( ; j<jpos; j+=SIMDSIZE ) {
2441 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2443 for( ; j<jend; ++j ) {
2444 *left += *right; ++left; ++right;
2464 template<
typename MT
2467 template<
typename MT2 >
2468 inline void Rows<MT,true,true,SF,CRAs...>::addAssign(
const DenseMatrix<MT2,true>& rhs )
2478 constexpr
size_t block( BLOCK_SIZE );
2482 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
2483 for(
size_t i=0UL; i<
rows(); ++i ) {
2484 const size_t index( idx(i) );
2485 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2486 matrix_(index,j ) += (~rhs)(i,j );
2487 matrix_(index,j+1UL) += (~rhs)(i,j+1UL);
2489 if( jpos < (~rhs).columns() ) {
2490 matrix_(index,jpos) += (~rhs)(i,jpos);
2496 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2497 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2498 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2499 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2500 for(
size_t i=ii; i<iend; ++i ) {
2501 const size_t index( idx(i) );
2502 for(
size_t j=jj; j<jend; ++j ) {
2503 matrix_(index,j) += (~rhs)(i,j);
2526 template<
typename MT
2529 template<
typename MT2 >
2530 inline void Rows<MT,true,true,SF,CRAs...>::addAssign(
const SparseMatrix<MT2,false>& rhs )
2538 for(
size_t i=0UL; i<
rows(); ++i ) {
2539 const size_t index( idx(i) );
2540 for( ConstIterator_<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2541 matrix_(index,element->index()) += element->value();
2560 template<
typename MT
2563 template<
typename MT2 >
2564 inline void Rows<MT,true,true,SF,CRAs...>::addAssign(
const SparseMatrix<MT2,true>& rhs )
2574 for(
size_t j=0UL; j<
columns(); ++j ) {
2575 for( ConstIterator_<MT2> element=(~rhs).begin(j); element!=(~rhs).
end(j); ++element )
2576 matrix_(idx(element->index()),j) += element->value();
2595 template<
typename MT
2598 template<
typename MT2 >
2599 inline DisableIf_<
typename Rows<MT,
true,
true,SF,CRAs...>::BLAZE_TEMPLATE VectorizedSubAssign<MT2> >
2600 Rows<MT,true,true,SF,CRAs...>::subAssign(
const DenseMatrix<MT2,false>& rhs )
2608 const size_t jpos(
columns() &
size_t(-2) );
2611 for(
size_t i=0UL; i<
rows(); ++i )
2613 const size_t index( idx(i) );
2615 if( IsDiagonal<MT2>::value ) {
2616 matrix_(index,i) -= (~rhs)(i,i);
2619 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2620 matrix_(index,j ) -= (~rhs)(i,j );
2621 matrix_(index,j+1UL) -= (~rhs)(i,j+1UL);
2624 matrix_(index,jpos) -= (~rhs)(i,jpos);
2645 template<
typename MT
2648 template<
typename MT2 >
2649 inline EnableIf_<
typename Rows<MT,
true,
true,SF,CRAs...>::BLAZE_TEMPLATE VectorizedSubAssign<MT2> >
2650 Rows<MT,true,true,SF,CRAs...>::subAssign(
const DenseMatrix<MT2,false>& rhs )
2660 for(
size_t i=0UL; i<
rows(); ++i )
2662 const size_t jbegin( ( IsUpper<MT2>::value )
2663 ?( ( IsStrictlyUpper<MT2>::value ? i+1UL : i ) &
size_t(-SIMDSIZE) )
2665 const size_t jend ( ( IsLower<MT2>::value )
2666 ?( IsStrictlyLower<MT2>::value ? i : i+1UL )
2670 const size_t jpos( jend &
size_t(-SIMDSIZE) );
2675 ConstIterator_<MT2> right( (~rhs).
begin(i) + jbegin );
2677 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2678 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2679 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2680 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2681 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2683 for( ; j<jpos; j+=SIMDSIZE ) {
2684 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2686 for( ; j<jend; ++j ) {
2687 *left -= *right; ++left; ++right;
2707 template<
typename MT
2710 template<
typename MT2 >
2711 inline void Rows<MT,true,true,SF,CRAs...>::subAssign(
const DenseMatrix<MT2,true>& rhs )
2721 constexpr
size_t block( BLOCK_SIZE );
2725 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
2726 for(
size_t i=0UL; i<
rows(); ++i ) {
2727 const size_t index( idx(i) );
2728 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2729 matrix_(index,j ) -= (~rhs)(i,j );
2730 matrix_(index,j+1UL) -= (~rhs)(i,j+1UL);
2732 if( jpos < (~rhs).columns() ) {
2733 matrix_(index,jpos) -= (~rhs)(i,jpos);
2739 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2740 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2741 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2742 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2743 for(
size_t i=ii; i<iend; ++i ) {
2744 const size_t index( idx(i) );
2745 for(
size_t j=jj; j<jend; ++j ) {
2746 matrix_(index,j) -= (~rhs)(i,j);
2769 template<
typename MT
2772 template<
typename MT2 >
2773 inline void Rows<MT,true,true,SF,CRAs...>::subAssign(
const SparseMatrix<MT2,false>& rhs )
2781 for(
size_t i=0UL; i<
rows(); ++i ) {
2782 const size_t index( idx(i) );
2783 for( ConstIterator_<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
2784 matrix_(index,element->index()) -= element->value();
2803 template<
typename MT
2806 template<
typename MT2 >
2807 inline void Rows<MT,true,true,SF,CRAs...>::subAssign(
const SparseMatrix<MT2,true>& rhs )
2817 for(
size_t j=0UL; j<
columns(); ++j ) {
2818 for( ConstIterator_<MT2> element=(~rhs).begin(j); element!=(~rhs).
end(j); ++element )
2819 matrix_(idx(element->index()),j) -= element->value();
2838 template<
typename MT
2841 template<
typename MT2 >
2842 inline DisableIf_<
typename Rows<MT,
true,
true,SF,CRAs...>::BLAZE_TEMPLATE VectorizedSchurAssign<MT2> >
2843 Rows<MT,true,true,SF,CRAs...>::schurAssign(
const DenseMatrix<MT2,false>& rhs )
2851 const size_t jpos(
columns() &
size_t(-2) );
2854 for(
size_t i=0UL; i<
rows(); ++i ) {
2855 const size_t index( idx(i) );
2856 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2857 matrix_(index,j ) *= (~rhs)(i,j );
2858 matrix_(index,j+1UL) *= (~rhs)(i,j+1UL);
2861 matrix_(index,jpos) *= (~rhs)(i,jpos);
2881 template<
typename MT
2884 template<
typename MT2 >
2885 inline EnableIf_<
typename Rows<MT,
true,
true,SF,CRAs...>::BLAZE_TEMPLATE VectorizedSchurAssign<MT2> >
2886 Rows<MT,true,true,SF,CRAs...>::schurAssign(
const DenseMatrix<MT2,false>& rhs )
2896 for(
size_t i=0UL; i<
rows(); ++i )
2898 const size_t jpos(
columns() &
size_t(-SIMDSIZE) );
2903 ConstIterator_<MT2> right( (~rhs).
begin(i) );
2905 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
2906 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2907 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2908 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2909 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2911 for( ; j<jpos; j+=SIMDSIZE ) {
2912 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2915 *left *= *right; ++left; ++right;
2935 template<
typename MT
2938 template<
typename MT2 >
2939 inline void Rows<MT,true,true,SF,CRAs...>::schurAssign(
const DenseMatrix<MT2,true>& rhs )
2949 constexpr
size_t block( BLOCK_SIZE );
2953 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
2954 for(
size_t i=0UL; i<
rows(); ++i ) {
2955 const size_t index( idx(i) );
2956 for(
size_t j=0UL; j<jpos; j+=2UL ) {
2957 matrix_(index,j ) *= (~rhs)(i,j );
2958 matrix_(index,j+1UL) *= (~rhs)(i,j+1UL);
2960 if( jpos < (~rhs).columns() ) {
2961 matrix_(index,jpos) *= (~rhs)(i,jpos);
2967 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2968 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2969 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2970 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2971 for(
size_t i=ii; i<iend; ++i ) {
2972 const size_t index( idx(i) );
2973 for(
size_t j=jj; j<jend; ++j ) {
2974 matrix_(index,j) *= (~rhs)(i,j);
2997 template<
typename MT
3000 template<
typename MT2 >
3001 inline void Rows<MT,true,true,SF,CRAs...>::schurAssign(
const SparseMatrix<MT2,false>& rhs )
3011 for(
size_t i=0UL; i<
rows(); ++i )
3013 const size_t index( idx(i) );
3016 for( ConstIterator_<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element ) {
3017 for( ; j<element->index(); ++j )
3018 reset( matrix_(index,j) );
3019 matrix_(index,j) *= element->value();
3024 reset( matrix_(index,j) );
3044 template<
typename MT
3047 template<
typename MT2 >
3048 inline void Rows<MT,true,true,SF,CRAs...>::schurAssign(
const SparseMatrix<MT2,true>& rhs )
3060 for(
size_t j=0UL; j<
columns(); ++j )
3064 for( ConstIterator_<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element ) {
3065 for( ; i<element->index(); ++i )
3066 reset( matrix_(idx(i),j) );
3067 matrix_(idx(i),j) *= element->value();
3071 for( ; i<
rows(); ++i ) {
3072 reset( matrix_(idx(i),j) );
3100 template<
typename MT
3102 class Rows<MT,false,true,false,CRAs...>
3103 :
public View< DenseMatrix< Rows<MT,false,true,false,CRAs...>, false > >
3104 ,
private RowsData<CRAs...>
3108 using DataType = RowsData<CRAs...>;
3109 using Operand = If_< IsExpression<MT>, MT, MT& >;
3115 using This = Rows<MT,
false,
true,
false,CRAs...>;
3117 using BaseType = DenseMatrix<This,false>;
3118 using ViewedType = MT;
3127 using ConstReference = ConstReference_<MT>;
3133 using ConstPointer = ConstPointer_<MT>;
3136 using Pointer = If_< Or< IsConst<MT>, Not< HasMutableDataAccess<MT> > >, ConstPointer, Pointer_<MT> >;
3142 template<
typename MatrixType
3143 ,
typename IteratorType >
3149 using IteratorCategory =
typename std::iterator_traits<IteratorType>::iterator_category;
3152 using ValueType =
typename std::iterator_traits<IteratorType>::value_type;
3155 using PointerType =
typename std::iterator_traits<IteratorType>::pointer;
3158 using ReferenceType =
typename std::iterator_traits<IteratorType>::reference;
3161 using DifferenceType =
typename std::iterator_traits<IteratorType>::difference_type;
3164 using iterator_category = IteratorCategory;
3165 using value_type = ValueType;
3166 using pointer = PointerType;
3167 using reference = ReferenceType;
3168 using difference_type = DifferenceType;
3174 inline RowsIterator() noexcept
3175 : matrix_(
nullptr )
3189 inline RowsIterator( MatrixType& matrix,
size_t row,
size_t column ) noexcept
3190 : matrix_( &matrix )
3195 if( column_ != matrix_->columns() )
3196 pos_ = matrix_->begin( column_ ) + row_;
3205 template<
typename MatrixType2,
typename IteratorType2 >
3206 inline RowsIterator(
const RowsIterator<MatrixType2,IteratorType2>& it ) noexcept
3207 : matrix_( it.matrix_ )
3209 , column_( it.column_ )
3220 inline RowsIterator&
operator+=(
size_t inc ) noexcept {
3223 if( column_ != matrix_->columns() )
3224 pos_ = matrix_->begin( column_ ) + row_;
3236 inline RowsIterator&
operator-=(
size_t dec ) noexcept {
3239 if( column_ != matrix_->columns() )
3240 pos_ = matrix_->begin( column_ ) + row_;
3251 inline RowsIterator& operator++() noexcept {
3254 if( column_ != matrix_->columns() )
3255 pos_ = matrix_->begin( column_ ) + row_;
3266 inline const RowsIterator operator++(
int ) noexcept {
3267 const RowsIterator tmp( *
this );
3278 inline RowsIterator& operator--() noexcept {
3281 if( column_ != matrix_->columns() )
3282 pos_ = matrix_->begin( column_ ) + row_;
3293 inline const RowsIterator operator--(
int ) noexcept {
3294 const RowsIterator tmp( *
this );
3306 inline ReferenceType operator[](
size_t index )
const {
3308 const IteratorType pos( matrix_->begin( column_+index ) + row_ );
3318 inline ReferenceType
operator*()
const {
3328 inline PointerType operator->()
const {
3339 template<
typename MatrixType2,
typename IteratorType2 >
3340 inline bool operator==(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3341 return column_ == rhs.column_;
3351 template<
typename MatrixType2,
typename IteratorType2 >
3352 inline bool operator!=(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3353 return !( *
this == rhs );
3363 template<
typename MatrixType2,
typename IteratorType2 >
3364 inline bool operator<( const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3365 return column_ < rhs.column_;
3375 template<
typename MatrixType2,
typename IteratorType2 >
3376 inline bool operator>(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3377 return column_ > rhs.column_;
3387 template<
typename MatrixType2,
typename IteratorType2 >
3388 inline bool operator<=( const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3389 return column_ <= rhs.column_;
3399 template<
typename MatrixType2,
typename IteratorType2 >
3400 inline bool operator>=(
const RowsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3401 return column_ >= rhs.column_;
3411 inline DifferenceType
operator-(
const RowsIterator& rhs )
const noexcept {
3412 return column_ - rhs.column_;
3423 friend inline const RowsIterator
operator+(
const RowsIterator& it,
size_t inc ) noexcept {
3424 return RowsIterator( *it.matrix_, it.row_, it.column_+inc );
3435 friend inline const RowsIterator
operator+(
size_t inc,
const RowsIterator& it ) noexcept {
3436 return RowsIterator( *it.matrix_, it.row_, it.column_+inc );
3447 friend inline const RowsIterator
operator-(
const RowsIterator& it,
size_t dec ) noexcept {
3448 return RowsIterator( *it.matrix_, it.row_, it.column_-dec );
3454 MatrixType* matrix_;
3461 template<
typename MatrixType2,
typename IteratorType2 >
friend class RowsIterator;
3468 using ConstIterator = RowsIterator< const MT, ConstIterator_<MT> >;
3476 enum :
bool { simdEnabled =
false };
3479 enum :
bool { smpAssignable = MT::smpAssignable };
3485 template<
typename... RRAs >
3486 explicit inline Rows( MT& matrix, RRAs... args );
3488 inline Rows(
const Rows& ) =
default;
3489 inline Rows( Rows&& ) =
default;
3500 inline Reference operator()(
size_t i,
size_t j );
3501 inline ConstReference operator()(
size_t i,
size_t j )
const;
3502 inline Reference at(
size_t i,
size_t j );
3503 inline ConstReference at(
size_t i,
size_t j )
const;
3504 inline Pointer
data () noexcept;
3505 inline ConstPointer
data () const noexcept;
3506 inline Pointer
data (
size_t i ) noexcept;
3507 inline ConstPointer
data (
size_t i ) const noexcept;
3509 inline ConstIterator
begin (
size_t i ) const;
3510 inline ConstIterator
cbegin(
size_t i ) const;
3512 inline ConstIterator
end (
size_t i ) const;
3513 inline ConstIterator
cend (
size_t i ) const;
3521 inline Rows& operator=( initializer_list< initializer_list<
ElementType> > list );
3522 inline Rows& operator=( const Rows& rhs );
3524 template< typename MT2,
bool SO2 >
3525 inline Rows& operator=( const Matrix<MT2,SO2>& rhs );
3527 template< typename MT2,
bool SO2 >
3528 inline
DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows& >
3529 operator+=( const Matrix<MT2,SO2>& rhs );
3531 template< typename MT2,
bool SO2 >
3532 inline
EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows& >
3533 operator+=( const Matrix<MT2,SO2>& rhs );
3535 template< typename MT2,
bool SO2 >
3536 inline
DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows& >
3537 operator-=( const Matrix<MT2,SO2>& rhs );
3539 template< typename MT2,
bool SO2 >
3540 inline
EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows& >
3541 operator-=( const Matrix<MT2,SO2>& rhs );
3543 template< typename MT2,
bool SO2 >
3544 inline
DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows& >
3545 operator%=( const Matrix<MT2,SO2>& rhs );
3547 template< typename MT2,
bool SO2 >
3548 inline
EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows& >
3549 operator%=( const Matrix<MT2,SO2>& rhs );
3556 using DataType::idx;
3557 using DataType::idces;
3558 using DataType::
rows;
3560 inline MT& operand() noexcept;
3561 inline const MT& operand() const noexcept;
3563 inline
size_t columns() const noexcept;
3564 inline
size_t spacing() const noexcept;
3565 inline
size_t capacity() const noexcept;
3566 inline
size_t capacity(
size_t i ) const noexcept;
3568 inline
size_t nonZeros(
size_t i ) const;
3569 inline
void reset();
3570 inline
void reset(
size_t i );
3580 template< typename Other > inline Rows& scale( const Other& scalar );
3587 template< typename Other >
3588 inline
bool canAlias( const Other* alias ) const noexcept;
3590 template< typename MT2,
bool SO2,
bool SF2,
size_t... CRAs2 >
3591 inline
bool canAlias( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
3593 template< typename Other >
3594 inline
bool isAliased( const Other* alias ) const noexcept;
3596 template< typename MT2,
bool SO2,
bool SF2,
size_t... CRAs2 >
3597 inline
bool isAliased( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
3599 inline
bool isAligned () const noexcept;
3600 inline
bool canSMPAssign() const noexcept;
3602 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,false>& rhs );
3603 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,true>& rhs );
3604 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,false>& rhs );
3605 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,true>& rhs );
3607 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,false>& rhs );
3608 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,true>& rhs );
3609 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,false>& rhs );
3610 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,true>& rhs );
3612 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,false>& rhs );
3613 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,true>& rhs );
3614 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,false>& rhs );
3615 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,true>& rhs );
3617 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,false>& rhs );
3618 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,true>& rhs );
3619 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,false>& rhs );
3620 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,true>& rhs );
3633 template< typename MT2,
bool SO2,
bool DF2,
bool SF2,
size_t... CRAs2 > friend class Rows;
3673 template< typename MT
3675 template< typename... RRAs >
3676 inline Rows<MT,false,true,false,CRAs...>::Rows( MT& matrix, RRAs... args )
3677 : DataType( args... )
3678 , matrix_ ( matrix )
3680 if( !Contains< TypeList<RRAs...>,
Unchecked >::value ) {
3681 for(
size_t i=0UL; i<
rows(); ++i ) {
3682 if( matrix_.rows() <= idx(i) ) {
3711 template<
typename MT
3713 inline typename Rows<MT,
false,
true,
false,CRAs...>
::Reference 3714 Rows<MT,false,true,false,CRAs...>::operator()(
size_t i,
size_t j )
3719 return matrix_(idx(i),j);
3736 template<
typename MT
3739 Rows<MT,false,true,false,CRAs...>::operator()(
size_t i,
size_t j )
const 3744 return const_cast<const MT&
>( matrix_ )(idx(i),j);
3762 template<
typename MT
3764 inline typename Rows<MT,
false,
true,
false,CRAs...>
::Reference 3765 Rows<MT,false,true,false,CRAs...>::at(
size_t i,
size_t j )
3773 return (*
this)(i,j);
3791 template<
typename MT
3794 Rows<MT,false,true,false,CRAs...>::at(
size_t i,
size_t j )
const 3802 return (*
this)(i,j);
3818 template<
typename MT
3820 inline typename Rows<MT,
false,
true,
false,CRAs...>::Pointer
3823 return matrix_.data() + idx(0UL);
3839 template<
typename MT
3841 inline typename Rows<MT,
false,
true,
false,CRAs...>::ConstPointer
3844 return matrix_.data() + idx(0UL);
3859 template<
typename MT
3861 inline typename Rows<MT,
false,
true,
false,CRAs...>::Pointer
3864 return matrix_.data() + idx(i);
3879 template<
typename MT
3881 inline typename Rows<MT,
false,
true,
false,CRAs...>::ConstPointer
3884 return matrix_.data() + idx(i);
3899 template<
typename MT
3901 inline typename Rows<MT,
false,
true,
false,CRAs...>
::Iterator 3905 return Iterator( matrix_, idx(i), 0UL );
3920 template<
typename MT
3941 template<
typename MT
3962 template<
typename MT
3964 inline typename Rows<MT,
false,
true,
false,CRAs...>
::Iterator 3983 template<
typename MT
4004 template<
typename MT
4035 template<
typename MT
4037 inline Rows<MT,
false,
true,
false,CRAs...>&
4038 Rows<MT,false,true,false,CRAs...>::operator=(
const ElementType& rhs )
4040 for(
size_t i=0UL; i<
rows(); ++i ) {
4066 template<
typename MT
4068 inline Rows<MT,
false,
true,
false,CRAs...>&
4069 Rows<MT,false,true,false,CRAs...>::operator=( initializer_list< initializer_list<ElementType> > list )
4074 if( list.size() !=
rows() ) {
4078 if( IsRestricted<MT>::value ) {
4080 for(
const auto& rowList : list ) {
4081 const InitializerVector<ElementType> tmp( rowList,
columns() );
4082 if( !tryAssign(
row( matrix_, idx(i),
unchecked ), tmp, 0UL ) ){
4089 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4092 for(
const auto& rowList : list ) {
4093 std::fill( std::copy( rowList.begin(), rowList.end(), left.begin(i) ), left.end(i),
ElementType() );
4118 template<
typename MT
4120 inline Rows<MT,
false,
true,
false,CRAs...>&
4121 Rows<MT,false,true,false,CRAs...>::operator=(
const Rows& rhs )
4129 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && idces() == rhs.idces() ) )
4132 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
4136 if( IsRestricted<MT>::value ) {
4137 for(
size_t i=0UL; i<
rows(); ++i ) {
4144 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4146 if( rhs.canAlias( &matrix_ ) ) {
4177 template<
typename MT
4179 template<
typename MT2
4181 inline Rows<MT,
false,
true,
false,CRAs...>&
4182 Rows<MT,false,true,false,CRAs...>::operator=(
const Matrix<MT2,SO2>& rhs )
4193 using Right = If_< IsRestricted<MT>, CompositeType_<MT2>,
const MT2& >;
4194 Right right( ~rhs );
4196 if( IsRestricted<MT>::value ) {
4197 for(
size_t i=0UL; i<
rows(); ++i ) {
4204 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4206 if( IsSparseMatrix<MT2>::value ) {
4210 if( IsReference<Right>::value && right.canAlias( &matrix_ ) ) {
4211 const ResultType_<MT2> tmp( right );
4240 template<
typename MT
4242 template<
typename MT2
4244 inline DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows<MT,
false,
true,
false,CRAs...>& >
4254 using AddType = AddTrait_< ResultType, ResultType_<MT2> >;
4263 if( IsRestricted<MT>::value ) {
4264 for(
size_t i=0UL; i<
rows(); ++i ) {
4271 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4273 if( (~rhs).canAlias( &matrix_ ) ) {
4274 const AddType tmp( *
this + (~rhs) );
4303 template<
typename MT
4305 template<
typename MT2
4307 inline EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows<MT,
false,
true,
false,CRAs...>& >
4317 using AddType = AddTrait_< ResultType, ResultType_<MT2> >;
4326 const AddType tmp( *
this + (~rhs) );
4328 if( IsRestricted<MT>::value ) {
4329 for(
size_t i=0UL; i<
rows(); ++i ) {
4336 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4362 template<
typename MT
4364 template<
typename MT2
4366 inline DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows<MT,
false,
true,
false,CRAs...>& >
4376 using SubType = SubTrait_< ResultType, ResultType_<MT2> >;
4385 if( IsRestricted<MT>::value ) {
4386 for(
size_t i=0UL; i<
rows(); ++i ) {
4393 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4395 if( (~rhs).canAlias( &matrix_ ) ) {
4396 const SubType tmp( *
this - (~rhs ) );
4425 template<
typename MT
4427 template<
typename MT2
4429 inline EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows<MT,
false,
true,
false,CRAs...>& >
4439 using SubType = SubTrait_< ResultType, ResultType_<MT2> >;
4448 const SubType tmp( *
this - (~rhs) );
4450 if( IsRestricted<MT>::value ) {
4451 for(
size_t i=0UL; i<
rows(); ++i ) {
4458 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4484 template<
typename MT
4486 template<
typename MT2
4488 inline DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows<MT,
false,
true,
false,CRAs...>& >
4489 Rows<MT,false,true,false,CRAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
4498 using SchurType = SchurTrait_< ResultType, ResultType_<MT2> >;
4506 if( IsRestricted<MT>::value ) {
4507 for(
size_t i=0UL; i<
rows(); ++i ) {
4514 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4516 if( (~rhs).canAlias( &matrix_ ) ) {
4517 const SchurType tmp( *
this % (~rhs) );
4518 if( IsSparseMatrix<SchurType>::value )
4548 template<
typename MT
4550 template<
typename MT2
4552 inline EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Rows<MT,
false,
true,
false,CRAs...>& >
4553 Rows<MT,false,true,false,CRAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
4562 using SchurType = SchurTrait_< ResultType, ResultType_<MT2> >;
4570 const SchurType tmp( *
this % (~rhs) );
4572 if( IsRestricted<MT>::value ) {
4573 for(
size_t i=0UL; i<
rows(); ++i ) {
4580 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4582 if( IsSparseMatrix<SchurType>::value ) {
4610 template<
typename MT
4612 inline MT& Rows<MT,false,true,false,CRAs...>::operand() noexcept
4626 template<
typename MT
4628 inline const MT& Rows<MT,false,true,false,CRAs...>::operand() const noexcept
4642 template<
typename MT
4646 return matrix_.columns();
4661 template<
typename MT
4665 return matrix_.spacing();
4677 template<
typename MT
4696 template<
typename MT
4716 template<
typename MT
4720 size_t nonzeros( 0UL );
4722 for(
size_t i=0UL; i<
rows(); ++i ) {
4741 template<
typename MT
4747 size_t nonzeros( 0UL );
4749 const size_t index( idx(i) );
4750 for(
size_t j=0UL; j<
columns(); ++j ) {
4767 template<
typename MT
4771 for(
size_t i=0UL; i<
rows(); ++i ) {
4788 template<
typename MT
4794 const size_t index( idx(i) );
4795 for(
size_t j=0UL; j<
columns(); ++j ) {
4796 reset( matrix_( index, j ) );
4824 template<
typename MT
4826 inline Rows<MT,
false,
true,
false,CRAs...>&
4838 if( IsRestricted<MT>::value ) {
4839 for(
size_t i=0UL; i<
rows(); ++i ) {
4840 if( !tryAssign( matrix_,
row( tmp, i ), idx(i), 0UL ) ) {
4846 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4869 template<
typename MT
4871 inline Rows<MT,
false,
true,
false,CRAs...>&
4883 if( IsRestricted<MT>::value ) {
4884 for(
size_t i=0UL; i<
rows(); ++i ) {
4885 if( !tryAssign( matrix_,
row( tmp, i ), idx(i), 0UL ) ) {
4891 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4914 template<
typename MT
4916 template<
typename Other >
4917 inline Rows<MT,
false,
true,
false,CRAs...>&
4918 Rows<MT,false,true,false,CRAs...>::scale(
const Other& scalar )
4924 for(
size_t i=0UL; i<
rows(); ++i )
4926 const size_t index ( idx(i) );
4927 const size_t jbegin( IsUpper<MT>::value ? ( IsStrictlyUpper<MT>::value ? index+1UL : index ) : 0UL );
4928 const size_t jend ( IsLower<MT>::value ? ( IsStrictlyLower<MT>::value ? index : index+1UL ) :
columns() );
4930 for(
size_t j=jbegin; j<jend; ++j ) {
4931 matrix_(index,j) *= scalar;
4960 template<
typename MT
4962 template<
typename Other >
4963 inline bool Rows<MT,false,true,false,CRAs...>::canAlias(
const Other* alias )
const noexcept
4965 return matrix_.isAliased( alias );
4983 template<
typename MT
4985 template<
typename MT2
4990 Rows<MT,false,true,false,CRAs...>::canAlias(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
4992 return matrix_.isAliased( &alias->matrix_ );
5009 template<
typename MT
5011 template<
typename Other >
5012 inline bool Rows<MT,false,true,false,CRAs...>::isAliased(
const Other* alias )
const noexcept
5014 return matrix_.isAliased( alias );
5032 template<
typename MT
5034 template<
typename MT2
5039 Rows<MT,false,true,false,CRAs...>::isAliased(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
5041 return matrix_.isAliased( &alias->matrix_ );
5057 template<
typename MT
5059 inline bool Rows<MT,false,true,false,CRAs...>::isAligned() const noexcept
5078 template<
typename MT
5080 inline bool Rows<MT,false,true,false,CRAs...>::canSMPAssign() const noexcept
5082 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
5100 template<
typename MT
5102 template<
typename MT2 >
5103 inline void Rows<MT,false,true,false,CRAs...>::assign(
const DenseMatrix<MT2,false>& rhs )
5111 const size_t jpos(
columns() &
size_t(-2) );
5114 for(
size_t i=0UL; i<
rows(); ++i ) {
5115 const size_t index( idx(i) );
5116 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5117 matrix_(index,j ) = (~rhs)(i,j );
5118 matrix_(index,j+1UL) = (~rhs)(i,j+1UL);
5121 matrix_(index,jpos) = (~rhs)(i,jpos);
5141 template<
typename MT
5143 template<
typename MT2 >
5144 inline void Rows<MT,false,true,false,CRAs...>::assign(
const DenseMatrix<MT2,true>& rhs )
5154 constexpr
size_t block( BLOCK_SIZE );
5158 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
5159 for(
size_t i=0UL; i<
rows(); ++i ) {
5160 const size_t index( idx(i) );
5161 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5162 matrix_(index,j ) = (~rhs)(i,j );
5163 matrix_(index,j+1UL) = (~rhs)(i,j+1UL);
5165 if( jpos < (~rhs).columns() )
5166 matrix_(index,jpos) = (~rhs)(i,jpos);
5171 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5172 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5173 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5174 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5175 for(
size_t i=ii; i<iend; ++i ) {
5176 const size_t index( idx(i) );
5177 for(
size_t j=jj; j<jend; ++j ) {
5178 matrix_(index,j) = (~rhs)(i,j);
5201 template<
typename MT
5203 template<
typename MT2 >
5204 inline void Rows<MT,false,true,false,CRAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
5212 for(
size_t i=0UL; i<
rows(); ++i ) {
5213 const size_t index( idx(i) );
5214 for( ConstIterator_<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5215 matrix_(index,element->index()) = element->value();
5234 template<
typename MT
5236 template<
typename MT2 >
5237 inline void Rows<MT,false,true,false,CRAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
5247 for(
size_t j=0UL; j<
columns(); ++j ) {
5248 for( ConstIterator_<MT2> element=(~rhs).begin(j); element!=(~rhs).
end(j); ++element )
5249 matrix_(idx(element->index()),j) = element->value();
5268 template<
typename MT
5270 template<
typename MT2 >
5271 inline void Rows<MT,false,true,false,CRAs...>::addAssign(
const DenseMatrix<MT2,false>& rhs )
5279 const size_t jpos(
columns() &
size_t(-2) );
5282 for(
size_t i=0UL; i<
rows(); ++i )
5284 const size_t index( idx(i) );
5285 if( IsDiagonal<MT2>::value ) {
5286 matrix_(index,i) += (~rhs)(i,i);
5289 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5290 matrix_(index,j ) += (~rhs)(i,j );
5291 matrix_(index,j+1UL) += (~rhs)(i,j+1UL);
5294 matrix_(index,jpos) += (~rhs)(i,jpos);
5315 template<
typename MT
5317 template<
typename MT2 >
5318 inline void Rows<MT,false,true,false,CRAs...>::addAssign(
const DenseMatrix<MT2,true>& rhs )
5328 constexpr
size_t block( BLOCK_SIZE );
5332 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
5333 for(
size_t i=0UL; i<
rows(); ++i ) {
5334 const size_t index( idx(i) );
5335 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5336 matrix_(index,j ) += (~rhs)(i,j );
5337 matrix_(index,j+1UL) += (~rhs)(i,j+1UL);
5339 if( jpos < (~rhs).columns() )
5340 matrix_(index,jpos) += (~rhs)(i,jpos);
5345 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5346 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5347 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5348 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5349 for(
size_t i=ii; i<iend; ++i ) {
5350 const size_t index( idx(i) );
5351 for(
size_t j=jj; j<jend; ++j ) {
5352 matrix_(index,j) += (~rhs)(i,j);
5375 template<
typename MT
5377 template<
typename MT2 >
5378 inline void Rows<MT,false,true,false,CRAs...>::addAssign(
const SparseMatrix<MT2,false>& rhs )
5386 for(
size_t i=0UL; i<
rows(); ++i ) {
5387 const size_t index( idx(i) );
5388 for( ConstIterator_<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5389 matrix_(index,element->index()) += element->value();
5408 template<
typename MT
5410 template<
typename MT2 >
5411 inline void Rows<MT,false,true,false,CRAs...>::addAssign(
const SparseMatrix<MT2,true>& rhs )
5421 for(
size_t j=0UL; j<
columns(); ++j ) {
5422 for( ConstIterator_<MT2> element=(~rhs).begin(j); element!=(~rhs).
end(j); ++element )
5423 matrix_(idx(element->index()),j) += element->value();
5442 template<
typename MT
5444 template<
typename MT2 >
5445 inline void Rows<MT,false,true,false,CRAs...>::subAssign(
const DenseMatrix<MT2,false>& rhs )
5453 const size_t jpos(
columns() &
size_t(-2) );
5456 for(
size_t i=0UL; i<
rows(); ++i )
5458 const size_t index( idx(i) );
5460 if( IsDiagonal<MT2>::value ) {
5461 matrix_(index,i) -= (~rhs)(i,i);
5464 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5465 matrix_(index,j ) -= (~rhs)(i,j );
5466 matrix_(index,j+1UL) -= (~rhs)(i,j+1UL);
5469 matrix_(index,jpos) -= (~rhs)(i,jpos);
5490 template<
typename MT
5492 template<
typename MT2 >
5493 inline void Rows<MT,false,true,false,CRAs...>::subAssign(
const DenseMatrix<MT2,true>& rhs )
5503 constexpr
size_t block( BLOCK_SIZE );
5507 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
5508 for(
size_t i=0UL; i<
rows(); ++i ) {
5509 const size_t index( idx(i) );
5510 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5511 matrix_(index,j ) -= (~rhs)(i,j );
5512 matrix_(index,j+1UL) -= (~rhs)(i,j+1UL);
5514 if( jpos < (~rhs).columns() )
5515 matrix_(index,jpos) -= (~rhs)(i,jpos);
5520 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5521 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5522 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5523 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5524 for(
size_t i=ii; i<iend; ++i ) {
5525 const size_t index( idx(i) );
5526 for(
size_t j=jj; j<jend; ++j ) {
5527 matrix_(index,j) -= (~rhs)(i,j);
5550 template<
typename MT
5552 template<
typename MT2 >
5553 inline void Rows<MT,false,true,false,CRAs...>::subAssign(
const SparseMatrix<MT2,false>& rhs )
5561 for(
size_t i=0UL; i<
rows(); ++i ) {
5562 const size_t index( idx(i) );
5563 for( ConstIterator_<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element )
5564 matrix_(index,element->index()) -= element->value();
5583 template<
typename MT
5585 template<
typename MT2 >
5586 inline void Rows<MT,false,true,false,CRAs...>::subAssign(
const SparseMatrix<MT2,true>& rhs )
5596 for(
size_t j=0UL; j<
columns(); ++j ) {
5597 for( ConstIterator_<MT2> element=(~rhs).begin(j); element!=(~rhs).
end(j); ++element )
5598 matrix_(idx(element->index()),j) -= element->value();
5617 template<
typename MT
5619 template<
typename MT2 >
5620 inline void Rows<MT,false,true,false,CRAs...>::schurAssign(
const DenseMatrix<MT2,false>& rhs )
5628 const size_t jpos(
columns() &
size_t(-2) );
5631 for(
size_t i=0UL; i<
rows(); ++i ) {
5632 const size_t index( idx(i) );
5633 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5634 matrix_(index,j ) *= (~rhs)(i,j );
5635 matrix_(index,j+1UL) *= (~rhs)(i,j+1UL);
5638 matrix_(index,jpos) *= (~rhs)(i,jpos);
5658 template<
typename MT
5660 template<
typename MT2 >
5661 inline void Rows<MT,false,true,false,CRAs...>::schurAssign(
const DenseMatrix<MT2,true>& rhs )
5671 constexpr
size_t block( BLOCK_SIZE );
5675 const size_t jpos( (~rhs).
columns() &
size_t(-2) );
5676 for(
size_t i=0UL; i<
rows(); ++i ) {
5677 const size_t index( idx(i) );
5678 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5679 matrix_(index,j ) *= (~rhs)(i,j );
5680 matrix_(index,j+1UL) *= (~rhs)(i,j+1UL);
5682 if( jpos < (~rhs).columns() )
5683 matrix_(index,jpos) *= (~rhs)(i,jpos);
5688 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5689 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5690 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5691 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5692 for(
size_t i=ii; i<iend; ++i ) {
5693 const size_t index( idx(i) );
5694 for(
size_t j=jj; j<jend; ++j ) {
5695 matrix_(index,j) *= (~rhs)(i,j);
5718 template<
typename MT
5720 template<
typename MT2 >
5721 inline void Rows<MT,false,true,false,CRAs...>::schurAssign(
const SparseMatrix<MT2,false>& rhs )
5731 for(
size_t i=0UL; i<
rows(); ++i )
5733 const size_t index( idx(i) );
5736 for( ConstIterator_<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element ) {
5737 for( ; j<element->index(); ++j )
5738 reset( matrix_(index,j) );
5739 matrix_(index,j) *= element->value();
5744 reset( matrix_(index,j) );
5764 template<
typename MT
5766 template<
typename MT2 >
5767 inline void Rows<MT,false,true,false,CRAs...>::schurAssign(
const SparseMatrix<MT2,true>& rhs )
5779 for(
size_t j=0UL; j<
columns(); ++j )
5783 for( ConstIterator_<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element ) {
5784 for( ; i<element->index(); ++i )
5785 reset( matrix_(idx(i),j) );
5786 matrix_(idx(i),j) *= element->value();
5790 for( ; i<
rows(); ++i ) {
5791 reset( matrix_(idx(i),j) );
5819 template<
typename MT
5821 class Rows<MT,false,true,true,CRAs...>
5822 :
public View< DenseMatrix< Rows<MT,false,true,true,CRAs...>, false > >
5823 ,
private RowsData<CRAs...>
5827 using DataType = RowsData<CRAs...>;
5828 using Operand = If_< IsExpression<MT>, MT, MT& >;
5834 using This = Rows<MT,
false,
true,
true,CRAs...>;
5836 using BaseType = DenseMatrix<This,false>;
5837 using ViewedType = MT;
5842 using SIMDType = SIMDTrait_<ElementType>;
5847 using ConstReference = ConstReference_<MT>;
5853 using ConstPointer = ConstPointer_<MT>;
5856 using Pointer = If_< Or< IsConst<MT>, Not< HasMutableDataAccess<MT> > >, ConstPointer, Pointer_<MT> >;
5859 using ConstIterator = ConstIterator_<MT>;
5867 enum :
bool { simdEnabled = MT::simdEnabled };
5870 enum :
bool { smpAssignable = MT::smpAssignable };
5876 template<
typename... RRAs >
5877 explicit inline Rows( MT& matrix, RRAs... args );
5879 inline Rows(
const Rows& ) =
default;
5880 inline Rows( Rows&& ) =
default;
5891 inline Reference operator()(
size_t i,
size_t j );
5892 inline ConstReference operator()(
size_t i,
size_t j )
const;
5893 inline Reference at(
size_t i,
size_t j );
5894 inline ConstReference at(
size_t i,
size_t j )
const;
5895 inline Pointer
data () noexcept;
5896 inline ConstPointer
data () const noexcept;
5897 inline Pointer
data (
size_t i ) noexcept;
5898 inline ConstPointer
data (
size_t i ) const noexcept;
5900 inline ConstIterator
begin (
size_t i ) const;
5901 inline ConstIterator
cbegin(
size_t i ) const;
5903 inline ConstIterator
end (
size_t i ) const;
5904 inline ConstIterator
cend (
size_t i ) const;
5913 Rows& operator=( const Rows& ) = delete;
5920 using DataType::idx;
5921 using DataType::idces;
5922 using DataType::rows;
5924 inline MT& operand() noexcept;
5925 inline const MT& operand() const noexcept;
5927 inline
size_t columns() const noexcept;
5928 inline
size_t spacing() const noexcept;
5929 inline
size_t capacity() const noexcept;
5930 inline
size_t capacity(
size_t i ) const noexcept;
5932 inline
size_t nonZeros(
size_t i ) const;
5933 inline
void reset();
5934 inline
void reset(
size_t i );
5941 template< typename Other >
5942 inline
bool canAlias( const Other* alias ) const noexcept;
5944 template< typename MT2,
bool SO2,
bool SF2,
size_t... CRAs2 >
5945 inline
bool canAlias( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
5947 template< typename Other >
5948 inline
bool isAliased( const Other* alias ) const noexcept;
5950 template< typename MT2,
bool SO2,
bool SF2,
size_t... CRAs2 >
5951 inline
bool isAliased( const Rows<MT2,SO2,true,SF2,CRAs2...>* alias ) const noexcept;
5953 inline
bool isAligned () const noexcept;
5954 inline
bool canSMPAssign() const noexcept;
5971 template< typename MT2,
bool SO2,
bool DF2,
bool SF2,
size_t... CRAs2 > friend class Rows;
6011 template< typename MT
6013 template< typename... RRAs >
6014 inline Rows<MT,false,true,true,CRAs...>::Rows( MT& matrix, RRAs... args )
6015 : DataType( args... )
6016 , matrix_ ( matrix )
6018 if( !Contains< TypeList<RRAs...>,
Unchecked >::value ) {
6019 for(
size_t i=0UL; i<
rows(); ++i ) {
6020 if( matrix_.rows() <= idx(i) ) {
6049 template<
typename MT
6051 inline typename Rows<MT,
false,
true,
true,CRAs...>
::Reference 6052 Rows<MT,false,true,true,CRAs...>::operator()(
size_t i,
size_t j )
6057 return matrix_(j,idx(i));
6074 template<
typename MT
6077 Rows<MT,false,true,true,CRAs...>::operator()(
size_t i,
size_t j )
const 6082 return const_cast<const MT&
>( matrix_ )(j,idx(i));
6100 template<
typename MT
6102 inline typename Rows<MT,
false,
true,
true,CRAs...>
::Reference 6103 Rows<MT,false,true,true,CRAs...>::at(
size_t i,
size_t j )
6111 return (*
this)(i,j);
6129 template<
typename MT
6132 Rows<MT,false,true,true,CRAs...>::at(
size_t i,
size_t j )
const 6140 return (*
this)(i,j);
6156 template<
typename MT
6158 inline typename Rows<MT,
false,
true,
true,CRAs...>::Pointer
6161 return matrix_.data( idx(0UL) );
6177 template<
typename MT
6179 inline typename Rows<MT,
false,
true,
true,CRAs...>::ConstPointer
6182 return matrix_.data( idx(0UL) );
6197 template<
typename MT
6199 inline typename Rows<MT,
false,
true,
true,CRAs...>::Pointer
6202 return matrix_.data( idx(i) );
6217 template<
typename MT
6219 inline typename Rows<MT,
false,
true,
true,CRAs...>::ConstPointer
6222 return matrix_.data( idx(i) );
6237 template<
typename MT
6239 inline typename Rows<MT,
false,
true,
true,CRAs...>
::Iterator 6243 return matrix_.begin( idx(i) );
6258 template<
typename MT
6264 return matrix_.cbegin( idx(i) );
6279 template<
typename MT
6285 return matrix_.cbegin( idx(i) );
6300 template<
typename MT
6302 inline typename Rows<MT,
false,
true,
true,CRAs...>
::Iterator 6306 return matrix_.end( idx(i) );
6321 template<
typename MT
6327 return matrix_.cend( idx(i) );
6342 template<
typename MT
6348 return matrix_.cend( idx(i) );
6373 template<
typename MT
6375 inline Rows<MT,
false,
true,
true,CRAs...>&
6376 Rows<MT,false,true,true,CRAs...>::operator=(
const ElementType& rhs )
6378 for(
size_t i=0UL; i<
rows(); ++i ) {
6402 template<
typename MT
6404 inline MT& Rows<MT,false,true,true,CRAs...>::operand() noexcept
6418 template<
typename MT
6420 inline const MT& Rows<MT,false,true,true,CRAs...>::operand() const noexcept
6434 template<
typename MT
6438 return matrix_.columns();
6453 template<
typename MT
6457 return matrix_.spacing();
6469 template<
typename MT
6488 template<
typename MT
6508 template<
typename MT
6512 size_t nonzeros( 0UL );
6514 for(
size_t i=0UL; i<
rows(); ++i ) {
6515 nonzeros += matrix_.nonZeros( idx(i) );
6533 template<
typename MT
6539 return matrix_.nonZeros( idx(i) );
6551 template<
typename MT
6555 for(
size_t i=0UL; i<
rows(); ++i ) {
6556 matrix_.reset( idx(i) );
6572 template<
typename MT
6576 matrix_.reset( idx(i) );
6601 template<
typename MT
6603 template<
typename Other >
6604 inline bool Rows<MT,false,true,true,CRAs...>::canAlias(
const Other* alias )
const noexcept
6606 return matrix_.isAliased( alias );
6624 template<
typename MT
6626 template<
typename MT2
6631 Rows<MT,false,true,true,CRAs...>::canAlias(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
6633 return matrix_.isAliased( &alias->matrix_ );
6650 template<
typename MT
6652 template<
typename Other >
6653 inline bool Rows<MT,false,true,true,CRAs...>::isAliased(
const Other* alias )
const noexcept
6655 return matrix_.isAliased( alias );
6673 template<
typename MT
6675 template<
typename MT2
6680 Rows<MT,false,true,true,CRAs...>::isAliased(
const Rows<MT2,SO2,true,SF2,CRAs2...>* alias )
const noexcept
6682 return matrix_.isAliased( &alias->matrix_ );
6698 template<
typename MT
6700 inline bool Rows<MT,false,true,true,CRAs...>::isAligned() const noexcept
6702 return matrix_.isAligned();
6719 template<
typename MT
6721 inline bool Rows<MT,false,true,true,CRAs...>::canSMPAssign() const noexcept
6723 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
6744 template<
typename MT
6747 Rows<MT,false,true,true,CRAs...>::load(
size_t i,
size_t j )
const noexcept
6749 return matrix_.load( j, idx(i) );
6770 template<
typename MT
6775 return matrix_.loada( j, idx(i) );
6796 template<
typename MT
6801 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:131
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:3077
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.
EnableIf_< IsDenseMatrix< MT1 > > smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:196
Header file for the subtraction trait.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:522
Header file for basic type definitions.
Header file for the View base class.
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:79
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:164
Header file for the IsSparseMatrix type trait.
Header file for the IsDiagonal type trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
#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
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3076
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:364
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3074
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
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:701
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3078
Header file for the And class template.
#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
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:827
#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:3083
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:560
#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 decltype(auto) workaround.
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:733
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3084
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
Header file for the RequiresEvaluation type trait.
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:133
BLAZE_ALWAYS_INLINE 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:474
BLAZE_ALWAYS_INLINE 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:408
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE 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.
Header file for the DisableIf class template.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3082
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:1359
Header file for nested template disabiguation.
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
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
#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
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:102
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3079
Header file for the Or class template.
#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:367
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:443
Header file for the Not class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:250
Header file for all SIMD functionality.
Header file for the IsLower type trait.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:506
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:80
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.
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:430
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:8893
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
typename RowsTrait< MT, CRAs... >::Type RowsTrait_
Auxiliary alias declaration for the RowsTrait type trait.The RowsTrait_ alias declaration provides a ...
Definition: RowsTrait.h:145
Constraint on the data type.
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< 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:75
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.
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:131
Header file for the reset shim.
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
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.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
Header file for the rows trait.
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:76
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:490
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
BLAZE_ALWAYS_INLINE MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:169
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
Constraint on the data type.
Header file for the implementation of the RowsData class template.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3081
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
#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.
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the implementation of the Rows base template.
Header file for the IsHermitian type trait.
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.
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:801