35 #ifndef _BLAZE_MATH_VIEWS_COLUMNS_DENSE_H_ 36 #define _BLAZE_MATH_VIEWS_COLUMNS_DENSE_H_ 120 template<
typename MT
123 class Columns<MT,true,true,SF,CCAs...>
124 :
public View< DenseMatrix< Columns<MT,true,true,SF,CCAs...>, true > >
125 ,
private ColumnsData<CCAs...>
129 using DataType = ColumnsData<CCAs...>;
130 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
134 static constexpr
size_t N =
sizeof...( CCAs );
139 template<
typename MT1,
typename MT2 >
140 static constexpr
bool EnforceEvaluation_v =
141 ( IsRestricted_v<MT1> && RequiresEvaluation_v<MT2> );
147 using This = Columns<MT,
true,
true,SF,CCAs...>;
149 using BaseType = DenseMatrix<This,true>;
150 using ViewedType = MT;
155 using SIMDType = SIMDTrait_t<ElementType>;
166 using ConstPointer = ConstPointer_t<MT>;
169 using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
180 static constexpr
bool simdEnabled = MT::simdEnabled;
189 template<
typename... RCAs >
190 explicit inline Columns( MT& matrix, RCAs... args );
192 Columns(
const Columns& ) =
default;
193 Columns( Columns&& ) =
default;
200 ~Columns() =
default;
207 inline Reference operator()(
size_t i,
size_t j );
209 inline Reference at(
size_t i,
size_t j );
211 inline Pointer
data () noexcept;
212 inline ConstPointer
data () const noexcept;
213 inline Pointer
data (
size_t j ) noexcept;
214 inline ConstPointer
data (
size_t j ) const noexcept;
227 inline Columns& operator=( const
ElementType& rhs );
228 inline Columns& operator=( initializer_list< initializer_list<
ElementType> > list );
229 inline Columns& operator=( const Columns& rhs );
231 template< typename MT2,
bool SO2 >
232 inline Columns& operator=( const Matrix<MT2,SO2>& rhs );
234 template< typename MT2,
bool SO2 >
235 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
236 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
238 template< typename MT2,
bool SO2 >
239 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
240 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
242 template< typename MT2,
bool SO2 >
243 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
244 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
246 template< typename MT2,
bool SO2 >
247 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
248 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
250 template< typename MT2,
bool SO2 >
251 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
252 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
254 template< typename MT2,
bool SO2 >
255 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
256 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
264 using DataType::idces;
267 inline MT& operand() noexcept;
268 inline const MT& operand() const noexcept;
270 inline
size_t rows() const noexcept;
271 inline
size_t spacing() const noexcept;
272 inline
size_t capacity() const noexcept;
273 inline
size_t capacity(
size_t j ) const noexcept;
275 inline
size_t nonZeros(
size_t j ) const;
277 inline
void reset(
size_t j );
287 template< typename Other > inline Columns& scale( const Other& scalar );
294 template< typename MT2 >
295 static constexpr
bool VectorizedAssign_v =
296 ( useOptimizedKernels &&
297 simdEnabled && MT2::simdEnabled &&
303 template< typename MT2 >
304 static constexpr
bool VectorizedAddAssign_v =
305 ( useOptimizedKernels &&
306 simdEnabled && MT2::simdEnabled &&
314 template< typename MT2 >
315 static constexpr
bool VectorizedSubAssign_v =
316 ( useOptimizedKernels &&
317 simdEnabled && MT2::simdEnabled &&
325 template< typename MT2 >
326 static constexpr
bool VectorizedSchurAssign_v =
327 ( useOptimizedKernels &&
328 simdEnabled && MT2::simdEnabled &&
342 template< typename Other >
343 inline
bool canAlias( const Other* alias ) const noexcept;
345 template< typename MT2,
bool SO2,
bool SF2, typename... CCAs2 >
346 inline
bool canAlias( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
348 template< typename Other >
349 inline
bool isAliased( const Other* alias ) const noexcept;
351 template< typename MT2,
bool SO2,
bool SF2, typename... CCAs2 >
352 inline
bool isAliased( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
354 inline
bool isAligned () const noexcept;
355 inline
bool canSMPAssign() const noexcept;
366 template< typename MT2 >
367 inline auto assign( const DenseMatrix<MT2,true>& rhs ) ->
DisableIf_t< VectorizedAssign_v<MT2> >;
369 template< typename MT2 >
370 inline auto assign( const DenseMatrix<MT2,true>& rhs ) ->
EnableIf_t< VectorizedAssign_v<MT2> >;
372 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,false>& rhs );
374 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,true>& rhs );
375 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,false>& rhs );
377 template< typename MT2 >
378 inline auto addAssign( const DenseMatrix<MT2,true>& rhs ) ->
DisableIf_t< VectorizedAddAssign_v<MT2> >;
380 template< typename MT2 >
381 inline auto addAssign( const DenseMatrix<MT2,true>& rhs ) ->
EnableIf_t< VectorizedAddAssign_v<MT2> >;
383 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,false>& rhs );
384 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,true>& rhs );
385 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,false>& rhs );
387 template< typename MT2 >
388 inline auto subAssign( const DenseMatrix<MT2,true>& rhs ) ->
DisableIf_t< VectorizedSubAssign_v<MT2> >;
390 template< typename MT2 >
391 inline auto subAssign( const DenseMatrix<MT2,true>& rhs ) ->
EnableIf_t< VectorizedSubAssign_v<MT2> >;
393 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,false>& rhs );
394 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,true>& rhs );
395 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,false>& rhs );
397 template< typename MT2 >
398 inline auto schurAssign( const DenseMatrix<MT2,true>& rhs ) ->
DisableIf_t< VectorizedSchurAssign_v<MT2> >;
400 template< typename MT2 >
401 inline auto schurAssign( const DenseMatrix<MT2,true>& rhs ) ->
EnableIf_t< VectorizedSchurAssign_v<MT2> >;
403 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,false>& rhs );
404 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,true>& rhs );
405 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,false>& rhs );
418 template< typename MT2,
bool SO2,
bool DF2,
bool SF2, typename... CCAs2 > friend class Columns;
457 template< typename MT
460 template< typename... RCAs >
461 inline Columns<MT,true,true,SF,CCAs...>::Columns( MT& matrix, RCAs... args )
462 : DataType( args... )
466 for(
size_t j=0UL; j<
columns(); ++j ) {
467 if( matrix_.columns() <= idx(j) ) {
496 template<
typename MT
499 inline typename Columns<MT,
true,
true,SF,CCAs...>
::Reference 500 Columns<MT,true,true,SF,CCAs...>::operator()(
size_t i,
size_t j )
505 return matrix_(i,idx(j));
522 template<
typename MT
526 Columns<MT,true,true,SF,CCAs...>::operator()(
size_t i,
size_t j )
const 531 return const_cast<const MT&
>( matrix_ )(i,idx(j));
549 template<
typename MT
552 inline typename Columns<MT,
true,
true,SF,CCAs...>
::Reference 553 Columns<MT,true,true,SF,CCAs...>::at(
size_t i,
size_t j )
579 template<
typename MT
583 Columns<MT,true,true,SF,CCAs...>::at(
size_t i,
size_t j )
const 607 template<
typename MT
610 inline typename Columns<MT,
true,
true,SF,CCAs...>::Pointer
613 return matrix_.data( idx(0UL) );
629 template<
typename MT
632 inline typename Columns<MT,
true,
true,SF,CCAs...>::ConstPointer
635 return matrix_.data( idx(0UL) );
650 template<
typename MT
653 inline typename Columns<MT,
true,
true,SF,CCAs...>::Pointer
656 return matrix_.data( idx(j) );
671 template<
typename MT
674 inline typename Columns<MT,
true,
true,SF,CCAs...>::ConstPointer
677 return matrix_.data( idx(j) );
692 template<
typename MT
695 inline typename Columns<MT,
true,
true,SF,CCAs...>
::Iterator 699 return matrix_.begin( idx(j) );
714 template<
typename MT
721 return matrix_.cbegin( idx(j) );
736 template<
typename MT
743 return matrix_.cbegin( idx(j) );
758 template<
typename MT
761 inline typename Columns<MT,
true,
true,SF,CCAs...>
::Iterator 765 return matrix_.end( idx(j) );
780 template<
typename MT
787 return matrix_.cend( idx(j) );
802 template<
typename MT
809 return matrix_.cend( idx(j) );
834 template<
typename MT
837 inline Columns<MT,
true,
true,SF,CCAs...>&
838 Columns<MT,true,true,SF,CCAs...>::operator=(
const ElementType& rhs )
840 for(
size_t j=0UL; j<
columns(); ++j ) {
866 template<
typename MT
869 inline Columns<MT,
true,
true,SF,CCAs...>&
870 Columns<MT,true,true,SF,CCAs...>::operator=( initializer_list< initializer_list<ElementType> > list )
875 if( list.size() !=
rows() ) {
879 if( IsRestricted_v<MT> ) {
880 const InitializerMatrix<ElementType> tmp( list,
columns() );
881 for(
size_t j=0UL; j<
columns(); ++j ) {
882 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
888 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
891 for(
const auto& rowList : list ) {
893 for(
const auto& element : rowList ) {
894 matrix_(i,idx(j)) = element;
924 template<
typename MT
927 inline Columns<MT,
true,
true,SF,CCAs...>&
928 Columns<MT,true,true,SF,CCAs...>::operator=(
const Columns& rhs )
936 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && compareIndices( *
this, rhs ) ) )
939 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
943 if( IsRestricted_v<MT> ) {
944 for(
size_t j=0UL; j<
columns(); ++j ) {
951 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
953 if( rhs.canAlias( &matrix_ ) ) {
984 template<
typename MT
987 template<
typename MT2
989 inline Columns<MT,
true,
true,SF,CCAs...>&
990 Columns<MT,true,true,SF,CCAs...>::operator=(
const Matrix<MT2,SO2>& rhs )
1001 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<MT2>,
const MT2& >;
1002 Right right( ~rhs );
1004 if( IsRestricted_v<MT> ) {
1005 for(
size_t j=0UL; j<
columns(); ++j ) {
1012 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1014 if( IsSparseMatrix_v<MT2> ) {
1018 if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
1019 const ResultType_t<MT2> tmp( right );
1048 template<
typename MT
1050 ,
typename... CCAs >
1051 template<
typename MT2
1054 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
1063 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
1072 if( IsRestricted_v<MT> ) {
1073 for(
size_t j=0UL; j<
columns(); ++j ) {
1080 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1082 if( (~rhs).canAlias( &matrix_ ) ) {
1083 const AddType tmp( *
this + (~rhs) );
1112 template<
typename MT
1114 ,
typename... CCAs >
1115 template<
typename MT2
1118 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
1127 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
1136 const AddType tmp( *
this + (~rhs) );
1138 if( IsRestricted_v<MT> ) {
1139 for(
size_t j=0UL; j<
columns(); ++j ) {
1146 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1172 template<
typename MT
1174 ,
typename... CCAs >
1175 template<
typename MT2
1178 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
1187 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
1196 if( IsRestricted_v<MT> ) {
1197 for(
size_t j=0UL; j<
columns(); ++j ) {
1204 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1206 if( (~rhs).canAlias( &matrix_ ) ) {
1207 const SubType tmp( *
this - (~rhs ) );
1236 template<
typename MT
1238 ,
typename... CCAs >
1239 template<
typename MT2
1242 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
1251 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
1260 const SubType tmp( *
this - (~rhs) );
1262 if( IsRestricted_v<MT> ) {
1263 for(
size_t j=0UL; j<
columns(); ++j ) {
1270 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1296 template<
typename MT
1298 ,
typename... CCAs >
1299 template<
typename MT2
1301 inline auto Columns<MT,true,true,SF,CCAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
1302 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
1311 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
1319 if( IsRestricted_v<MT> ) {
1320 for(
size_t j=0UL; j<
columns(); ++j ) {
1327 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1329 if( (~rhs).canAlias( &matrix_ ) ) {
1330 const SchurType tmp( *
this % (~rhs) );
1331 if( IsSparseMatrix_v<SchurType> )
1361 template<
typename MT
1363 ,
typename... CCAs >
1364 template<
typename MT2
1366 inline auto Columns<MT,true,true,SF,CCAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
1367 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
1376 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
1384 const SchurType tmp( *
this % (~rhs) );
1386 if( IsRestricted_v<MT> ) {
1387 for(
size_t j=0UL; j<
columns(); ++j ) {
1394 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1396 if( IsSparseMatrix_v<SchurType> ) {
1424 template<
typename MT
1426 ,
typename... CCAs >
1427 inline MT& Columns<MT,true,true,SF,CCAs...>::operand() noexcept
1441 template<
typename MT
1443 ,
typename... CCAs >
1444 inline const MT& Columns<MT,true,true,SF,CCAs...>::operand() const noexcept
1458 template<
typename MT
1460 ,
typename... CCAs >
1463 return matrix_.rows();
1478 template<
typename MT
1480 ,
typename... CCAs >
1483 return matrix_.spacing();
1495 template<
typename MT
1497 ,
typename... CCAs >
1515 template<
typename MT
1517 ,
typename... CCAs >
1536 template<
typename MT
1538 ,
typename... CCAs >
1541 size_t nonzeros( 0UL );
1543 for(
size_t j=0UL; j<
columns(); ++j ) {
1544 nonzeros += matrix_.nonZeros( idx(j) );
1562 template<
typename MT
1564 ,
typename... CCAs >
1569 return matrix_.nonZeros( idx(j) );
1581 template<
typename MT
1583 ,
typename... CCAs >
1586 for(
size_t j=0UL; j<
columns(); ++j ) {
1587 matrix_.reset( idx(j) );
1603 template<
typename MT
1605 ,
typename... CCAs >
1608 matrix_.reset( idx(j) );
1635 template<
typename MT
1637 ,
typename... CCAs >
1638 inline Columns<MT,
true,
true,SF,CCAs...>&
1650 if( IsRestricted_v<MT> ) {
1651 for(
size_t j=0UL; j<
columns(); ++j ) {
1652 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
1658 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1681 template<
typename MT
1683 ,
typename... CCAs >
1684 inline Columns<MT,
true,
true,SF,CCAs...>&
1696 if( IsRestricted_v<MT> ) {
1697 for(
size_t j=0UL; j<
columns(); ++j ) {
1698 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
1704 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1727 template<
typename MT
1729 ,
typename... CCAs >
1730 template<
typename Other >
1731 inline Columns<MT,
true,
true,SF,CCAs...>&
1732 Columns<MT,true,true,SF,CCAs...>::scale(
const Other& scalar )
1738 for(
size_t j=0UL; j<
columns(); ++j )
1740 const size_t index ( idx(j) );
1741 const size_t ibegin( IsLower<MT>::value ? ( IsStrictlyLower_v<MT> ? index+1UL : index ) : 0UL );
1742 const size_t iend ( IsUpper<MT>::value ? ( IsStrictlyUpper_v<MT> ? index : index+1UL ) :
rows() );
1744 for(
size_t i=ibegin; i<iend; ++i ) {
1745 matrix_(i,index) *= scalar;
1774 template<
typename MT
1776 ,
typename... CCAs >
1777 template<
typename Other >
1778 inline bool Columns<MT,true,true,SF,CCAs...>::canAlias(
const Other* alias )
const noexcept
1780 return matrix_.isAliased( alias );
1798 template<
typename MT
1800 ,
typename... CCAs >
1801 template<
typename MT2
1804 ,
typename... CCAs2 >
1806 Columns<MT,true,true,SF,CCAs...>::canAlias(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
1808 return matrix_.isAliased( &alias->matrix_ );
1825 template<
typename MT
1827 ,
typename... CCAs >
1828 template<
typename Other >
1829 inline bool Columns<MT,true,true,SF,CCAs...>::isAliased(
const Other* alias )
const noexcept
1831 return matrix_.isAliased( alias );
1849 template<
typename MT
1851 ,
typename... CCAs >
1852 template<
typename MT2
1855 ,
typename... CCAs2 >
1857 Columns<MT,true,true,SF,CCAs...>::isAliased(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
1859 return matrix_.isAliased( &alias->matrix_ );
1875 template<
typename MT
1877 ,
typename... CCAs >
1878 inline bool Columns<MT,true,true,SF,CCAs...>::isAligned() const noexcept
1880 return matrix_.isAligned();
1897 template<
typename MT
1899 ,
typename... CCAs >
1900 inline bool Columns<MT,true,true,SF,CCAs...>::canSMPAssign() const noexcept
1902 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
1923 template<
typename MT
1925 ,
typename... CCAs >
1927 Columns<MT,true,true,SF,CCAs...>::load(
size_t i,
size_t j )
const noexcept
1929 return matrix_.load( i, idx(j) );
1950 template<
typename MT
1952 ,
typename... CCAs >
1956 return matrix_.loada( i, idx(j) );
1977 template<
typename MT
1979 ,
typename... CCAs >
1983 return matrix_.loadu( i, idx(j) );
2005 template<
typename MT
2007 ,
typename... CCAs >
2009 Columns<MT,true,true,SF,CCAs...>::store(
size_t i,
size_t j,
const SIMDType& value ) noexcept
2011 matrix_.store( i, idx(j), value );
2033 template<
typename MT
2035 ,
typename... CCAs >
2039 matrix_.storea( i, idx(j), value );
2061 template<
typename MT
2063 ,
typename... CCAs >
2067 matrix_.storeu( i, idx(j), value );
2089 template<
typename MT
2091 ,
typename... CCAs >
2095 matrix_.stream( i, idx(j), value );
2113 template<
typename MT
2115 ,
typename... CCAs >
2116 template<
typename MT2 >
2117 inline auto Columns<MT,true,true,SF,CCAs...>::assign(
const DenseMatrix<MT2,true>& rhs )
2118 -> DisableIf_t< VectorizedAssign_v<MT2> >
2126 const size_t ipos(
rows() &
size_t(-2) );
2129 for(
size_t j=0UL; j<
columns(); ++j ) {
2130 const size_t index( idx(j) );
2131 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2132 matrix_(i ,index) = (~rhs)(i ,j);
2133 matrix_(i+1UL,index) = (~rhs)(i+1UL,j);
2135 if( ipos <
rows() ) {
2136 matrix_(ipos,index) = (~rhs)(ipos,j);
2156 template<
typename MT
2158 ,
typename... CCAs >
2159 template<
typename MT2 >
2160 inline auto Columns<MT,true,true,SF,CCAs...>::assign(
const DenseMatrix<MT2,true>& rhs )
2161 -> EnableIf_t< VectorizedAssign_v<MT2> >
2171 const size_t ipos(
rows() &
size_t(-SIMDSIZE) );
2176 !(~rhs).isAliased( &matrix_ ) )
2178 for(
size_t j=0UL; j<
columns(); ++j )
2182 ConstIterator_t<MT2> right( (~rhs).
begin(j) );
2184 for( ; i<ipos; i+=SIMDSIZE ) {
2185 left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2187 for( ; i<
rows(); ++i ) {
2194 for(
size_t j=0UL; j<
columns(); ++j )
2198 ConstIterator_t<MT2> right( (~rhs).
begin(j) );
2200 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2201 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2202 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2203 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2204 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2206 for( ; i<ipos; i+=SIMDSIZE ) {
2207 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2209 for( ; i<
rows(); ++i ) {
2210 *left = *right; ++left; ++right;
2231 template<
typename MT
2233 ,
typename... CCAs >
2234 template<
typename MT2 >
2235 inline void Columns<MT,true,true,SF,CCAs...>::assign(
const DenseMatrix<MT2,false>& rhs )
2245 constexpr
size_t block( BLOCK_SIZE );
2249 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
2250 for(
size_t j=0UL; j<
columns(); ++j ) {
2251 const size_t index( idx(j) );
2252 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2253 matrix_(i ,index) = (~rhs)(i ,j);
2254 matrix_(i+1UL,index) = (~rhs)(i+1UL,j);
2256 if( ipos < (~rhs).rows() ) {
2257 matrix_(ipos,index) = (~rhs)(ipos,j);
2263 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2264 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2265 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2266 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2267 for(
size_t j=jj; j<jend; ++j ) {
2268 const size_t index( idx(j) );
2269 for(
size_t i=ii; i<iend; ++i ) {
2270 matrix_(i,index) = (~rhs)(i,j);
2293 template<
typename MT
2295 ,
typename... CCAs >
2296 template<
typename MT2 >
2297 inline void Columns<MT,true,true,SF,CCAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
2305 for(
size_t j=0UL; j<
columns(); ++j ) {
2306 const size_t index( idx(j) );
2307 for( ConstIterator_t<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2308 matrix_(element->index(),index) = element->value();
2327 template<
typename MT
2329 ,
typename... CCAs >
2330 template<
typename MT2 >
2331 inline void Columns<MT,true,true,SF,CCAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
2341 for(
size_t i=0UL; i<
rows(); ++i ) {
2342 for( ConstIterator_t<MT2> element=(~rhs).begin(i); element!=(~rhs).
end(i); ++element )
2343 matrix_(i,idx(element->index())) = element->value();
2362 template<
typename MT
2364 ,
typename... CCAs >
2365 template<
typename MT2 >
2366 inline auto Columns<MT,true,true,SF,CCAs...>::addAssign(
const DenseMatrix<MT2,true>& rhs )
2367 -> DisableIf_t< VectorizedAddAssign_v<MT2> >
2375 const size_t ipos(
rows() &
size_t(-2) );
2378 for(
size_t j=0UL; j<
columns(); ++j )
2380 const size_t index( idx(j) );
2381 if( IsDiagonal_v<MT2> ) {
2382 matrix_(j,index) += (~rhs)(j,j);
2385 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2386 matrix_(i ,index) += (~rhs)(i ,j);
2387 matrix_(i+1UL,index) += (~rhs)(i+1UL,j);
2389 if( ipos <
rows() ) {
2390 matrix_(ipos,index) += (~rhs)(ipos,j);
2411 template<
typename MT
2413 ,
typename... CCAs >
2414 template<
typename MT2 >
2415 inline auto Columns<MT,true,true,SF,CCAs...>::addAssign(
const DenseMatrix<MT2,true>& rhs )
2416 -> EnableIf_t< VectorizedAddAssign_v<MT2> >
2426 for(
size_t j=0UL; j<
columns(); ++j )
2428 const size_t ibegin( ( IsLower_v<MT2> )
2429 ?( ( IsStrictlyLower_v<MT2> ? j+1UL : j ) &
size_t(-SIMDSIZE) )
2431 const size_t iend ( ( IsUpper_v<MT2> )
2432 ?( IsStrictlyUpper_v<MT2> ? j : j+1UL )
2436 const size_t ipos( iend &
size_t(-SIMDSIZE) );
2441 ConstIterator_t<MT2> right( (~rhs).
begin(j) + ibegin );
2443 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2444 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2445 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2446 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2447 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2449 for( ; i<ipos; i+=SIMDSIZE ) {
2450 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2452 for( ; i<iend; ++i ) {
2453 *left += *right; ++left; ++right;
2473 template<
typename MT
2475 ,
typename... CCAs >
2476 template<
typename MT2 >
2477 inline void Columns<MT,true,true,SF,CCAs...>::addAssign(
const DenseMatrix<MT2,false>& rhs )
2487 constexpr
size_t block( BLOCK_SIZE );
2491 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
2492 for(
size_t j=0UL; j<
columns(); ++j ) {
2493 const size_t index( idx(j) );
2494 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2495 matrix_(i ,index) += (~rhs)(i ,j);
2496 matrix_(i+1UL,index) += (~rhs)(i+1UL,j);
2498 if( ipos < (~rhs).rows() )
2499 matrix_(ipos,index) += (~rhs)(ipos,j);
2504 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2505 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2506 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2507 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2508 for(
size_t j=jj; j<jend; ++j ) {
2509 const size_t index( idx(j) );
2510 for(
size_t i=ii; i<iend; ++i ) {
2511 matrix_(i,index) += (~rhs)(i,j);
2534 template<
typename MT
2536 ,
typename... CCAs >
2537 template<
typename MT2 >
2538 inline void Columns<MT,true,true,SF,CCAs...>::addAssign(
const SparseMatrix<MT2,true>& rhs )
2546 for(
size_t j=0UL; j<
columns(); ++j ) {
2547 const size_t index( idx(j) );
2548 for( ConstIterator_t<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2549 matrix_(element->index(),index) += element->value();
2568 template<
typename MT
2570 ,
typename... CCAs >
2571 template<
typename MT2 >
2572 inline void Columns<MT,true,true,SF,CCAs...>::addAssign(
const SparseMatrix<MT2,false>& rhs )
2582 for(
size_t i=0UL; i<
rows(); ++i ) {
2583 for( ConstIterator_t<MT2> element=(~rhs).begin(i); element!=(~rhs).
end(i); ++element )
2584 matrix_(i,idx(element->index())) += element->value();
2603 template<
typename MT
2605 ,
typename... CCAs >
2606 template<
typename MT2 >
2607 inline auto Columns<MT,true,true,SF,CCAs...>::subAssign(
const DenseMatrix<MT2,true>& rhs )
2608 -> DisableIf_t< VectorizedSubAssign_v<MT2> >
2616 const size_t ipos(
rows() &
size_t(-2) );
2619 for(
size_t j=0UL; j<
columns(); ++j )
2621 const size_t index( idx(j) );
2623 if( IsDiagonal_v<MT2> ) {
2624 matrix_(j,index) -= (~rhs)(j,j);
2627 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2628 matrix_(i ,index) -= (~rhs)(i ,j);
2629 matrix_(i+1UL,index) -= (~rhs)(i+1UL,j);
2631 if( ipos <
rows() ) {
2632 matrix_(ipos,index) -= (~rhs)(ipos,j);
2653 template<
typename MT
2655 ,
typename... CCAs >
2656 template<
typename MT2 >
2657 inline auto Columns<MT,true,true,SF,CCAs...>::subAssign(
const DenseMatrix<MT2,true>& rhs )
2658 -> EnableIf_t< VectorizedSubAssign_v<MT2> >
2668 for(
size_t j=0UL; j<
columns(); ++j )
2670 const size_t ibegin( ( IsLower_v<MT2> )
2671 ?( ( IsStrictlyLower_v<MT2> ? j+1UL : j ) &
size_t(-SIMDSIZE) )
2673 const size_t iend ( ( IsUpper_v<MT2> )
2674 ?( IsStrictlyUpper_v<MT2> ? j : j+1UL )
2678 const size_t ipos( iend &
size_t(-SIMDSIZE) );
2683 ConstIterator_t<MT2> right( (~rhs).
begin(j) + ibegin );
2685 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2686 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2687 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2688 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2689 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2691 for( ; i<ipos; i+=SIMDSIZE ) {
2692 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2694 for( ; i<iend; ++i ) {
2695 *left -= *right; ++left; ++right;
2715 template<
typename MT
2717 ,
typename... CCAs >
2718 template<
typename MT2 >
2719 inline void Columns<MT,true,true,SF,CCAs...>::subAssign(
const DenseMatrix<MT2,false>& rhs )
2729 constexpr
size_t block( BLOCK_SIZE );
2733 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
2734 for(
size_t j=0UL; j<
columns(); ++j ) {
2735 const size_t index( idx(j) );
2736 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2737 matrix_(i ,index) -= (~rhs)(i ,j);
2738 matrix_(i+1UL,index) -= (~rhs)(i+1UL,j);
2740 if( ipos < (~rhs).rows() )
2741 matrix_(ipos,index) -= (~rhs)(ipos,j);
2746 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2747 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2748 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2749 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2750 for(
size_t j=jj; j<jend; ++j ) {
2751 const size_t index( idx(j) );
2752 for(
size_t i=ii; i<iend; ++i ) {
2753 matrix_(i,index) -= (~rhs)(i,j);
2776 template<
typename MT
2778 ,
typename... CCAs >
2779 template<
typename MT2 >
2780 inline void Columns<MT,true,true,SF,CCAs...>::subAssign(
const SparseMatrix<MT2,true>& rhs )
2788 for(
size_t j=0UL; j<
columns(); ++j ) {
2789 const size_t index( idx(j) );
2790 for( ConstIterator_t<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2791 matrix_(element->index(),index) -= element->value();
2810 template<
typename MT
2812 ,
typename... CCAs >
2813 template<
typename MT2 >
2814 inline void Columns<MT,true,true,SF,CCAs...>::subAssign(
const SparseMatrix<MT2,false>& rhs )
2824 for(
size_t i=0UL; i<
rows(); ++i ) {
2825 for( ConstIterator_t<MT2> element=(~rhs).begin(i); element!=(~rhs).
end(i); ++element )
2826 matrix_(i,idx(element->index())) -= element->value();
2845 template<
typename MT
2847 ,
typename... CCAs >
2848 template<
typename MT2 >
2849 inline auto Columns<MT,true,true,SF,CCAs...>::schurAssign(
const DenseMatrix<MT2,true>& rhs )
2850 -> DisableIf_t< VectorizedSchurAssign_v<MT2> >
2858 const size_t ipos(
rows() &
size_t(-2) );
2861 for(
size_t j=0UL; j<
columns(); ++j ) {
2862 const size_t index( idx(j) );
2863 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2864 matrix_(i ,index) *= (~rhs)(i ,j);
2865 matrix_(i+1UL,index) *= (~rhs)(i+1UL,j);
2867 if( ipos <
rows() ) {
2868 matrix_(ipos,index) *= (~rhs)(ipos,j);
2889 template<
typename MT
2891 ,
typename... CCAs >
2892 template<
typename MT2 >
2893 inline auto Columns<MT,true,true,SF,CCAs...>::schurAssign(
const DenseMatrix<MT2,true>& rhs )
2894 -> EnableIf_t< VectorizedSchurAssign_v<MT2> >
2904 for(
size_t j=0UL; j<
columns(); ++j )
2906 const size_t ipos(
rows() &
size_t(-SIMDSIZE) );
2911 ConstIterator_t<MT2> right( (~rhs).
begin(j) );
2913 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
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;
2917 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2919 for( ; i<ipos; i+=SIMDSIZE ) {
2920 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2922 for( ; i<
rows(); ++i ) {
2923 *left *= *right; ++left; ++right;
2943 template<
typename MT
2945 ,
typename... CCAs >
2946 template<
typename MT2 >
2947 inline void Columns<MT,true,true,SF,CCAs...>::schurAssign(
const DenseMatrix<MT2,false>& rhs )
2957 constexpr
size_t block( BLOCK_SIZE );
2961 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
2962 for(
size_t j=0UL; j<
columns(); ++j ) {
2963 const size_t index( idx(j) );
2964 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2965 matrix_(i ,index) *= (~rhs)(i ,j);
2966 matrix_(i+1UL,index) *= (~rhs)(i+1UL,j);
2968 if( ipos < (~rhs).rows() )
2969 matrix_(ipos,index) *= (~rhs)(ipos,j);
2974 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2975 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
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 j=jj; j<jend; ++j ) {
2979 const size_t index( idx(j) );
2980 for(
size_t i=ii; i<iend; ++i ) {
2981 matrix_(i,index) *= (~rhs)(i,j);
3004 template<
typename MT
3006 ,
typename... CCAs >
3007 template<
typename MT2 >
3008 inline void Columns<MT,true,true,SF,CCAs...>::schurAssign(
const SparseMatrix<MT2,true>& rhs )
3018 for(
size_t j=0UL; j<
columns(); ++j )
3020 const size_t index( idx(j) );
3023 for( ConstIterator_t<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element ) {
3024 for( ; i<element->index(); ++i )
3025 reset( matrix_(i,index) );
3026 matrix_(i,index) *= element->value();
3030 for( ; i<
rows(); ++i ) {
3031 reset( matrix_(i,index) );
3051 template<
typename MT
3053 ,
typename... CCAs >
3054 template<
typename MT2 >
3055 inline void Columns<MT,true,true,SF,CCAs...>::schurAssign(
const SparseMatrix<MT2,false>& rhs )
3067 for(
size_t i=0UL; i<
rows(); ++i )
3071 for( ConstIterator_t<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element ) {
3072 for( ; j<element->index(); ++j )
3073 reset( matrix_(i,idx(j)) );
3074 matrix_(i,idx(j)) *= element->value();
3079 reset( matrix_(i,idx(j)) );
3107 template<
typename MT
3108 ,
typename... CCAs >
3109 class Columns<MT,false,true,false,CCAs...>
3110 :
public View< DenseMatrix< Columns<MT,false,true,false,CCAs...>, true > >
3111 ,
private ColumnsData<CCAs...>
3115 using DataType = ColumnsData<CCAs...>;
3116 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
3120 static constexpr
size_t N =
sizeof...( CCAs );
3125 template<
typename MT1,
typename MT2 >
3126 static constexpr
bool EnforceEvaluation_v =
3127 ( IsRestricted_v<MT1> && RequiresEvaluation_v<MT2> );
3133 using This = Columns<MT,
false,
true,
false,CCAs...>;
3135 using BaseType = DenseMatrix<This,true>;
3136 using ViewedType = MT;
3151 using ConstPointer = ConstPointer_t<MT>;
3154 using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
3160 template<
typename MatrixType
3161 ,
typename IteratorType >
3162 class ColumnsIterator
3167 using IteratorCategory =
typename std::iterator_traits<IteratorType>::iterator_category;
3170 using ValueType =
typename std::iterator_traits<IteratorType>::value_type;
3173 using PointerType =
typename std::iterator_traits<IteratorType>::pointer;
3176 using ReferenceType =
typename std::iterator_traits<IteratorType>::reference;
3179 using DifferenceType =
typename std::iterator_traits<IteratorType>::difference_type;
3182 using iterator_category = IteratorCategory;
3183 using value_type = ValueType;
3184 using pointer = PointerType;
3185 using reference = ReferenceType;
3186 using difference_type = DifferenceType;
3192 inline ColumnsIterator() noexcept
3193 : matrix_(
nullptr )
3207 inline ColumnsIterator( MatrixType& matrix,
size_t row,
size_t column ) noexcept
3208 : matrix_( &matrix )
3213 if( row_ != matrix_->rows() )
3214 pos_ = matrix_->begin( row_ ) + column_;
3223 template<
typename MatrixType2,
typename IteratorType2 >
3224 inline ColumnsIterator(
const ColumnsIterator<MatrixType2,IteratorType2>& it ) noexcept
3225 : matrix_( it.matrix_ )
3227 , column_( it.column_ )
3238 inline ColumnsIterator&
operator+=(
size_t inc ) noexcept {
3241 if( row_ != matrix_->rows() )
3242 pos_ = matrix_->begin( row_ ) + column_;
3254 inline ColumnsIterator&
operator-=(
size_t dec ) noexcept {
3257 if( row_ != matrix_->rows() )
3258 pos_ = matrix_->begin( row_ ) + column_;
3269 inline ColumnsIterator& operator++() noexcept {
3272 if( row_ != matrix_->rows() )
3273 pos_ = matrix_->begin( row_ ) + column_;
3284 inline const ColumnsIterator operator++(
int ) noexcept {
3285 const ColumnsIterator tmp( *
this );
3296 inline ColumnsIterator& operator--() noexcept {
3299 if( row_ != matrix_->rows() )
3300 pos_ = matrix_->begin( row_ ) + column_;
3311 inline const ColumnsIterator operator--(
int ) noexcept {
3312 const ColumnsIterator tmp( *
this );
3324 inline ReferenceType operator[](
size_t index )
const {
3326 const IteratorType pos( matrix_->begin( row_+index ) + column_ );
3336 inline ReferenceType
operator*()
const {
3346 inline PointerType operator->()
const {
3357 template<
typename MatrixType2,
typename IteratorType2 >
3358 inline bool operator==(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3359 return row_ == rhs.row_;
3369 template<
typename MatrixType2,
typename IteratorType2 >
3370 inline bool operator!=(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3371 return !( *
this == rhs );
3381 template<
typename MatrixType2,
typename IteratorType2 >
3382 inline bool operator<( const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3383 return row_ < rhs.row_;
3393 template<
typename MatrixType2,
typename IteratorType2 >
3394 inline bool operator>(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3395 return row_ > rhs.row_;
3405 template<
typename MatrixType2,
typename IteratorType2 >
3406 inline bool operator<=( const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3407 return row_ <= rhs.row_;
3417 template<
typename MatrixType2,
typename IteratorType2 >
3418 inline bool operator>=(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3419 return row_ >= rhs.row_;
3429 inline DifferenceType
operator-(
const ColumnsIterator& rhs )
const noexcept {
3430 return row_ - rhs.row_;
3441 friend inline const ColumnsIterator
operator+(
const ColumnsIterator& it,
size_t inc ) noexcept {
3442 return ColumnsIterator( *it.matrix_, it.row_+inc, it.column_ );
3453 friend inline const ColumnsIterator
operator+(
size_t inc,
const ColumnsIterator& it ) noexcept {
3454 return ColumnsIterator( *it.matrix_, it.row_+inc, it.column_ );
3465 friend inline const ColumnsIterator
operator-(
const ColumnsIterator& it,
size_t dec ) noexcept {
3466 return ColumnsIterator( *it.matrix_, it.row_-dec, it.column_ );
3472 MatrixType* matrix_;
3479 template<
typename MatrixType2,
typename IteratorType2 >
friend class ColumnsIterator;
3486 using ConstIterator = ColumnsIterator< const MT, ConstIterator_t<MT> >;
3494 static constexpr
bool simdEnabled =
false;
3503 template<
typename... RCAs >
3504 explicit inline Columns( MT& matrix, RCAs... args );
3506 Columns(
const Columns& ) =
default;
3507 Columns( Columns&& ) =
default;
3514 ~Columns() =
default;
3521 inline Reference operator()(
size_t i,
size_t j );
3523 inline Reference at(
size_t i,
size_t j );
3525 inline Pointer
data () noexcept;
3526 inline ConstPointer
data () const noexcept;
3527 inline Pointer
data (
size_t j ) noexcept;
3528 inline ConstPointer
data (
size_t j ) const noexcept;
3541 inline Columns& operator=( const
ElementType& rhs );
3542 inline Columns& operator=( initializer_list< initializer_list<
ElementType> > list );
3543 inline Columns& operator=( const Columns& rhs );
3545 template< typename MT2,
bool SO2 >
3546 inline Columns& operator=( const Matrix<MT2,SO2>& rhs );
3548 template< typename MT2,
bool SO2 >
3549 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
3550 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
3552 template< typename MT2,
bool SO2 >
3553 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
3554 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
3556 template< typename MT2,
bool SO2 >
3557 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
3558 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
3560 template< typename MT2,
bool SO2 >
3561 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
3562 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
3564 template< typename MT2,
bool SO2 >
3565 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
3566 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
3568 template< typename MT2,
bool SO2 >
3569 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
3570 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
3577 using DataType::idx;
3578 using DataType::idces;
3581 inline MT& operand() noexcept;
3582 inline const MT& operand() const noexcept;
3584 inline
size_t rows() const noexcept;
3585 inline
size_t spacing() const noexcept;
3586 inline
size_t capacity() const noexcept;
3587 inline
size_t capacity(
size_t j ) const noexcept;
3589 inline
size_t nonZeros(
size_t j ) const;
3590 inline
void reset();
3591 inline
void reset(
size_t j );
3601 template< typename Other > inline Columns& scale( const Other& scalar );
3608 template< typename Other >
3609 inline
bool canAlias( const Other* alias ) const noexcept;
3611 template< typename MT2,
bool SO2,
bool SF2, typename... CCAs2 >
3612 inline
bool canAlias( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
3614 template< typename Other >
3615 inline
bool isAliased( const Other* alias ) const noexcept;
3617 template< typename MT2,
bool SO2,
bool SF2, typename... CCAs2 >
3618 inline
bool isAliased( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
3620 inline
bool isAligned () const noexcept;
3621 inline
bool canSMPAssign() const noexcept;
3623 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,true>& rhs );
3624 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,false>& rhs );
3625 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,true>& rhs );
3626 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,false>& rhs );
3628 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,true>& rhs );
3629 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,false>& rhs );
3630 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,true>& rhs );
3631 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,false>& rhs );
3633 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,true>& rhs );
3634 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,false>& rhs );
3635 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,true>& rhs );
3636 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,false>& rhs );
3638 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,true>& rhs );
3639 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,false>& rhs );
3640 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,true>& rhs );
3641 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,false>& rhs );
3654 template< typename MT2,
bool SO2,
bool DF2,
bool SF2, typename... CCAs2 > friend class Columns;
3694 template< typename MT
3695 , typename... CCAs >
3696 template< typename... RCAs >
3697 inline Columns<MT,false,true,false,CCAs...>::Columns( MT& matrix, RCAs... args )
3698 : DataType( args... )
3699 , matrix_ ( matrix )
3702 for(
size_t j=0UL; j<
columns(); ++j ) {
3703 if( matrix_.columns() <= idx(j) ) {
3732 template<
typename MT
3733 ,
typename... CCAs >
3734 inline typename Columns<MT,
false,
true,
false,CCAs...>
::Reference 3735 Columns<MT,false,true,false,CCAs...>::operator()(
size_t i,
size_t j )
3740 return matrix_(i,idx(j));
3757 template<
typename MT
3758 ,
typename... CCAs >
3760 Columns<MT,false,true,false,CCAs...>::operator()(
size_t i,
size_t j )
const 3765 return const_cast<const MT&
>( matrix_ )(i,idx(j));
3783 template<
typename MT
3784 ,
typename... CCAs >
3785 inline typename Columns<MT,
false,
true,
false,CCAs...>
::Reference 3786 Columns<MT,false,true,false,CCAs...>::at(
size_t i,
size_t j )
3794 return (*
this)(i,j);
3812 template<
typename MT
3813 ,
typename... CCAs >
3815 Columns<MT,false,true,false,CCAs...>::at(
size_t i,
size_t j )
const 3823 return (*
this)(i,j);
3839 template<
typename MT
3840 ,
typename... CCAs >
3841 inline typename Columns<MT,
false,
true,
false,CCAs...>::Pointer
3844 return matrix_.data() + idx(0UL);
3860 template<
typename MT
3861 ,
typename... CCAs >
3862 inline typename Columns<MT,
false,
true,
false,CCAs...>::ConstPointer
3865 return matrix_.data() + idx(0UL);
3880 template<
typename MT
3881 ,
typename... CCAs >
3882 inline typename Columns<MT,
false,
true,
false,CCAs...>::Pointer
3885 return matrix_.data() + idx(j);
3900 template<
typename MT
3901 ,
typename... CCAs >
3902 inline typename Columns<MT,
false,
true,
false,CCAs...>::ConstPointer
3905 return matrix_.data() + idx(j);
3920 template<
typename MT
3921 ,
typename... CCAs >
3922 inline typename Columns<MT,
false,
true,
false,CCAs...>
::Iterator 3926 return Iterator( matrix_, 0UL, idx(j) );
3941 template<
typename MT
3942 ,
typename... CCAs >
3962 template<
typename MT
3963 ,
typename... CCAs >
3983 template<
typename MT
3984 ,
typename... CCAs >
3985 inline typename Columns<MT,
false,
true,
false,CCAs...>
::Iterator 4004 template<
typename MT
4005 ,
typename... CCAs >
4025 template<
typename MT
4026 ,
typename... CCAs >
4056 template<
typename MT
4057 ,
typename... CCAs >
4058 inline Columns<MT,
false,
true,
false,CCAs...>&
4059 Columns<MT,false,true,false,CCAs...>::operator=(
const ElementType& rhs )
4061 for(
size_t j=0UL; j<
columns(); ++j ) {
4087 template<
typename MT
4088 ,
typename... CCAs >
4089 inline Columns<MT,
false,
true,
false,CCAs...>&
4090 Columns<MT,false,true,false,CCAs...>::operator=( initializer_list< initializer_list<ElementType> > list )
4095 if( list.size() !=
rows() ) {
4099 if( IsRestricted_v<MT> ) {
4100 const InitializerMatrix<ElementType> tmp( list,
columns() );
4101 for(
size_t j=0UL; j<
columns(); ++j ) {
4102 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
4108 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4111 for(
const auto& rowList : list ) {
4113 for(
const auto& element : rowList ) {
4114 matrix_(i,idx(j)) = element;
4144 template<
typename MT
4145 ,
typename... CCAs >
4146 inline Columns<MT,
false,
true,
false,CCAs...>&
4147 Columns<MT,false,true,false,CCAs...>::operator=(
const Columns& rhs )
4155 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && compareIndices( *
this, rhs ) ) )
4158 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
4162 if( IsRestricted_v<MT> ) {
4163 for(
size_t j=0UL; j<
columns(); ++j ) {
4170 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4172 if( rhs.canAlias( &matrix_ ) ) {
4203 template<
typename MT
4204 ,
typename... CCAs >
4205 template<
typename MT2
4207 inline Columns<MT,
false,
true,
false,CCAs...>&
4208 Columns<MT,false,true,false,CCAs...>::operator=(
const Matrix<MT2,SO2>& rhs )
4219 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<MT2>,
const MT2& >;
4220 Right right( ~rhs );
4222 if( IsRestricted_v<MT> ) {
4223 for(
size_t j=0UL; j<
columns(); ++j ) {
4230 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4232 if( IsSparseMatrix_v<MT2> ) {
4236 if( IsReference_v<Right> && right.canAlias( &matrix_ ) ) {
4237 const ResultType_t<MT2> tmp( right );
4266 template<
typename MT
4267 ,
typename... CCAs >
4268 template<
typename MT2
4271 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
4280 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
4289 if( IsRestricted_v<MT> ) {
4290 for(
size_t j=0UL; j<
columns(); ++j ) {
4297 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4299 if( (~rhs).canAlias( &matrix_ ) ) {
4300 const AddType tmp( *
this + (~rhs) );
4329 template<
typename MT
4330 ,
typename... CCAs >
4331 template<
typename MT2
4334 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
4343 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
4352 const AddType tmp( *
this + (~rhs) );
4354 if( IsRestricted_v<MT> ) {
4355 for(
size_t j=0UL; j<
columns(); ++j ) {
4362 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4388 template<
typename MT
4389 ,
typename... CCAs >
4390 template<
typename MT2
4393 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
4402 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
4411 if( IsRestricted_v<MT> ) {
4412 for(
size_t j=0UL; j<
columns(); ++j ) {
4419 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4421 if( (~rhs).canAlias( &matrix_ ) ) {
4422 const SubType tmp( *
this - (~rhs ) );
4451 template<
typename MT
4452 ,
typename... CCAs >
4453 template<
typename MT2
4456 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
4465 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
4474 const SubType tmp( *
this - (~rhs) );
4476 if( IsRestricted_v<MT> ) {
4477 for(
size_t j=0UL; j<
columns(); ++j ) {
4484 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4510 template<
typename MT
4511 ,
typename... CCAs >
4512 template<
typename MT2
4514 inline auto Columns<MT,false,true,false,CCAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
4515 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
4524 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
4532 if( IsRestricted_v<MT> ) {
4533 for(
size_t j=0UL; j<
columns(); ++j ) {
4540 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4542 if( (~rhs).canAlias( &matrix_ ) ) {
4543 const SchurType tmp( *
this % (~rhs) );
4544 if( IsSparseMatrix_v<SchurType> )
4574 template<
typename MT
4575 ,
typename... CCAs >
4576 template<
typename MT2
4578 inline auto Columns<MT,false,true,false,CCAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
4579 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
4588 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
4596 const SchurType tmp( *
this % (~rhs) );
4598 if( IsRestricted_v<MT> ) {
4599 for(
size_t j=0UL; j<
columns(); ++j ) {
4606 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4608 if( IsSparseMatrix_v<SchurType> ) {
4636 template<
typename MT
4637 ,
typename... CCAs >
4638 inline MT& Columns<MT,false,true,false,CCAs...>::operand() noexcept
4652 template<
typename MT
4653 ,
typename... CCAs >
4654 inline const MT& Columns<MT,false,true,false,CCAs...>::operand() const noexcept
4668 template<
typename MT
4669 ,
typename... CCAs >
4672 return matrix_.rows();
4687 template<
typename MT
4688 ,
typename... CCAs >
4691 return matrix_.rows();
4703 template<
typename MT
4704 ,
typename... CCAs >
4722 template<
typename MT
4723 ,
typename... CCAs >
4742 template<
typename MT
4743 ,
typename... CCAs >
4746 size_t nonzeros( 0UL );
4748 for(
size_t j=0UL; j<
columns(); ++j ) {
4767 template<
typename MT
4768 ,
typename... CCAs >
4773 size_t nonzeros( 0UL );
4775 const size_t index( idx(j) );
4776 for(
size_t i=0UL; i<
rows(); ++i ) {
4793 template<
typename MT
4794 ,
typename... CCAs >
4797 for(
size_t j=0UL; j<
columns(); ++j ) {
4814 template<
typename MT
4815 ,
typename... CCAs >
4820 const size_t index( idx(j) );
4821 for(
size_t i=0UL; i<
rows(); ++i ) {
4822 reset( matrix_( i, index ) );
4850 template<
typename MT
4851 ,
typename... CCAs >
4852 inline Columns<MT,
false,
true,
false,CCAs...>&
4864 if( IsRestricted_v<MT> ) {
4865 for(
size_t j=0UL; j<
columns(); ++j ) {
4866 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
4872 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4895 template<
typename MT
4896 ,
typename... CCAs >
4897 inline Columns<MT,
false,
true,
false,CCAs...>&
4909 if( IsRestricted_v<MT> ) {
4910 for(
size_t j=0UL; j<
columns(); ++j ) {
4911 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
4917 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4940 template<
typename MT
4941 ,
typename... CCAs >
4942 template<
typename Other >
4943 inline Columns<MT,
false,
true,
false,CCAs...>&
4944 Columns<MT,false,true,false,CCAs...>::scale(
const Other& scalar )
4950 for(
size_t j=0UL; j<
columns(); ++j )
4952 const size_t index ( idx(j) );
4953 const size_t ibegin( IsLower<MT>::value ? ( IsStrictlyLower_v<MT> ? index+1UL : index ) : 0UL );
4954 const size_t iend ( IsUpper<MT>::value ? ( IsStrictlyUpper_v<MT> ? index : index+1UL ) :
rows() );
4956 for(
size_t i=ibegin; i<iend; ++i ) {
4957 matrix_(i,index) *= scalar;
4986 template<
typename MT
4987 ,
typename... CCAs >
4988 template<
typename Other >
4989 inline bool Columns<MT,false,true,false,CCAs...>::canAlias(
const Other* alias )
const noexcept
4991 return matrix_.isAliased( alias );
5009 template<
typename MT
5010 ,
typename... CCAs >
5011 template<
typename MT2
5014 ,
typename... CCAs2 >
5016 Columns<MT,false,true,false,CCAs...>::canAlias(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
5018 return matrix_.isAliased( &alias->matrix_ );
5035 template<
typename MT
5036 ,
typename... CCAs >
5037 template<
typename Other >
5038 inline bool Columns<MT,false,true,false,CCAs...>::isAliased(
const Other* alias )
const noexcept
5040 return matrix_.isAliased( alias );
5058 template<
typename MT
5059 ,
typename... CCAs >
5060 template<
typename MT2
5063 ,
typename... CCAs2 >
5065 Columns<MT,false,true,false,CCAs...>::isAliased(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
5067 return matrix_.isAliased( &alias->matrix_ );
5083 template<
typename MT
5084 ,
typename... CCAs >
5085 inline bool Columns<MT,false,true,false,CCAs...>::isAligned() const noexcept
5104 template<
typename MT
5105 ,
typename... CCAs >
5106 inline bool Columns<MT,false,true,false,CCAs...>::canSMPAssign() const noexcept
5108 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
5126 template<
typename MT
5127 ,
typename... CCAs >
5128 template<
typename MT2 >
5129 inline void Columns<MT,false,true,false,CCAs...>::assign(
const DenseMatrix<MT2,true>& rhs )
5137 const size_t ipos(
rows() &
size_t(-2) );
5140 for(
size_t j=0UL; j<
columns(); ++j ) {
5141 const size_t index( idx(j) );
5142 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5143 matrix_(i ,index) = (~rhs)(i ,j);
5144 matrix_(i+1UL,index) = (~rhs)(i+1UL,j);
5146 if( ipos <
rows() ) {
5147 matrix_(ipos,index) = (~rhs)(ipos,j);
5167 template<
typename MT
5168 ,
typename... CCAs >
5169 template<
typename MT2 >
5170 inline void Columns<MT,false,true,false,CCAs...>::assign(
const DenseMatrix<MT2,false>& rhs )
5180 constexpr
size_t block( BLOCK_SIZE );
5184 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
5185 for(
size_t j=0UL; j<
columns(); ++j ) {
5186 const size_t index( idx(j) );
5187 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5188 matrix_(i ,index) = (~rhs)(i ,j);
5189 matrix_(i+1UL,index) = (~rhs)(i+1UL,j);
5191 if( ipos < (~rhs).rows() ) {
5192 matrix_(ipos,index) = (~rhs)(ipos,j);
5198 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5199 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5200 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5201 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5202 for(
size_t j=jj; j<jend; ++j ) {
5203 const size_t index( idx(j) );
5204 for(
size_t i=ii; i<iend; ++i ) {
5205 matrix_(i,index) = (~rhs)(i,j);
5228 template<
typename MT
5229 ,
typename... CCAs >
5230 template<
typename MT2 >
5231 inline void Columns<MT,false,true,false,CCAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
5239 for(
size_t j=0UL; j<
columns(); ++j ) {
5240 const size_t index( idx(j) );
5241 for( ConstIterator_t<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5242 matrix_(element->index(),index) = element->value();
5261 template<
typename MT
5262 ,
typename... CCAs >
5263 template<
typename MT2 >
5264 inline void Columns<MT,false,true,false,CCAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
5274 for(
size_t i=0UL; i<
rows(); ++i ) {
5275 for( ConstIterator_t<MT2> element=(~rhs).begin(i); element!=(~rhs).
end(i); ++element )
5276 matrix_(i,idx(element->index())) = element->value();
5295 template<
typename MT
5296 ,
typename... CCAs >
5297 template<
typename MT2 >
5298 inline void Columns<MT,false,true,false,CCAs...>::addAssign(
const DenseMatrix<MT2,true>& rhs )
5306 const size_t ipos(
rows() &
size_t(-2) );
5309 for(
size_t j=0UL; j<
columns(); ++j )
5311 const size_t index( idx(j) );
5312 if( IsDiagonal_v<MT2> ) {
5313 matrix_(j,index) += (~rhs)(j,j);
5316 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5317 matrix_(i ,index) += (~rhs)(i ,j);
5318 matrix_(i+1UL,index) += (~rhs)(i+1UL,j);
5320 if( ipos <
rows() ) {
5321 matrix_(ipos,index) += (~rhs)(ipos,j);
5342 template<
typename MT
5343 ,
typename... CCAs >
5344 template<
typename MT2 >
5345 inline void Columns<MT,false,true,false,CCAs...>::addAssign(
const DenseMatrix<MT2,false>& rhs )
5355 constexpr
size_t block( BLOCK_SIZE );
5359 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
5360 for(
size_t j=0UL; j<
columns(); ++j ) {
5361 const size_t index( idx(j) );
5362 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5363 matrix_(i ,index) += (~rhs)(i ,j);
5364 matrix_(i+1UL,index) += (~rhs)(i+1UL,j);
5366 if( ipos < (~rhs).rows() )
5367 matrix_(ipos,index) += (~rhs)(ipos,j);
5372 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5373 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5374 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5375 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5376 for(
size_t j=jj; j<jend; ++j ) {
5377 const size_t index( idx(j) );
5378 for(
size_t i=ii; i<iend; ++i ) {
5379 matrix_(i,index) += (~rhs)(i,j);
5402 template<
typename MT
5403 ,
typename... CCAs >
5404 template<
typename MT2 >
5405 inline void Columns<MT,false,true,false,CCAs...>::addAssign(
const SparseMatrix<MT2,true>& rhs )
5413 for(
size_t j=0UL; j<
columns(); ++j ) {
5414 const size_t index( idx(j) );
5415 for( ConstIterator_t<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5416 matrix_(element->index(),index) += element->value();
5435 template<
typename MT
5436 ,
typename... CCAs >
5437 template<
typename MT2 >
5438 inline void Columns<MT,false,true,false,CCAs...>::addAssign(
const SparseMatrix<MT2,false>& rhs )
5448 for(
size_t i=0UL; i<
rows(); ++i ) {
5449 for( ConstIterator_t<MT2> element=(~rhs).begin(i); element!=(~rhs).
end(i); ++element )
5450 matrix_(i,idx(element->index())) += element->value();
5469 template<
typename MT
5470 ,
typename... CCAs >
5471 template<
typename MT2 >
5472 inline void Columns<MT,false,true,false,CCAs...>::subAssign(
const DenseMatrix<MT2,true>& rhs )
5480 const size_t ipos(
rows() &
size_t(-2) );
5483 for(
size_t j=0UL; j<
columns(); ++j )
5485 const size_t index( idx(j) );
5487 if( IsDiagonal_v<MT2> ) {
5488 matrix_(j,index) -= (~rhs)(j,j);
5491 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5492 matrix_(i ,index) -= (~rhs)(i ,j);
5493 matrix_(i+1UL,index) -= (~rhs)(i+1UL,j);
5495 if( ipos <
rows() ) {
5496 matrix_(ipos,index) -= (~rhs)(ipos,j);
5517 template<
typename MT
5518 ,
typename... CCAs >
5519 template<
typename MT2 >
5520 inline void Columns<MT,false,true,false,CCAs...>::subAssign(
const DenseMatrix<MT2,false>& rhs )
5530 constexpr
size_t block( BLOCK_SIZE );
5534 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
5535 for(
size_t j=0UL; j<
columns(); ++j ) {
5536 const size_t index( idx(j) );
5537 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5538 matrix_(i ,index) -= (~rhs)(i ,j);
5539 matrix_(i+1UL,index) -= (~rhs)(i+1UL,j);
5541 if( ipos < (~rhs).rows() )
5542 matrix_(ipos,index) -= (~rhs)(ipos,j);
5547 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5548 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5549 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5550 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5551 for(
size_t j=jj; j<jend; ++j ) {
5552 const size_t index( idx(j) );
5553 for(
size_t i=ii; i<iend; ++i ) {
5554 matrix_(i,index) -= (~rhs)(i,j);
5577 template<
typename MT
5578 ,
typename... CCAs >
5579 template<
typename MT2 >
5580 inline void Columns<MT,false,true,false,CCAs...>::subAssign(
const SparseMatrix<MT2,true>& rhs )
5588 for(
size_t j=0UL; j<
columns(); ++j ) {
5589 const size_t index( idx(j) );
5590 for( ConstIterator_t<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5591 matrix_(element->index(),index) -= element->value();
5610 template<
typename MT
5611 ,
typename... CCAs >
5612 template<
typename MT2 >
5613 inline void Columns<MT,false,true,false,CCAs...>::subAssign(
const SparseMatrix<MT2,false>& rhs )
5623 for(
size_t i=0UL; i<
rows(); ++i ) {
5624 for( ConstIterator_t<MT2> element=(~rhs).begin(i); element!=(~rhs).
end(i); ++element )
5625 matrix_(i,idx(element->index())) -= element->value();
5644 template<
typename MT
5645 ,
typename... CCAs >
5646 template<
typename MT2 >
5647 inline void Columns<MT,false,true,false,CCAs...>::schurAssign(
const DenseMatrix<MT2,true>& rhs )
5655 const size_t ipos(
rows() &
size_t(-2) );
5658 for(
size_t j=0UL; j<
columns(); ++j ) {
5659 const size_t index( idx(j) );
5660 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5661 matrix_(i ,index) *= (~rhs)(i ,j);
5662 matrix_(i+1UL,index) *= (~rhs)(i+1UL,j);
5664 if( ipos <
rows() ) {
5665 matrix_(ipos,index) *= (~rhs)(ipos,j);
5685 template<
typename MT
5686 ,
typename... CCAs >
5687 template<
typename MT2 >
5688 inline void Columns<MT,false,true,false,CCAs...>::schurAssign(
const DenseMatrix<MT2,false>& rhs )
5698 constexpr
size_t block( BLOCK_SIZE );
5702 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
5703 for(
size_t j=0UL; j<
columns(); ++j ) {
5704 const size_t index( idx(j) );
5705 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5706 matrix_(i ,index) *= (~rhs)(i ,j);
5707 matrix_(i+1UL,index) *= (~rhs)(i+1UL,j);
5709 if( ipos < (~rhs).rows() )
5710 matrix_(ipos,index) *= (~rhs)(ipos,j);
5715 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5716 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5717 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5718 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5719 for(
size_t j=jj; j<jend; ++j ) {
5720 const size_t index( idx(j) );
5721 for(
size_t i=ii; i<iend; ++i ) {
5722 matrix_(i,index) *= (~rhs)(i,j);
5745 template<
typename MT
5746 ,
typename... CCAs >
5747 template<
typename MT2 >
5748 inline void Columns<MT,false,true,false,CCAs...>::schurAssign(
const SparseMatrix<MT2,true>& rhs )
5758 for(
size_t j=0UL; j<
columns(); ++j )
5760 const size_t index( idx(j) );
5763 for( ConstIterator_t<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element ) {
5764 for( ; i<element->index(); ++i )
5765 reset( matrix_(i,index) );
5766 matrix_(i,index) *= element->value();
5770 for( ; i<
rows(); ++i ) {
5771 reset( matrix_(i,index) );
5791 template<
typename MT
5792 ,
typename... CCAs >
5793 template<
typename MT2 >
5794 inline void Columns<MT,false,true,false,CCAs...>::schurAssign(
const SparseMatrix<MT2,false>& rhs )
5806 for(
size_t i=0UL; i<
rows(); ++i )
5810 for( ConstIterator_t<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element ) {
5811 for( ; j<element->index(); ++j )
5812 reset( matrix_(i,idx(j)) );
5813 matrix_(i,idx(j)) *= element->value();
5818 reset( matrix_(i,idx(j)) );
5846 template<
typename MT
5847 ,
typename... CCAs >
5848 class Columns<MT,false,true,true,CCAs...>
5849 :
public View< DenseMatrix< Columns<MT,false,true,true,CCAs...>, true > >
5850 ,
private ColumnsData<CCAs...>
5854 using DataType = ColumnsData<CCAs...>;
5855 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
5859 static constexpr
size_t N =
sizeof...( CCAs );
5865 using This = Columns<MT,
false,
true,
true,CCAs...>;
5867 using BaseType = DenseMatrix<This,true>;
5868 using ViewedType = MT;
5873 using SIMDType = SIMDTrait_t<ElementType>;
5884 using ConstPointer = ConstPointer_t<MT>;
5887 using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
5898 static constexpr
bool simdEnabled = MT::simdEnabled;
5907 template<
typename... RCAs >
5908 explicit inline Columns( MT& matrix, RCAs... args );
5910 Columns(
const Columns& ) =
default;
5911 Columns( Columns&& ) =
default;
5918 ~Columns() =
default;
5925 inline Reference operator()(
size_t i,
size_t j );
5927 inline Reference at(
size_t i,
size_t j );
5929 inline Pointer
data () noexcept;
5930 inline ConstPointer
data () const noexcept;
5931 inline Pointer
data (
size_t j ) noexcept;
5932 inline ConstPointer
data (
size_t j ) const noexcept;
5945 inline Columns& operator=( const
ElementType& rhs );
5947 Columns& operator=( const Columns& ) = delete;
5954 using DataType::idx;
5955 using DataType::idces;
5958 inline MT& operand() noexcept;
5959 inline const MT& operand() const noexcept;
5961 inline
size_t rows() const noexcept;
5962 inline
size_t spacing() const noexcept;
5963 inline
size_t capacity() const noexcept;
5964 inline
size_t capacity(
size_t j ) const noexcept;
5966 inline
size_t nonZeros(
size_t j ) const;
5967 inline
void reset();
5968 inline
void reset(
size_t j );
5975 template< typename Other >
5976 inline
bool canAlias( const Other* alias ) const noexcept;
5978 template< typename MT2,
bool SO2,
bool SF2, typename... CCAs2 >
5979 inline
bool canAlias( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
5981 template< typename Other >
5982 inline
bool isAliased( const Other* alias ) const noexcept;
5984 template< typename MT2,
bool SO2,
bool SF2, typename... CCAs2 >
5985 inline
bool isAliased( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
5987 inline
bool isAligned () const noexcept;
5988 inline
bool canSMPAssign() const noexcept;
6005 template< typename MT2,
bool SO2,
bool DF2,
bool SF2, typename... CCAs2 > friend class Columns;
6045 template< typename MT
6046 , typename... CCAs >
6047 template< typename... RCAs >
6048 inline Columns<MT,false,true,true,CCAs...>::Columns( MT& matrix, RCAs... args )
6049 : DataType( args... )
6050 , matrix_ ( matrix )
6053 for(
size_t j=0UL; j<
columns(); ++j ) {
6054 if( matrix_.columns() <= idx(j) ) {
6083 template<
typename MT
6084 ,
typename... CCAs >
6085 inline typename Columns<MT,
false,
true,
true,CCAs...>
::Reference 6086 Columns<MT,false,true,true,CCAs...>::operator()(
size_t i,
size_t j )
6091 return matrix_(idx(j),i);
6108 template<
typename MT
6109 ,
typename... CCAs >
6111 Columns<MT,false,true,true,CCAs...>::operator()(
size_t i,
size_t j )
const 6116 return const_cast<const MT&
>( matrix_ )(idx(j),i);
6134 template<
typename MT
6135 ,
typename... CCAs >
6136 inline typename Columns<MT,
false,
true,
true,CCAs...>
::Reference 6137 Columns<MT,false,true,true,CCAs...>::at(
size_t i,
size_t j )
6145 return (*
this)(i,j);
6163 template<
typename MT
6164 ,
typename... CCAs >
6166 Columns<MT,false,true,true,CCAs...>::at(
size_t i,
size_t j )
const 6174 return (*
this)(i,j);
6190 template<
typename MT
6191 ,
typename... CCAs >
6192 inline typename Columns<MT,
false,
true,
true,CCAs...>::Pointer
6195 return matrix_.data( idx(0UL) );
6211 template<
typename MT
6212 ,
typename... CCAs >
6213 inline typename Columns<MT,
false,
true,
true,CCAs...>::ConstPointer
6216 return matrix_.data( idx(0UL) );
6231 template<
typename MT
6232 ,
typename... CCAs >
6233 inline typename Columns<MT,
false,
true,
true,CCAs...>::Pointer
6236 return matrix_.data( idx(j) );
6251 template<
typename MT
6252 ,
typename... CCAs >
6253 inline typename Columns<MT,
false,
true,
true,CCAs...>::ConstPointer
6256 return matrix_.data( idx(j) );
6271 template<
typename MT
6272 ,
typename... CCAs >
6273 inline typename Columns<MT,
false,
true,
true,CCAs...>
::Iterator 6277 return matrix_.begin( idx(j) );
6292 template<
typename MT
6293 ,
typename... CCAs >
6298 return matrix_.cbegin( idx(j) );
6313 template<
typename MT
6314 ,
typename... CCAs >
6319 return matrix_.cbegin( idx(j) );
6334 template<
typename MT
6335 ,
typename... CCAs >
6336 inline typename Columns<MT,
false,
true,
true,CCAs...>
::Iterator 6340 return matrix_.end( idx(j) );
6355 template<
typename MT
6356 ,
typename... CCAs >
6361 return matrix_.cend( idx(j) );
6376 template<
typename MT
6377 ,
typename... CCAs >
6382 return matrix_.cend( idx(j) );
6407 template<
typename MT
6408 ,
typename... CCAs >
6409 inline Columns<MT,
false,
true,
true,CCAs...>&
6410 Columns<MT,false,true,true,CCAs...>::operator=(
const ElementType& rhs )
6412 for(
size_t j=0UL; j<
columns(); ++j ) {
6436 template<
typename MT
6437 ,
typename... CCAs >
6438 inline MT& Columns<MT,false,true,true,CCAs...>::operand() noexcept
6452 template<
typename MT
6453 ,
typename... CCAs >
6454 inline const MT& Columns<MT,false,true,true,CCAs...>::operand() const noexcept
6468 template<
typename MT
6469 ,
typename... CCAs >
6472 return matrix_.rows();
6487 template<
typename MT
6488 ,
typename... CCAs >
6491 return matrix_.spacing();
6503 template<
typename MT
6504 ,
typename... CCAs >
6522 template<
typename MT
6523 ,
typename... CCAs >
6542 template<
typename MT
6543 ,
typename... CCAs >
6546 size_t nonzeros( 0UL );
6548 for(
size_t j=0UL; j<
columns(); ++j ) {
6549 nonzeros += matrix_.nonZeros( idx(j) );
6567 template<
typename MT
6568 ,
typename... CCAs >
6573 return matrix_.nonZeros( idx(j) );
6585 template<
typename MT
6586 ,
typename... CCAs >
6589 for(
size_t j=0UL; j<
columns(); ++j ) {
6590 matrix_.reset( idx(j) );
6606 template<
typename MT
6607 ,
typename... CCAs >
6610 matrix_.reset( idx(j) );
6633 template<
typename MT
6634 ,
typename... CCAs >
6635 template<
typename Other >
6636 inline bool Columns<MT,false,true,true,CCAs...>::canAlias(
const Other* alias )
const noexcept
6638 return matrix_.isAliased( alias );
6656 template<
typename MT
6657 ,
typename... CCAs >
6658 template<
typename MT2
6661 ,
typename... CCAs2 >
6663 Columns<MT,false,true,true,CCAs...>::canAlias(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
6665 return matrix_.isAliased( &alias->matrix_ );
6682 template<
typename MT
6683 ,
typename... CCAs >
6684 template<
typename Other >
6685 inline bool Columns<MT,false,true,true,CCAs...>::isAliased(
const Other* alias )
const noexcept
6687 return matrix_.isAliased( alias );
6705 template<
typename MT
6706 ,
typename... CCAs >
6707 template<
typename MT2
6710 ,
typename... CCAs2 >
6712 Columns<MT,false,true,true,CCAs...>::isAliased(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
6714 return matrix_.isAliased( &alias->matrix_ );
6730 template<
typename MT
6731 ,
typename... CCAs >
6732 inline bool Columns<MT,false,true,true,CCAs...>::isAligned() const noexcept
6734 return matrix_.isAligned();
6751 template<
typename MT
6752 ,
typename... CCAs >
6753 inline bool Columns<MT,false,true,true,CCAs...>::canSMPAssign() const noexcept
6755 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
6776 template<
typename MT
6777 ,
typename... CCAs >
6779 Columns<MT,false,true,true,CCAs...>::load(
size_t i,
size_t j )
const noexcept
6781 return matrix_.load( idx(j), i );
6802 template<
typename MT
6803 ,
typename... CCAs >
6807 return matrix_.loada( idx(j), i );
6828 template<
typename MT
6829 ,
typename... CCAs >
6833 return matrix_.loadu( idx(j), i );
Constraint on the data type.
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Constraint on the data type.
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
Header file for the blaze::checked and blaze::unchecked instances.
Header file for the implementation of the Columns base template.
Header file for kernel specific block sizes.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3078
Header file for the Schur product trait.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
Header file for basic type definitions.
constexpr const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:750
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:169
Header file for the View base class.
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.The HasSIMDSub_v variable template provides...
Definition: HasSIMDSub.h:188
Header file for the IsSparseMatrix type trait.
Header file for the IsDiagonal type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i...
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3077
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3079
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SUBMATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a submatrix type (i.e. a dense or sparse submatrix), a compilation error is created.
Definition: Submatrix.h:81
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:851
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower or upper unitriangular matrix ty...
Definition: UniTriangular.h:81
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
#define BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a symmetric matrix type...
Definition: Symmetric.h:60
Header file for the reset shim.
Header file for the decltype(auto) workaround.
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
Constraints on the storage order of matrix types.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a transposition expression (i...
Definition: TransExpr.h:81
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:75
Header file for the RequiresEvaluation type trait.
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:482
MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:416
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
Constraint on the data type.
Constraint on the data type.
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:252
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the DisableIf class template.
Header file for the IsStrictlyUpper type trait.
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.The IsSIMDCombinable_v variable templ...
Definition: IsSIMDCombinable.h:137
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3083
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1364
Header file for the If class template.
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: ColumnMajorMatrix.h:61
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.The HasSIMDMult_v variable template provid...
Definition: HasSIMDMult.h:189
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3080
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the HasSIMDAdd type trait.
Header file for the DenseMatrix base class.
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:370
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:446
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:253
Header file for all SIMD functionality.
constexpr bool Contains_v
Auxiliary variable template for the Contains type trait.The Contains_v variable template provides a c...
Definition: Contains.h:139
Header file for the IsLower type trait.
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:78
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a vectorizable data type...
Definition: Vectorizable.h:61
Header file for the exception macros of the math module.
MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:438
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COLUMNS_TYPE(T)
Constraint on the data type.In case the given data type T is a column selection type (i...
Definition: Columns.h:81
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8908
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Constraint on the data type.
Header file for the IsSIMDCombinable type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: RowMajorMatrix.h:61
Header file for the HasSIMDMult type trait.
Header file for the IsConst type trait.
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Header file for the addition trait.
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
Header file for the Unique class template.
Check< false > Unchecked
Type of the blaze::unchecked instance.blaze::Unchecked is the type of the blaze::unchecked instance...
Definition: Check.h:96
Header file for the columns trait.
Constraint on the data type.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
Header file for the cache size of the target architecture.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
Constraint on the data type.
Constraint on the data type.
Header file for the HasSIMDSub type trait.
Constraints on the storage order of matrix types.
Header file for the HasMutableDataAccess type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
Header file for the IsReference type trait.
auto smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
constexpr bool IsDiagonal_v
Auxiliary variable template for the IsDiagonal type trait.The IsDiagonal_v variable template provides...
Definition: IsDiagonal.h:148
constexpr const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:718
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:74
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
Header file for the implementation of the ColumnsData class template.
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3082
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.The HasSIMDAdd_v variable template provides...
Definition: HasSIMDAdd.h:188
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
#define BLAZE_THROW_LOGIC_ERROR(MESSAGE)
Macro for the emission of a std::logic_error exception.This macro encapsulates the default way of Bla...
Definition: Exception.h:187
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
Header file for the IsUpper type trait.
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
Header file for the IsRestricted type trait.
System settings for the inline keywords.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the IsExpression type trait class.
Constraint on the data type.
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:825