35 #ifndef _BLAZE_MATH_VIEWS_COLUMNS_DENSE_H_ 36 #define _BLAZE_MATH_VIEWS_COLUMNS_DENSE_H_ 126 template<
typename MT
129 class Columns<MT,true,true,SF,CCAs...>
130 :
public View< DenseMatrix< Columns<MT,true,true,SF,CCAs...>, true > >
131 ,
private ColumnsData<CCAs...>
135 using DataType = ColumnsData<CCAs...>;
136 using Operand = If_< IsExpression<MT>, MT, MT& >;
142 using This = Columns<MT,
true,
true,SF,CCAs...>;
144 using BaseType = DenseMatrix<This,true>;
145 using ViewedType = MT;
150 using SIMDType = SIMDTrait_<ElementType>;
161 using ConstPointer = ConstPointer_<MT>;
164 using Pointer = If_< Or< IsConst<MT>, Not< HasMutableDataAccess<MT> > >, ConstPointer, Pointer_<MT> >;
175 enum :
bool { simdEnabled = MT::simdEnabled };
178 enum :
bool { smpAssignable = MT::smpAssignable };
184 template<
typename... RCAs >
185 explicit inline Columns( MT& matrix, RCAs... args );
187 inline Columns(
const Columns& ) =
default;
188 inline Columns( Columns&& ) =
default;
199 inline Reference operator()(
size_t i,
size_t j );
200 inline ConstReference operator()(
size_t i,
size_t j )
const;
201 inline Reference at(
size_t i,
size_t j );
202 inline ConstReference at(
size_t i,
size_t j )
const;
203 inline Pointer
data () noexcept;
204 inline ConstPointer
data () const noexcept;
205 inline Pointer
data (
size_t j ) noexcept;
206 inline ConstPointer
data (
size_t j ) const noexcept;
208 inline ConstIterator
begin (
size_t j ) const;
209 inline ConstIterator
cbegin(
size_t j ) const;
211 inline ConstIterator
end (
size_t j ) const;
212 inline ConstIterator
cend (
size_t j ) const;
219 inline Columns& operator=( const
ElementType& rhs );
220 inline Columns& operator=( initializer_list< initializer_list<
ElementType> > list );
221 inline Columns& operator=( const Columns& rhs );
223 template< typename MT2,
bool SO2 >
224 inline Columns& operator=( const Matrix<MT2,SO2>& rhs );
226 template< typename MT2,
bool SO2 >
227 inline
DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns& >
228 operator+=( const Matrix<MT2,SO2>& rhs );
230 template< typename MT2,
bool SO2 >
231 inline
EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns& >
232 operator+=( const Matrix<MT2,SO2>& rhs );
234 template< typename MT2,
bool SO2 >
235 inline
DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns& >
236 operator-=( const Matrix<MT2,SO2>& rhs );
238 template< typename MT2,
bool SO2 >
239 inline
EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns& >
240 operator-=( const Matrix<MT2,SO2>& rhs );
242 template< typename MT2,
bool SO2 >
243 inline
DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns& >
244 operator%=( const Matrix<MT2,SO2>& rhs );
246 template< typename MT2,
bool SO2 >
247 inline
EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns& >
248 operator%=( const Matrix<MT2,SO2>& rhs );
256 using DataType::idces;
259 inline MT& operand() noexcept;
260 inline const MT& operand() const noexcept;
262 inline
size_t rows() const noexcept;
263 inline
size_t spacing() const noexcept;
264 inline
size_t capacity() const noexcept;
265 inline
size_t capacity(
size_t j ) const noexcept;
267 inline
size_t nonZeros(
size_t j ) const;
269 inline
void reset(
size_t j );
279 template< typename Other > inline Columns& scale( const Other& scalar );
286 template< typename MT2 >
287 struct VectorizedAssign {
288 enum :
bool { value = useOptimizedKernels &&
289 simdEnabled && MT2::simdEnabled &&
290 IsSIMDCombinable< ElementType, ElementType_<MT2> >::value };
296 template<
typename MT2 >
297 struct VectorizedAddAssign {
298 enum :
bool { value = useOptimizedKernels &&
299 simdEnabled && MT2::simdEnabled &&
300 IsSIMDCombinable< ElementType, ElementType_<MT2> >::value &&
301 HasSIMDAdd< ElementType, ElementType_<MT2> >::value &&
302 !IsDiagonal<MT2>::value };
308 template<
typename MT2 >
309 struct VectorizedSubAssign {
310 enum :
bool { value = useOptimizedKernels &&
311 simdEnabled && MT2::simdEnabled &&
312 IsSIMDCombinable< ElementType, ElementType_<MT2> >::value &&
313 HasSIMDSub< ElementType, ElementType_<MT2> >::value &&
314 !IsDiagonal<MT2>::value };
320 template<
typename MT2 >
321 struct VectorizedSchurAssign {
322 enum :
bool { value = useOptimizedKernels &&
323 simdEnabled && MT2::simdEnabled &&
324 IsSIMDCombinable< ElementType, ElementType_<MT2> >::value &&
325 HasSIMDMult< ElementType, ElementType_<MT2> >::value };
338 template<
typename Other >
339 inline bool canAlias(
const Other* alias )
const noexcept;
341 template<
typename MT2,
bool SO2,
bool SF2,
size_t... CCAs2 >
342 inline bool canAlias(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept;
344 template<
typename Other >
345 inline bool isAliased(
const Other* alias )
const noexcept;
347 template<
typename MT2,
bool SO2,
bool SF2,
size_t... CCAs2 >
348 inline bool isAliased(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept;
350 inline bool isAligned () const noexcept;
351 inline
bool canSMPAssign() const noexcept;
362 template< typename MT2 >
363 inline
DisableIf_< VectorizedAssign<MT2> > assign( const DenseMatrix<MT2,true>& rhs );
365 template< typename MT2 >
366 inline
EnableIf_< VectorizedAssign<MT2> > assign( const DenseMatrix<MT2,true>& rhs );
368 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,false>& rhs );
370 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,true>& rhs );
371 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,false>& rhs );
373 template< typename MT2 >
374 inline
DisableIf_< VectorizedAddAssign<MT2> > addAssign( const DenseMatrix<MT2,true>& rhs );
376 template< typename MT2 >
377 inline
EnableIf_< VectorizedAddAssign<MT2> > addAssign( const DenseMatrix<MT2,true>& rhs );
379 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,false>& rhs );
380 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,true>& rhs );
381 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,false>& rhs );
383 template< typename MT2 >
384 inline
DisableIf_< VectorizedSubAssign<MT2> > subAssign( const DenseMatrix<MT2,true>& rhs );
386 template< typename MT2 >
387 inline
EnableIf_< VectorizedSubAssign<MT2> > subAssign( const DenseMatrix<MT2,true>& rhs );
389 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,false>& rhs );
390 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,true>& rhs );
391 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,false>& rhs );
393 template< typename MT2 >
394 inline
DisableIf_< VectorizedSchurAssign<MT2> > schurAssign( const DenseMatrix<MT2,true>& rhs );
396 template< typename MT2 >
397 inline
EnableIf_< VectorizedSchurAssign<MT2> > schurAssign( const DenseMatrix<MT2,true>& rhs );
399 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,false>& rhs );
400 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,true>& rhs );
401 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,false>& rhs );
414 template< typename MT2,
bool SO2,
bool DF2,
bool SF2,
size_t... CCAs2 > friend class Columns;
453 template< typename MT
456 template< typename... RCAs >
457 inline Columns<MT,true,true,SF,CCAs...>::Columns( MT& matrix, RCAs... args )
458 : DataType( args... )
461 if( !Contains< TypeList<RCAs...>,
Unchecked >::value ) {
462 for(
size_t j=0UL; j<
columns(); ++j ) {
463 if( matrix_.columns() <= idx(j) ) {
492 template<
typename MT
495 inline typename Columns<MT,
true,
true,SF,CCAs...>
::Reference 496 Columns<MT,true,true,SF,CCAs...>::operator()(
size_t i,
size_t j )
501 return matrix_(i,idx(j));
518 template<
typename MT
522 Columns<MT,true,true,SF,CCAs...>::operator()(
size_t i,
size_t j )
const 527 return const_cast<const MT&
>( matrix_ )(i,idx(j));
545 template<
typename MT
548 inline typename Columns<MT,
true,
true,SF,CCAs...>
::Reference 549 Columns<MT,true,true,SF,CCAs...>::at(
size_t i,
size_t j )
575 template<
typename MT
579 Columns<MT,true,true,SF,CCAs...>::at(
size_t i,
size_t j )
const 603 template<
typename MT
606 inline typename Columns<MT,
true,
true,SF,CCAs...>::Pointer
609 return matrix_.data( idx(0UL) );
625 template<
typename MT
628 inline typename Columns<MT,
true,
true,SF,CCAs...>::ConstPointer
631 return matrix_.data( idx(0UL) );
646 template<
typename MT
649 inline typename Columns<MT,
true,
true,SF,CCAs...>::Pointer
652 return matrix_.data( idx(j) );
667 template<
typename MT
670 inline typename Columns<MT,
true,
true,SF,CCAs...>::ConstPointer
673 return matrix_.data( idx(j) );
688 template<
typename MT
691 inline typename Columns<MT,
true,
true,SF,CCAs...>
::Iterator 695 return matrix_.begin( idx(j) );
710 template<
typename MT
717 return matrix_.cbegin( idx(j) );
732 template<
typename MT
739 return matrix_.cbegin( idx(j) );
754 template<
typename MT
757 inline typename Columns<MT,
true,
true,SF,CCAs...>
::Iterator 761 return matrix_.end( idx(j) );
776 template<
typename MT
783 return matrix_.cend( idx(j) );
798 template<
typename MT
805 return matrix_.cend( idx(j) );
830 template<
typename MT
833 inline Columns<MT,
true,
true,SF,CCAs...>&
834 Columns<MT,true,true,SF,CCAs...>::operator=(
const ElementType& rhs )
836 for(
size_t j=0UL; j<
columns(); ++j ) {
862 template<
typename MT
865 inline Columns<MT,
true,
true,SF,CCAs...>&
866 Columns<MT,true,true,SF,CCAs...>::operator=( initializer_list< initializer_list<ElementType> > list )
871 if( list.size() !=
rows() ) {
875 if( IsRestricted<MT>::value ) {
876 const InitializerMatrix<ElementType> tmp( list,
columns() );
877 for(
size_t j=0UL; j<
columns(); ++j ) {
878 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
884 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
887 for(
const auto& rowList : list ) {
889 for(
const auto& element : rowList ) {
890 matrix_(i,idx(j)) = element;
920 template<
typename MT
923 inline Columns<MT,
true,
true,SF,CCAs...>&
924 Columns<MT,true,true,SF,CCAs...>::operator=(
const Columns& rhs )
932 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && idces() == rhs.idces() ) )
935 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
939 if( IsRestricted<MT>::value ) {
940 for(
size_t j=0UL; j<
columns(); ++j ) {
947 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
949 if( rhs.canAlias( &matrix_ ) ) {
980 template<
typename MT
983 template<
typename MT2
985 inline Columns<MT,
true,
true,SF,CCAs...>&
986 Columns<MT,true,true,SF,CCAs...>::operator=(
const Matrix<MT2,SO2>& rhs )
997 using Right = If_< IsRestricted<MT>, CompositeType_<MT2>,
const MT2& >;
1000 if( IsRestricted<MT>::value ) {
1001 for(
size_t j=0UL; j<
columns(); ++j ) {
1008 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1010 if( IsSparseMatrix<MT2>::value ) {
1014 if( IsReference<Right>::value && right.canAlias( &matrix_ ) ) {
1015 const ResultType_<MT2> tmp( right );
1044 template<
typename MT
1047 template<
typename MT2
1049 inline DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns<MT,
true,
true,SF,CCAs...>& >
1059 using AddType = AddTrait_< ResultType, ResultType_<MT2> >;
1068 if( IsRestricted<MT>::value ) {
1069 for(
size_t j=0UL; j<
columns(); ++j ) {
1076 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1078 if( (~rhs).canAlias( &matrix_ ) ) {
1079 const AddType tmp( *
this + (~rhs) );
1108 template<
typename MT
1111 template<
typename MT2
1113 inline EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns<MT,
true,
true,SF,CCAs...>& >
1123 using AddType = AddTrait_< ResultType, ResultType_<MT2> >;
1132 const AddType tmp( *
this + (~rhs) );
1134 if( IsRestricted<MT>::value ) {
1135 for(
size_t j=0UL; j<
columns(); ++j ) {
1142 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1168 template<
typename MT
1171 template<
typename MT2
1173 inline DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns<MT,
true,
true,SF,CCAs...>& >
1183 using SubType = SubTrait_< ResultType, ResultType_<MT2> >;
1192 if( IsRestricted<MT>::value ) {
1193 for(
size_t j=0UL; j<
columns(); ++j ) {
1200 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1202 if( (~rhs).canAlias( &matrix_ ) ) {
1203 const SubType tmp( *
this - (~rhs ) );
1232 template<
typename MT
1235 template<
typename MT2
1237 inline EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns<MT,
true,
true,SF,CCAs...>& >
1247 using SubType = SubTrait_< ResultType, ResultType_<MT2> >;
1256 const SubType tmp( *
this - (~rhs) );
1258 if( IsRestricted<MT>::value ) {
1259 for(
size_t j=0UL; j<
columns(); ++j ) {
1266 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1292 template<
typename MT
1295 template<
typename MT2
1297 inline DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns<MT,
true,
true,SF,CCAs...>& >
1298 Columns<MT,true,true,SF,CCAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
1307 using SchurType = SchurTrait_< ResultType, ResultType_<MT2> >;
1315 if( IsRestricted<MT>::value ) {
1316 for(
size_t j=0UL; j<
columns(); ++j ) {
1323 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1325 if( (~rhs).canAlias( &matrix_ ) ) {
1326 const SchurType tmp( *
this % (~rhs) );
1327 if( IsSparseMatrix<SchurType>::value )
1357 template<
typename MT
1360 template<
typename MT2
1362 inline EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns<MT,
true,
true,SF,CCAs...>& >
1363 Columns<MT,true,true,SF,CCAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
1372 using SchurType = SchurTrait_< ResultType, ResultType_<MT2> >;
1380 const SchurType tmp( *
this % (~rhs) );
1382 if( IsRestricted<MT>::value ) {
1383 for(
size_t j=0UL; j<
columns(); ++j ) {
1390 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1392 if( IsSparseMatrix<SchurType>::value ) {
1420 template<
typename MT
1423 inline MT& Columns<MT,true,true,SF,CCAs...>::operand() noexcept
1437 template<
typename MT
1440 inline const MT& Columns<MT,true,true,SF,CCAs...>::operand() const noexcept
1454 template<
typename MT
1459 return matrix_.rows();
1474 template<
typename MT
1479 return matrix_.spacing();
1491 template<
typename MT
1511 template<
typename MT
1532 template<
typename MT
1537 size_t nonzeros( 0UL );
1539 for(
size_t j=0UL; j<
columns(); ++j ) {
1540 nonzeros += matrix_.nonZeros( idx(j) );
1558 template<
typename MT
1565 return matrix_.nonZeros( idx(j) );
1577 template<
typename MT
1582 for(
size_t j=0UL; j<
columns(); ++j ) {
1583 matrix_.reset( idx(j) );
1599 template<
typename MT
1604 matrix_.reset( idx(j) );
1631 template<
typename MT
1634 inline Columns<MT,
true,
true,SF,CCAs...>&
1646 if( IsRestricted<MT>::value ) {
1647 for(
size_t j=0UL; j<
columns(); ++j ) {
1648 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
1654 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1677 template<
typename MT
1680 inline Columns<MT,
true,
true,SF,CCAs...>&
1692 if( IsRestricted<MT>::value ) {
1693 for(
size_t j=0UL; j<
columns(); ++j ) {
1694 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
1700 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
1723 template<
typename MT
1726 template<
typename Other >
1727 inline Columns<MT,
true,
true,SF,CCAs...>&
1728 Columns<MT,true,true,SF,CCAs...>::scale(
const Other& scalar )
1734 for(
size_t j=0UL; j<
columns(); ++j )
1736 const size_t index ( idx(j) );
1737 const size_t ibegin( IsLower<MT>::value ? ( IsStrictlyLower<MT>::value ? index+1UL : index ) : 0UL );
1738 const size_t iend ( IsUpper<MT>::value ? ( IsStrictlyUpper<MT>::value ? index : index+1UL ) :
rows() );
1740 for(
size_t i=ibegin; i<iend; ++i ) {
1741 matrix_(i,index) *= scalar;
1770 template<
typename MT
1773 template<
typename Other >
1774 inline bool Columns<MT,true,true,SF,CCAs...>::canAlias(
const Other* alias )
const noexcept
1776 return matrix_.isAliased( alias );
1794 template<
typename MT
1797 template<
typename MT2
1802 Columns<MT,true,true,SF,CCAs...>::canAlias(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
1804 return matrix_.isAliased( &alias->matrix_ );
1821 template<
typename MT
1824 template<
typename Other >
1825 inline bool Columns<MT,true,true,SF,CCAs...>::isAliased(
const Other* alias )
const noexcept
1827 return matrix_.isAliased( alias );
1845 template<
typename MT
1848 template<
typename MT2
1853 Columns<MT,true,true,SF,CCAs...>::isAliased(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
1855 return matrix_.isAliased( &alias->matrix_ );
1871 template<
typename MT
1874 inline bool Columns<MT,true,true,SF,CCAs...>::isAligned() const noexcept
1876 return matrix_.isAligned();
1893 template<
typename MT
1896 inline bool Columns<MT,true,true,SF,CCAs...>::canSMPAssign() const noexcept
1898 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
1919 template<
typename MT
1923 Columns<MT,true,true,SF,CCAs...>::load(
size_t i,
size_t j )
const noexcept
1925 return matrix_.load( i, idx(j) );
1946 template<
typename MT
1952 return matrix_.loada( i, idx(j) );
1973 template<
typename MT
1979 return matrix_.loadu( i, idx(j) );
2001 template<
typename MT
2005 Columns<MT,true,true,SF,CCAs...>::store(
size_t i,
size_t j,
const SIMDType& value ) noexcept
2007 matrix_.store( i, idx(j), value );
2029 template<
typename MT
2035 matrix_.storea( i, idx(j), value );
2057 template<
typename MT
2063 matrix_.storeu( i, idx(j), value );
2085 template<
typename MT
2091 matrix_.stream( i, idx(j), value );
2109 template<
typename MT
2112 template<
typename MT2 >
2113 inline DisableIf_<
typename Columns<MT,
true,
true,SF,CCAs...>::BLAZE_TEMPLATE VectorizedAssign<MT2> >
2114 Columns<MT,true,true,SF,CCAs...>::assign(
const DenseMatrix<MT2,true>& rhs )
2122 const size_t ipos(
rows() &
size_t(-2) );
2125 for(
size_t j=0UL; j<
columns(); ++j ) {
2126 const size_t index( idx(j) );
2127 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2128 matrix_(i ,index) = (~rhs)(i ,j);
2129 matrix_(i+1UL,index) = (~rhs)(i+1UL,j);
2131 if( ipos <
rows() ) {
2132 matrix_(ipos,index) = (~rhs)(ipos,j);
2152 template<
typename MT
2155 template<
typename MT2 >
2156 inline EnableIf_<
typename Columns<MT,
true,
true,SF,CCAs...>::BLAZE_TEMPLATE VectorizedAssign<MT2> >
2157 Columns<MT,true,true,SF,CCAs...>::assign(
const DenseMatrix<MT2,true>& rhs )
2167 const size_t ipos(
rows() &
size_t(-SIMDSIZE) );
2172 !(~rhs).isAliased( &matrix_ ) )
2174 for(
size_t j=0UL; j<
columns(); ++j )
2178 ConstIterator_<MT2> right( (~rhs).
begin(j) );
2180 for( ; i<ipos; i+=SIMDSIZE ) {
2181 left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2183 for( ; i<
rows(); ++i ) {
2190 for(
size_t j=0UL; j<
columns(); ++j )
2194 ConstIterator_<MT2> right( (~rhs).
begin(j) );
2196 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2197 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2198 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2199 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2200 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2202 for( ; i<ipos; i+=SIMDSIZE ) {
2203 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2205 for( ; i<
rows(); ++i ) {
2206 *left = *right; ++left; ++right;
2227 template<
typename MT
2230 template<
typename MT2 >
2231 inline void Columns<MT,true,true,SF,CCAs...>::assign(
const DenseMatrix<MT2,false>& rhs )
2241 constexpr
size_t block( BLOCK_SIZE );
2245 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
2246 for(
size_t j=0UL; j<
columns(); ++j ) {
2247 const size_t index( idx(j) );
2248 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2249 matrix_(i ,index) = (~rhs)(i ,j);
2250 matrix_(i+1UL,index) = (~rhs)(i+1UL,j);
2252 if( ipos < (~rhs).rows() ) {
2253 matrix_(ipos,index) = (~rhs)(ipos,j);
2259 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2260 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2261 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2262 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2263 for(
size_t j=jj; j<jend; ++j ) {
2264 const size_t index( idx(j) );
2265 for(
size_t i=ii; i<iend; ++i ) {
2266 matrix_(i,index) = (~rhs)(i,j);
2289 template<
typename MT
2292 template<
typename MT2 >
2293 inline void Columns<MT,true,true,SF,CCAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
2301 for(
size_t j=0UL; j<
columns(); ++j ) {
2302 const size_t index( idx(j) );
2303 for( ConstIterator_<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2304 matrix_(element->index(),index) = element->value();
2323 template<
typename MT
2326 template<
typename MT2 >
2327 inline void Columns<MT,true,true,SF,CCAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
2337 for(
size_t i=0UL; i<
rows(); ++i ) {
2338 for( ConstIterator_<MT2> element=(~rhs).begin(i); element!=(~rhs).
end(i); ++element )
2339 matrix_(i,idx(element->index())) = element->value();
2358 template<
typename MT
2361 template<
typename MT2 >
2362 inline DisableIf_<
typename Columns<MT,
true,
true,SF,CCAs...>::BLAZE_TEMPLATE VectorizedAddAssign<MT2> >
2363 Columns<MT,true,true,SF,CCAs...>::addAssign(
const DenseMatrix<MT2,true>& rhs )
2371 const size_t ipos(
rows() &
size_t(-2) );
2374 for(
size_t j=0UL; j<
columns(); ++j )
2376 const size_t index( idx(j) );
2377 if( IsDiagonal<MT2>::value ) {
2378 matrix_(j,index) += (~rhs)(j,j);
2381 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2382 matrix_(i ,index) += (~rhs)(i ,j);
2383 matrix_(i+1UL,index) += (~rhs)(i+1UL,j);
2385 if( ipos <
rows() ) {
2386 matrix_(ipos,index) += (~rhs)(ipos,j);
2407 template<
typename MT
2410 template<
typename MT2 >
2411 inline EnableIf_<
typename Columns<MT,
true,
true,SF,CCAs...>::BLAZE_TEMPLATE VectorizedAddAssign<MT2> >
2412 Columns<MT,true,true,SF,CCAs...>::addAssign(
const DenseMatrix<MT2,true>& rhs )
2422 for(
size_t j=0UL; j<
columns(); ++j )
2424 const size_t ibegin( ( IsLower<MT2>::value )
2425 ?( ( IsStrictlyLower<MT2>::value ? j+1UL : j ) &
size_t(-SIMDSIZE) )
2427 const size_t iend ( ( IsUpper<MT2>::value )
2428 ?( IsStrictlyUpper<MT2>::value ? j : j+1UL )
2432 const size_t ipos( iend &
size_t(-SIMDSIZE) );
2437 ConstIterator_<MT2> right( (~rhs).
begin(j) + ibegin );
2439 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2440 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2441 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2442 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2443 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2445 for( ; i<ipos; i+=SIMDSIZE ) {
2446 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2448 for( ; i<iend; ++i ) {
2449 *left += *right; ++left; ++right;
2469 template<
typename MT
2472 template<
typename MT2 >
2473 inline void Columns<MT,true,true,SF,CCAs...>::addAssign(
const DenseMatrix<MT2,false>& rhs )
2483 constexpr
size_t block( BLOCK_SIZE );
2487 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
2488 for(
size_t j=0UL; j<
columns(); ++j ) {
2489 const size_t index( idx(j) );
2490 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2491 matrix_(i ,index) += (~rhs)(i ,j);
2492 matrix_(i+1UL,index) += (~rhs)(i+1UL,j);
2494 if( ipos < (~rhs).rows() )
2495 matrix_(ipos,index) += (~rhs)(ipos,j);
2500 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2501 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2502 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2503 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2504 for(
size_t j=jj; j<jend; ++j ) {
2505 const size_t index( idx(j) );
2506 for(
size_t i=ii; i<iend; ++i ) {
2507 matrix_(i,index) += (~rhs)(i,j);
2530 template<
typename MT
2533 template<
typename MT2 >
2534 inline void Columns<MT,true,true,SF,CCAs...>::addAssign(
const SparseMatrix<MT2,true>& rhs )
2542 for(
size_t j=0UL; j<
columns(); ++j ) {
2543 const size_t index( idx(j) );
2544 for( ConstIterator_<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2545 matrix_(element->index(),index) += element->value();
2564 template<
typename MT
2567 template<
typename MT2 >
2568 inline void Columns<MT,true,true,SF,CCAs...>::addAssign(
const SparseMatrix<MT2,false>& rhs )
2578 for(
size_t i=0UL; i<
rows(); ++i ) {
2579 for( ConstIterator_<MT2> element=(~rhs).begin(i); element!=(~rhs).
end(i); ++element )
2580 matrix_(i,idx(element->index())) += element->value();
2599 template<
typename MT
2602 template<
typename MT2 >
2603 inline DisableIf_<
typename Columns<MT,
true,
true,SF,CCAs...>::BLAZE_TEMPLATE VectorizedSubAssign<MT2> >
2604 Columns<MT,true,true,SF,CCAs...>::subAssign(
const DenseMatrix<MT2,true>& rhs )
2612 const size_t ipos(
rows() &
size_t(-2) );
2615 for(
size_t j=0UL; j<
columns(); ++j )
2617 const size_t index( idx(j) );
2619 if( IsDiagonal<MT2>::value ) {
2620 matrix_(j,index) -= (~rhs)(j,j);
2623 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2624 matrix_(i ,index) -= (~rhs)(i ,j);
2625 matrix_(i+1UL,index) -= (~rhs)(i+1UL,j);
2627 if( ipos <
rows() ) {
2628 matrix_(ipos,index) -= (~rhs)(ipos,j);
2649 template<
typename MT
2652 template<
typename MT2 >
2653 inline EnableIf_<
typename Columns<MT,
true,
true,SF,CCAs...>::BLAZE_TEMPLATE VectorizedSubAssign<MT2> >
2654 Columns<MT,true,true,SF,CCAs...>::subAssign(
const DenseMatrix<MT2,true>& rhs )
2664 for(
size_t j=0UL; j<
columns(); ++j )
2666 const size_t ibegin( ( IsLower<MT2>::value )
2667 ?( ( IsStrictlyLower<MT2>::value ? j+1UL : j ) &
size_t(-SIMDSIZE) )
2669 const size_t iend ( ( IsUpper<MT2>::value )
2670 ?( IsStrictlyUpper<MT2>::value ? j : j+1UL )
2674 const size_t ipos( iend &
size_t(-SIMDSIZE) );
2679 ConstIterator_<MT2> right( (~rhs).
begin(j) + ibegin );
2681 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2682 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2683 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2684 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2685 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2687 for( ; i<ipos; i+=SIMDSIZE ) {
2688 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2690 for( ; i<iend; ++i ) {
2691 *left -= *right; ++left; ++right;
2711 template<
typename MT
2714 template<
typename MT2 >
2715 inline void Columns<MT,true,true,SF,CCAs...>::subAssign(
const DenseMatrix<MT2,false>& rhs )
2725 constexpr
size_t block( BLOCK_SIZE );
2729 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
2730 for(
size_t j=0UL; j<
columns(); ++j ) {
2731 const size_t index( idx(j) );
2732 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2733 matrix_(i ,index) -= (~rhs)(i ,j);
2734 matrix_(i+1UL,index) -= (~rhs)(i+1UL,j);
2736 if( ipos < (~rhs).rows() )
2737 matrix_(ipos,index) -= (~rhs)(ipos,j);
2742 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2743 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2744 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2745 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2746 for(
size_t j=jj; j<jend; ++j ) {
2747 const size_t index( idx(j) );
2748 for(
size_t i=ii; i<iend; ++i ) {
2749 matrix_(i,index) -= (~rhs)(i,j);
2772 template<
typename MT
2775 template<
typename MT2 >
2776 inline void Columns<MT,true,true,SF,CCAs...>::subAssign(
const SparseMatrix<MT2,true>& rhs )
2784 for(
size_t j=0UL; j<
columns(); ++j ) {
2785 const size_t index( idx(j) );
2786 for( ConstIterator_<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
2787 matrix_(element->index(),index) -= element->value();
2806 template<
typename MT
2809 template<
typename MT2 >
2810 inline void Columns<MT,true,true,SF,CCAs...>::subAssign(
const SparseMatrix<MT2,false>& rhs )
2820 for(
size_t i=0UL; i<
rows(); ++i ) {
2821 for( ConstIterator_<MT2> element=(~rhs).begin(i); element!=(~rhs).
end(i); ++element )
2822 matrix_(i,idx(element->index())) -= element->value();
2841 template<
typename MT
2844 template<
typename MT2 >
2845 inline DisableIf_<
typename Columns<MT,
true,
true,SF,CCAs...>::BLAZE_TEMPLATE VectorizedSchurAssign<MT2> >
2846 Columns<MT,true,true,SF,CCAs...>::schurAssign(
const DenseMatrix<MT2,true>& rhs )
2854 const size_t ipos(
rows() &
size_t(-2) );
2857 for(
size_t j=0UL; j<
columns(); ++j ) {
2858 const size_t index( idx(j) );
2859 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2860 matrix_(i ,index) *= (~rhs)(i ,j);
2861 matrix_(i+1UL,index) *= (~rhs)(i+1UL,j);
2863 if( ipos <
rows() ) {
2864 matrix_(ipos,index) *= (~rhs)(ipos,j);
2885 template<
typename MT
2888 template<
typename MT2 >
2889 inline EnableIf_<
typename Columns<MT,
true,
true,SF,CCAs...>::BLAZE_TEMPLATE VectorizedSchurAssign<MT2> >
2890 Columns<MT,true,true,SF,CCAs...>::schurAssign(
const DenseMatrix<MT2,true>& rhs )
2900 for(
size_t j=0UL; j<
columns(); ++j )
2902 const size_t ipos(
rows() &
size_t(-SIMDSIZE) );
2907 ConstIterator_<MT2> right( (~rhs).
begin(j) );
2909 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2910 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2911 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2912 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2913 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2915 for( ; i<ipos; i+=SIMDSIZE ) {
2916 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2918 for( ; i<
rows(); ++i ) {
2919 *left *= *right; ++left; ++right;
2939 template<
typename MT
2942 template<
typename MT2 >
2943 inline void Columns<MT,true,true,SF,CCAs...>::schurAssign(
const DenseMatrix<MT2,false>& rhs )
2953 constexpr
size_t block( BLOCK_SIZE );
2957 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
2958 for(
size_t j=0UL; j<
columns(); ++j ) {
2959 const size_t index( idx(j) );
2960 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2961 matrix_(i ,index) *= (~rhs)(i ,j);
2962 matrix_(i+1UL,index) *= (~rhs)(i+1UL,j);
2964 if( ipos < (~rhs).rows() )
2965 matrix_(ipos,index) *= (~rhs)(ipos,j);
2970 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
2971 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
2972 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
2973 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
2974 for(
size_t j=jj; j<jend; ++j ) {
2975 const size_t index( idx(j) );
2976 for(
size_t i=ii; i<iend; ++i ) {
2977 matrix_(i,index) *= (~rhs)(i,j);
3000 template<
typename MT
3003 template<
typename MT2 >
3004 inline void Columns<MT,true,true,SF,CCAs...>::schurAssign(
const SparseMatrix<MT2,true>& rhs )
3014 for(
size_t j=0UL; j<
columns(); ++j )
3016 const size_t index( idx(j) );
3019 for( ConstIterator_<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element ) {
3020 for( ; i<element->index(); ++i )
3021 reset( matrix_(i,index) );
3022 matrix_(i,index) *= element->value();
3026 for( ; i<
rows(); ++i ) {
3027 reset( matrix_(i,index) );
3047 template<
typename MT
3050 template<
typename MT2 >
3051 inline void Columns<MT,true,true,SF,CCAs...>::schurAssign(
const SparseMatrix<MT2,false>& rhs )
3063 for(
size_t i=0UL; i<
rows(); ++i )
3067 for( ConstIterator_<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element ) {
3068 for( ; j<element->index(); ++j )
3069 reset( matrix_(i,idx(j)) );
3070 matrix_(i,idx(j)) *= element->value();
3075 reset( matrix_(i,idx(j)) );
3103 template<
typename MT
3105 class Columns<MT,false,true,false,CCAs...>
3106 :
public View< DenseMatrix< Columns<MT,false,true,false,CCAs...>, true > >
3107 ,
private ColumnsData<CCAs...>
3111 using DataType = ColumnsData<CCAs...>;
3112 using Operand = If_< IsExpression<MT>, MT, MT& >;
3118 using This = Columns<MT,
false,
true,
false,CCAs...>;
3120 using BaseType = DenseMatrix<This,true>;
3121 using ViewedType = MT;
3130 using ConstReference = ConstReference_<MT>;
3136 using ConstPointer = ConstPointer_<MT>;
3139 using Pointer = If_< Or< IsConst<MT>, Not< HasMutableDataAccess<MT> > >, ConstPointer, Pointer_<MT> >;
3145 template<
typename MatrixType
3146 ,
typename IteratorType >
3147 class ColumnsIterator
3152 using IteratorCategory =
typename std::iterator_traits<IteratorType>::iterator_category;
3155 using ValueType =
typename std::iterator_traits<IteratorType>::value_type;
3158 using PointerType =
typename std::iterator_traits<IteratorType>::pointer;
3161 using ReferenceType =
typename std::iterator_traits<IteratorType>::reference;
3164 using DifferenceType =
typename std::iterator_traits<IteratorType>::difference_type;
3167 using iterator_category = IteratorCategory;
3168 using value_type = ValueType;
3169 using pointer = PointerType;
3170 using reference = ReferenceType;
3171 using difference_type = DifferenceType;
3177 inline ColumnsIterator() noexcept
3178 : matrix_(
nullptr )
3192 inline ColumnsIterator( MatrixType& matrix,
size_t row,
size_t column ) noexcept
3193 : matrix_( &matrix )
3198 if( row_ != matrix_->rows() )
3199 pos_ = matrix_->begin( row_ ) + column_;
3208 template<
typename MatrixType2,
typename IteratorType2 >
3209 inline ColumnsIterator(
const ColumnsIterator<MatrixType2,IteratorType2>& it ) noexcept
3210 : matrix_( it.matrix_ )
3212 , column_( it.column_ )
3223 inline ColumnsIterator&
operator+=(
size_t inc ) noexcept {
3226 if( row_ != matrix_->rows() )
3227 pos_ = matrix_->begin( row_ ) + column_;
3239 inline ColumnsIterator&
operator-=(
size_t dec ) noexcept {
3242 if( row_ != matrix_->rows() )
3243 pos_ = matrix_->begin( row_ ) + column_;
3254 inline ColumnsIterator& operator++() noexcept {
3257 if( row_ != matrix_->rows() )
3258 pos_ = matrix_->begin( row_ ) + column_;
3269 inline const ColumnsIterator operator++(
int ) noexcept {
3270 const ColumnsIterator tmp( *
this );
3281 inline ColumnsIterator& operator--() noexcept {
3284 if( row_ != matrix_->rows() )
3285 pos_ = matrix_->begin( row_ ) + column_;
3296 inline const ColumnsIterator operator--(
int ) noexcept {
3297 const ColumnsIterator tmp( *
this );
3309 inline ReferenceType operator[](
size_t index )
const {
3311 const IteratorType pos( matrix_->begin( row_+index ) + column_ );
3321 inline ReferenceType
operator*()
const {
3331 inline PointerType operator->()
const {
3342 template<
typename MatrixType2,
typename IteratorType2 >
3343 inline bool operator==(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3344 return row_ == rhs.row_;
3354 template<
typename MatrixType2,
typename IteratorType2 >
3355 inline bool operator!=(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3356 return !( *
this == rhs );
3366 template<
typename MatrixType2,
typename IteratorType2 >
3367 inline bool operator<( const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3368 return row_ < rhs.row_;
3378 template<
typename MatrixType2,
typename IteratorType2 >
3379 inline bool operator>(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3380 return row_ > rhs.row_;
3390 template<
typename MatrixType2,
typename IteratorType2 >
3391 inline bool operator<=( const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3392 return row_ <= rhs.row_;
3402 template<
typename MatrixType2,
typename IteratorType2 >
3403 inline bool operator>=(
const ColumnsIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
3404 return row_ >= rhs.row_;
3414 inline DifferenceType
operator-(
const ColumnsIterator& rhs )
const noexcept {
3415 return row_ - rhs.row_;
3426 friend inline const ColumnsIterator
operator+(
const ColumnsIterator& it,
size_t inc ) noexcept {
3427 return ColumnsIterator( *it.matrix_, it.row_+inc, it.column_ );
3438 friend inline const ColumnsIterator
operator+(
size_t inc,
const ColumnsIterator& it ) noexcept {
3439 return ColumnsIterator( *it.matrix_, it.row_+inc, it.column_ );
3450 friend inline const ColumnsIterator
operator-(
const ColumnsIterator& it,
size_t dec ) noexcept {
3451 return ColumnsIterator( *it.matrix_, it.row_-dec, it.column_ );
3457 MatrixType* matrix_;
3464 template<
typename MatrixType2,
typename IteratorType2 >
friend class ColumnsIterator;
3471 using ConstIterator = ColumnsIterator< const MT, ConstIterator_<MT> >;
3479 enum :
bool { simdEnabled =
false };
3482 enum :
bool { smpAssignable = MT::smpAssignable };
3488 template<
typename... RCAs >
3489 explicit inline Columns( MT& matrix, RCAs... args );
3491 inline Columns(
const Columns& ) =
default;
3492 inline Columns( Columns&& ) =
default;
3503 inline Reference operator()(
size_t i,
size_t j );
3504 inline ConstReference operator()(
size_t i,
size_t j )
const;
3505 inline Reference at(
size_t i,
size_t j );
3506 inline ConstReference at(
size_t i,
size_t j )
const;
3507 inline Pointer
data () noexcept;
3508 inline ConstPointer
data () const noexcept;
3509 inline Pointer
data (
size_t j ) noexcept;
3510 inline ConstPointer
data (
size_t j ) const noexcept;
3512 inline ConstIterator
begin (
size_t j ) const;
3513 inline ConstIterator
cbegin(
size_t j ) const;
3515 inline ConstIterator
end (
size_t j ) const;
3516 inline ConstIterator
cend (
size_t j ) const;
3523 inline Columns& operator=( const
ElementType& rhs );
3524 inline Columns& operator=( initializer_list< initializer_list<
ElementType> > list );
3525 inline Columns& operator=( const Columns& rhs );
3527 template< typename MT2,
bool SO2 >
3528 inline Columns& operator=( const Matrix<MT2,SO2>& rhs );
3530 template< typename MT2,
bool SO2 >
3531 inline
DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns& >
3532 operator+=( const Matrix<MT2,SO2>& rhs );
3534 template< typename MT2,
bool SO2 >
3535 inline
EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns& >
3536 operator+=( const Matrix<MT2,SO2>& rhs );
3538 template< typename MT2,
bool SO2 >
3539 inline
DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns& >
3540 operator-=( const Matrix<MT2,SO2>& rhs );
3542 template< typename MT2,
bool SO2 >
3543 inline
EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns& >
3544 operator-=( const Matrix<MT2,SO2>& rhs );
3546 template< typename MT2,
bool SO2 >
3547 inline
DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns& >
3548 operator%=( const Matrix<MT2,SO2>& rhs );
3550 template< typename MT2,
bool SO2 >
3551 inline
EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns& >
3552 operator%=( const Matrix<MT2,SO2>& rhs );
3559 using DataType::idx;
3560 using DataType::idces;
3563 inline MT& operand() noexcept;
3564 inline const MT& operand() const noexcept;
3566 inline
size_t rows() const noexcept;
3567 inline
size_t spacing() const noexcept;
3568 inline
size_t capacity() const noexcept;
3569 inline
size_t capacity(
size_t j ) const noexcept;
3571 inline
size_t nonZeros(
size_t j ) const;
3572 inline
void reset();
3573 inline
void reset(
size_t j );
3583 template< typename Other > inline Columns& scale( const Other& scalar );
3590 template< typename Other >
3591 inline
bool canAlias( const Other* alias ) const noexcept;
3593 template< typename MT2,
bool SO2,
bool SF2,
size_t... CCAs2 >
3594 inline
bool canAlias( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
3596 template< typename Other >
3597 inline
bool isAliased( const Other* alias ) const noexcept;
3599 template< typename MT2,
bool SO2,
bool SF2,
size_t... CCAs2 >
3600 inline
bool isAliased( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
3602 inline
bool isAligned () const noexcept;
3603 inline
bool canSMPAssign() const noexcept;
3605 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,true>& rhs );
3606 template< typename MT2 > inline
void assign( const DenseMatrix<MT2,false>& rhs );
3607 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,true>& rhs );
3608 template< typename MT2 > inline
void assign( const SparseMatrix<MT2,false>& rhs );
3610 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,true>& rhs );
3611 template< typename MT2 > inline
void addAssign( const DenseMatrix<MT2,false>& rhs );
3612 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,true>& rhs );
3613 template< typename MT2 > inline
void addAssign( const SparseMatrix<MT2,false>& rhs );
3615 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,true>& rhs );
3616 template< typename MT2 > inline
void subAssign( const DenseMatrix<MT2,false>& rhs );
3617 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,true>& rhs );
3618 template< typename MT2 > inline
void subAssign( const SparseMatrix<MT2,false>& rhs );
3620 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,true>& rhs );
3621 template< typename MT2 > inline
void schurAssign( const DenseMatrix<MT2,false>& rhs );
3622 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,true>& rhs );
3623 template< typename MT2 > inline
void schurAssign( const SparseMatrix<MT2,false>& rhs );
3636 template< typename MT2,
bool SO2,
bool DF2,
bool SF2,
size_t... CCAs2 > friend class Columns;
3676 template< typename MT
3678 template< typename... RCAs >
3679 inline Columns<MT,false,true,false,CCAs...>::Columns( MT& matrix, RCAs... args )
3680 : DataType( args... )
3681 , matrix_ ( matrix )
3683 if( !Contains< TypeList<RCAs...>,
Unchecked >::value ) {
3684 for(
size_t j=0UL; j<
columns(); ++j ) {
3685 if( matrix_.columns() <= idx(j) ) {
3714 template<
typename MT
3716 inline typename Columns<MT,
false,
true,
false,CCAs...>
::Reference 3717 Columns<MT,false,true,false,CCAs...>::operator()(
size_t i,
size_t j )
3722 return matrix_(i,idx(j));
3739 template<
typename MT
3742 Columns<MT,false,true,false,CCAs...>::operator()(
size_t i,
size_t j )
const 3747 return const_cast<const MT&
>( matrix_ )(i,idx(j));
3765 template<
typename MT
3767 inline typename Columns<MT,
false,
true,
false,CCAs...>
::Reference 3768 Columns<MT,false,true,false,CCAs...>::at(
size_t i,
size_t j )
3776 return (*
this)(i,j);
3794 template<
typename MT
3797 Columns<MT,false,true,false,CCAs...>::at(
size_t i,
size_t j )
const 3805 return (*
this)(i,j);
3821 template<
typename MT
3823 inline typename Columns<MT,
false,
true,
false,CCAs...>::Pointer
3826 return matrix_.data() + idx(0UL);
3842 template<
typename MT
3844 inline typename Columns<MT,
false,
true,
false,CCAs...>::ConstPointer
3847 return matrix_.data() + idx(0UL);
3862 template<
typename MT
3864 inline typename Columns<MT,
false,
true,
false,CCAs...>::Pointer
3867 return matrix_.data() + idx(j);
3882 template<
typename MT
3884 inline typename Columns<MT,
false,
true,
false,CCAs...>::ConstPointer
3887 return matrix_.data() + idx(j);
3902 template<
typename MT
3904 inline typename Columns<MT,
false,
true,
false,CCAs...>
::Iterator 3908 return Iterator( matrix_, 0UL, idx(j) );
3923 template<
typename MT
3944 template<
typename MT
3965 template<
typename MT
3967 inline typename Columns<MT,
false,
true,
false,CCAs...>
::Iterator 3986 template<
typename MT
4007 template<
typename MT
4038 template<
typename MT
4040 inline Columns<MT,
false,
true,
false,CCAs...>&
4041 Columns<MT,false,true,false,CCAs...>::operator=(
const ElementType& rhs )
4043 for(
size_t j=0UL; j<
columns(); ++j ) {
4069 template<
typename MT
4071 inline Columns<MT,
false,
true,
false,CCAs...>&
4072 Columns<MT,false,true,false,CCAs...>::operator=( initializer_list< initializer_list<ElementType> > list )
4077 if( list.size() !=
rows() ) {
4081 if( IsRestricted<MT>::value ) {
4082 const InitializerMatrix<ElementType> tmp( list,
columns() );
4083 for(
size_t j=0UL; j<
columns(); ++j ) {
4084 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
4090 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4093 for(
const auto& rowList : list ) {
4095 for(
const auto& element : rowList ) {
4096 matrix_(i,idx(j)) = element;
4126 template<
typename MT
4128 inline Columns<MT,
false,
true,
false,CCAs...>&
4129 Columns<MT,false,true,false,CCAs...>::operator=(
const Columns& rhs )
4137 if(
this == &rhs || ( &matrix_ == &rhs.matrix_ && idces() == rhs.idces() ) )
4140 if(
rows() != rhs.rows() ||
columns() != rhs.columns() ) {
4144 if( IsRestricted<MT>::value ) {
4145 for(
size_t j=0UL; j<
columns(); ++j ) {
4152 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4154 if( rhs.canAlias( &matrix_ ) ) {
4185 template<
typename MT
4187 template<
typename MT2
4189 inline Columns<MT,
false,
true,
false,CCAs...>&
4190 Columns<MT,false,true,false,CCAs...>::operator=(
const Matrix<MT2,SO2>& rhs )
4201 using Right = If_< IsRestricted<MT>, CompositeType_<MT2>,
const MT2& >;
4202 Right right( ~rhs );
4204 if( IsRestricted<MT>::value ) {
4205 for(
size_t j=0UL; j<
columns(); ++j ) {
4212 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4214 if( IsSparseMatrix<MT2>::value ) {
4218 if( IsReference<Right>::value && right.canAlias( &matrix_ ) ) {
4219 const ResultType_<MT2> tmp( right );
4248 template<
typename MT
4250 template<
typename MT2
4252 inline DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns<MT,
false,
true,
false,CCAs...>& >
4262 using AddType = AddTrait_< ResultType, ResultType_<MT2> >;
4271 if( IsRestricted<MT>::value ) {
4272 for(
size_t j=0UL; j<
columns(); ++j ) {
4279 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4281 if( (~rhs).canAlias( &matrix_ ) ) {
4282 const AddType tmp( *
this + (~rhs) );
4311 template<
typename MT
4313 template<
typename MT2
4315 inline EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns<MT,
false,
true,
false,CCAs...>& >
4325 using AddType = AddTrait_< ResultType, ResultType_<MT2> >;
4334 const AddType tmp( *
this + (~rhs) );
4336 if( IsRestricted<MT>::value ) {
4337 for(
size_t j=0UL; j<
columns(); ++j ) {
4344 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4370 template<
typename MT
4372 template<
typename MT2
4374 inline DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns<MT,
false,
true,
false,CCAs...>& >
4384 using SubType = SubTrait_< ResultType, ResultType_<MT2> >;
4393 if( IsRestricted<MT>::value ) {
4394 for(
size_t j=0UL; j<
columns(); ++j ) {
4401 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4403 if( (~rhs).canAlias( &matrix_ ) ) {
4404 const SubType tmp( *
this - (~rhs ) );
4433 template<
typename MT
4435 template<
typename MT2
4437 inline EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns<MT,
false,
true,
false,CCAs...>& >
4447 using SubType = SubTrait_< ResultType, ResultType_<MT2> >;
4456 const SubType tmp( *
this - (~rhs) );
4458 if( IsRestricted<MT>::value ) {
4459 for(
size_t j=0UL; j<
columns(); ++j ) {
4466 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4492 template<
typename MT
4494 template<
typename MT2
4496 inline DisableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns<MT,
false,
true,
false,CCAs...>& >
4497 Columns<MT,false,true,false,CCAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
4506 using SchurType = SchurTrait_< ResultType, ResultType_<MT2> >;
4514 if( IsRestricted<MT>::value ) {
4515 for(
size_t j=0UL; j<
columns(); ++j ) {
4522 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4524 if( (~rhs).canAlias( &matrix_ ) ) {
4525 const SchurType tmp( *
this % (~rhs) );
4526 if( IsSparseMatrix<SchurType>::value )
4556 template<
typename MT
4558 template<
typename MT2
4560 inline EnableIf_< And< IsRestricted<MT>, RequiresEvaluation<MT2> >, Columns<MT,
false,
true,
false,CCAs...>& >
4561 Columns<MT,false,true,false,CCAs...>::operator%=(
const Matrix<MT2,SO2>& rhs )
4570 using SchurType = SchurTrait_< ResultType, ResultType_<MT2> >;
4578 const SchurType tmp( *
this % (~rhs) );
4580 if( IsRestricted<MT>::value ) {
4581 for(
size_t j=0UL; j<
columns(); ++j ) {
4588 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4590 if( IsSparseMatrix<SchurType>::value ) {
4618 template<
typename MT
4620 inline MT& Columns<MT,false,true,false,CCAs...>::operand() noexcept
4634 template<
typename MT
4636 inline const MT& Columns<MT,false,true,false,CCAs...>::operand() const noexcept
4650 template<
typename MT
4654 return matrix_.rows();
4669 template<
typename MT
4673 return matrix_.spacing();
4685 template<
typename MT
4704 template<
typename MT
4724 template<
typename MT
4728 size_t nonzeros( 0UL );
4730 for(
size_t j=0UL; j<
columns(); ++j ) {
4749 template<
typename MT
4755 size_t nonzeros( 0UL );
4757 const size_t index( idx(j) );
4758 for(
size_t i=0UL; i<
rows(); ++i ) {
4775 template<
typename MT
4779 for(
size_t j=0UL; j<
columns(); ++j ) {
4796 template<
typename MT
4802 const size_t index( idx(j) );
4803 for(
size_t i=0UL; i<
rows(); ++i ) {
4804 reset( matrix_( i, index ) );
4832 template<
typename MT
4834 inline Columns<MT,
false,
true,
false,CCAs...>&
4846 if( IsRestricted<MT>::value ) {
4847 for(
size_t j=0UL; j<
columns(); ++j ) {
4848 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
4854 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4877 template<
typename MT
4879 inline Columns<MT,
false,
true,
false,CCAs...>&
4891 if( IsRestricted<MT>::value ) {
4892 for(
size_t j=0UL; j<
columns(); ++j ) {
4893 if( !tryAssign( matrix_,
column( tmp, j ), 0UL, idx(j) ) ) {
4899 BLAZE_DECLTYPE_AUTO( left, derestrict( *
this ) );
4922 template<
typename MT
4924 template<
typename Other >
4925 inline Columns<MT,
false,
true,
false,CCAs...>&
4926 Columns<MT,false,true,false,CCAs...>::scale(
const Other& scalar )
4932 for(
size_t j=0UL; j<
columns(); ++j )
4934 const size_t index ( idx(j) );
4935 const size_t ibegin( IsLower<MT>::value ? ( IsStrictlyLower<MT>::value ? index+1UL : index ) : 0UL );
4936 const size_t iend ( IsUpper<MT>::value ? ( IsStrictlyUpper<MT>::value ? index : index+1UL ) :
rows() );
4938 for(
size_t i=ibegin; i<iend; ++i ) {
4939 matrix_(i,index) *= scalar;
4968 template<
typename MT
4970 template<
typename Other >
4971 inline bool Columns<MT,false,true,false,CCAs...>::canAlias(
const Other* alias )
const noexcept
4973 return matrix_.isAliased( alias );
4991 template<
typename MT
4993 template<
typename MT2
4998 Columns<MT,false,true,false,CCAs...>::canAlias(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
5000 return matrix_.isAliased( &alias->matrix_ );
5017 template<
typename MT
5019 template<
typename Other >
5020 inline bool Columns<MT,false,true,false,CCAs...>::isAliased(
const Other* alias )
const noexcept
5022 return matrix_.isAliased( alias );
5040 template<
typename MT
5042 template<
typename MT2
5047 Columns<MT,false,true,false,CCAs...>::isAliased(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
5049 return matrix_.isAliased( &alias->matrix_ );
5065 template<
typename MT
5067 inline bool Columns<MT,false,true,false,CCAs...>::isAligned() const noexcept
5086 template<
typename MT
5088 inline bool Columns<MT,false,true,false,CCAs...>::canSMPAssign() const noexcept
5090 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
5108 template<
typename MT
5110 template<
typename MT2 >
5111 inline void Columns<MT,false,true,false,CCAs...>::assign(
const DenseMatrix<MT2,true>& rhs )
5119 const size_t ipos(
rows() &
size_t(-2) );
5122 for(
size_t j=0UL; j<
columns(); ++j ) {
5123 const size_t index( idx(j) );
5124 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5125 matrix_(i ,index) = (~rhs)(i ,j);
5126 matrix_(i+1UL,index) = (~rhs)(i+1UL,j);
5128 if( ipos <
rows() ) {
5129 matrix_(ipos,index) = (~rhs)(ipos,j);
5149 template<
typename MT
5151 template<
typename MT2 >
5152 inline void Columns<MT,false,true,false,CCAs...>::assign(
const DenseMatrix<MT2,false>& rhs )
5162 constexpr
size_t block( BLOCK_SIZE );
5166 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
5167 for(
size_t j=0UL; j<
columns(); ++j ) {
5168 const size_t index( idx(j) );
5169 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5170 matrix_(i ,index) = (~rhs)(i ,j);
5171 matrix_(i+1UL,index) = (~rhs)(i+1UL,j);
5173 if( ipos < (~rhs).rows() ) {
5174 matrix_(ipos,index) = (~rhs)(ipos,j);
5180 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5181 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5182 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5183 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5184 for(
size_t j=jj; j<jend; ++j ) {
5185 const size_t index( idx(j) );
5186 for(
size_t i=ii; i<iend; ++i ) {
5187 matrix_(i,index) = (~rhs)(i,j);
5210 template<
typename MT
5212 template<
typename MT2 >
5213 inline void Columns<MT,false,true,false,CCAs...>::assign(
const SparseMatrix<MT2,true>& rhs )
5221 for(
size_t j=0UL; j<
columns(); ++j ) {
5222 const size_t index( idx(j) );
5223 for( ConstIterator_<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5224 matrix_(element->index(),index) = element->value();
5243 template<
typename MT
5245 template<
typename MT2 >
5246 inline void Columns<MT,false,true,false,CCAs...>::assign(
const SparseMatrix<MT2,false>& rhs )
5256 for(
size_t i=0UL; i<
rows(); ++i ) {
5257 for( ConstIterator_<MT2> element=(~rhs).begin(i); element!=(~rhs).
end(i); ++element )
5258 matrix_(i,idx(element->index())) = element->value();
5277 template<
typename MT
5279 template<
typename MT2 >
5280 inline void Columns<MT,false,true,false,CCAs...>::addAssign(
const DenseMatrix<MT2,true>& rhs )
5288 const size_t ipos(
rows() &
size_t(-2) );
5291 for(
size_t j=0UL; j<
columns(); ++j )
5293 const size_t index( idx(j) );
5294 if( IsDiagonal<MT2>::value ) {
5295 matrix_(j,index) += (~rhs)(j,j);
5298 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5299 matrix_(i ,index) += (~rhs)(i ,j);
5300 matrix_(i+1UL,index) += (~rhs)(i+1UL,j);
5302 if( ipos <
rows() ) {
5303 matrix_(ipos,index) += (~rhs)(ipos,j);
5324 template<
typename MT
5326 template<
typename MT2 >
5327 inline void Columns<MT,false,true,false,CCAs...>::addAssign(
const DenseMatrix<MT2,false>& rhs )
5337 constexpr
size_t block( BLOCK_SIZE );
5341 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
5342 for(
size_t j=0UL; j<
columns(); ++j ) {
5343 const size_t index( idx(j) );
5344 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5345 matrix_(i ,index) += (~rhs)(i ,j);
5346 matrix_(i+1UL,index) += (~rhs)(i+1UL,j);
5348 if( ipos < (~rhs).rows() )
5349 matrix_(ipos,index) += (~rhs)(ipos,j);
5354 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5355 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5356 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5357 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5358 for(
size_t j=jj; j<jend; ++j ) {
5359 const size_t index( idx(j) );
5360 for(
size_t i=ii; i<iend; ++i ) {
5361 matrix_(i,index) += (~rhs)(i,j);
5384 template<
typename MT
5386 template<
typename MT2 >
5387 inline void Columns<MT,false,true,false,CCAs...>::addAssign(
const SparseMatrix<MT2,true>& rhs )
5395 for(
size_t j=0UL; j<
columns(); ++j ) {
5396 const size_t index( idx(j) );
5397 for( ConstIterator_<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5398 matrix_(element->index(),index) += element->value();
5417 template<
typename MT
5419 template<
typename MT2 >
5420 inline void Columns<MT,false,true,false,CCAs...>::addAssign(
const SparseMatrix<MT2,false>& rhs )
5430 for(
size_t i=0UL; i<
rows(); ++i ) {
5431 for( ConstIterator_<MT2> element=(~rhs).begin(i); element!=(~rhs).
end(i); ++element )
5432 matrix_(i,idx(element->index())) += element->value();
5451 template<
typename MT
5453 template<
typename MT2 >
5454 inline void Columns<MT,false,true,false,CCAs...>::subAssign(
const DenseMatrix<MT2,true>& rhs )
5462 const size_t ipos(
rows() &
size_t(-2) );
5465 for(
size_t j=0UL; j<
columns(); ++j )
5467 const size_t index( idx(j) );
5469 if( IsDiagonal<MT2>::value ) {
5470 matrix_(j,index) -= (~rhs)(j,j);
5473 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5474 matrix_(i ,index) -= (~rhs)(i ,j);
5475 matrix_(i+1UL,index) -= (~rhs)(i+1UL,j);
5477 if( ipos <
rows() ) {
5478 matrix_(ipos,index) -= (~rhs)(ipos,j);
5499 template<
typename MT
5501 template<
typename MT2 >
5502 inline void Columns<MT,false,true,false,CCAs...>::subAssign(
const DenseMatrix<MT2,false>& rhs )
5512 constexpr
size_t block( BLOCK_SIZE );
5516 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
5517 for(
size_t j=0UL; j<
columns(); ++j ) {
5518 const size_t index( idx(j) );
5519 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5520 matrix_(i ,index) -= (~rhs)(i ,j);
5521 matrix_(i+1UL,index) -= (~rhs)(i+1UL,j);
5523 if( ipos < (~rhs).rows() )
5524 matrix_(ipos,index) -= (~rhs)(ipos,j);
5529 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5530 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5531 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5532 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5533 for(
size_t j=jj; j<jend; ++j ) {
5534 const size_t index( idx(j) );
5535 for(
size_t i=ii; i<iend; ++i ) {
5536 matrix_(i,index) -= (~rhs)(i,j);
5559 template<
typename MT
5561 template<
typename MT2 >
5562 inline void Columns<MT,false,true,false,CCAs...>::subAssign(
const SparseMatrix<MT2,true>& rhs )
5570 for(
size_t j=0UL; j<
columns(); ++j ) {
5571 const size_t index( idx(j) );
5572 for( ConstIterator_<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element )
5573 matrix_(element->index(),index) -= element->value();
5592 template<
typename MT
5594 template<
typename MT2 >
5595 inline void Columns<MT,false,true,false,CCAs...>::subAssign(
const SparseMatrix<MT2,false>& rhs )
5605 for(
size_t i=0UL; i<
rows(); ++i ) {
5606 for( ConstIterator_<MT2> element=(~rhs).begin(i); element!=(~rhs).
end(i); ++element )
5607 matrix_(i,idx(element->index())) -= element->value();
5626 template<
typename MT
5628 template<
typename MT2 >
5629 inline void Columns<MT,false,true,false,CCAs...>::schurAssign(
const DenseMatrix<MT2,true>& rhs )
5637 const size_t ipos(
rows() &
size_t(-2) );
5640 for(
size_t j=0UL; j<
columns(); ++j ) {
5641 const size_t index( idx(j) );
5642 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5643 matrix_(i ,index) *= (~rhs)(i ,j);
5644 matrix_(i+1UL,index) *= (~rhs)(i+1UL,j);
5646 if( ipos <
rows() ) {
5647 matrix_(ipos,index) *= (~rhs)(ipos,j);
5667 template<
typename MT
5669 template<
typename MT2 >
5670 inline void Columns<MT,false,true,false,CCAs...>::schurAssign(
const DenseMatrix<MT2,false>& rhs )
5680 constexpr
size_t block( BLOCK_SIZE );
5684 const size_t ipos( (~rhs).
rows() &
size_t(-2) );
5685 for(
size_t j=0UL; j<
columns(); ++j ) {
5686 const size_t index( idx(j) );
5687 for(
size_t i=0UL; i<ipos; i+=2UL ) {
5688 matrix_(i ,index) *= (~rhs)(i ,j);
5689 matrix_(i+1UL,index) *= (~rhs)(i+1UL,j);
5691 if( ipos < (~rhs).rows() )
5692 matrix_(ipos,index) *= (~rhs)(ipos,j);
5697 for(
size_t jj=0UL; jj<
columns(); jj+=block ) {
5698 const size_t jend( (
columns()<(jj+block) )?(
columns() ):( jj+block ) );
5699 for(
size_t ii=0UL; ii<
rows(); ii+=block ) {
5700 const size_t iend( (
rows()<(ii+block) )?(
rows() ):( ii+block ) );
5701 for(
size_t j=jj; j<jend; ++j ) {
5702 const size_t index( idx(j) );
5703 for(
size_t i=ii; i<iend; ++i ) {
5704 matrix_(i,index) *= (~rhs)(i,j);
5727 template<
typename MT
5729 template<
typename MT2 >
5730 inline void Columns<MT,false,true,false,CCAs...>::schurAssign(
const SparseMatrix<MT2,true>& rhs )
5740 for(
size_t j=0UL; j<
columns(); ++j )
5742 const size_t index( idx(j) );
5745 for( ConstIterator_<MT2> element=(~rhs).
begin(j); element!=(~rhs).
end(j); ++element ) {
5746 for( ; i<element->index(); ++i )
5747 reset( matrix_(i,index) );
5748 matrix_(i,index) *= element->value();
5752 for( ; i<
rows(); ++i ) {
5753 reset( matrix_(i,index) );
5773 template<
typename MT
5775 template<
typename MT2 >
5776 inline void Columns<MT,false,true,false,CCAs...>::schurAssign(
const SparseMatrix<MT2,false>& rhs )
5788 for(
size_t i=0UL; i<
rows(); ++i )
5792 for( ConstIterator_<MT2> element=(~rhs).
begin(i); element!=(~rhs).
end(i); ++element ) {
5793 for( ; j<element->index(); ++j )
5794 reset( matrix_(i,idx(j)) );
5795 matrix_(i,idx(j)) *= element->value();
5800 reset( matrix_(i,idx(j)) );
5828 template<
typename MT
5830 class Columns<MT,false,true,true,CCAs...>
5831 :
public View< DenseMatrix< Columns<MT,false,true,true,CCAs...>, true > >
5832 ,
private ColumnsData<CCAs...>
5836 using DataType = ColumnsData<CCAs...>;
5837 using Operand = If_< IsExpression<MT>, MT, MT& >;
5843 using This = Columns<MT,
false,
true,
true,CCAs...>;
5845 using BaseType = DenseMatrix<This,true>;
5846 using ViewedType = MT;
5851 using SIMDType = SIMDTrait_<ElementType>;
5856 using ConstReference = ConstReference_<MT>;
5862 using ConstPointer = ConstPointer_<MT>;
5865 using Pointer = If_< Or< IsConst<MT>, Not< HasMutableDataAccess<MT> > >, ConstPointer, Pointer_<MT> >;
5868 using ConstIterator = ConstIterator_<MT>;
5876 enum :
bool { simdEnabled = MT::simdEnabled };
5879 enum :
bool { smpAssignable = MT::smpAssignable };
5885 template<
typename... RCAs >
5886 explicit inline Columns( MT& matrix, RCAs... args );
5888 inline Columns(
const Columns& ) =
default;
5889 inline Columns( Columns&& ) =
default;
5900 inline Reference operator()(
size_t i,
size_t j );
5901 inline ConstReference operator()(
size_t i,
size_t j )
const;
5902 inline Reference at(
size_t i,
size_t j );
5903 inline ConstReference at(
size_t i,
size_t j )
const;
5904 inline Pointer
data () noexcept;
5905 inline ConstPointer
data () const noexcept;
5906 inline Pointer
data (
size_t j ) noexcept;
5907 inline ConstPointer
data (
size_t j ) const noexcept;
5909 inline ConstIterator
begin (
size_t j ) const;
5910 inline ConstIterator
cbegin(
size_t j ) const;
5912 inline ConstIterator
end (
size_t j ) const;
5913 inline ConstIterator
cend (
size_t j ) const;
5920 inline Columns& operator=( const
ElementType& rhs );
5922 Columns& operator=( const Columns& ) = delete;
5929 using DataType::idx;
5930 using DataType::idces;
5931 using DataType::columns;
5933 inline MT& operand() noexcept;
5934 inline const MT& operand() const noexcept;
5936 inline
size_t rows() const noexcept;
5937 inline
size_t spacing() const noexcept;
5938 inline
size_t capacity() const noexcept;
5939 inline
size_t capacity(
size_t j ) const noexcept;
5941 inline
size_t nonZeros(
size_t j ) const;
5942 inline
void reset();
5943 inline
void reset(
size_t j );
5950 template< typename Other >
5951 inline
bool canAlias( const Other* alias ) const noexcept;
5953 template< typename MT2,
bool SO2,
bool SF2,
size_t... CCAs2 >
5954 inline
bool canAlias( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
5956 template< typename Other >
5957 inline
bool isAliased( const Other* alias ) const noexcept;
5959 template< typename MT2,
bool SO2,
bool SF2,
size_t... CCAs2 >
5960 inline
bool isAliased( const Columns<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
5962 inline
bool isAligned () const noexcept;
5963 inline
bool canSMPAssign() const noexcept;
5980 template< typename MT2,
bool SO2,
bool DF2,
bool SF2,
size_t... CCAs2 > friend class Columns;
6020 template< typename MT
6022 template< typename... RCAs >
6023 inline Columns<MT,false,true,true,CCAs...>::Columns( MT& matrix, RCAs... args )
6024 : DataType( args... )
6025 , matrix_ ( matrix )
6027 if( !Contains< TypeList<RCAs...>,
Unchecked >::value ) {
6028 for(
size_t j=0UL; j<
columns(); ++j ) {
6029 if( matrix_.columns() <= idx(j) ) {
6058 template<
typename MT
6060 inline typename Columns<MT,
false,
true,
true,CCAs...>
::Reference 6061 Columns<MT,false,true,true,CCAs...>::operator()(
size_t i,
size_t j )
6066 return matrix_(idx(j),i);
6083 template<
typename MT
6086 Columns<MT,false,true,true,CCAs...>::operator()(
size_t i,
size_t j )
const 6091 return const_cast<const MT&
>( matrix_ )(idx(j),i);
6109 template<
typename MT
6111 inline typename Columns<MT,
false,
true,
true,CCAs...>
::Reference 6112 Columns<MT,false,true,true,CCAs...>::at(
size_t i,
size_t j )
6120 return (*
this)(i,j);
6138 template<
typename MT
6141 Columns<MT,false,true,true,CCAs...>::at(
size_t i,
size_t j )
const 6149 return (*
this)(i,j);
6165 template<
typename MT
6167 inline typename Columns<MT,
false,
true,
true,CCAs...>::Pointer
6170 return matrix_.data( idx(0UL) );
6186 template<
typename MT
6188 inline typename Columns<MT,
false,
true,
true,CCAs...>::ConstPointer
6191 return matrix_.data( idx(0UL) );
6206 template<
typename MT
6208 inline typename Columns<MT,
false,
true,
true,CCAs...>::Pointer
6211 return matrix_.data( idx(j) );
6226 template<
typename MT
6228 inline typename Columns<MT,
false,
true,
true,CCAs...>::ConstPointer
6231 return matrix_.data( idx(j) );
6246 template<
typename MT
6248 inline typename Columns<MT,
false,
true,
true,CCAs...>
::Iterator 6252 return matrix_.begin( idx(j) );
6267 template<
typename MT
6273 return matrix_.cbegin( idx(j) );
6288 template<
typename MT
6294 return matrix_.cbegin( idx(j) );
6309 template<
typename MT
6311 inline typename Columns<MT,
false,
true,
true,CCAs...>
::Iterator 6315 return matrix_.end( idx(j) );
6330 template<
typename MT
6336 return matrix_.cend( idx(j) );
6351 template<
typename MT
6357 return matrix_.cend( idx(j) );
6382 template<
typename MT
6384 inline Columns<MT,
false,
true,
true,CCAs...>&
6385 Columns<MT,false,true,true,CCAs...>::operator=(
const ElementType& rhs )
6387 for(
size_t j=0UL; j<
columns(); ++j ) {
6411 template<
typename MT
6413 inline MT& Columns<MT,false,true,true,CCAs...>::operand() noexcept
6427 template<
typename MT
6429 inline const MT& Columns<MT,false,true,true,CCAs...>::operand() const noexcept
6443 template<
typename MT
6447 return matrix_.rows();
6462 template<
typename MT
6466 return matrix_.spacing();
6478 template<
typename MT
6497 template<
typename MT
6517 template<
typename MT
6521 size_t nonzeros( 0UL );
6523 for(
size_t j=0UL; j<
columns(); ++j ) {
6524 nonzeros += matrix_.nonZeros( idx(j) );
6542 template<
typename MT
6548 return matrix_.nonZeros( idx(j) );
6560 template<
typename MT
6564 for(
size_t j=0UL; j<
columns(); ++j ) {
6565 matrix_.reset( idx(j) );
6581 template<
typename MT
6585 matrix_.reset( idx(j) );
6608 template<
typename MT
6610 template<
typename Other >
6611 inline bool Columns<MT,false,true,true,CCAs...>::canAlias(
const Other* alias )
const noexcept
6613 return matrix_.isAliased( alias );
6631 template<
typename MT
6633 template<
typename MT2
6638 Columns<MT,false,true,true,CCAs...>::canAlias(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
6640 return matrix_.isAliased( &alias->matrix_ );
6657 template<
typename MT
6659 template<
typename Other >
6660 inline bool Columns<MT,false,true,true,CCAs...>::isAliased(
const Other* alias )
const noexcept
6662 return matrix_.isAliased( alias );
6680 template<
typename MT
6682 template<
typename MT2
6687 Columns<MT,false,true,true,CCAs...>::isAliased(
const Columns<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
6689 return matrix_.isAliased( &alias->matrix_ );
6705 template<
typename MT
6707 inline bool Columns<MT,false,true,true,CCAs...>::isAligned() const noexcept
6709 return matrix_.isAligned();
6726 template<
typename MT
6728 inline bool Columns<MT,false,true,true,CCAs...>::canSMPAssign() const noexcept
6730 return (
rows() *
columns() > SMP_DMATASSIGN_THRESHOLD );
6751 template<
typename MT
6754 Columns<MT,false,true,true,CCAs...>::load(
size_t i,
size_t j )
const noexcept
6756 return matrix_.load( idx(j), i );
6777 template<
typename MT
6782 return matrix_.loada( idx(j), i );
6803 template<
typename MT
6808 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:131
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:3077
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.
EnableIf_< IsDenseMatrix< MT1 > > smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:196
Header file for the subtraction trait.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:522
Header file for basic type definitions.
Header file for the View base class.
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:79
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:164
Header file for the IsSparseMatrix type trait.
Header file for the IsDiagonal type trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i...
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3076
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:364
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3074
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:701
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3078
Header file for the And class template.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SUBMATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a submatrix type (i.e. a dense or sparse submatrix), a compilation error is created.
Definition: Submatrix.h:81
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:827
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower or upper unitriangular matrix ty...
Definition: UniTriangular.h:81
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3083
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:560
#define BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a symmetric matrix type...
Definition: Symmetric.h:60
Header file for the decltype(auto) workaround.
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:733
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3084
Constraints on the storage order of matrix types.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a transposition expression (i...
Definition: TransExpr.h:81
Header file for the RequiresEvaluation type trait.
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:133
BLAZE_ALWAYS_INLINE MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:474
BLAZE_ALWAYS_INLINE MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:408
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:252
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
Header file for the DisableIf class template.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
typename ColumnsTrait< MT, CCAs... >::Type ColumnsTrait_
Auxiliary alias declaration for the ColumnsTrait type trait.The ColumnsTrait_ alias declaration provi...
Definition: ColumnsTrait.h:145
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3082
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
decltype(auto) ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatMapExpr.h:1359
Header file for nested template disabiguation.
Header file for the If class template.
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: ColumnMajorMatrix.h:61
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:102
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3079
Header file for the Or class template.
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the HasSIMDAdd type trait.
Header file for the DenseMatrix base class.
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:367
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:443
Header file for the Not class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:250
Header file for all SIMD functionality.
Header file for the IsLower type trait.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:506
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:80
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_VECTORIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a vectorizable data type...
Definition: Vectorizable.h:61
Header file for the exception macros of the math module.
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:430
#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:8893
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Constraint on the data type.
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:75
Header file for the IsSIMDCombinable type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: RowMajorMatrix.h:61
Header file for the HasSIMDMult type trait.
Header file for the IsConst type trait.
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Header file for the addition trait.
Header file for the Unique class template.
Check< false > Unchecked
Type of the blaze::unchecked instance.blaze::Unchecked is the type of the blaze::unchecked instance...
Definition: Check.h:96
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:131
Header file for the reset shim.
Header file for the cache size of the target architecture.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
Constraint on the data type.
Constraint on the data type.
Header file for the HasSIMDSub type trait.
Constraints on the storage order of matrix types.
Header file for the HasMutableDataAccess type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
Header file for the IsReference type trait.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
BLAZE_ALWAYS_INLINE EnableIf_< And< IsIntegral< T1 >, HasSize< T1, 1UL > > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:76
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:490
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
BLAZE_ALWAYS_INLINE MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:169
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
Header file for the implementation of the ColumnsData class template.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3081
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
#define BLAZE_THROW_LOGIC_ERROR(MESSAGE)
Macro for the emission of a std::logic_error exception.This macro encapsulates the default way of Bla...
Definition: Exception.h:187
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
Header file for the IsUpper type trait.
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the IsHermitian type trait.
Header file for the IsRestricted type trait.
System settings for the inline keywords.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the IsExpression type trait class.
Constraint on the data type.
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:801