35#ifndef _BLAZE_MATH_VIEWS_COLUMNS_DENSE_H_
36#define _BLAZE_MATH_VIEWS_COLUMNS_DENSE_H_
121class Columns<MT,true,true,SF,CCAs...>
122 :
public View< DenseMatrix< Columns<MT,true,true,SF,CCAs...>, true > >
123 ,
private ColumnsData<CCAs...>
127 using DataType = ColumnsData<CCAs...>;
128 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
137 template<
typename MT1,
typename MT2 >
138 static constexpr bool EnforceEvaluation_v =
139 ( IsRestricted_v<MT1> && RequiresEvaluation_v<MT2> );
145 using This = Columns<MT,
true,
true,SF,CCAs...>;
148 using BaseType = View< DenseMatrix<This,true> >;
150 using ViewedType = MT;
151 using ResultType = ColumnsTrait_t<MT,N>;
152 using OppositeType = OppositeType_t<ResultType>;
153 using TransposeType = TransposeType_t<ResultType>;
154 using ElementType = ElementType_t<MT>;
155 using SIMDType = SIMDTrait_t<ElementType>;
156 using ReturnType = ReturnType_t<MT>;
157 using CompositeType =
const Columns&;
160 using ConstReference = ConstReference_t<MT>;
163 using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
166 using ConstPointer = ConstPointer_t<MT>;
169 using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
172 using ConstIterator = ConstIterator_t<MT>;
175 using Iterator = If_t< IsConst_v<MT>, ConstIterator, Iterator_t<MT> >;
180 static constexpr bool simdEnabled = MT::simdEnabled;
183 static constexpr bool smpAssignable = MT::smpAssignable;
186 static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
192 template<
typename... RCAs >
193 explicit inline Columns( MT& matrix, RCAs... args );
195 Columns(
const Columns& ) =
default;
196 Columns( Columns&& ) =
default;
203 ~Columns() =
default;
210 inline Reference operator()(
size_t i,
size_t j );
211 inline ConstReference operator()(
size_t i,
size_t j )
const;
212 inline Reference at(
size_t i,
size_t j );
213 inline ConstReference at(
size_t i,
size_t j )
const;
214 inline Pointer
data () noexcept;
215 inline ConstPointer
data () const noexcept;
216 inline Pointer
data (
size_t j ) noexcept;
217 inline ConstPointer
data (
size_t j ) const noexcept;
218 inline Iterator
begin (
size_t j );
219 inline ConstIterator
begin (
size_t j ) const;
220 inline ConstIterator
cbegin(
size_t j ) const;
221 inline Iterator
end (
size_t j );
222 inline ConstIterator
end (
size_t j ) const;
223 inline ConstIterator
cend (
size_t j ) const;
230 inline Columns& operator=( const ElementType& rhs );
232 inline Columns& operator=( const Columns& rhs );
234 template< typename MT2,
bool SO2 >
235 inline Columns& operator=( const Matrix<MT2,SO2>& rhs );
237 template< typename MT2,
bool SO2 >
238 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
239 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
241 template< typename MT2,
bool SO2 >
242 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
243 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
245 template< typename MT2,
bool SO2 >
246 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
247 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
249 template< typename MT2,
bool SO2 >
250 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
251 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
253 template< typename MT2,
bool SO2 >
254 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
255 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
257 template< typename MT2,
bool SO2 >
258 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
259 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
267 using DataType::idces;
270 inline MT& operand() noexcept;
271 inline const MT& operand() const noexcept;
273 inline
size_t rows() const noexcept;
274 inline
size_t spacing() const noexcept;
275 inline
size_t capacity() const noexcept;
276 inline
size_t capacity(
size_t j ) const noexcept;
278 inline
size_t nonZeros(
size_t j ) const;
280 inline
void reset(
size_t j );
290 template< typename Other > inline Columns& scale( const Other& scalar );
297 template< typename MT2 >
298 static constexpr
bool VectorizedAssign_v =
299 ( useOptimizedKernels &&
300 simdEnabled && MT2::simdEnabled &&
306 template< typename MT2 >
307 static constexpr
bool VectorizedAddAssign_v =
308 ( VectorizedAssign_v<MT2> &&
315 template< typename MT2 >
316 static constexpr
bool VectorizedSubAssign_v =
317 ( VectorizedAssign_v<MT2> &&
324 template< typename MT2 >
325 static constexpr
bool VectorizedSchurAssign_v =
326 ( VectorizedAssign_v<MT2> &&
332 static constexpr
size_t SIMDSIZE = SIMDTrait<ElementType>::
size;
339 template< typename Other >
340 inline
bool canAlias( const Other* alias ) const noexcept;
342 template< typename MT2,
bool SO2,
bool SF2, typename... CCAs2 >
343 inline
bool canAlias( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
345 template< typename Other >
346 inline
bool isAliased( const Other* alias ) const noexcept;
348 template< typename MT2,
bool SO2,
bool SF2, typename... CCAs2 >
349 inline
bool isAliased( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
351 inline
bool isAligned () const noexcept;
352 inline
bool canSMPAssign() const noexcept;
363 template< typename MT2 >
364 inline auto assign( const DenseMatrix<MT2,true>& rhs ) ->
DisableIf_t< VectorizedAssign_v<MT2> >;
366 template< typename MT2 >
367 inline auto assign( const DenseMatrix<MT2,true>& rhs ) ->
EnableIf_t< VectorizedAssign_v<MT2> >;
369 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,false>& rhs );
371 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,true>& rhs );
372 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,false>& rhs );
374 template< typename MT2 >
375 inline auto addAssign( const DenseMatrix<MT2,true>& rhs ) ->
DisableIf_t< VectorizedAddAssign_v<MT2> >;
377 template< typename MT2 >
378 inline auto addAssign( const DenseMatrix<MT2,true>& rhs ) ->
EnableIf_t< VectorizedAddAssign_v<MT2> >;
380 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,false>& rhs );
381 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,true>& rhs );
382 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,false>& rhs );
384 template< typename MT2 >
385 inline auto subAssign( const DenseMatrix<MT2,true>& rhs ) ->
DisableIf_t< VectorizedSubAssign_v<MT2> >;
387 template< typename MT2 >
388 inline auto subAssign( const DenseMatrix<MT2,true>& rhs ) ->
EnableIf_t< VectorizedSubAssign_v<MT2> >;
390 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,false>& rhs );
391 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,true>& rhs );
392 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,false>& rhs );
394 template< typename MT2 >
395 inline auto schurAssign( const DenseMatrix<MT2,true>& rhs ) ->
DisableIf_t< VectorizedSchurAssign_v<MT2> >;
397 template< typename MT2 >
398 inline auto schurAssign( const DenseMatrix<MT2,true>& rhs ) ->
EnableIf_t< VectorizedSchurAssign_v<MT2> >;
400 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,false>& rhs );
401 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,true>& rhs );
402 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,false>& rhs );
415 template< typename MT2,
bool SO2,
bool DF2,
bool SF2, typename... CCAs2 > friend class Columns;
457template< typename... RCAs >
458inline Columns<MT,true,true,SF,CCAs...>::Columns( MT& matrix, RCAs... args )
459 : DataType( args... )
463 for(
size_t j=0UL; j<
columns(); ++j ) {
464 if( matrix_.columns() <= idx(j) ) {
496inline typename Columns<MT,
true,
true,SF,CCAs...>::Reference
497 Columns<MT,true,true,SF,CCAs...>::operator()(
size_t i,
size_t j )
502 return matrix_(i,idx(j));
522inline typename Columns<MT,
true,
true,SF,CCAs...>::ConstReference
523 Columns<MT,true,true,SF,CCAs...>::operator()(
size_t i,
size_t j )
const
528 return const_cast<const MT&
>( matrix_ )(i,idx(j));
549inline typename Columns<MT,
true,
true,SF,CCAs...>::Reference
550 Columns<MT,true,true,SF,CCAs...>::at(
size_t i,
size_t j )
579inline typename Columns<MT,
true,
true,SF,CCAs...>::ConstReference
580 Columns<MT,true,true,SF,CCAs...>::at(
size_t i,
size_t j )
const
607inline typename Columns<MT,
true,
true,SF,CCAs...>::Pointer
610 return matrix_.data( idx(0UL) );
629inline typename Columns<MT,
true,
true,SF,CCAs...>::ConstPointer
632 return matrix_.data( idx(0UL) );
650inline typename Columns<MT,
true,
true,SF,CCAs...>::Pointer
653 return matrix_.data( idx(j) );
671inline typename Columns<MT,
true,
true,SF,CCAs...>::ConstPointer
674 return matrix_.data( idx(j) );
692inline typename Columns<MT,
true,
true,SF,CCAs...>::Iterator
696 return matrix_.begin( idx(j) );
714inline typename Columns<MT,
true,
true,SF,CCAs...>::ConstIterator
718 return matrix_.cbegin( idx(j) );
736inline typename Columns<MT,
true,
true,SF,CCAs...>::ConstIterator
740 return matrix_.cbegin( idx(j) );
758inline typename Columns<MT,
true,
true,SF,CCAs...>::Iterator
762 return matrix_.end( idx(j) );
780inline typename Columns<MT,
true,
true,SF,CCAs...>::ConstIterator
784 return matrix_.cend( idx(j) );
802inline typename Columns<MT,
true,
true,SF,CCAs...>::ConstIterator
806 return matrix_.cend( idx(j) );
834inline Columns<MT,
true,
true,SF,CCAs...>&
835 Columns<MT,true,true,SF,CCAs...>::operator=(
const ElementType& rhs )
837 for(
size_t j=0UL; j<
columns(); ++j ) {
866inline Columns<MT,
true,
true,SF,CCAs...>&
872 if( list.size() !=
rows() ) {
876 if( IsRestricted_v<MT> ) {
877 const InitializerMatrix<ElementType> tmp( list,
columns() );
878 for(
size_t j=0UL; j<
columns(); ++j ) {
879 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
885 decltype(
auto) left( derestrict( *
this ) );
888 for(
const auto& rowList : list ) {
890 for(
const auto& element : rowList ) {
891 matrix_(i,idx(j)) = element;
895 matrix_(i,idx(j)) = ElementType();
924inline Columns<MT,
true,
true,SF,CCAs...>&
925 Columns<MT,true,true,SF,CCAs...>::operator=(
const Columns& rhs )
933 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && compareIndices( *
this, rhs ) ) )
936 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
940 if( IsRestricted_v<MT> ) {
941 for(
size_t j=0UL; j<
columns(); ++j ) {
948 decltype(
auto) left( derestrict( *
this ) );
950 if( rhs.canAlias(
this ) ) {
951 const ResultType tmp( rhs );
984template<
typename MT2
986inline Columns<MT,
true,
true,SF,CCAs...>&
987 Columns<MT,true,true,SF,CCAs...>::operator=(
const Matrix<MT2,SO2>& rhs )
994 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
998 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<MT2>,
const MT2& >;
1001 if( IsRestricted_v<MT> ) {
1002 for(
size_t j=0UL; j<
columns(); ++j ) {
1009 decltype(
auto) left( derestrict( *
this ) );
1011 if( IsSparseMatrix_v<MT2> ) {
1015 if( IsReference_v<Right> && right.canAlias(
this ) ) {
1016 const ResultType_t<MT2> tmp( right );
1045template<
typename MT
1047 ,
typename... CCAs >
1048template<
typename MT2
1051 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
1060 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
1065 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
1069 if( IsRestricted_v<MT> ) {
1070 for(
size_t j=0UL; j<
columns(); ++j ) {
1077 decltype(
auto) left( derestrict( *
this ) );
1079 if( (*rhs).canAlias(
this ) ) {
1080 const AddType tmp( *
this + (*rhs) );
1109template<
typename MT
1111 ,
typename... CCAs >
1112template<
typename MT2
1115 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
1124 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
1129 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
1133 const AddType tmp( *
this + (*rhs) );
1135 if( IsRestricted_v<MT> ) {
1136 for(
size_t j=0UL; j<
columns(); ++j ) {
1143 decltype(
auto) left( derestrict( *
this ) );
1169template<
typename MT
1171 ,
typename... CCAs >
1172template<
typename MT2
1175 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
1184 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
1189 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
1193 if( IsRestricted_v<MT> ) {
1194 for(
size_t j=0UL; j<
columns(); ++j ) {
1201 decltype(
auto) left( derestrict( *
this ) );
1203 if( (*rhs).canAlias(
this ) ) {
1204 const SubType tmp( *
this - (*rhs ) );
1233template<
typename MT
1235 ,
typename... CCAs >
1236template<
typename MT2
1239 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
1248 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
1253 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
1257 const SubType tmp( *
this - (*rhs) );
1259 if( IsRestricted_v<MT> ) {
1260 for(
size_t j=0UL; j<
columns(); ++j ) {
1267 decltype(
auto) left( derestrict( *
this ) );
1293template<
typename MT
1295 ,
typename... CCAs >
1296template<
typename MT2
1298inline auto Columns<MT,true,true,SF,CCAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
1299 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
1308 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
1312 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
1316 if( IsRestricted_v<MT> ) {
1317 for(
size_t j=0UL; j<
columns(); ++j ) {
1324 decltype(
auto) left( derestrict( *
this ) );
1326 if( (*rhs).canAlias(
this ) ) {
1327 const SchurType tmp( *
this % (*rhs) );
1328 if( IsSparseMatrix_v<SchurType> )
1358template<
typename MT
1360 ,
typename... CCAs >
1361template<
typename MT2
1363inline auto Columns<MT,true,true,SF,CCAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
1364 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
1373 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
1377 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
1381 const SchurType tmp( *
this % (*rhs) );
1383 if( IsRestricted_v<MT> ) {
1384 for(
size_t j=0UL; j<
columns(); ++j ) {
1391 decltype(
auto) left( derestrict( *
this ) );
1393 if( IsSparseMatrix_v<SchurType> ) {
1421template<
typename MT
1423 ,
typename... CCAs >
1424inline MT& Columns<MT,true,true,SF,CCAs...>::operand() noexcept
1438template<
typename MT
1440 ,
typename... CCAs >
1441inline const MT& Columns<MT,true,true,SF,CCAs...>::operand() const noexcept
1455template<
typename MT
1457 ,
typename... CCAs >
1460 return matrix_.rows();
1475template<
typename MT
1477 ,
typename... CCAs >
1480 return matrix_.spacing();
1492template<
typename MT
1494 ,
typename... CCAs >
1512template<
typename MT
1514 ,
typename... CCAs >
1533template<
typename MT
1535 ,
typename... CCAs >
1538 size_t nonzeros( 0UL );
1540 for(
size_t j=0UL; j<
columns(); ++j ) {
1541 nonzeros += matrix_.nonZeros( idx(j) );
1559template<
typename MT
1561 ,
typename... CCAs >
1566 return matrix_.nonZeros( idx(j) );
1578template<
typename MT
1580 ,
typename... CCAs >
1583 for(
size_t j=0UL; j<
columns(); ++j ) {
1584 matrix_.reset( idx(j) );
1600template<
typename MT
1602 ,
typename... CCAs >
1605 matrix_.reset( idx(j) );
1632template<
typename MT
1634 ,
typename... CCAs >
1635inline Columns<MT,
true,
true,SF,CCAs...>&
1645 const ResultType tmp(
trans( *
this ) );
1647 if( IsRestricted_v<MT> ) {
1648 for(
size_t j=0UL; j<
columns(); ++j ) {
1649 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
1655 decltype(
auto) left( derestrict( *
this ) );
1678template<
typename MT
1680 ,
typename... CCAs >
1681inline Columns<MT,
true,
true,SF,CCAs...>&
1691 const ResultType tmp(
ctrans( *
this ) );
1693 if( IsRestricted_v<MT> ) {
1694 for(
size_t j=0UL; j<
columns(); ++j ) {
1695 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
1701 decltype(
auto) left( derestrict( *
this ) );
1724template<
typename MT
1726 ,
typename... CCAs >
1727template<
typename Other >
1728inline Columns<MT,
true,
true,SF,CCAs...>&
1729 Columns<MT,true,true,SF,CCAs...>::scale(
const Other& scalar )
1735 for(
size_t j=0UL; j<
columns(); ++j )
1737 const size_t index ( idx(j) );
1738 const size_t ibegin( IsLower<MT>::value ? ( IsStrictlyLower_v<MT> ? index+1UL : index ) : 0UL );
1739 const size_t iend ( IsUpper<MT>::value ? ( IsStrictlyUpper_v<MT> ? index : index+1UL ) :
rows() );
1741 for(
size_t i=ibegin; i<iend; ++i ) {
1742 matrix_(i,index) *= scalar;
1771template<
typename MT
1773 ,
typename... CCAs >
1774template<
typename Other >
1775inline bool Columns<MT,true,true,SF,CCAs...>::canAlias(
const Other* alias )
const noexcept
1777 return matrix_.isAliased( &unview( *alias ) );
1795template<
typename MT
1797 ,
typename... CCAs >
1798template<
typename MT2
1801 ,
typename... CCAs2 >
1803 Columns<MT,true,true,SF,CCAs...>::canAlias(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
1805 return matrix_.isAliased( &alias->matrix_ );
1822template<
typename MT
1824 ,
typename... CCAs >
1825template<
typename Other >
1826inline bool Columns<MT,true,true,SF,CCAs...>::isAliased(
const Other* alias )
const noexcept
1828 return matrix_.isAliased( &unview( *alias ) );
1846template<
typename MT
1848 ,
typename... CCAs >
1849template<
typename MT2
1852 ,
typename... CCAs2 >
1854 Columns<MT,true,true,SF,CCAs...>::isAliased(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
1856 return matrix_.isAliased( &alias->matrix_ );
1872template<
typename MT
1874 ,
typename... CCAs >
1875inline bool Columns<MT,true,true,SF,CCAs...>::isAligned() const noexcept
1877 return matrix_.isAligned();
1894template<
typename MT
1896 ,
typename... CCAs >
1897inline bool Columns<MT,true,true,SF,CCAs...>::canSMPAssign() const noexcept
1899 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
1920template<
typename MT
1922 ,
typename... CCAs >
1924 Columns<MT,true,true,SF,CCAs...>::load(
size_t i,
size_t j )
const noexcept
1926 return matrix_.load( i, idx(j) );
1947template<
typename MT
1949 ,
typename... CCAs >
1953 return matrix_.loada( i, idx(j) );
1974template<
typename MT
1976 ,
typename... CCAs >
1980 return matrix_.loadu( i, idx(j) );
2002template<
typename MT
2004 ,
typename... CCAs >
2006 Columns<MT,true,true,SF,CCAs...>::store(
size_t i,
size_t j,
const SIMDType& value )
noexcept
2008 matrix_.store( i, idx(j), value );
2030template<
typename MT
2032 ,
typename... CCAs >
2036 matrix_.storea( i, idx(j), value );
2058template<
typename MT
2060 ,
typename... CCAs >
2064 matrix_.storeu( i, idx(j), value );
2086template<
typename MT
2088 ,
typename... CCAs >
2092 matrix_.stream( i, idx(j), value );
2110template<
typename MT
2112 ,
typename... CCAs >
2113template<
typename MT2 >
2114inline auto Columns<MT,true,true,SF,CCAs...>::assign(
const DenseMatrix<MT2,true>& rhs )
2115 -> DisableIf_t< VectorizedAssign_v<MT2> >
2126 for(
size_t j=0UL; j<
columns(); ++j ) {
2127 const size_t index( idx(j) );
2128 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2129 matrix_(i ,index) = (*rhs)(i ,j);
2130 matrix_(i+1UL,index) = (*rhs)(i+1UL,j);
2132 if( ipos <
rows() ) {
2133 matrix_(ipos,index) = (*rhs)(ipos,j);
2153template<
typename MT
2155 ,
typename... CCAs >
2156template<
typename MT2 >
2157inline auto Columns<MT,true,true,SF,CCAs...>::assign(
const DenseMatrix<MT2,true>& rhs )
2158 -> EnableIf_t< VectorizedAssign_v<MT2> >
2172 rows()*
columns() > ( cacheSize / (
sizeof(ElementType) * 3UL ) ) &&
2173 !(*rhs).isAliased(
this ) )
2175 for(
size_t j=0UL; j<
columns(); ++j )
2178 Iterator left(
begin(j) );
2179 ConstIterator_t<MT2> right( (*rhs).begin(j) );
2181 for( ; i<ipos; i+=SIMDSIZE ) {
2182 left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2184 for( ; i<
rows(); ++i ) {
2191 for(
size_t j=0UL; j<
columns(); ++j )
2194 Iterator left(
begin(j) );
2195 ConstIterator_t<MT2> right( (*rhs).begin(j) );
2197 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2198 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2199 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2200 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2201 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2203 for( ; i<ipos; i+=SIMDSIZE ) {
2204 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2206 for( ; i<
rows(); ++i ) {
2207 *left = *right; ++left; ++right;
2228template<
typename MT
2230 ,
typename... CCAs >
2231template<
typename MT2 >
2232inline void Columns<MT,true,true,SF,CCAs...>::assign(
const DenseMatrix<MT2,false>& rhs )
2242 constexpr size_t block( BLOCK_SIZE );
2246 const size_t ipos(
prevMultiple( (*rhs).rows(), 2UL ) );
2249 for(
size_t j=0UL; j<
columns(); ++j ) {
2250 const size_t index( idx(j) );
2251 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2252 matrix_(i ,index) = (*rhs)(i ,j);
2253 matrix_(i+1UL,index) = (*rhs)(i+1UL,j);
2255 if( ipos < (*rhs).rows() ) {
2256 matrix_(ipos,index) = (*rhs)(ipos,j);
2262 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2263 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2264 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2265 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2266 for(
size_t j=jj; j<jend; ++j ) {
2267 const size_t index( idx(j) );
2268 for(
size_t i=ii; i<iend; ++i ) {
2269 matrix_(i,index) = (*rhs)(i,j);
2292template<
typename MT
2294 ,
typename... CCAs >
2295template<
typename MT2 >
2296inline void Columns<MT,true,true,SF,CCAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
2304 for(
size_t j=0UL; j<
columns(); ++j ) {
2305 const size_t index( idx(j) );
2306 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
2307 matrix_(element->index(),index) = element->value();
2326template<
typename MT
2328 ,
typename... CCAs >
2329template<
typename MT2 >
2330inline void Columns<MT,true,true,SF,CCAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
2340 for(
size_t i=0UL; i<
rows(); ++i ) {
2341 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
2342 matrix_(i,idx(element->index())) = element->value();
2361template<
typename MT
2363 ,
typename... CCAs >
2364template<
typename MT2 >
2365inline auto Columns<MT,true,true,SF,CCAs...>::addAssign(
const DenseMatrix<MT2,true>& rhs )
2366 -> DisableIf_t< VectorizedAddAssign_v<MT2> >
2377 for(
size_t j=0UL; j<
columns(); ++j )
2379 const size_t index( idx(j) );
2380 if( IsDiagonal_v<MT2> ) {
2381 matrix_(j,index) += (*rhs)(j,j);
2384 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2385 matrix_(i ,index) += (*rhs)(i ,j);
2386 matrix_(i+1UL,index) += (*rhs)(i+1UL,j);
2388 if( ipos <
rows() ) {
2389 matrix_(ipos,index) += (*rhs)(ipos,j);
2410template<
typename MT
2412 ,
typename... CCAs >
2413template<
typename MT2 >
2414inline auto Columns<MT,true,true,SF,CCAs...>::addAssign(
const DenseMatrix<MT2,true>& rhs )
2415 -> EnableIf_t< VectorizedAddAssign_v<MT2> >
2425 for(
size_t j=0UL; j<
columns(); ++j )
2427 const size_t ibegin( ( IsLower_v<MT2> )
2428 ?(
prevMultiple( ( IsStrictlyLower_v<MT2> ? j+1UL : j ), SIMDSIZE ) )
2430 const size_t iend ( ( IsUpper_v<MT2> )
2431 ?( IsStrictlyUpper_v<MT2> ? j : j+1UL )
2439 Iterator left(
begin(j) + ibegin );
2440 ConstIterator_t<MT2> right( (*rhs).begin(j) + ibegin );
2442 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2443 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
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;
2448 for( ; i<ipos; i+=SIMDSIZE ) {
2449 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2451 for( ; i<iend; ++i ) {
2452 *left += *right; ++left; ++right;
2472template<
typename MT
2474 ,
typename... CCAs >
2475template<
typename MT2 >
2476inline void Columns<MT,true,true,SF,CCAs...>::addAssign(
const DenseMatrix<MT2,false>& rhs )
2486 constexpr size_t block( BLOCK_SIZE );
2490 const size_t ipos(
prevMultiple( (*rhs).rows(), 2UL ) );
2493 for(
size_t j=0UL; j<
columns(); ++j ) {
2494 const size_t index( idx(j) );
2495 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2496 matrix_(i ,index) += (*rhs)(i ,j);
2497 matrix_(i+1UL,index) += (*rhs)(i+1UL,j);
2499 if( ipos < (*rhs).rows() )
2500 matrix_(ipos,index) += (*rhs)(ipos,j);
2505 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2506 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2507 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2508 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2509 for(
size_t j=jj; j<jend; ++j ) {
2510 const size_t index( idx(j) );
2511 for(
size_t i=ii; i<iend; ++i ) {
2512 matrix_(i,index) += (*rhs)(i,j);
2535template<
typename MT
2537 ,
typename... CCAs >
2538template<
typename MT2 >
2539inline void Columns<MT,true,true,SF,CCAs...>::addAssign(
const SparseMatrix<MT2,true>& rhs )
2547 for(
size_t j=0UL; j<
columns(); ++j ) {
2548 const size_t index( idx(j) );
2549 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
2550 matrix_(element->index(),index) += element->value();
2569template<
typename MT
2571 ,
typename... CCAs >
2572template<
typename MT2 >
2573inline void Columns<MT,true,true,SF,CCAs...>::addAssign(
const SparseMatrix<MT2,false>& rhs )
2583 for(
size_t i=0UL; i<
rows(); ++i ) {
2584 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
2585 matrix_(i,idx(element->index())) += element->value();
2604template<
typename MT
2606 ,
typename... CCAs >
2607template<
typename MT2 >
2608inline auto Columns<MT,true,true,SF,CCAs...>::subAssign(
const DenseMatrix<MT2,true>& rhs )
2609 -> DisableIf_t< VectorizedSubAssign_v<MT2> >
2620 for(
size_t j=0UL; j<
columns(); ++j )
2622 const size_t index( idx(j) );
2624 if( IsDiagonal_v<MT2> ) {
2625 matrix_(j,index) -= (*rhs)(j,j);
2628 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2629 matrix_(i ,index) -= (*rhs)(i ,j);
2630 matrix_(i+1UL,index) -= (*rhs)(i+1UL,j);
2632 if( ipos <
rows() ) {
2633 matrix_(ipos,index) -= (*rhs)(ipos,j);
2654template<
typename MT
2656 ,
typename... CCAs >
2657template<
typename MT2 >
2658inline auto Columns<MT,true,true,SF,CCAs...>::subAssign(
const DenseMatrix<MT2,true>& rhs )
2659 -> EnableIf_t< VectorizedSubAssign_v<MT2> >
2669 for(
size_t j=0UL; j<
columns(); ++j )
2671 const size_t ibegin( ( IsLower_v<MT2> )
2672 ?(
prevMultiple( ( IsStrictlyLower_v<MT2> ? j+1UL : j ), SIMDSIZE ) )
2674 const size_t iend ( ( IsUpper_v<MT2> )
2675 ?( IsStrictlyUpper_v<MT2> ? j : j+1UL )
2683 Iterator left(
begin(j) + ibegin );
2684 ConstIterator_t<MT2> right( (*rhs).begin(j) + ibegin );
2686 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
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;
2690 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2692 for( ; i<ipos; i+=SIMDSIZE ) {
2693 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2695 for( ; i<iend; ++i ) {
2696 *left -= *right; ++left; ++right;
2716template<
typename MT
2718 ,
typename... CCAs >
2719template<
typename MT2 >
2720inline void Columns<MT,true,true,SF,CCAs...>::subAssign(
const DenseMatrix<MT2,false>& rhs )
2730 constexpr size_t block( BLOCK_SIZE );
2734 const size_t ipos(
prevMultiple( (*rhs).rows(), 2UL ) );
2737 for(
size_t j=0UL; j<
columns(); ++j ) {
2738 const size_t index( idx(j) );
2739 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2740 matrix_(i ,index) -= (*rhs)(i ,j);
2741 matrix_(i+1UL,index) -= (*rhs)(i+1UL,j);
2743 if( ipos < (*rhs).rows() )
2744 matrix_(ipos,index) -= (*rhs)(ipos,j);
2749 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2750 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2751 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2752 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2753 for(
size_t j=jj; j<jend; ++j ) {
2754 const size_t index( idx(j) );
2755 for(
size_t i=ii; i<iend; ++i ) {
2756 matrix_(i,index) -= (*rhs)(i,j);
2779template<
typename MT
2781 ,
typename... CCAs >
2782template<
typename MT2 >
2783inline void Columns<MT,true,true,SF,CCAs...>::subAssign(
const SparseMatrix<MT2,true>& rhs )
2791 for(
size_t j=0UL; j<
columns(); ++j ) {
2792 const size_t index( idx(j) );
2793 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
2794 matrix_(element->index(),index) -= element->value();
2813template<
typename MT
2815 ,
typename... CCAs >
2816template<
typename MT2 >
2817inline void Columns<MT,true,true,SF,CCAs...>::subAssign(
const SparseMatrix<MT2,false>& rhs )
2827 for(
size_t i=0UL; i<
rows(); ++i ) {
2828 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
2829 matrix_(i,idx(element->index())) -= element->value();
2848template<
typename MT
2850 ,
typename... CCAs >
2851template<
typename MT2 >
2852inline auto Columns<MT,true,true,SF,CCAs...>::schurAssign(
const DenseMatrix<MT2,true>& rhs )
2853 -> DisableIf_t< VectorizedSchurAssign_v<MT2> >
2864 for(
size_t j=0UL; j<
columns(); ++j ) {
2865 const size_t index( idx(j) );
2866 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2867 matrix_(i ,index) *= (*rhs)(i ,j);
2868 matrix_(i+1UL,index) *= (*rhs)(i+1UL,j);
2870 if( ipos <
rows() ) {
2871 matrix_(ipos,index) *= (*rhs)(ipos,j);
2892template<
typename MT
2894 ,
typename... CCAs >
2895template<
typename MT2 >
2896inline auto Columns<MT,true,true,SF,CCAs...>::schurAssign(
const DenseMatrix<MT2,true>& rhs )
2897 -> EnableIf_t< VectorizedSchurAssign_v<MT2> >
2907 for(
size_t j=0UL; j<
columns(); ++j )
2913 Iterator left(
begin(j) );
2914 ConstIterator_t<MT2> right( (*rhs).begin(j) );
2916 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2917 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2918 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2919 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2920 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2922 for( ; i<ipos; i+=SIMDSIZE ) {
2923 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2925 for( ; i<
rows(); ++i ) {
2926 *left *= *right; ++left; ++right;
2946template<
typename MT
2948 ,
typename... CCAs >
2949template<
typename MT2 >
2950inline void Columns<MT,true,true,SF,CCAs...>::schurAssign(
const DenseMatrix<MT2,false>& rhs )
2960 constexpr size_t block( BLOCK_SIZE );
2964 const size_t ipos(
prevMultiple( (*rhs).rows(), 2UL ) );
2967 for(
size_t j=0UL; j<
columns(); ++j ) {
2968 const size_t index( idx(j) );
2969 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2970 matrix_(i ,index) *= (*rhs)(i ,j);
2971 matrix_(i+1UL,index) *= (*rhs)(i+1UL,j);
2973 if( ipos < (*rhs).rows() )
2974 matrix_(ipos,index) *= (*rhs)(ipos,j);
2979 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2980 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2981 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2982 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2983 for(
size_t j=jj; j<jend; ++j ) {
2984 const size_t index( idx(j) );
2985 for(
size_t i=ii; i<iend; ++i ) {
2986 matrix_(i,index) *= (*rhs)(i,j);
3009template<
typename MT
3011 ,
typename... CCAs >
3012template<
typename MT2 >
3013inline void Columns<MT,true,true,SF,CCAs...>::schurAssign(
const SparseMatrix<MT2,true>& rhs )
3023 for(
size_t j=0UL; j<
columns(); ++j )
3025 const size_t index( idx(j) );
3028 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element ) {
3029 for( ; i<element->index(); ++i )
3030 reset( matrix_(i,index) );
3031 matrix_(i,index) *= element->value();
3035 for( ; i<
rows(); ++i ) {
3036 reset( matrix_(i,index) );
3056template<
typename MT
3058 ,
typename... CCAs >
3059template<
typename MT2 >
3060inline void Columns<MT,true,true,SF,CCAs...>::schurAssign(
const SparseMatrix<MT2,false>& rhs )
3072 for(
size_t i=0UL; i<
rows(); ++i )
3076 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element ) {
3077 for( ; j<element->index(); ++j )
3078 reset( matrix_(i,idx(j)) );
3079 matrix_(i,idx(j)) *= element->value();
3084 reset( matrix_(i,idx(j)) );
3112template<
typename MT
3113 ,
typename... CCAs >
3114class Columns<MT,false,true,false,CCAs...>
3115 :
public View< DenseMatrix< Columns<MT,false,true,false,CCAs...>, true > >
3116 ,
private ColumnsData<CCAs...>
3120 using DataType = ColumnsData<CCAs...>;
3121 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
3130 template<
typename MT1,
typename MT2 >
3131 static constexpr bool EnforceEvaluation_v =
3132 ( IsRestricted_v<MT1> && RequiresEvaluation_v<MT2> );
3138 using This = Columns<MT,
false,
true,
false,CCAs...>;
3141 using BaseType = View< DenseMatrix<This,true> >;
3143 using ViewedType = MT;
3144 using ResultType = ColumnsTrait_t<MT,N>;
3145 using OppositeType = OppositeType_t<ResultType>;
3146 using TransposeType = TransposeType_t<ResultType>;
3147 using ElementType = ElementType_t<MT>;
3148 using ReturnType = ReturnType_t<MT>;
3149 using CompositeType =
const Columns&;
3152 using ConstReference = ConstReference_t<MT>;
3155 using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
3158 using ConstPointer = ConstPointer_t<MT>;
3161 using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
3167 template<
typename MatrixType
3168 ,
typename IteratorType >
3169 class ColumnsIterator
3174 using IteratorCategory =
typename std::iterator_traits<IteratorType>::iterator_category;
3177 using ValueType =
typename std::iterator_traits<IteratorType>::value_type;
3180 using PointerType =
typename std::iterator_traits<IteratorType>::pointer;
3183 using ReferenceType =
typename std::iterator_traits<IteratorType>::reference;
3186 using DifferenceType =
typename std::iterator_traits<IteratorType>::difference_type;
3189 using iterator_category = IteratorCategory;
3190 using value_type = ValueType;
3191 using pointer = PointerType;
3192 using reference = ReferenceType;
3193 using difference_type = DifferenceType;
3199 inline ColumnsIterator() noexcept
3200 : matrix_(
nullptr )
3214 inline ColumnsIterator( MatrixType& matrix,
size_t row,
size_t column ) noexcept
3215 : matrix_( &matrix )
3220 if( row_ != matrix_->rows() )
3221 pos_ = matrix_->begin( row_ ) + column_;
3230 template<
typename MatrixType2,
typename IteratorType2 >
3231 inline ColumnsIterator(
const ColumnsIterator<MatrixType2,IteratorType2>& it ) noexcept
3232 : matrix_( it.matrix_ )
3234 , column_( it.column_ )
3245 inline ColumnsIterator&
operator+=(
size_t inc )
noexcept {
3248 if( row_ != matrix_->rows() )
3249 pos_ = matrix_->begin( row_ ) + column_;
3261 inline ColumnsIterator&
operator-=(
size_t dec )
noexcept {
3264 if( row_ != matrix_->rows() )
3265 pos_ = matrix_->begin( row_ ) + column_;
3276 inline ColumnsIterator& operator++() noexcept {
3279 if( row_ != matrix_->rows() )
3280 pos_ = matrix_->begin( row_ ) + column_;
3291 inline const ColumnsIterator operator++(
int )
noexcept {
3292 const ColumnsIterator tmp( *
this );
3303 inline ColumnsIterator& operator--() noexcept {
3306 if( row_ != matrix_->rows() )
3307 pos_ = matrix_->begin( row_ ) + column_;
3318 inline const ColumnsIterator operator--(
int )
noexcept {
3319 const ColumnsIterator tmp( *
this );
3331 inline ReferenceType operator[](
size_t index )
const {
3333 const IteratorType pos( matrix_->begin( row_+index ) + column_ );
3343 inline ReferenceType
operator*()
const {
3353 inline PointerType operator->()
const {
3364 template<
typename MatrixType2,
typename IteratorType2 >
3365 inline bool operator==(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3366 return row_ == rhs.row_;
3376 template<
typename MatrixType2,
typename IteratorType2 >
3377 inline bool operator!=(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3378 return !( *
this == rhs );
3388 template<
typename MatrixType2,
typename IteratorType2 >
3389 inline bool operator<(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3390 return row_ < rhs.row_;
3400 template<
typename MatrixType2,
typename IteratorType2 >
3401 inline bool operator>(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3402 return row_ > rhs.row_;
3412 template<
typename MatrixType2,
typename IteratorType2 >
3413 inline bool operator<=(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3414 return row_ <= rhs.row_;
3424 template<
typename MatrixType2,
typename IteratorType2 >
3425 inline bool operator>=(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3426 return row_ >= rhs.row_;
3436 inline DifferenceType
operator-(
const ColumnsIterator& rhs )
const noexcept {
3437 return row_ - rhs.row_;
3448 friend inline const ColumnsIterator
operator+(
const ColumnsIterator& it,
size_t inc )
noexcept {
3449 return ColumnsIterator( *it.matrix_, it.row_+inc, it.column_ );
3460 friend inline const ColumnsIterator
operator+(
size_t inc,
const ColumnsIterator& it )
noexcept {
3461 return ColumnsIterator( *it.matrix_, it.row_+inc, it.column_ );
3472 friend inline const ColumnsIterator
operator-(
const ColumnsIterator& it,
size_t dec )
noexcept {
3473 return ColumnsIterator( *it.matrix_, it.row_-dec, it.column_ );
3479 MatrixType* matrix_;
3486 template<
typename MatrixType2,
typename IteratorType2 >
friend class ColumnsIterator;
3493 using ConstIterator = ColumnsIterator< const MT, ConstIterator_t<MT> >;
3496 using Iterator = If_t< IsConst_v<MT>, ConstIterator, ColumnsIterator< MT, Iterator_t<MT> > >;
3501 static constexpr bool simdEnabled =
false;
3504 static constexpr bool smpAssignable = MT::smpAssignable;
3507 static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
3513 template<
typename... RCAs >
3514 explicit inline Columns( MT& matrix, RCAs... args );
3516 Columns(
const Columns& ) =
default;
3517 Columns( Columns&& ) =
default;
3524 ~Columns() =
default;
3531 inline Reference operator()(
size_t i,
size_t j );
3532 inline ConstReference operator()(
size_t i,
size_t j )
const;
3533 inline Reference at(
size_t i,
size_t j );
3534 inline ConstReference at(
size_t i,
size_t j )
const;
3535 inline Pointer
data () noexcept;
3536 inline ConstPointer
data () const noexcept;
3537 inline Pointer
data (
size_t j ) noexcept;
3538 inline ConstPointer
data (
size_t j ) const noexcept;
3539 inline Iterator
begin (
size_t j );
3540 inline ConstIterator
begin (
size_t j ) const;
3541 inline ConstIterator
cbegin(
size_t j ) const;
3542 inline Iterator
end (
size_t j );
3543 inline ConstIterator
end (
size_t j ) const;
3544 inline ConstIterator
cend (
size_t j ) const;
3551 inline Columns& operator=( const ElementType& rhs );
3553 inline Columns& operator=( const Columns& rhs );
3555 template< typename MT2,
bool SO2 >
3556 inline Columns& operator=( const Matrix<MT2,SO2>& rhs );
3558 template< typename MT2,
bool SO2 >
3559 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
3560 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
3562 template< typename MT2,
bool SO2 >
3563 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
3564 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
3566 template< typename MT2,
bool SO2 >
3567 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
3568 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
3570 template< typename MT2,
bool SO2 >
3571 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
3572 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
3574 template< typename MT2,
bool SO2 >
3575 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
3576 ->
DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
3578 template< typename MT2,
bool SO2 >
3579 inline auto operator%=( const Matrix<MT2,SO2>& rhs )
3580 ->
EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >;
3587 using DataType::idx;
3588 using DataType::idces;
3591 inline MT& operand() noexcept;
3592 inline const MT& operand() const noexcept;
3594 inline
size_t rows() const noexcept;
3595 inline
size_t spacing() const noexcept;
3596 inline
size_t capacity() const noexcept;
3597 inline
size_t capacity(
size_t j ) const noexcept;
3599 inline
size_t nonZeros(
size_t j ) const;
3600 inline
void reset();
3601 inline
void reset(
size_t j );
3611 template< typename Other > inline Columns& scale( const Other& scalar );
3618 template< typename Other >
3619 inline
bool canAlias( const Other* alias ) const noexcept;
3621 template< typename MT2,
bool SO2,
bool SF2, typename... CCAs2 >
3622 inline
bool canAlias( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
3624 template< typename Other >
3625 inline
bool isAliased( const Other* alias ) const noexcept;
3627 template< typename MT2,
bool SO2,
bool SF2, typename... CCAs2 >
3628 inline
bool isAliased( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
3630 inline
bool isAligned () const noexcept;
3631 inline
bool canSMPAssign() const noexcept;
3633 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,true>& rhs );
3634 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,false>& rhs );
3635 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,true>& rhs );
3636 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,false>& rhs );
3638 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,true>& rhs );
3639 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,false>& rhs );
3640 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,true>& rhs );
3641 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,false>& rhs );
3643 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,true>& rhs );
3644 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,false>& rhs );
3645 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,true>& rhs );
3646 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,false>& rhs );
3648 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,true>& rhs );
3649 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,false>& rhs );
3650 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,true>& rhs );
3651 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,false>& rhs );
3664 template< typename MT2,
bool SO2,
bool DF2,
bool SF2, typename... CCAs2 > friend class Columns;
3704template< typename MT
3705 , typename... CCAs >
3706template< typename... RCAs >
3707inline Columns<MT,false,true,false,CCAs...>::Columns( MT& matrix, RCAs... args )
3708 : DataType( args... )
3709 , matrix_ ( matrix )
3712 for(
size_t j=0UL; j<
columns(); ++j ) {
3713 if( matrix_.columns() <= idx(j) ) {
3742template<
typename MT
3743 ,
typename... CCAs >
3744inline typename Columns<MT,
false,
true,
false,CCAs...>::Reference
3745 Columns<MT,false,true,false,CCAs...>::operator()(
size_t i,
size_t j )
3750 return matrix_(i,idx(j));
3767template<
typename MT
3768 ,
typename... CCAs >
3769inline typename Columns<MT,
false,
true,
false,CCAs...>::ConstReference
3770 Columns<MT,false,true,false,CCAs...>::operator()(
size_t i,
size_t j )
const
3775 return const_cast<const MT&
>( matrix_ )(i,idx(j));
3793template<
typename MT
3794 ,
typename... CCAs >
3795inline typename Columns<MT,
false,
true,
false,CCAs...>::Reference
3796 Columns<MT,false,true,false,CCAs...>::at(
size_t i,
size_t j )
3804 return (*
this)(i,j);
3822template<
typename MT
3823 ,
typename... CCAs >
3824inline typename Columns<MT,
false,
true,
false,CCAs...>::ConstReference
3825 Columns<MT,false,true,false,CCAs...>::at(
size_t i,
size_t j )
const
3833 return (*
this)(i,j);
3849template<
typename MT
3850 ,
typename... CCAs >
3851inline typename Columns<MT,
false,
true,
false,CCAs...>::Pointer
3854 return matrix_.data() + idx(0UL);
3870template<
typename MT
3871 ,
typename... CCAs >
3872inline typename Columns<MT,
false,
true,
false,CCAs...>::ConstPointer
3875 return matrix_.data() + idx(0UL);
3890template<
typename MT
3891 ,
typename... CCAs >
3892inline typename Columns<MT,
false,
true,
false,CCAs...>::Pointer
3895 return matrix_.data() + idx(j);
3910template<
typename MT
3911 ,
typename... CCAs >
3912inline typename Columns<MT,
false,
true,
false,CCAs...>::ConstPointer
3915 return matrix_.data() + idx(j);
3930template<
typename MT
3931 ,
typename... CCAs >
3932inline typename Columns<MT,
false,
true,
false,CCAs...>::Iterator
3936 return Iterator( matrix_, 0UL, idx(j) );
3951template<
typename MT
3952 ,
typename... CCAs >
3953inline typename Columns<MT,
false,
true,
false,CCAs...>::ConstIterator
3957 return ConstIterator( matrix_, 0UL, idx(j) );
3972template<
typename MT
3973 ,
typename... CCAs >
3974inline typename Columns<MT,
false,
true,
false,CCAs...>::ConstIterator
3978 return ConstIterator( matrix_, 0UL, idx(j) );
3993template<
typename MT
3994 ,
typename... CCAs >
3995inline typename Columns<MT,
false,
true,
false,CCAs...>::Iterator
3999 return Iterator( matrix_,
rows(), idx(j) );
4014template<
typename MT
4015 ,
typename... CCAs >
4016inline typename Columns<MT,
false,
true,
false,CCAs...>::ConstIterator
4020 return ConstIterator( matrix_,
rows(), idx(j) );
4035template<
typename MT
4036 ,
typename... CCAs >
4037inline typename Columns<MT,
false,
true,
false,CCAs...>::ConstIterator
4041 return ConstIterator( matrix_,
rows(), idx(j) );
4066template<
typename MT
4067 ,
typename... CCAs >
4068inline Columns<MT,
false,
true,
false,CCAs...>&
4069 Columns<MT,false,true,false,CCAs...>::operator=(
const ElementType& rhs )
4071 for(
size_t j=0UL; j<
columns(); ++j ) {
4097template<
typename MT
4098 ,
typename... CCAs >
4099inline Columns<MT,
false,
true,
false,CCAs...>&
4105 if( list.size() !=
rows() ) {
4109 if( IsRestricted_v<MT> ) {
4110 const InitializerMatrix<ElementType> tmp( list,
columns() );
4111 for(
size_t j=0UL; j<
columns(); ++j ) {
4112 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
4118 decltype(
auto) left( derestrict( *
this ) );
4121 for(
const auto& rowList : list ) {
4123 for(
const auto& element : rowList ) {
4124 matrix_(i,idx(j)) = element;
4128 matrix_(i,idx(j)) = ElementType();
4154template<
typename MT
4155 ,
typename... CCAs >
4156inline Columns<MT,
false,
true,
false,CCAs...>&
4157 Columns<MT,false,true,false,CCAs...>::operator=(
const Columns& rhs )
4165 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && compareIndices( *
this, rhs ) ) )
4168 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
4172 if( IsRestricted_v<MT> ) {
4173 for(
size_t j=0UL; j<
columns(); ++j ) {
4180 decltype(
auto) left( derestrict( *
this ) );
4182 if( rhs.canAlias(
this ) ) {
4183 const ResultType tmp( rhs );
4213template<
typename MT
4214 ,
typename... CCAs >
4215template<
typename MT2
4217inline Columns<MT,
false,
true,
false,CCAs...>&
4218 Columns<MT,false,true,false,CCAs...>::operator=(
const Matrix<MT2,SO2>& rhs )
4225 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
4229 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<MT2>,
const MT2& >;
4230 Right right( *rhs );
4232 if( IsRestricted_v<MT> ) {
4233 for(
size_t j=0UL; j<
columns(); ++j ) {
4240 decltype(
auto) left( derestrict( *
this ) );
4242 if( IsSparseMatrix_v<MT2> ) {
4246 if( IsReference_v<Right> && right.canAlias(
this ) ) {
4247 const ResultType_t<MT2> tmp( right );
4276template<
typename MT
4277 ,
typename... CCAs >
4278template<
typename MT2
4281 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
4290 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
4295 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
4299 if( IsRestricted_v<MT> ) {
4300 for(
size_t j=0UL; j<
columns(); ++j ) {
4307 decltype(
auto) left( derestrict( *
this ) );
4309 if( (*rhs).canAlias(
this ) ) {
4310 const AddType tmp( *
this + (*rhs) );
4339template<
typename MT
4340 ,
typename... CCAs >
4341template<
typename MT2
4344 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
4353 using AddType = AddTrait_t< ResultType, ResultType_t<MT2> >;
4358 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
4362 const AddType tmp( *
this + (*rhs) );
4364 if( IsRestricted_v<MT> ) {
4365 for(
size_t j=0UL; j<
columns(); ++j ) {
4372 decltype(
auto) left( derestrict( *
this ) );
4398template<
typename MT
4399 ,
typename... CCAs >
4400template<
typename MT2
4403 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
4412 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
4417 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
4421 if( IsRestricted_v<MT> ) {
4422 for(
size_t j=0UL; j<
columns(); ++j ) {
4429 decltype(
auto) left( derestrict( *
this ) );
4431 if( (*rhs).canAlias(
this ) ) {
4432 const SubType tmp( *
this - (*rhs ) );
4461template<
typename MT
4462 ,
typename... CCAs >
4463template<
typename MT2
4466 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
4475 using SubType = SubTrait_t< ResultType, ResultType_t<MT2> >;
4480 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
4484 const SubType tmp( *
this - (*rhs) );
4486 if( IsRestricted_v<MT> ) {
4487 for(
size_t j=0UL; j<
columns(); ++j ) {
4494 decltype(
auto) left( derestrict( *
this ) );
4520template<
typename MT
4521 ,
typename... CCAs >
4522template<
typename MT2
4524inline auto Columns<MT,false,true,false,CCAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
4525 -> DisableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
4534 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
4538 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
4542 if( IsRestricted_v<MT> ) {
4543 for(
size_t j=0UL; j<
columns(); ++j ) {
4550 decltype(
auto) left( derestrict( *
this ) );
4552 if( (*rhs).canAlias(
this ) ) {
4553 const SchurType tmp( *
this % (*rhs) );
4554 if( IsSparseMatrix_v<SchurType> )
4584template<
typename MT
4585 ,
typename... CCAs >
4586template<
typename MT2
4588inline auto Columns<MT,false,true,false,CCAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
4589 -> EnableIf_t< EnforceEvaluation_v<MT,MT2>, Columns& >
4598 using SchurType = SchurTrait_t< ResultType, ResultType_t<MT2> >;
4602 if(
rows() != (*rhs).rows() ||
columns() != (*rhs).columns() ) {
4606 const SchurType tmp( *
this % (*rhs) );
4608 if( IsRestricted_v<MT> ) {
4609 for(
size_t j=0UL; j<
columns(); ++j ) {
4616 decltype(
auto) left( derestrict( *
this ) );
4618 if( IsSparseMatrix_v<SchurType> ) {
4646template<
typename MT
4647 ,
typename... CCAs >
4648inline MT& Columns<MT,false,true,false,CCAs...>::operand() noexcept
4662template<
typename MT
4663 ,
typename... CCAs >
4664inline const MT& Columns<MT,false,true,false,CCAs...>::operand() const noexcept
4678template<
typename MT
4679 ,
typename... CCAs >
4682 return matrix_.rows();
4697template<
typename MT
4698 ,
typename... CCAs >
4701 return matrix_.rows();
4713template<
typename MT
4714 ,
typename... CCAs >
4732template<
typename MT
4733 ,
typename... CCAs >
4752template<
typename MT
4753 ,
typename... CCAs >
4756 size_t nonzeros( 0UL );
4758 for(
size_t j=0UL; j<
columns(); ++j ) {
4777template<
typename MT
4778 ,
typename... CCAs >
4783 size_t nonzeros( 0UL );
4785 const size_t index( idx(j) );
4786 for(
size_t i=0UL; i<
rows(); ++i ) {
4803template<
typename MT
4804 ,
typename... CCAs >
4807 for(
size_t j=0UL; j<
columns(); ++j ) {
4824template<
typename MT
4825 ,
typename... CCAs >
4830 const size_t index( idx(j) );
4831 for(
size_t i=0UL; i<
rows(); ++i ) {
4832 reset( matrix_( i, index ) );
4860template<
typename MT
4861 ,
typename... CCAs >
4862inline Columns<MT,
false,
true,
false,CCAs...>&
4872 const ResultType tmp(
trans( *
this ) );
4874 if( IsRestricted_v<MT> ) {
4875 for(
size_t j=0UL; j<
columns(); ++j ) {
4876 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
4882 decltype(
auto) left( derestrict( *
this ) );
4905template<
typename MT
4906 ,
typename... CCAs >
4907inline Columns<MT,
false,
true,
false,CCAs...>&
4917 const ResultType tmp(
ctrans( *
this ) );
4919 if( IsRestricted_v<MT> ) {
4920 for(
size_t j=0UL; j<
columns(); ++j ) {
4921 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
4927 decltype(
auto) left( derestrict( *
this ) );
4950template<
typename MT
4951 ,
typename... CCAs >
4952template<
typename Other >
4953inline Columns<MT,
false,
true,
false,CCAs...>&
4954 Columns<MT,false,true,false,CCAs...>::scale(
const Other& scalar )
4960 for(
size_t j=0UL; j<
columns(); ++j )
4962 const size_t index ( idx(j) );
4963 const size_t ibegin( IsLower<MT>::value ? ( IsStrictlyLower_v<MT> ? index+1UL : index ) : 0UL );
4964 const size_t iend ( IsUpper<MT>::value ? ( IsStrictlyUpper_v<MT> ? index : index+1UL ) :
rows() );
4966 for(
size_t i=ibegin; i<iend; ++i ) {
4967 matrix_(i,index) *= scalar;
4996template<
typename MT
4997 ,
typename... CCAs >
4998template<
typename Other >
4999inline bool Columns<MT,false,true,false,CCAs...>::canAlias(
const Other* alias )
const noexcept
5001 return matrix_.isAliased( &unview( *alias ) );
5019template<
typename MT
5020 ,
typename... CCAs >
5021template<
typename MT2
5024 ,
typename... CCAs2 >
5026 Columns<MT,false,true,false,CCAs...>::canAlias(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
5028 return matrix_.isAliased( &alias->matrix_ );
5045template<
typename MT
5046 ,
typename... CCAs >
5047template<
typename Other >
5048inline bool Columns<MT,false,true,false,CCAs...>::isAliased(
const Other* alias )
const noexcept
5050 return matrix_.isAliased( &unview( *alias ) );
5068template<
typename MT
5069 ,
typename... CCAs >
5070template<
typename MT2
5073 ,
typename... CCAs2 >
5075 Columns<MT,false,true,false,CCAs...>::isAliased(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
5077 return matrix_.isAliased( &alias->matrix_ );
5093template<
typename MT
5094 ,
typename... CCAs >
5095inline bool Columns<MT,false,true,false,CCAs...>::isAligned() const noexcept
5114template<
typename MT
5115 ,
typename... CCAs >
5116inline bool Columns<MT,false,true,false,CCAs...>::canSMPAssign() const noexcept
5118 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
5136template<
typename MT
5137 ,
typename... CCAs >
5138template<
typename MT2 >
5139inline void Columns<MT,false,true,false,CCAs...>::assign(
const DenseMatrix<MT2,true>& rhs )
5150 for(
size_t j=0UL; j<
columns(); ++j ) {
5151 const size_t index( idx(j) );
5152 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5153 matrix_(i ,index) = (*rhs)(i ,j);
5154 matrix_(i+1UL,index) = (*rhs)(i+1UL,j);
5156 if( ipos <
rows() ) {
5157 matrix_(ipos,index) = (*rhs)(ipos,j);
5177template<
typename MT
5178 ,
typename... CCAs >
5179template<
typename MT2 >
5180inline void Columns<MT,false,true,false,CCAs...>::assign(
const DenseMatrix<MT2,false>& rhs )
5190 constexpr size_t block( BLOCK_SIZE );
5194 const size_t ipos(
prevMultiple( (*rhs).rows(), 2UL ) );
5197 for(
size_t j=0UL; j<
columns(); ++j ) {
5198 const size_t index( idx(j) );
5199 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5200 matrix_(i ,index) = (*rhs)(i ,j);
5201 matrix_(i+1UL,index) = (*rhs)(i+1UL,j);
5203 if( ipos < (*rhs).rows() ) {
5204 matrix_(ipos,index) = (*rhs)(ipos,j);
5210 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5211 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5212 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5213 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5214 for(
size_t j=jj; j<jend; ++j ) {
5215 const size_t index( idx(j) );
5216 for(
size_t i=ii; i<iend; ++i ) {
5217 matrix_(i,index) = (*rhs)(i,j);
5240template<
typename MT
5241 ,
typename... CCAs >
5242template<
typename MT2 >
5243inline void Columns<MT,false,true,false,CCAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
5251 for(
size_t j=0UL; j<
columns(); ++j ) {
5252 const size_t index( idx(j) );
5253 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
5254 matrix_(element->index(),index) = element->value();
5273template<
typename MT
5274 ,
typename... CCAs >
5275template<
typename MT2 >
5276inline void Columns<MT,false,true,false,CCAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
5286 for(
size_t i=0UL; i<
rows(); ++i ) {
5287 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
5288 matrix_(i,idx(element->index())) = element->value();
5307template<
typename MT
5308 ,
typename... CCAs >
5309template<
typename MT2 >
5310inline void Columns<MT,false,true,false,CCAs...>::addAssign(
const DenseMatrix<MT2,true>& rhs )
5321 for(
size_t j=0UL; j<
columns(); ++j )
5323 const size_t index( idx(j) );
5324 if( IsDiagonal_v<MT2> ) {
5325 matrix_(j,index) += (*rhs)(j,j);
5328 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5329 matrix_(i ,index) += (*rhs)(i ,j);
5330 matrix_(i+1UL,index) += (*rhs)(i+1UL,j);
5332 if( ipos <
rows() ) {
5333 matrix_(ipos,index) += (*rhs)(ipos,j);
5354template<
typename MT
5355 ,
typename... CCAs >
5356template<
typename MT2 >
5357inline void Columns<MT,false,true,false,CCAs...>::addAssign(
const DenseMatrix<MT2,false>& rhs )
5367 constexpr size_t block( BLOCK_SIZE );
5371 const size_t ipos(
prevMultiple( (*rhs).rows(), 2UL ) );
5374 for(
size_t j=0UL; j<
columns(); ++j ) {
5375 const size_t index( idx(j) );
5376 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5377 matrix_(i ,index) += (*rhs)(i ,j);
5378 matrix_(i+1UL,index) += (*rhs)(i+1UL,j);
5380 if( ipos < (*rhs).rows() )
5381 matrix_(ipos,index) += (*rhs)(ipos,j);
5386 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5387 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5388 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5389 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5390 for(
size_t j=jj; j<jend; ++j ) {
5391 const size_t index( idx(j) );
5392 for(
size_t i=ii; i<iend; ++i ) {
5393 matrix_(i,index) += (*rhs)(i,j);
5416template<
typename MT
5417 ,
typename... CCAs >
5418template<
typename MT2 >
5419inline void Columns<MT,false,true,false,CCAs...>::addAssign(
const SparseMatrix<MT2,true>& rhs )
5427 for(
size_t j=0UL; j<
columns(); ++j ) {
5428 const size_t index( idx(j) );
5429 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
5430 matrix_(element->index(),index) += element->value();
5449template<
typename MT
5450 ,
typename... CCAs >
5451template<
typename MT2 >
5452inline void Columns<MT,false,true,false,CCAs...>::addAssign(
const SparseMatrix<MT2,false>& rhs )
5462 for(
size_t i=0UL; i<
rows(); ++i ) {
5463 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
5464 matrix_(i,idx(element->index())) += element->value();
5483template<
typename MT
5484 ,
typename... CCAs >
5485template<
typename MT2 >
5486inline void Columns<MT,false,true,false,CCAs...>::subAssign(
const DenseMatrix<MT2,true>& rhs )
5497 for(
size_t j=0UL; j<
columns(); ++j )
5499 const size_t index( idx(j) );
5501 if( IsDiagonal_v<MT2> ) {
5502 matrix_(j,index) -= (*rhs)(j,j);
5505 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5506 matrix_(i ,index) -= (*rhs)(i ,j);
5507 matrix_(i+1UL,index) -= (*rhs)(i+1UL,j);
5509 if( ipos <
rows() ) {
5510 matrix_(ipos,index) -= (*rhs)(ipos,j);
5531template<
typename MT
5532 ,
typename... CCAs >
5533template<
typename MT2 >
5534inline void Columns<MT,false,true,false,CCAs...>::subAssign(
const DenseMatrix<MT2,false>& rhs )
5544 constexpr size_t block( BLOCK_SIZE );
5548 const size_t ipos(
prevMultiple( (*rhs).rows(), 2UL ) );
5551 for(
size_t j=0UL; j<
columns(); ++j ) {
5552 const size_t index( idx(j) );
5553 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5554 matrix_(i ,index) -= (*rhs)(i ,j);
5555 matrix_(i+1UL,index) -= (*rhs)(i+1UL,j);
5557 if( ipos < (*rhs).rows() )
5558 matrix_(ipos,index) -= (*rhs)(ipos,j);
5563 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5564 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5565 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5566 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5567 for(
size_t j=jj; j<jend; ++j ) {
5568 const size_t index( idx(j) );
5569 for(
size_t i=ii; i<iend; ++i ) {
5570 matrix_(i,index) -= (*rhs)(i,j);
5593template<
typename MT
5594 ,
typename... CCAs >
5595template<
typename MT2 >
5596inline void Columns<MT,false,true,false,CCAs...>::subAssign(
const SparseMatrix<MT2,true>& rhs )
5604 for(
size_t j=0UL; j<
columns(); ++j ) {
5605 const size_t index( idx(j) );
5606 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element )
5607 matrix_(element->index(),index) -= element->value();
5626template<
typename MT
5627 ,
typename... CCAs >
5628template<
typename MT2 >
5629inline void Columns<MT,false,true,false,CCAs...>::subAssign(
const SparseMatrix<MT2,false>& rhs )
5639 for(
size_t i=0UL; i<
rows(); ++i ) {
5640 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element )
5641 matrix_(i,idx(element->index())) -= element->value();
5660template<
typename MT
5661 ,
typename... CCAs >
5662template<
typename MT2 >
5663inline void Columns<MT,false,true,false,CCAs...>::schurAssign(
const DenseMatrix<MT2,true>& rhs )
5674 for(
size_t j=0UL; j<
columns(); ++j ) {
5675 const size_t index( idx(j) );
5676 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5677 matrix_(i ,index) *= (*rhs)(i ,j);
5678 matrix_(i+1UL,index) *= (*rhs)(i+1UL,j);
5680 if( ipos <
rows() ) {
5681 matrix_(ipos,index) *= (*rhs)(ipos,j);
5701template<
typename MT
5702 ,
typename... CCAs >
5703template<
typename MT2 >
5704inline void Columns<MT,false,true,false,CCAs...>::schurAssign(
const DenseMatrix<MT2,false>& rhs )
5714 constexpr size_t block( BLOCK_SIZE );
5718 const size_t ipos(
prevMultiple( (*rhs).rows(), 2UL ) );
5721 for(
size_t j=0UL; j<
columns(); ++j ) {
5722 const size_t index( idx(j) );
5723 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5724 matrix_(i ,index) *= (*rhs)(i ,j);
5725 matrix_(i+1UL,index) *= (*rhs)(i+1UL,j);
5727 if( ipos < (*rhs).rows() )
5728 matrix_(ipos,index) *= (*rhs)(ipos,j);
5733 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5734 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5735 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5736 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5737 for(
size_t j=jj; j<jend; ++j ) {
5738 const size_t index( idx(j) );
5739 for(
size_t i=ii; i<iend; ++i ) {
5740 matrix_(i,index) *= (*rhs)(i,j);
5763template<
typename MT
5764 ,
typename... CCAs >
5765template<
typename MT2 >
5766inline void Columns<MT,false,true,false,CCAs...>::schurAssign(
const SparseMatrix<MT2,true>& rhs )
5776 for(
size_t j=0UL; j<
columns(); ++j )
5778 const size_t index( idx(j) );
5781 for( ConstIterator_t<MT2> element=(*rhs).begin(j); element!=(*rhs).end(j); ++element ) {
5782 for( ; i<element->index(); ++i )
5783 reset( matrix_(i,index) );
5784 matrix_(i,index) *= element->value();
5788 for( ; i<
rows(); ++i ) {
5789 reset( matrix_(i,index) );
5809template<
typename MT
5810 ,
typename... CCAs >
5811template<
typename MT2 >
5812inline void Columns<MT,false,true,false,CCAs...>::schurAssign(
const SparseMatrix<MT2,false>& rhs )
5824 for(
size_t i=0UL; i<
rows(); ++i )
5828 for( ConstIterator_t<MT2> element=(*rhs).begin(i); element!=(*rhs).end(i); ++element ) {
5829 for( ; j<element->index(); ++j )
5830 reset( matrix_(i,idx(j)) );
5831 matrix_(i,idx(j)) *= element->value();
5836 reset( matrix_(i,idx(j)) );
5864template<
typename MT
5865 ,
typename... CCAs >
5866class Columns<MT,false,true,true,CCAs...>
5867 :
public View< DenseMatrix< Columns<MT,false,true,true,CCAs...>, true > >
5868 ,
private ColumnsData<CCAs...>
5872 using DataType = ColumnsData<CCAs...>;
5873 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
5883 using This = Columns<MT,
false,
true,
true,CCAs...>;
5886 using BaseType = View< DenseMatrix<This,true> >;
5888 using ViewedType = MT;
5889 using ResultType = ColumnsTrait_t<MT,N>;
5890 using OppositeType = OppositeType_t<ResultType>;
5891 using TransposeType = TransposeType_t<ResultType>;
5892 using ElementType = ElementType_t<MT>;
5893 using SIMDType = SIMDTrait_t<ElementType>;
5894 using ReturnType = ReturnType_t<MT>;
5895 using CompositeType =
const Columns&;
5898 using ConstReference = ConstReference_t<MT>;
5901 using Reference = If_t< IsConst_v<MT>, ConstReference, Reference_t<MT> >;
5904 using ConstPointer = ConstPointer_t<MT>;
5907 using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
5910 using ConstIterator = ConstIterator_t<MT>;
5913 using Iterator = If_t< IsConst_v<MT>, ConstIterator, Iterator_t<MT> >;
5918 static constexpr bool simdEnabled = MT::simdEnabled;
5921 static constexpr bool smpAssignable = MT::smpAssignable;
5924 static constexpr bool compileTimeArgs = DataType::compileTimeArgs;
5930 template<
typename... RCAs >
5931 explicit inline Columns( MT& matrix, RCAs... args );
5933 Columns(
const Columns& ) =
default;
5934 Columns( Columns&& ) =
default;
5941 ~Columns() =
default;
5948 inline Reference operator()(
size_t i,
size_t j );
5949 inline ConstReference operator()(
size_t i,
size_t j )
const;
5950 inline Reference at(
size_t i,
size_t j );
5951 inline ConstReference at(
size_t i,
size_t j )
const;
5952 inline Pointer
data () noexcept;
5953 inline ConstPointer
data () const noexcept;
5954 inline Pointer
data (
size_t j ) noexcept;
5955 inline ConstPointer
data (
size_t j ) const noexcept;
5956 inline Iterator
begin (
size_t j );
5957 inline ConstIterator
begin (
size_t j ) const;
5958 inline ConstIterator
cbegin(
size_t j ) const;
5959 inline Iterator
end (
size_t j );
5960 inline ConstIterator
end (
size_t j ) const;
5961 inline ConstIterator
cend (
size_t j ) const;
5968 inline Columns& operator=( const ElementType& rhs );
5970 Columns& operator=( const Columns& ) = delete;
5977 using DataType::idx;
5978 using DataType::idces;
5981 inline MT& operand() noexcept;
5982 inline const MT& operand() const noexcept;
5984 inline
size_t rows() const noexcept;
5985 inline
size_t spacing() const noexcept;
5986 inline
size_t capacity() const noexcept;
5987 inline
size_t capacity(
size_t j ) const noexcept;
5989 inline
size_t nonZeros(
size_t j ) const;
5990 inline
void reset();
5991 inline
void reset(
size_t j );
5998 template< typename Other >
5999 inline
bool canAlias( const Other* alias ) const noexcept;
6001 template< typename MT2,
bool SO2,
bool SF2, typename... CCAs2 >
6002 inline
bool canAlias( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
6004 template< typename Other >
6005 inline
bool isAliased( const Other* alias ) const noexcept;
6007 template< typename MT2,
bool SO2,
bool SF2, typename... CCAs2 >
6008 inline
bool isAliased( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
6010 inline
bool isAligned () const noexcept;
6011 inline
bool canSMPAssign() const noexcept;
6028 template< typename MT2,
bool SO2,
bool DF2,
bool SF2, typename... CCAs2 > friend class Columns;
6068template< typename MT
6069 , typename... CCAs >
6070template< typename... RCAs >
6071inline Columns<MT,false,true,true,CCAs...>::Columns( MT& matrix, RCAs... args )
6072 : DataType( args... )
6073 , matrix_ ( matrix )
6076 for(
size_t j=0UL; j<
columns(); ++j ) {
6077 if( matrix_.columns() <= idx(j) ) {
6106template<
typename MT
6107 ,
typename... CCAs >
6108inline typename Columns<MT,
false,
true,
true,CCAs...>::Reference
6109 Columns<MT,false,true,true,CCAs...>::operator()(
size_t i,
size_t j )
6114 return matrix_(idx(j),i);
6131template<
typename MT
6132 ,
typename... CCAs >
6133inline typename Columns<MT,
false,
true,
true,CCAs...>::ConstReference
6134 Columns<MT,false,true,true,CCAs...>::operator()(
size_t i,
size_t j )
const
6139 return const_cast<const MT&
>( matrix_ )(idx(j),i);
6157template<
typename MT
6158 ,
typename... CCAs >
6159inline typename Columns<MT,
false,
true,
true,CCAs...>::Reference
6160 Columns<MT,false,true,true,CCAs...>::at(
size_t i,
size_t j )
6168 return (*
this)(i,j);
6186template<
typename MT
6187 ,
typename... CCAs >
6188inline typename Columns<MT,
false,
true,
true,CCAs...>::ConstReference
6189 Columns<MT,false,true,true,CCAs...>::at(
size_t i,
size_t j )
const
6197 return (*
this)(i,j);
6213template<
typename MT
6214 ,
typename... CCAs >
6215inline typename Columns<MT,
false,
true,
true,CCAs...>::Pointer
6218 return matrix_.data( idx(0UL) );
6234template<
typename MT
6235 ,
typename... CCAs >
6236inline typename Columns<MT,
false,
true,
true,CCAs...>::ConstPointer
6239 return matrix_.data( idx(0UL) );
6254template<
typename MT
6255 ,
typename... CCAs >
6256inline typename Columns<MT,
false,
true,
true,CCAs...>::Pointer
6259 return matrix_.data( idx(j) );
6274template<
typename MT
6275 ,
typename... CCAs >
6276inline typename Columns<MT,
false,
true,
true,CCAs...>::ConstPointer
6279 return matrix_.data( idx(j) );
6294template<
typename MT
6295 ,
typename... CCAs >
6296inline typename Columns<MT,
false,
true,
true,CCAs...>::Iterator
6300 return matrix_.begin( idx(j) );
6315template<
typename MT
6316 ,
typename... CCAs >
6317inline typename Columns<MT,
false,
true,
true,CCAs...>::ConstIterator
6321 return matrix_.cbegin( idx(j) );
6336template<
typename MT
6337 ,
typename... CCAs >
6338inline typename Columns<MT,
false,
true,
true,CCAs...>::ConstIterator
6342 return matrix_.cbegin( idx(j) );
6357template<
typename MT
6358 ,
typename... CCAs >
6359inline typename Columns<MT,
false,
true,
true,CCAs...>::Iterator
6363 return matrix_.end( idx(j) );
6378template<
typename MT
6379 ,
typename... CCAs >
6380inline typename Columns<MT,
false,
true,
true,CCAs...>::ConstIterator
6384 return matrix_.cend( idx(j) );
6399template<
typename MT
6400 ,
typename... CCAs >
6401inline typename Columns<MT,
false,
true,
true,CCAs...>::ConstIterator
6405 return matrix_.cend( idx(j) );
6430template<
typename MT
6431 ,
typename... CCAs >
6432inline Columns<MT,
false,
true,
true,CCAs...>&
6433 Columns<MT,false,true,true,CCAs...>::operator=(
const ElementType& rhs )
6435 for(
size_t j=0UL; j<
columns(); ++j ) {
6459template<
typename MT
6460 ,
typename... CCAs >
6461inline MT& Columns<MT,false,true,true,CCAs...>::operand() noexcept
6475template<
typename MT
6476 ,
typename... CCAs >
6477inline const MT& Columns<MT,false,true,true,CCAs...>::operand() const noexcept
6491template<
typename MT
6492 ,
typename... CCAs >
6495 return matrix_.rows();
6510template<
typename MT
6511 ,
typename... CCAs >
6514 return matrix_.spacing();
6526template<
typename MT
6527 ,
typename... CCAs >
6545template<
typename MT
6546 ,
typename... CCAs >
6565template<
typename MT
6566 ,
typename... CCAs >
6569 size_t nonzeros( 0UL );
6571 for(
size_t j=0UL; j<
columns(); ++j ) {
6572 nonzeros += matrix_.nonZeros( idx(j) );
6590template<
typename MT
6591 ,
typename... CCAs >
6596 return matrix_.nonZeros( idx(j) );
6608template<
typename MT
6609 ,
typename... CCAs >
6612 for(
size_t j=0UL; j<
columns(); ++j ) {
6613 matrix_.reset( idx(j) );
6629template<
typename MT
6630 ,
typename... CCAs >
6633 matrix_.reset( idx(j) );
6656template<
typename MT
6657 ,
typename... CCAs >
6658template<
typename Other >
6659inline bool Columns<MT,false,true,true,CCAs...>::canAlias(
const Other* alias )
const noexcept
6661 return matrix_.isAliased( &unview( *alias ) );
6679template<
typename MT
6680 ,
typename... CCAs >
6681template<
typename MT2
6684 ,
typename... CCAs2 >
6686 Columns<MT,false,true,true,CCAs...>::canAlias(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
6688 return matrix_.isAliased( &alias->matrix_ );
6705template<
typename MT
6706 ,
typename... CCAs >
6707template<
typename Other >
6708inline bool Columns<MT,false,true,true,CCAs...>::isAliased(
const Other* alias )
const noexcept
6710 return matrix_.isAliased( &unview( *alias ) );
6728template<
typename MT
6729 ,
typename... CCAs >
6730template<
typename MT2
6733 ,
typename... CCAs2 >
6735 Columns<MT,false,true,true,CCAs...>::isAliased(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
6737 return matrix_.isAliased( &alias->matrix_ );
6753template<
typename MT
6754 ,
typename... CCAs >
6755inline bool Columns<MT,false,true,true,CCAs...>::isAligned() const noexcept
6757 return matrix_.isAligned();
6774template<
typename MT
6775 ,
typename... CCAs >
6776inline bool Columns<MT,false,true,true,CCAs...>::canSMPAssign() const noexcept
6778 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
6799template<
typename MT
6800 ,
typename... CCAs >
6802 Columns<MT,false,true,true,CCAs...>::load(
size_t i,
size_t j )
const noexcept
6804 return matrix_.load( idx(j), i );
6825template<
typename MT
6826 ,
typename... CCAs >
6830 return matrix_.loada( idx(j), i );
6851template<
typename MT
6852 ,
typename... CCAs >
6856 return matrix_.loadu( idx(j), i );
Header file for the addition trait.
Header file for auxiliary alias declarations.
Header file for run time assertion macros.
Header file for kernel specific block sizes.
Header file for the blaze::checked and blaze::unchecked instances.
Constraints on the storage order of matrix types.
Header file for the implementation of the ColumnsData class template.
Header file for the columns trait.
constexpr const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:751
constexpr const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:719
Header file for the EnableIf class template.
Header file for the HasMutableDataAccess type trait.
Header file for the HasSIMDAdd type trait.
Header file for the HasSIMDMult type trait.
Header file for the HasSIMDSub type trait.
Constraint on the data type.
Header file for the If class template.
Header file for the IsConst type trait.
Header file for the IsDiagonal type trait.
Header file for the IsExpression type trait class.
Header file for the IsLower type trait.
Header file for the IsReference type trait.
Header file for the IsRestricted type trait.
Header file for the IsSIMDCombinable type trait.
Header file for the IsSparseMatrix type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsUpper type trait.
Header file for the MAYBE_UNUSED function template.
Constraint on the data type.
Header file for the prevMultiple shim.
Constraint on the data type.
Constraints on the storage order of matrix types.
Header file for all SIMD functionality.
Header file for the Schur product trait.
Header file for the subtraction trait.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Initializer list type of the Blaze library.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
Header file for the DenseMatrix base class.
Header file for the View base class.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:137
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.
Definition: Pointer.h:79
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.
Definition: Vectorizable.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.
Definition: Reference.h:79
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1501
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:182
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:386
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:265
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:9640
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:448
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:207
bool isDefault(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the given diagonal matrix is in default state.
Definition: DiagonalMatrix.h:169
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: RowMajorMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition: RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Hermitian.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.
Definition: TransExpr.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SUBMATRIX_TYPE(T)
Constraint on the data type.
Definition: Submatrix.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:60
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition: DenseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: UniTriangular.h:81
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: ColumnMajorMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COLUMNS_TYPE(T)
Constraint on the data type.
Definition: Columns.h:81
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.
Definition: HasSIMDSub.h:187
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.
Definition: IsSIMDCombinable.h:137
constexpr bool IsDiagonal_v
Auxiliary variable template for the IsDiagonal type trait.
Definition: IsDiagonal.h:148
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.
Definition: HasSIMDAdd.h:187
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.
Definition: HasSIMDMult.h:188
BLAZE_ALWAYS_INLINE constexpr auto prevMultiple(T1 value, T2 factor) noexcept
Rounds down an integral value to the previous multiple of a given factor.
Definition: PrevMultiple.h:68
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:370
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:253
constexpr bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:332
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:446
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
constexpr bool operator<=(const NegativeAccuracy< A > &, const T &rhs)
Less-or-equal-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:408
MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:628
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:644
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:730
MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:562
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:692
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition: Matrix.h:806
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:660
MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:584
void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:1221
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:518
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:676
void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:1195
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:137
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition: Assert.h:117
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:78
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:75
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:74
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
auto smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition: Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
#define BLAZE_THROW_LOGIC_ERROR(MESSAGE)
Macro for the emission of a std::logic_error exception.
Definition: Exception.h:187
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:175
constexpr bool isChecked(const Ts &... args)
Extracting blaze::Check arguments from a given list of arguments.
Definition: Check.h:225
constexpr Unchecked unchecked
Global Unchecked instance.
Definition: Check.h:146
Header file for the exception macros of the math module.
Header file for the extended initializer_list functionality.
Header file for the reset shim.
Header file for the cache size of the target architecture.
System settings for the inline keywords.
System settings for performance optimizations.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.
Header file for the implementation of the Columns base template.