35 #ifndef _BLAZE_MATH_VIEWS_COLUMN_DENSE_H_ 36 #define _BLAZE_MATH_VIEWS_COLUMN_DENSE_H_ 122 template<
typename MT
125 class Column<MT,true,true,SF,CCAs...>
126 :
public View< DenseVector< Column<MT,true,true,SF,CCAs...>, false > >
127 ,
private ColumnData<CCAs...>
131 using DataType = ColumnData<CCAs...>;
132 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
138 using This = Column<MT,
true,
true,SF,CCAs...>;
140 using BaseType = DenseVector<This,false>;
141 using ViewedType = MT;
145 using SIMDType = SIMDTrait_t<ElementType>;
156 using ConstPointer = ConstPointer_t<MT>;
159 using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
170 static constexpr
bool simdEnabled = MT::simdEnabled;
179 template<
typename... RCAs >
180 explicit inline Column( MT& matrix, RCAs... args );
182 Column(
const Column& ) =
default;
196 inline Reference operator[](
size_t index );
200 inline Pointer
data () noexcept;
201 inline ConstPointer
data () const noexcept;
214 inline Column& operator=( const
ElementType& rhs );
215 inline Column& operator=( initializer_list<
ElementType> list );
216 inline Column& operator=( const Column& rhs );
218 template< typename VT > inline Column& operator= ( const Vector<VT,false>& rhs );
219 template< typename VT > inline Column& operator+=( const Vector<VT,false>& rhs );
220 template< typename VT > inline Column& operator-=( const Vector<VT,false>& rhs );
221 template< typename VT > inline Column& operator*=( const Vector<VT,false>& rhs );
222 template< typename VT > inline Column& operator/=( const DenseVector<VT,false>& rhs );
223 template< typename VT > inline Column& operator%=( const Vector<VT,false>& rhs );
232 inline MT& operand() noexcept;
233 inline const MT& operand() const noexcept;
235 inline
size_t size() const noexcept;
236 inline
size_t spacing() const noexcept;
237 inline
size_t capacity() const noexcept;
246 template< typename Other > inline Column& scale( const Other& scalar );
253 template< typename VT >
254 static constexpr
bool VectorizedAssign_v =
255 ( useOptimizedKernels &&
256 simdEnabled && VT::simdEnabled &&
262 template< typename VT >
263 static constexpr
bool VectorizedAddAssign_v =
264 ( useOptimizedKernels &&
265 simdEnabled && VT::simdEnabled &&
272 template< typename VT >
273 static constexpr
bool VectorizedSubAssign_v =
274 ( useOptimizedKernels &&
275 simdEnabled && VT::simdEnabled &&
282 template< typename VT >
283 static constexpr
bool VectorizedMultAssign_v =
284 ( useOptimizedKernels &&
285 simdEnabled && VT::simdEnabled &&
292 template< typename VT >
293 static constexpr
bool VectorizedDivAssign_v =
294 ( useOptimizedKernels &&
295 simdEnabled && VT::simdEnabled &&
309 template< typename Other >
310 inline
bool canAlias( const Other* alias ) const noexcept;
312 template< typename MT2,
bool SO2,
bool SF2,
size_t... CCAs2 >
313 inline
bool canAlias( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
315 template< typename Other >
316 inline
bool isAliased( const Other* alias ) const noexcept;
318 template< typename MT2,
bool SO2,
bool SF2,
size_t... CCAs2 >
319 inline
bool isAliased( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
321 inline
bool isAligned () const noexcept;
322 inline
bool canSMPAssign() const noexcept;
333 template< typename VT >
334 inline auto assign( const DenseVector<VT,false>& rhs ) ->
DisableIf_t< VectorizedAssign_v<VT> >;
336 template< typename VT >
337 inline auto assign( const DenseVector<VT,false>& rhs ) ->
EnableIf_t< VectorizedAssign_v<VT> >;
339 template< typename VT > inline
void assign( const SparseVector<VT,false>& rhs );
341 template< typename VT >
342 inline auto addAssign( const DenseVector<VT,false>& rhs ) ->
DisableIf_t< VectorizedAddAssign_v<VT> >;
344 template< typename VT >
345 inline auto addAssign( const DenseVector<VT,false>& rhs ) ->
EnableIf_t< VectorizedAddAssign_v<VT> >;
347 template< typename VT > inline
void addAssign( const SparseVector<VT,false>& rhs );
349 template< typename VT >
350 inline auto subAssign( const DenseVector<VT,false>& rhs ) ->
DisableIf_t< VectorizedSubAssign_v<VT> >;
352 template< typename VT >
353 inline auto subAssign( const DenseVector<VT,false>& rhs ) ->
EnableIf_t< VectorizedSubAssign_v<VT> >;
355 template< typename VT > inline
void subAssign( const SparseVector<VT,false>& rhs );
357 template< typename VT >
358 inline auto multAssign( const DenseVector<VT,false>& rhs ) ->
DisableIf_t< VectorizedMultAssign_v<VT> >;
360 template< typename VT >
361 inline auto multAssign( const DenseVector<VT,false>& rhs ) ->
EnableIf_t< VectorizedMultAssign_v<VT> >;
363 template< typename VT > inline
void multAssign( const SparseVector<VT,false>& rhs );
365 template< typename VT >
366 inline auto divAssign( const DenseVector<VT,false>& rhs ) ->
DisableIf_t< VectorizedDivAssign_v<VT> >;
368 template< typename VT >
369 inline auto divAssign( const DenseVector<VT,false>& rhs ) ->
EnableIf_t< VectorizedDivAssign_v<VT> >;
382 template< typename MT2,
bool SO2,
bool DF2,
bool SF2,
size_t... CCAs2 > friend class Column;
420 template< typename MT
423 template< typename... RCAs >
424 inline Column<MT,true,true,SF,CCAs...>::Column( MT& matrix, RCAs... args )
425 : DataType( args... )
429 if( matrix_.columns() <=
column() ) {
459 template<
typename MT
462 inline typename Column<MT,
true,
true,SF,CCAs...>
::Reference 463 Column<MT,true,true,SF,CCAs...>::operator[](
size_t index )
466 return matrix_(index,
column());
482 template<
typename MT
486 Column<MT,true,true,SF,CCAs...>::operator[](
size_t index )
const 489 return const_cast<const MT&
>( matrix_ )(index,
column());
506 template<
typename MT
509 inline typename Column<MT,
true,
true,SF,CCAs...>
::Reference 510 Column<MT,true,true,SF,CCAs...>::at(
size_t index )
512 if( index >=
size() ) {
515 return (*
this)[index];
532 template<
typename MT
536 Column<MT,true,true,SF,CCAs...>::at(
size_t index )
const 538 if( index >=
size() ) {
541 return (*
this)[index];
556 template<
typename MT
559 inline typename Column<MT,
true,
true,SF,CCAs...>::Pointer
562 return matrix_.data(
column() );
577 template<
typename MT
580 inline typename Column<MT,
true,
true,SF,CCAs...>::ConstPointer
583 return matrix_.data(
column() );
597 template<
typename MT
600 inline typename Column<MT,
true,
true,SF,CCAs...>
::Iterator 603 return matrix_.begin(
column() );
617 template<
typename MT
623 return matrix_.cbegin(
column() );
637 template<
typename MT
643 return matrix_.cbegin(
column() );
657 template<
typename MT
660 inline typename Column<MT,
true,
true,SF,CCAs...>
::Iterator 663 return matrix_.end(
column() );
677 template<
typename MT
683 return matrix_.cend(
column() );
697 template<
typename MT
703 return matrix_.cend(
column() );
728 template<
typename MT
731 inline Column<MT,
true,
true,SF,CCAs...>&
732 Column<MT,true,true,SF,CCAs...>::operator=(
const ElementType& rhs )
734 decltype(
auto) left( derestrict( matrix_ ) );
747 for(
size_t i=ibegin; i<iend; ++i ) {
748 if( !IsRestricted_v<MT> || IsTriangular_v<MT> || trySet( matrix_, i,
column(), rhs ) )
773 template<
typename MT
776 inline Column<MT,
true,
true,SF,CCAs...>&
777 Column<MT,true,true,SF,CCAs...>::operator=( initializer_list<ElementType> list )
779 if( list.size() >
size() ) {
783 if( IsRestricted_v<MT> ) {
784 const InitializerVector<ElementType,false> tmp( list,
size() );
785 if( !tryAssign( matrix_, tmp, 0UL,
column() ) ) {
790 decltype(
auto) left( derestrict( *this ) );
816 template< typename MT
819 inline Column<MT,true,true,SF,CCAs...>&
820 Column<MT,true,true,SF,CCAs...>::operator=( const Column& rhs )
822 if( &rhs ==
this )
return *
this;
824 if(
size() != rhs.size() ) {
828 if( !tryAssign( matrix_, rhs, 0UL,
column() ) ) {
832 decltype(
auto) left( derestrict( *this ) );
864 template<
typename MT
867 template<
typename VT >
868 inline Column<MT,
true,
true,SF,CCAs...>&
869 Column<MT,true,true,SF,CCAs...>::operator=(
const Vector<VT,false>& rhs )
878 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>,
const VT& >;
881 if( !tryAssign( matrix_, right, 0UL,
column() ) ) {
885 decltype(
auto) left( derestrict( *this ) );
888 const ResultType_t<VT> tmp( right );
892 if( IsSparseVector_v<VT> )
919 template<
typename MT
922 template<
typename VT >
923 inline Column<MT,
true,
true,SF,CCAs...>&
933 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>,
const VT& >;
936 if( !tryAddAssign( matrix_, right, 0UL,
column() ) ) {
940 decltype(
auto) left( derestrict( *this ) );
943 const ResultType_t<VT> tmp( right );
972 template<
typename MT
975 template<
typename VT >
976 inline Column<MT,
true,
true,SF,CCAs...>&
986 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>,
const VT& >;
989 if( !trySubAssign( matrix_, right, 0UL,
column() ) ) {
993 decltype(
auto) left( derestrict( *this ) );
996 const ResultType_t<VT> tmp( right );
1024 template<
typename MT
1027 template<
typename VT >
1028 inline Column<MT,
true,
true,SF,CCAs...>&
1038 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>,
const VT& >;
1039 Right right( ~rhs );
1041 if( !tryMultAssign( matrix_, right, 0UL,
column() ) ) {
1045 decltype(
auto) left( derestrict( *this ) );
1048 const ResultType_t<VT> tmp( right );
1075 template<
typename MT
1078 template<
typename VT >
1079 inline Column<MT,
true,
true,SF,CCAs...>&
1089 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>,
const VT& >;
1090 Right right( ~rhs );
1092 if( !tryDivAssign( matrix_, right, 0UL,
column() ) ) {
1096 decltype(
auto) left( derestrict( *this ) );
1099 const ResultType_t<VT> tmp( right );
1127 template<
typename MT
1130 template<
typename VT >
1131 inline Column<MT,
true,
true,SF,CCAs...>&
1132 Column<MT,true,true,SF,CCAs...>::operator%=(
const Vector<VT,false>& rhs )
1134 using blaze::assign;
1139 using CrossType = CrossTrait_t< ResultType, ResultType_t<VT> >;
1145 if(
size() != 3UL || (~rhs).
size() != 3UL ) {
1149 const CrossType right( *
this % (~rhs) );
1151 if( !tryAssign( matrix_, right, 0UL,
column() ) ) {
1155 decltype(
auto) left( derestrict( *this ) );
1157 assign( left, right );
1181 template< typename MT
1184 inline MT& Column<MT,true,true,SF,CCAs...>::operand() noexcept
1198 template<
typename MT
1201 inline const MT& Column<MT,true,true,SF,CCAs...>::operand() const noexcept
1215 template<
typename MT
1220 return matrix_.rows();
1235 template<
typename MT
1240 return matrix_.spacing();
1252 template<
typename MT
1257 return matrix_.capacity(
column() );
1272 template<
typename MT
1277 return matrix_.nonZeros(
column() );
1289 template<
typename MT
1294 matrix_.reset(
column() );
1321 template<
typename MT
1324 template<
typename Other >
1325 inline Column<MT,
true,
true,SF,CCAs...>&
1326 Column<MT,true,true,SF,CCAs...>::scale(
const Other& scalar )
1330 const size_t ibegin( ( IsLower_v<MT> )
1331 ?( ( IsStrictlyLower_v<MT> )
1335 const size_t iend ( ( IsUpper_v<MT> )
1336 ?( ( IsStrictlyUpper_v<MT> )
1341 for(
size_t i=ibegin; i<iend; ++i ) {
1342 matrix_(i,
column()) *= scalar;
1370 template<
typename MT
1373 template<
typename Other >
1374 inline bool Column<MT,true,true,SF,CCAs...>::canAlias(
const Other* alias )
const noexcept
1376 return matrix_.isAliased( alias );
1393 template<
typename MT
1396 template<
typename MT2
1401 Column<MT,true,true,SF,CCAs...>::canAlias(
const Column<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
1403 return matrix_.isAliased( alias->matrix_ ) && (
column() == alias->column() );
1420 template<
typename MT
1423 template<
typename Other >
1424 inline bool Column<MT,true,true,SF,CCAs...>::isAliased(
const Other* alias )
const noexcept
1426 return matrix_.isAliased( alias );
1443 template<
typename MT
1446 template<
typename MT2
1451 Column<MT,true,true,SF,CCAs...>::isAliased(
const Column<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
1453 return matrix_.isAliased( &alias->matrix_ ) && (
column() == alias->column() );
1469 template<
typename MT
1472 inline bool Column<MT,true,true,SF,CCAs...>::isAligned() const noexcept
1474 return matrix_.isAligned();
1491 template<
typename MT
1494 inline bool Column<MT,true,true,SF,CCAs...>::canSMPAssign() const noexcept
1496 return (
size() > SMP_DVECASSIGN_THRESHOLD );
1514 template<
typename MT
1518 Column<MT,true,true,SF,CCAs...>::load(
size_t index )
const noexcept
1520 return matrix_.load( index,
column() );
1539 template<
typename MT
1545 return matrix_.loada( index,
column() );
1564 template<
typename MT
1570 return matrix_.loadu( index,
column() );
1589 template<
typename MT
1593 Column<MT,true,true,SF,CCAs...>::store(
size_t index,
const SIMDType& value ) noexcept
1595 matrix_.store( index,
column(), value );
1615 template<
typename MT
1621 matrix_.storea( index,
column(), value );
1641 template<
typename MT
1647 matrix_.storeu( index,
column(), value );
1667 template<
typename MT
1673 matrix_.stream( index,
column(), value );
1691 template<
typename MT
1694 template<
typename VT >
1695 inline auto Column<MT,true,true,SF,CCAs...>::assign(
const DenseVector<VT,false>& rhs )
1696 -> DisableIf_t< VectorizedAssign_v<VT> >
1700 const size_t ipos( (~rhs).
size() &
size_t(-2) );
1701 for(
size_t i=0UL; i<ipos; i+=2UL ) {
1702 matrix_(i ,
column()) = (~rhs)[i ];
1703 matrix_(i+1UL,
column()) = (~rhs)[i+1UL];
1705 if( ipos < (~rhs).size() )
1706 matrix_(ipos,
column()) = (~rhs)[ipos];
1724 template<
typename MT
1727 template<
typename VT >
1728 inline auto Column<MT,true,true,SF,CCAs...>::assign(
const DenseVector<VT,false>& rhs )
1729 -> EnableIf_t< VectorizedAssign_v<VT> >
1735 constexpr
bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
1739 const size_t ipos( ( remainder )?(
rows &
size_t(-SIMDSIZE) ):(
rows ) );
1744 ConstIterator_t<VT> right( (~rhs).
begin() );
1746 if( useStreaming &&
rows > ( cacheSize/(
sizeof(
ElementType) * 3UL ) ) && !(~rhs).isAliased(
this ) )
1748 for( ; i<ipos; i+=SIMDSIZE ) {
1749 left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1751 for( ; remainder && i<
rows; ++i ) {
1752 *left = *right; ++left; ++right;
1757 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
1758 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1759 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1760 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1761 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1763 for( ; i<ipos; i+=SIMDSIZE ) {
1764 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1766 for( ; remainder && i<
rows; ++i ) {
1767 *left = *right; ++left; ++right;
1787 template<
typename MT
1790 template<
typename VT >
1791 inline void Column<MT,true,true,SF,CCAs...>::assign(
const SparseVector<VT,false>& rhs )
1795 for( ConstIterator_t<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
1796 matrix_(element->index(),
column()) = element->value();
1814 template<
typename MT
1817 template<
typename VT >
1818 inline auto Column<MT,true,true,SF,CCAs...>::addAssign(
const DenseVector<VT,false>& rhs )
1819 -> DisableIf_t< VectorizedAddAssign_v<VT> >
1823 const size_t ipos( (~rhs).
size() &
size_t(-2) );
1824 for(
size_t i=0UL; i<ipos; i+=2UL ) {
1825 matrix_(i ,
column()) += (~rhs)[i ];
1826 matrix_(i+1UL,
column()) += (~rhs)[i+1UL];
1828 if( ipos < (~rhs).size() )
1829 matrix_(ipos,
column()) += (~rhs)[ipos];
1847 template<
typename MT
1850 template<
typename VT >
1851 inline auto Column<MT,true,true,SF,CCAs...>::addAssign(
const DenseVector<VT,false>& rhs )
1852 -> EnableIf_t< VectorizedAddAssign_v<VT> >
1858 constexpr
bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
1862 const size_t ipos( ( remainder )?(
rows &
size_t(-SIMDSIZE) ):(
rows ) );
1867 ConstIterator_t<VT> right( (~rhs).
begin() );
1869 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
1870 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1871 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1872 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1873 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1875 for( ; i<ipos; i+=SIMDSIZE ) {
1876 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1878 for( ; remainder && i<
rows; ++i ) {
1879 *left += *right; ++left; ++right;
1898 template<
typename MT
1901 template<
typename VT >
1902 inline void Column<MT,true,true,SF,CCAs...>::addAssign(
const SparseVector<VT,false>& rhs )
1906 for( ConstIterator_t<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
1907 matrix_(element->index(),
column()) += element->value();
1925 template<
typename MT
1928 template<
typename VT >
1929 inline auto Column<MT,true,true,SF,CCAs...>::subAssign(
const DenseVector<VT,false>& rhs )
1930 -> DisableIf_t< VectorizedSubAssign_v<VT> >
1934 const size_t ipos( (~rhs).
size() &
size_t(-2) );
1935 for(
size_t i=0UL; i<ipos; i+=2UL ) {
1936 matrix_(i ,
column()) -= (~rhs)[i ];
1937 matrix_(i+1UL,
column()) -= (~rhs)[i+1UL];
1939 if( ipos < (~rhs).size() )
1940 matrix_(ipos,
column()) -= (~rhs)[ipos];
1958 template<
typename MT
1961 template<
typename VT >
1962 inline auto Column<MT,true,true,SF,CCAs...>::subAssign(
const DenseVector<VT,false>& rhs )
1963 -> EnableIf_t< VectorizedSubAssign_v<VT> >
1969 constexpr
bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
1973 const size_t ipos( ( remainder )?(
rows &
size_t(-SIMDSIZE) ):(
rows ) );
1978 ConstIterator_t<VT> right( (~rhs).
begin() );
1980 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
1981 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1982 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1983 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1984 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1986 for( ; i<ipos; i+=SIMDSIZE ) {
1987 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
1989 for( ; remainder && i<
rows; ++i ) {
1990 *left -= *right; ++left; ++right;
2009 template<
typename MT
2012 template<
typename VT >
2013 inline void Column<MT,true,true,SF,CCAs...>::subAssign(
const SparseVector<VT,false>& rhs )
2017 for( ConstIterator_t<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
2018 matrix_(element->index(),
column()) -= element->value();
2036 template<
typename MT
2039 template<
typename VT >
2040 inline auto Column<MT,true,true,SF,CCAs...>::multAssign(
const DenseVector<VT,false>& rhs )
2041 -> DisableIf_t< VectorizedMultAssign_v<VT> >
2045 const size_t ipos( (~rhs).
size() &
size_t(-2) );
2046 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2047 matrix_(i ,
column()) *= (~rhs)[i ];
2048 matrix_(i+1UL,
column()) *= (~rhs)[i+1UL];
2050 if( ipos < (~rhs).size() )
2051 matrix_(ipos,
column()) *= (~rhs)[ipos];
2069 template<
typename MT
2072 template<
typename VT >
2073 inline auto Column<MT,true,true,SF,CCAs...>::multAssign(
const DenseVector<VT,false>& rhs )
2074 -> EnableIf_t< VectorizedMultAssign_v<VT> >
2080 constexpr
bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
2084 const size_t ipos( ( remainder )?(
rows &
size_t(-SIMDSIZE) ):(
rows ) );
2089 ConstIterator_t<VT> right( (~rhs).
begin() );
2091 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2092 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2093 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2094 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2095 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2097 for( ; i<ipos; i+=SIMDSIZE ) {
2098 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2100 for( ; remainder && i<
rows; ++i ) {
2101 *left *= *right; ++left, ++right;
2120 template<
typename MT
2123 template<
typename VT >
2124 inline void Column<MT,true,true,SF,CCAs...>::multAssign(
const SparseVector<VT,false>& rhs )
2132 for( ConstIterator_t<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element ) {
2133 const size_t index( element->index() );
2134 for( ; i<index; ++i )
2136 matrix_(i,
column()) *= element->value();
2140 for( ; i<
size(); ++i ) {
2160 template<
typename MT
2163 template<
typename VT >
2164 inline auto Column<MT,true,true,SF,CCAs...>::divAssign(
const DenseVector<VT,false>& rhs )
2165 -> DisableIf_t< VectorizedDivAssign_v<VT> >
2169 const size_t ipos( (~rhs).
size() &
size_t(-2) );
2170 for(
size_t i=0UL; i<ipos; i+=2UL ) {
2171 matrix_(i ,
column()) /= (~rhs)[i ];
2172 matrix_(i+1UL,
column()) /= (~rhs)[i+1UL];
2174 if( ipos < (~rhs).size() )
2175 matrix_(ipos,
column()) /= (~rhs)[ipos];
2193 template<
typename MT
2196 template<
typename VT >
2197 inline auto Column<MT,true,true,SF,CCAs...>::divAssign(
const DenseVector<VT,false>& rhs )
2198 -> EnableIf_t< VectorizedDivAssign_v<VT> >
2206 const size_t ipos(
rows &
size_t(-SIMDSIZE) );
2211 ConstIterator_t<VT> right( (~rhs).
begin() );
2213 for( ; (i+SIMDSIZE*3UL) < ipos; i+=SIMDSIZE*4UL ) {
2214 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2215 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2216 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2217 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2219 for( ; i<ipos; i+=SIMDSIZE ) {
2220 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
2222 for( ; i<
rows; ++i ) {
2223 *left /= *right; ++left; ++right;
2250 template<
typename MT
2252 class Column<MT,false,true,false,CCAs...>
2253 :
public View< DenseVector< Column<MT,false,true,false,CCAs...>, false > >
2254 ,
private ColumnData<CCAs...>
2258 using DataType = ColumnData<CCAs...>;
2259 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
2265 using This = Column<MT,
false,
true,
false,CCAs...>;
2267 using BaseType = DenseVector<This,false>;
2268 using ViewedType = MT;
2282 using ConstPointer = ConstPointer_t<MT>;
2285 using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
2291 template<
typename MatrixType
2292 ,
typename IteratorType >
2293 class ColumnIterator
2298 using IteratorCategory =
typename std::iterator_traits<IteratorType>::iterator_category;
2301 using ValueType =
typename std::iterator_traits<IteratorType>::value_type;
2304 using PointerType =
typename std::iterator_traits<IteratorType>::pointer;
2307 using ReferenceType =
typename std::iterator_traits<IteratorType>::reference;
2310 using DifferenceType =
typename std::iterator_traits<IteratorType>::difference_type;
2313 using iterator_category = IteratorCategory;
2314 using value_type = ValueType;
2315 using pointer = PointerType;
2316 using reference = ReferenceType;
2317 using difference_type = DifferenceType;
2323 inline ColumnIterator() noexcept
2324 : matrix_(
nullptr )
2338 inline ColumnIterator( MatrixType& matrix,
size_t row,
size_t column ) noexcept
2339 : matrix_( &matrix )
2344 if( row_ != matrix_->rows() )
2345 pos_ = matrix_->begin( row_ ) + column_;
2354 template<
typename MatrixType2,
typename IteratorType2 >
2355 inline ColumnIterator(
const ColumnIterator<MatrixType2,IteratorType2>& it ) noexcept
2356 : matrix_( it.matrix_ )
2358 , column_( it.column_ )
2369 inline ColumnIterator&
operator+=(
size_t inc ) noexcept {
2372 if( row_ != matrix_->rows() )
2373 pos_ = matrix_->begin( row_ ) + column_;
2385 inline ColumnIterator&
operator-=(
size_t dec ) noexcept {
2388 if( row_ != matrix_->rows() )
2389 pos_ = matrix_->begin( row_ ) + column_;
2400 inline ColumnIterator& operator++() noexcept {
2403 if( row_ != matrix_->rows() )
2404 pos_ = matrix_->begin( row_ ) + column_;
2415 inline const ColumnIterator operator++(
int ) noexcept {
2416 const ColumnIterator tmp( *
this );
2427 inline ColumnIterator& operator--() noexcept {
2430 if( row_ != matrix_->rows() )
2431 pos_ = matrix_->begin( row_ ) + column_;
2442 inline const ColumnIterator operator--(
int ) noexcept {
2443 const ColumnIterator tmp( *
this );
2455 inline ReferenceType operator[](
size_t index )
const {
2457 const IteratorType pos( matrix_->begin( row_+index ) + column_ );
2467 inline ReferenceType
operator*()
const {
2477 inline PointerType operator->()
const {
2488 template<
typename MatrixType2,
typename IteratorType2 >
2489 inline bool operator==(
const ColumnIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
2490 return row_ == rhs.row_;
2500 template<
typename MatrixType2,
typename IteratorType2 >
2501 inline bool operator!=(
const ColumnIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
2502 return !( *
this == rhs );
2512 template<
typename MatrixType2,
typename IteratorType2 >
2513 inline bool operator<( const ColumnIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
2514 return row_ < rhs.row_;
2524 template<
typename MatrixType2,
typename IteratorType2 >
2525 inline bool operator>(
const ColumnIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
2526 return row_ > rhs.row_;
2536 template<
typename MatrixType2,
typename IteratorType2 >
2537 inline bool operator<=( const ColumnIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
2538 return row_ <= rhs.row_;
2548 template<
typename MatrixType2,
typename IteratorType2 >
2549 inline bool operator>=(
const ColumnIterator<MatrixType2,IteratorType2>& rhs )
const noexcept {
2550 return row_ >= rhs.row_;
2560 inline DifferenceType
operator-(
const ColumnIterator& rhs )
const noexcept {
2561 return row_ - rhs.row_;
2572 friend inline const ColumnIterator
operator+(
const ColumnIterator& it,
size_t inc ) noexcept {
2573 return ColumnIterator( *it.matrix_, it.row_+inc, it.column_ );
2584 friend inline const ColumnIterator
operator+(
size_t inc,
const ColumnIterator& it ) noexcept {
2585 return ColumnIterator( *it.matrix_, it.row_+inc, it.column_ );
2596 friend inline const ColumnIterator
operator-(
const ColumnIterator& it,
size_t dec ) noexcept {
2597 return ColumnIterator( *it.matrix_, it.row_-dec, it.column_ );
2603 MatrixType* matrix_;
2610 template<
typename MatrixType2,
typename IteratorType2 >
friend class ColumnIterator;
2617 using ConstIterator = ColumnIterator< const MT, ConstIterator_t<MT> >;
2625 static constexpr
bool simdEnabled =
false;
2634 template<
typename... RCAs >
2635 explicit inline Column( MT& matrix, RCAs... args );
2637 Column(
const Column& ) =
default;
2644 ~Column() =
default;
2651 inline Reference operator[](
size_t index );
2655 inline Pointer
data () noexcept;
2656 inline ConstPointer
data () const noexcept;
2669 inline Column& operator=( const
ElementType& rhs );
2670 inline Column& operator=( initializer_list<
ElementType> list );
2671 inline Column& operator=( const Column& rhs );
2673 template< typename VT > inline Column& operator= ( const Vector<VT,false>& rhs );
2674 template< typename VT > inline Column& operator+=( const Vector<VT,false>& rhs );
2675 template< typename VT > inline Column& operator-=( const Vector<VT,false>& rhs );
2676 template< typename VT > inline Column& operator*=( const Vector<VT,false>& rhs );
2677 template< typename VT > inline Column& operator/=( const DenseVector<VT,false>& rhs );
2678 template< typename VT > inline Column& operator%=( const Vector<VT,false>& rhs );
2687 inline MT& operand() noexcept;
2688 inline const MT& operand() const noexcept;
2690 inline
size_t size() const noexcept;
2691 inline
size_t spacing() const noexcept;
2692 inline
size_t capacity() const noexcept;
2694 inline
void reset();
2701 template< typename Other > inline Column& scale( const Other& scalar );
2708 template< typename Other >
2709 inline
bool canAlias ( const Other* alias ) const noexcept;
2711 template< typename MT2,
bool SO2,
bool SF2,
size_t... CCAs2 >
2712 inline
bool canAlias ( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
2714 template< typename Other >
2715 inline
bool isAliased( const Other* alias ) const noexcept;
2717 template< typename MT2,
bool SO2,
bool SF2,
size_t... CCAs2 >
2718 inline
bool isAliased( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
2720 inline
bool isAligned () const noexcept;
2721 inline
bool canSMPAssign() const noexcept;
2723 template< typename VT > inline
void assign ( const DenseVector <VT,false>& rhs );
2724 template< typename VT > inline
void assign ( const SparseVector<VT,false>& rhs );
2725 template< typename VT > inline
void addAssign ( const DenseVector <VT,false>& rhs );
2726 template< typename VT > inline
void addAssign ( const SparseVector<VT,false>& rhs );
2727 template< typename VT > inline
void subAssign ( const DenseVector <VT,false>& rhs );
2728 template< typename VT > inline
void subAssign ( const SparseVector<VT,false>& rhs );
2729 template< typename VT > inline
void multAssign( const DenseVector <VT,false>& rhs );
2730 template< typename VT > inline
void multAssign( const SparseVector<VT,false>& rhs );
2731 template< typename VT > inline
void divAssign ( const DenseVector <VT,false>& rhs );
2744 template< typename MT2,
bool SO2,
bool DF2,
bool SF2,
size_t... CCAs2 > friend class Column;
2783 template< typename MT
2785 template< typename... RCAs >
2786 inline Column<MT,false,true,false,CCAs...>::Column( MT& matrix, RCAs... args )
2787 : DataType( args... )
2788 , matrix_ ( matrix )
2791 if( matrix_.columns() <=
column() ) {
2821 template<
typename MT
2823 inline typename Column<MT,
false,
true,
false,CCAs...>
::Reference 2824 Column<MT,false,true,false,CCAs...>::operator[](
size_t index )
2827 return matrix_(index,
column());
2843 template<
typename MT
2846 Column<MT,false,true,false,CCAs...>::operator[](
size_t index )
const 2849 return const_cast<const MT&
>( matrix_ )(index,
column());
2866 template<
typename MT
2868 inline typename Column<MT,
false,
true,
false,CCAs...>
::Reference 2869 Column<MT,false,true,false,CCAs...>::at(
size_t index )
2871 if( index >=
size() ) {
2874 return (*
this)[index];
2891 template<
typename MT
2894 Column<MT,false,true,false,CCAs...>::at(
size_t index )
const 2896 if( index >=
size() ) {
2899 return (*
this)[index];
2914 template<
typename MT
2916 inline typename Column<MT,
false,
true,
false,CCAs...>::Pointer
2919 return matrix_.data() +
column();
2934 template<
typename MT
2936 inline typename Column<MT,
false,
true,
false,CCAs...>::ConstPointer
2939 return matrix_.data() +
column();
2953 template<
typename MT
2955 inline typename Column<MT,
false,
true,
false,CCAs...>
::Iterator 2972 template<
typename MT
2991 template<
typename MT
3010 template<
typename MT
3012 inline typename Column<MT,
false,
true,
false,CCAs...>
::Iterator 3029 template<
typename MT
3048 template<
typename MT
3078 template<
typename MT
3080 inline Column<MT,
false,
true,
false,CCAs...>&
3081 Column<MT,false,true,false,CCAs...>::operator=(
const ElementType& rhs )
3083 decltype(
auto) left( derestrict( matrix_ ) );
3096 for(
size_t i=ibegin; i<iend; ++i ) {
3097 if( !IsRestricted_v<MT> || IsTriangular_v<MT> || trySet( matrix_, i,
column(), rhs ) )
3122 template<
typename MT
3124 inline Column<MT,
false,
true,
false,CCAs...>&
3125 Column<MT,false,true,false,CCAs...>::operator=( initializer_list<ElementType> list )
3127 if( list.size() >
size() ) {
3131 if( IsRestricted_v<MT> ) {
3132 const InitializerVector<ElementType,false> tmp( list,
size() );
3133 if( !tryAssign( matrix_, tmp, 0UL,
column() ) ) {
3138 decltype(
auto) left( derestrict( *this ) );
3164 template< typename MT
3166 inline Column<MT,false,true,false,CCAs...>&
3167 Column<MT,false,true,false,CCAs...>::operator=( const Column& rhs )
3169 if( &rhs ==
this )
return *
this;
3171 if(
size() != rhs.size() ) {
3175 if( !tryAssign( matrix_, rhs, 0UL,
column() ) ) {
3179 decltype(
auto) left( derestrict( *this ) );
3211 template<
typename MT
3213 template<
typename VT >
3214 inline Column<MT,
false,
true,
false,CCAs...>&
3215 Column<MT,false,true,false,CCAs...>::operator=(
const Vector<VT,false>& rhs )
3225 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>,
const VT& >;
3226 Right right( ~rhs );
3228 if( !tryAssign( matrix_, right, 0UL,
column() ) ) {
3232 decltype(
auto) left( derestrict( *this ) );
3239 if( IsSparseVector_v<VT> )
3266 template<
typename MT
3268 template<
typename VT >
3269 inline Column<MT,
false,
true,
false,CCAs...>&
3279 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>,
const VT& >;
3280 Right right( ~rhs );
3282 if( !tryAddAssign( matrix_, right, 0UL,
column() ) ) {
3286 decltype(
auto) left( derestrict( *this ) );
3289 const ResultType_t<VT> tmp( right );
3318 template<
typename MT
3320 template<
typename VT >
3321 inline Column<MT,
false,
true,
false,CCAs...>&
3331 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>,
const VT& >;
3332 Right right( ~rhs );
3334 if( !trySubAssign( matrix_, right, 0UL,
column() ) ) {
3338 decltype(
auto) left( derestrict( *this ) );
3341 const ResultType_t<VT> tmp( right );
3369 template<
typename MT
3371 template<
typename VT >
3372 inline Column<MT,
false,
true,
false,CCAs...>&
3382 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>,
const VT& >;
3383 Right right( ~rhs );
3385 if( !tryMultAssign( matrix_, right, 0UL,
column() ) ) {
3389 decltype(
auto) left( derestrict( *this ) );
3392 const ResultType_t<VT> tmp( right );
3419 template<
typename MT
3421 template<
typename VT >
3422 inline Column<MT,
false,
true,
false,CCAs...>&
3432 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>,
const VT& >;
3433 Right right( ~rhs );
3435 if( !tryDivAssign( matrix_, right, 0UL,
column() ) ) {
3439 decltype(
auto) left( derestrict( *this ) );
3442 const ResultType_t<VT> tmp( right );
3470 template<
typename MT
3472 template<
typename VT >
3473 inline Column<MT,
false,
true,
false,CCAs...>&
3474 Column<MT,false,true,false,CCAs...>::operator%=(
const Vector<VT,false>& rhs )
3476 using blaze::assign;
3481 using CrossType = CrossTrait_t< ResultType, ResultType_t<VT> >;
3487 if(
size() != 3UL || (~rhs).
size() != 3UL ) {
3491 const CrossType right( *
this % (~rhs) );
3493 if( !tryAssign( matrix_, right, 0UL,
column() ) ) {
3497 decltype(
auto) left( derestrict( *this ) );
3499 assign( left, right );
3523 template< typename MT
3525 inline MT& Column<MT,false,true,false,CCAs...>::operand() noexcept
3539 template<
typename MT
3541 inline const MT& Column<MT,false,true,false,CCAs...>::operand() const noexcept
3555 template<
typename MT
3559 return matrix_.rows();
3574 template<
typename MT
3578 return matrix_.spacing();
3590 template<
typename MT
3594 return matrix_.rows();
3609 template<
typename MT
3614 size_t nonzeros( 0UL );
3616 for(
size_t i=0UL; i<
rows; ++i )
3632 template<
typename MT
3638 const size_t ibegin( ( IsLower_v<MT> )
3639 ?( ( IsUniLower_v<MT> || IsStrictlyLower_v<MT> )
3643 const size_t iend ( ( IsUpper_v<MT> )
3644 ?( ( IsUniUpper_v<MT> || IsStrictlyUpper_v<MT> )
3649 for(
size_t i=ibegin; i<iend; ++i )
3677 template<
typename MT
3679 template<
typename Other >
3680 inline Column<MT,
false,
true,
false,CCAs...>&
3681 Column<MT,false,true,false,CCAs...>::scale(
const Other& scalar )
3685 const size_t ibegin( ( IsLower_v<MT> )
3686 ?( ( IsStrictlyLower_v<MT> )
3690 const size_t iend ( ( IsUpper_v<MT> )
3691 ?( ( IsStrictlyUpper_v<MT> )
3696 for(
size_t i=ibegin; i<iend; ++i ) {
3697 matrix_(i,
column()) *= scalar;
3725 template<
typename MT
3727 template<
typename Other >
3728 inline bool Column<MT,false,true,false,CCAs...>::canAlias(
const Other* alias )
const noexcept
3730 return matrix_.isAliased( alias );
3747 template<
typename MT
3749 template<
typename MT2
3754 Column<MT,false,true,false,CCAs...>::canAlias(
const Column<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
3756 return matrix_.isAliased( &alias->matrix_ ) && (
column() == alias->column() );
3773 template<
typename MT
3775 template<
typename Other >
3776 inline bool Column<MT,false,true,false,CCAs...>::isAliased(
const Other* alias )
const noexcept
3778 return matrix_.isAliased( alias );
3795 template<
typename MT
3797 template<
typename MT2
3802 Column<MT,false,true,false,CCAs...>::isAliased(
const Column<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
3804 return matrix_.isAliased( &alias->matrix_ ) && (
column() == alias->column() );
3820 template<
typename MT
3822 inline bool Column<MT,false,true,false,CCAs...>::isAligned() const noexcept
3841 template<
typename MT
3843 inline bool Column<MT,false,true,false,CCAs...>::canSMPAssign() const noexcept
3845 return (
size() > SMP_DVECASSIGN_THRESHOLD );
3863 template<
typename MT
3865 template<
typename VT >
3866 inline void Column<MT,false,true,false,CCAs...>::assign(
const DenseVector<VT,false>& rhs )
3870 const size_t ipos( (~rhs).
size() &
size_t(-2) );
3871 for(
size_t i=0UL; i<ipos; i+=2UL ) {
3872 matrix_(i ,
column()) = (~rhs)[i ];
3873 matrix_(i+1UL,
column()) = (~rhs)[i+1UL];
3875 if( ipos < (~rhs).size() )
3876 matrix_(ipos,
column()) = (~rhs)[ipos];
3894 template<
typename MT
3896 template<
typename VT >
3897 inline void Column<MT,false,true,false,CCAs...>::assign(
const SparseVector<VT,false>& rhs )
3901 for( ConstIterator_t<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
3902 matrix_(element->index(),
column()) = element->value();
3920 template<
typename MT
3922 template<
typename VT >
3923 inline void Column<MT,false,true,false,CCAs...>::addAssign(
const DenseVector<VT,false>& rhs )
3927 const size_t ipos( (~rhs).
size() &
size_t(-2) );
3928 for(
size_t i=0UL; i<ipos; i+=2UL ) {
3929 matrix_(i ,
column()) += (~rhs)[i ];
3930 matrix_(i+1UL,
column()) += (~rhs)[i+1UL];
3932 if( ipos < (~rhs).size() )
3933 matrix_(ipos,
column()) += (~rhs)[ipos];
3951 template<
typename MT
3953 template<
typename VT >
3954 inline void Column<MT,false,true,false,CCAs...>::addAssign(
const SparseVector<VT,false>& rhs )
3958 for( ConstIterator_t<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
3959 matrix_(element->index(),
column()) += element->value();
3977 template<
typename MT
3979 template<
typename VT >
3980 inline void Column<MT,false,true,false,CCAs...>::subAssign(
const DenseVector<VT,false>& rhs )
3984 const size_t ipos( (~rhs).
size() &
size_t(-2) );
3985 for(
size_t i=0UL; i<ipos; i+=2UL ) {
3986 matrix_(i ,
column()) -= (~rhs)[i ];
3987 matrix_(i+1UL,
column()) -= (~rhs)[i+1UL];
3989 if( ipos < (~rhs).size() )
3990 matrix_(ipos,
column()) -= (~rhs)[ipos];
4008 template<
typename MT
4010 template<
typename VT >
4011 inline void Column<MT,false,true,false,CCAs...>::subAssign(
const SparseVector<VT,false>& rhs )
4015 for( ConstIterator_t<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
4016 matrix_(element->index(),
column()) -= element->value();
4034 template<
typename MT
4036 template<
typename VT >
4037 inline void Column<MT,false,true,false,CCAs...>::multAssign(
const DenseVector<VT,false>& rhs )
4041 const size_t ipos( (~rhs).
size() &
size_t(-2) );
4042 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4043 matrix_(i ,
column()) *= (~rhs)[i ];
4044 matrix_(i+1UL,
column()) *= (~rhs)[i+1UL];
4046 if( ipos < (~rhs).size() )
4047 matrix_(ipos,
column()) *= (~rhs)[ipos];
4065 template<
typename MT
4067 template<
typename VT >
4068 inline void Column<MT,false,true,false,CCAs...>::multAssign(
const SparseVector<VT,false>& rhs )
4076 for( ConstIterator_t<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element ) {
4077 const size_t index( element->index() );
4078 for( ; i<index; ++i )
4080 matrix_(i,
column()) *= element->value();
4084 for( ; i<
size(); ++i ) {
4104 template<
typename MT
4106 template<
typename VT >
4107 inline void Column<MT,false,true,false,CCAs...>::divAssign(
const DenseVector<VT,false>& rhs )
4111 const size_t ipos( (~rhs).
size() &
size_t(-2) );
4112 for(
size_t i=0UL; i<ipos; i+=2UL ) {
4113 matrix_(i ,
column()) /= (~rhs)[i ];
4114 matrix_(i+1UL,
column()) /= (~rhs)[i+1UL];
4116 if( ipos < (~rhs).size() )
4117 matrix_(ipos,
column()) /= (~rhs)[ipos];
4143 template<
typename MT
4145 class Column<MT,false,true,true,CCAs...>
4146 :
public View< DenseVector< Column<MT,false,true,true,CCAs...>, false > >
4147 ,
private ColumnData<CCAs...>
4151 using DataType = ColumnData<CCAs...>;
4152 using Operand = If_t< IsExpression_v<MT>, MT, MT& >;
4158 using This = Column<MT,
false,
true,
true,CCAs...>;
4160 using BaseType = DenseVector<This,false>;
4161 using ViewedType = MT;
4165 using SIMDType = SIMDTrait_t<ElementType>;
4176 using ConstPointer = ConstPointer_t<MT>;
4179 using Pointer = If_t< IsConst_v<MT> || !HasMutableDataAccess_v<MT>, ConstPointer, Pointer_t<MT> >;
4190 static constexpr
bool simdEnabled = MT::simdEnabled;
4199 template<
typename... RCAs >
4200 explicit inline Column( MT& matrix, RCAs... args );
4202 Column(
const Column& ) =
default;
4209 ~Column() =
default;
4216 inline Reference operator[](
size_t index );
4220 inline Pointer
data () noexcept;
4221 inline ConstPointer
data () const noexcept;
4234 inline Column& operator=( const
ElementType& rhs );
4235 inline Column& operator=( initializer_list<
ElementType> list );
4236 inline Column& operator=( const Column& rhs );
4238 template< typename VT > inline Column& operator= ( const Vector<VT,false>& rhs );
4239 template< typename VT > inline Column& operator+=( const Vector<VT,false>& rhs );
4240 template< typename VT > inline Column& operator-=( const Vector<VT,false>& rhs );
4241 template< typename VT > inline Column& operator*=( const Vector<VT,false>& rhs );
4242 template< typename VT > inline Column& operator/=( const DenseVector<VT,false>& rhs );
4243 template< typename VT > inline Column& operator%=( const Vector<VT,false>& rhs );
4252 inline MT& operand() noexcept;
4253 inline const MT& operand() const noexcept;
4255 inline
size_t size() const noexcept;
4256 inline
size_t spacing() const noexcept;
4257 inline
size_t capacity() const noexcept;
4259 inline
void reset();
4266 template< typename Other > inline Column& scale( const Other& scalar );
4273 template< typename VT >
4274 static constexpr
bool VectorizedAssign_v =
4275 ( useOptimizedKernels &&
4276 simdEnabled && VT::simdEnabled &&
4282 template< typename VT >
4283 static constexpr
bool VectorizedAddAssign_v =
4284 ( useOptimizedKernels &&
4285 simdEnabled && VT::simdEnabled &&
4292 template< typename VT >
4293 static constexpr
bool VectorizedSubAssign_v =
4294 ( useOptimizedKernels &&
4295 simdEnabled && VT::simdEnabled &&
4302 template< typename VT >
4303 static constexpr
bool VectorizedMultAssign_v =
4304 ( useOptimizedKernels &&
4305 simdEnabled && VT::simdEnabled &&
4312 template< typename VT >
4313 static constexpr
bool VectorizedDivAssign_v =
4314 ( useOptimizedKernels &&
4315 simdEnabled && VT::simdEnabled &&
4329 template< typename Other >
4330 inline
bool canAlias( const Other* alias ) const noexcept;
4332 template< typename MT2,
bool SO2,
bool SF2,
size_t... CCAs2 >
4333 inline
bool canAlias( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
4335 template< typename Other >
4336 inline
bool isAliased( const Other* alias ) const noexcept;
4338 template< typename MT2,
bool SO2,
bool SF2,
size_t... CCAs2 >
4339 inline
bool isAliased( const Column<MT2,SO2,true,SF2,CCAs2...>* alias ) const noexcept;
4341 inline
bool isAligned () const noexcept;
4342 inline
bool canSMPAssign() const noexcept;
4353 template< typename VT >
4354 inline auto assign( const DenseVector<VT,false>& rhs ) ->
DisableIf_t< VectorizedAssign_v<VT> >;
4356 template< typename VT >
4357 inline auto assign( const DenseVector<VT,false>& rhs ) ->
EnableIf_t< VectorizedAssign_v<VT> >;
4359 template< typename VT > inline
void assign( const SparseVector<VT,false>& rhs );
4361 template< typename VT >
4362 inline auto addAssign( const DenseVector<VT,false>& rhs ) ->
DisableIf_t< VectorizedAddAssign_v<VT> >;
4364 template< typename VT >
4365 inline auto addAssign( const DenseVector<VT,false>& rhs ) ->
EnableIf_t< VectorizedAddAssign_v<VT> >;
4367 template< typename VT > inline
void addAssign( const SparseVector<VT,false>& rhs );
4369 template< typename VT >
4370 inline auto subAssign( const DenseVector<VT,false>& rhs ) ->
DisableIf_t< VectorizedSubAssign_v<VT> >;
4372 template< typename VT >
4373 inline auto subAssign( const DenseVector<VT,false>& rhs ) ->
EnableIf_t< VectorizedSubAssign_v<VT> >;
4375 template< typename VT > inline
void subAssign( const SparseVector<VT,false>& rhs );
4377 template< typename VT >
4378 inline auto multAssign( const DenseVector<VT,false>& rhs ) ->
DisableIf_t< VectorizedMultAssign_v<VT> >;
4380 template< typename VT >
4381 inline auto multAssign( const DenseVector<VT,false>& rhs ) ->
EnableIf_t< VectorizedMultAssign_v<VT> >;
4383 template< typename VT > inline
void multAssign( const SparseVector<VT,false>& rhs );
4385 template< typename VT >
4386 inline auto divAssign( const DenseVector<VT,false>& rhs ) ->
DisableIf_t< VectorizedDivAssign_v<VT> >;
4388 template< typename VT >
4389 inline auto divAssign( const DenseVector<VT,false>& rhs ) ->
EnableIf_t< VectorizedDivAssign_v<VT> >;
4402 template< typename MT2,
bool SO2,
bool DF2,
bool SF2,
size_t... CCAs2 > friend class Column;
4441 template< typename MT
4443 template< typename... RCAs >
4444 inline Column<MT,false,true,true,CCAs...>::Column( MT& matrix, RCAs... args )
4445 : DataType( args... )
4446 , matrix_ ( matrix )
4449 if( matrix_.columns() <=
column() ) {
4479 template<
typename MT
4481 inline typename Column<MT,
false,
true,
true,CCAs...>
::Reference 4482 Column<MT,false,true,true,CCAs...>::operator[](
size_t index )
4485 return matrix_(
column(),index);
4501 template<
typename MT
4504 Column<MT,false,true,true,CCAs...>::operator[](
size_t index )
const 4507 return const_cast<const MT&
>( matrix_ )(
column(),index);
4524 template<
typename MT
4526 inline typename Column<MT,
false,
true,
true,CCAs...>
::Reference 4527 Column<MT,false,true,true,CCAs...>::at(
size_t index )
4529 if( index >=
size() ) {
4532 return (*
this)[index];
4549 template<
typename MT
4552 Column<MT,false,true,true,CCAs...>::at(
size_t index )
const 4554 if( index >=
size() ) {
4557 return (*
this)[index];
4572 template<
typename MT
4574 inline typename Column<MT,
false,
true,
true,CCAs...>::Pointer
4577 return matrix_.data(
column() );
4592 template<
typename MT
4594 inline typename Column<MT,
false,
true,
true,CCAs...>::ConstPointer
4597 return matrix_.data(
column() );
4611 template<
typename MT
4613 inline typename Column<MT,
false,
true,
true,CCAs...>
::Iterator 4616 return matrix_.begin(
column() );
4630 template<
typename MT
4635 return matrix_.cbegin(
column() );
4649 template<
typename MT
4654 return matrix_.cbegin(
column() );
4668 template<
typename MT
4670 inline typename Column<MT,
false,
true,
true,CCAs...>
::Iterator 4673 return matrix_.end(
column() );
4687 template<
typename MT
4692 return matrix_.cend(
column() );
4706 template<
typename MT
4711 return matrix_.cend(
column() );
4732 template<
typename MT
4734 inline Column<MT,
false,
true,
true,CCAs...>&
4735 Column<MT,false,true,true,CCAs...>::operator=(
const ElementType& rhs )
4737 decltype(
auto) left( derestrict( matrix_ ) );
4750 for(
size_t j=jbegin; j<jend; ++j ) {
4751 if( !IsRestricted_v<MT> || IsTriangular_v<MT> || trySet( matrix_,
column(), j, rhs ) )
4776 template<
typename MT
4778 inline Column<MT,
false,
true,
true,CCAs...>&
4779 Column<MT,false,true,true,CCAs...>::operator=( initializer_list<ElementType> list )
4781 if( list.size() >
size() ) {
4785 if( IsRestricted_v<MT> ) {
4786 const InitializerVector<ElementType,false> tmp( list,
size() );
4787 if( !tryAssign( matrix_, tmp, 0UL,
column() ) ) {
4792 decltype(
auto) left( derestrict( *this ) );
4818 template< typename MT
4820 inline Column<MT,false,true,true,CCAs...>&
4821 Column<MT,false,true,true,CCAs...>::operator=( const Column& rhs )
4823 if( &rhs ==
this )
return *
this;
4825 if(
size() != rhs.size() ) {
4829 if( !tryAssign( matrix_, rhs, 0UL,
column() ) ) {
4833 decltype(
auto) left( derestrict( *this ) );
4865 template<
typename MT
4867 template<
typename VT >
4868 inline Column<MT,
false,
true,
true,CCAs...>&
4869 Column<MT,false,true,true,CCAs...>::operator=(
const Vector<VT,false>& rhs )
4878 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>,
const VT& >;
4879 Right right( ~rhs );
4881 if( !tryAssign( matrix_, right, 0UL,
column() ) ) {
4885 decltype(
auto) left( derestrict( *this ) );
4888 const ResultType_t<VT> tmp( right );
4892 if( IsSparseVector_v<VT> )
4919 template<
typename MT
4921 template<
typename VT >
4922 inline Column<MT,
false,
true,
true,CCAs...>&
4932 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>,
const VT& >;
4933 Right right( ~rhs );
4935 if( !tryAddAssign( matrix_, right, 0UL,
column() ) ) {
4939 decltype(
auto) left( derestrict( *this ) );
4942 const ResultType_t<VT> tmp( right );
4971 template<
typename MT
4973 template<
typename VT >
4974 inline Column<MT,
false,
true,
true,CCAs...>&
4984 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>,
const VT& >;
4985 Right right( ~rhs );
4987 if( !trySubAssign( matrix_, right, 0UL,
column() ) ) {
4991 decltype(
auto) left( derestrict( *this ) );
4994 const ResultType_t<VT> tmp( right );
5022 template<
typename MT
5024 template<
typename VT >
5025 inline Column<MT,
false,
true,
true,CCAs...>&
5035 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>,
const VT& >;
5036 Right right( ~rhs );
5038 if( !tryMultAssign( matrix_, right, 0UL,
column() ) ) {
5042 decltype(
auto) left( derestrict( *this ) );
5045 const ResultType_t<VT> tmp( right );
5072 template<
typename MT
5074 template<
typename VT >
5075 inline Column<MT,
false,
true,
true,CCAs...>&
5085 using Right = If_t< IsRestricted_v<MT>, CompositeType_t<VT>,
const VT& >;
5086 Right right( ~rhs );
5088 if( !tryDivAssign( matrix_, right, 0UL,
column() ) ) {
5092 decltype(
auto) left( derestrict( *this ) );
5095 const ResultType_t<VT> tmp( right );
5123 template<
typename MT
5125 template<
typename VT >
5126 inline Column<MT,
false,
true,
true,CCAs...>&
5127 Column<MT,false,true,true,CCAs...>::operator%=(
const Vector<VT,false>& rhs )
5129 using blaze::assign;
5134 using CrossType = CrossTrait_t< ResultType, ResultType_t<VT> >;
5140 if(
size() != 3UL || (~rhs).
size() != 3UL ) {
5144 const CrossType right( *
this % (~rhs) );
5146 if( !tryAssign( matrix_, right, 0UL,
column() ) ) {
5150 decltype(
auto) left( derestrict( *this ) );
5152 assign( left, right );
5176 template< typename MT
5178 inline MT& Column<MT,false,true,true,CCAs...>::operand() noexcept
5192 template<
typename MT
5194 inline const MT& Column<MT,false,true,true,CCAs...>::operand() const noexcept
5208 template<
typename MT
5212 return matrix_.rows();
5227 template<
typename MT
5231 return matrix_.spacing();
5243 template<
typename MT
5247 return matrix_.capacity(
column() );
5262 template<
typename MT
5266 return matrix_.nonZeros(
column() );
5278 template<
typename MT
5282 matrix_.reset(
column() );
5309 template<
typename MT
5311 template<
typename Other >
5312 inline Column<MT,
false,
true,
true,CCAs...>&
5313 Column<MT,false,true,true,CCAs...>::scale(
const Other& scalar )
5317 const size_t jbegin( ( IsUpper_v<MT> )
5318 ?( ( IsStrictlyUpper_v<MT> )
5322 const size_t jend ( ( IsLower_v<MT> )
5323 ?( ( IsStrictlyLower_v<MT> )
5328 for(
size_t j=jbegin; j<jend; ++j ) {
5329 matrix_(
column(),j) *= scalar;
5357 template<
typename MT
5359 template<
typename Other >
5360 inline bool Column<MT,false,true,true,CCAs...>::canAlias(
const Other* alias )
const noexcept
5362 return matrix_.isAliased( alias );
5379 template<
typename MT
5381 template<
typename MT2
5386 Column<MT,false,true,true,CCAs...>::canAlias(
const Column<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
5388 return matrix_.isAliased( alias->matrix_ ) && (
column() == alias->column() );
5405 template<
typename MT
5407 template<
typename Other >
5408 inline bool Column<MT,false,true,true,CCAs...>::isAliased(
const Other* alias )
const noexcept
5410 return matrix_.isAliased( alias );
5427 template<
typename MT
5429 template<
typename MT2
5434 Column<MT,false,true,true,CCAs...>::isAliased(
const Column<MT2,SO2,true,SF2,CCAs2...>* alias )
const noexcept
5436 return matrix_.isAliased( &alias->matrix_ ) && (
column() == alias->column() );
5452 template<
typename MT
5454 inline bool Column<MT,false,true,true,CCAs...>::isAligned() const noexcept
5456 return matrix_.isAligned();
5473 template<
typename MT
5475 inline bool Column<MT,false,true,true,CCAs...>::canSMPAssign() const noexcept
5477 return (
size() > SMP_DVECASSIGN_THRESHOLD );
5495 template<
typename MT
5498 Column<MT,false,true,true,CCAs...>::load(
size_t index )
const noexcept
5500 return matrix_.load(
column(), index );
5519 template<
typename MT
5524 return matrix_.loada(
column(), index );
5543 template<
typename MT
5548 return matrix_.loadu(
column(), index );
5567 template<
typename MT
5570 Column<MT,false,true,true,CCAs...>::store(
size_t index,
const SIMDType& value ) noexcept
5572 matrix_.store(
column(), index, value );
5592 template<
typename MT
5597 matrix_.storea(
column(), index, value );
5617 template<
typename MT
5622 matrix_.storeu(
column(), index, value );
5642 template<
typename MT
5647 matrix_.stream(
column(), index, value );
5665 template<
typename MT
5667 template<
typename VT >
5668 inline auto Column<MT,false,true,true,CCAs...>::assign(
const DenseVector<VT,false>& rhs )
5669 -> DisableIf_t< VectorizedAssign_v<VT> >
5673 const size_t jpos( (~rhs).
size() &
size_t(-2) );
5674 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5675 matrix_(
column(),j ) = (~rhs)[j ];
5676 matrix_(
column(),j+1UL) = (~rhs)[j+1UL];
5678 if( jpos < (~rhs).size() )
5679 matrix_(
column(),jpos) = (~rhs)[jpos];
5697 template<
typename MT
5699 template<
typename VT >
5700 inline auto Column<MT,false,true,true,CCAs...>::assign(
const DenseVector<VT,false>& rhs )
5701 -> EnableIf_t< VectorizedAssign_v<VT> >
5707 constexpr
bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
5711 const size_t jpos( ( remainder )?(
columns &
size_t(-SIMDSIZE) ):(
columns ) );
5716 ConstIterator_t<VT> right( (~rhs).
begin() );
5718 if( useStreaming &&
columns > ( cacheSize/(
sizeof(
ElementType) * 3UL ) ) && !(~rhs).isAliased(
this ) )
5720 for( ; j<jpos; j+=SIMDSIZE ) {
5721 left.stream( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5723 for( ; remainder && j<
columns; ++j ) {
5724 *left = *right; ++left; ++right;
5729 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
5730 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5731 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5732 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5733 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5735 for( ; j<jpos; j+=SIMDSIZE ) {
5736 left.store( right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5738 for( ; remainder && j<
columns; ++j ) {
5739 *left = *right; ++left; ++right;
5759 template<
typename MT
5761 template<
typename VT >
5762 inline void Column<MT,false,true,true,CCAs...>::assign(
const SparseVector<VT,false>& rhs )
5766 for( ConstIterator_t<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
5767 matrix_(
column(),element->index()) = element->value();
5785 template<
typename MT
5787 template<
typename VT >
5788 inline auto Column<MT,false,true,true,CCAs...>::addAssign(
const DenseVector<VT,false>& rhs )
5789 -> DisableIf_t< VectorizedAddAssign_v<VT> >
5793 const size_t jpos( (~rhs).
size() &
size_t(-2) );
5794 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5795 matrix_(
column(),j ) += (~rhs)[j ];
5796 matrix_(
column(),j+1UL) += (~rhs)[j+1UL];
5798 if( jpos < (~rhs).size() )
5799 matrix_(
column(),jpos) += (~rhs)[jpos];
5817 template<
typename MT
5819 template<
typename VT >
5820 inline auto Column<MT,false,true,true,CCAs...>::addAssign(
const DenseVector<VT,false>& rhs )
5821 -> EnableIf_t< VectorizedAddAssign_v<VT> >
5827 constexpr
bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
5831 const size_t jpos( ( remainder )?(
columns &
size_t(-SIMDSIZE) ):(
columns ) );
5836 ConstIterator_t<VT> right( (~rhs).
begin() );
5838 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
5839 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5840 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5841 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5842 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5844 for( ; j<jpos; j+=SIMDSIZE ) {
5845 left.store( left.load() + right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5847 for( ; remainder && j<
columns; ++j ) {
5848 *left += *right; ++left; ++right;
5867 template<
typename MT
5869 template<
typename VT >
5870 inline void Column<MT,false,true,true,CCAs...>::addAssign(
const SparseVector<VT,false>& rhs )
5874 for( ConstIterator_t<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
5875 matrix_(
column(),element->index()) += element->value();
5893 template<
typename MT
5895 template<
typename VT >
5896 inline auto Column<MT,false,true,true,CCAs...>::subAssign(
const DenseVector<VT,false>& rhs )
5897 -> DisableIf_t< VectorizedSubAssign_v<VT> >
5901 const size_t jpos( (~rhs).
size() &
size_t(-2) );
5902 for(
size_t j=0UL; j<jpos; j+=2UL ) {
5903 matrix_(
column(),j ) -= (~rhs)[j ];
5904 matrix_(
column(),j+1UL) -= (~rhs)[j+1UL];
5906 if( jpos < (~rhs).size() )
5907 matrix_(
column(),jpos) -= (~rhs)[jpos];
5925 template<
typename MT
5927 template<
typename VT >
5928 inline auto Column<MT,false,true,true,CCAs...>::subAssign(
const DenseVector<VT,false>& rhs )
5929 -> EnableIf_t< VectorizedSubAssign_v<VT> >
5935 constexpr
bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
5939 const size_t jpos( ( remainder )?(
columns &
size_t(-SIMDSIZE) ):(
columns ) );
5944 ConstIterator_t<VT> right( (~rhs).
begin() );
5946 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
5947 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5948 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5949 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5950 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5952 for( ; j<jpos; j+=SIMDSIZE ) {
5953 left.store( left.load() - right.load() ); left += SIMDSIZE; right += SIMDSIZE;
5955 for( ; remainder && j<
columns; ++j ) {
5956 *left -= *right; ++left; ++right;
5975 template<
typename MT
5977 template<
typename VT >
5978 inline void Column<MT,false,true,true,CCAs...>::subAssign(
const SparseVector<VT,false>& rhs )
5982 for( ConstIterator_t<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
5983 matrix_(
column(),element->index()) -= element->value();
6001 template<
typename MT
6003 template<
typename VT >
6004 inline auto Column<MT,false,true,true,CCAs...>::multAssign(
const DenseVector<VT,false>& rhs )
6005 -> DisableIf_t< VectorizedMultAssign_v<VT> >
6009 const size_t jpos( (~rhs).
size() &
size_t(-2) );
6010 for(
size_t j=0UL; j<jpos; j+=2UL ) {
6011 matrix_(
column(),j ) *= (~rhs)[j ];
6012 matrix_(
column(),j+1UL) *= (~rhs)[j+1UL];
6014 if( jpos < (~rhs).size() )
6015 matrix_(
column(),jpos) *= (~rhs)[jpos];
6033 template<
typename MT
6035 template<
typename VT >
6036 inline auto Column<MT,false,true,true,CCAs...>::multAssign(
const DenseVector<VT,false>& rhs )
6037 -> EnableIf_t< VectorizedMultAssign_v<VT> >
6043 constexpr
bool remainder( !IsPadded_v<MT> || !IsPadded_v<VT> );
6047 const size_t jpos( ( remainder )?(
columns &
size_t(-SIMDSIZE) ):(
columns ) );
6052 ConstIterator_t<VT> right( (~rhs).
begin() );
6054 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
6055 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6056 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6057 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6058 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6060 for( ; j<jpos; j+=SIMDSIZE ) {
6061 left.store( left.load() * right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6063 for( ; remainder && j<
columns; ++j ) {
6064 *left *= *right; ++left; ++right;
6083 template<
typename MT
6085 template<
typename VT >
6086 inline void Column<MT,false,true,true,CCAs...>::multAssign(
const SparseVector<VT,false>& rhs )
6094 for( ConstIterator_t<VT> element=(~rhs).
begin(); element!=(~rhs).
end(); ++element ) {
6095 const size_t index( element->index() );
6096 for( ; j<index; ++j )
6098 matrix_(
column(),j) *= element->value();
6102 for( ; j<
size(); ++j ) {
6122 template<
typename MT
6124 template<
typename VT >
6125 inline auto Column<MT,false,true,true,CCAs...>::divAssign(
const DenseVector<VT,false>& rhs )
6126 -> DisableIf_t< VectorizedDivAssign_v<VT> >
6130 const size_t jpos( (~rhs).
size() &
size_t(-2) );
6131 for(
size_t j=0UL; j<jpos; j+=2UL ) {
6132 matrix_(
column(),j ) /= (~rhs)[j ];
6133 matrix_(
column(),j+1UL) /= (~rhs)[j+1UL];
6135 if( jpos < (~rhs).size() )
6136 matrix_(
column(),jpos) /= (~rhs)[jpos];
6154 template<
typename MT
6156 template<
typename VT >
6157 inline auto Column<MT,false,true,true,CCAs...>::divAssign(
const DenseVector<VT,false>& rhs )
6158 -> EnableIf_t< VectorizedDivAssign_v<VT> >
6166 const size_t jpos(
columns &
size_t(-SIMDSIZE) );
6171 ConstIterator_t<VT> right( (~rhs).
begin() );
6173 for( ; (j+SIMDSIZE*3UL) < jpos; j+=SIMDSIZE*4UL ) {
6174 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6175 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6176 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6177 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6179 for( ; j<jpos; j+=SIMDSIZE ) {
6180 left.store( left.load() / right.load() ); left += SIMDSIZE; right += SIMDSIZE;
6183 *left /= *right; ++left; ++right;
Constraint on the data type.
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Constraint on the data type.
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
Header file for the blaze::checked and blaze::unchecked instances.
constexpr bool IsUniUpper_v
Auxiliary variable template for the IsUniUpper type trait.The IsUniUpper_v variable template provides...
Definition: IsUniUpper.h:172
#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
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:354
Header file for the IsUniUpper type trait.
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
Header file for basic type definitions.
constexpr const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:750
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:169
Header file for the View base class.
constexpr bool HasSIMDSub_v
Auxiliary variable template for the HasSIMDSub type trait.The HasSIMDSub_v variable template provides...
Definition: HasSIMDSub.h:188
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a column dense or sparse vector type...
Definition: ColumnVector.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i...
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3077
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
Header file for the implementation of the Column base template.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3079
Header file for the DenseVector base class.
#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
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower or upper unitriangular matrix ty...
Definition: UniTriangular.h:81
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
constexpr bool IsReference_v
Auxiliary variable template for the IsReference type trait.The IsReference_v variable template provid...
Definition: IsReference.h:95
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
#define BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a symmetric matrix type...
Definition: Symmetric.h:60
constexpr bool IsUpper_v
Auxiliary variable template for the IsUpper type trait.The IsUpper_v variable template provides a con...
Definition: IsUpper.h:174
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
Constraints on the storage order of matrix types.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSEXPR_TYPE(T)
Constraint on the data type.In case the given data type T is a transposition expression (i...
Definition: TransExpr.h:81
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storeu(T1 *address, const SIMDi8< T2 > &value) noexcept
Unaligned store of a vector of 1-byte integral values.
Definition: Storeu.h:75
Header file for the extended initializer_list functionality.
System settings for performance optimizations.
Header file for the IsUniLower type trait.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:482
MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:416
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
auto smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:220
Constraint on the data type.
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:252
Constraint on the transpose flag of vector types.
Constraint on the data type.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
typename ColumnTrait< MT, CCAs... >::Type ColumnTrait_t
Auxiliary alias declaration for the ColumnTrait type trait.The ColumnTrait_t alias declaration provid...
Definition: ColumnTrait.h:170
Header file for the DisableIf class template.
Header file for the IsStrictlyUpper type trait.
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.The IsSIMDCombinable_v variable templ...
Definition: IsSIMDCombinable.h:137
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3083
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the If class template.
Header file for the implementation of a vector representation of an initializer list.
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: ColumnMajorMatrix.h:61
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.The HasSIMDMult_v variable template provid...
Definition: HasSIMDMult.h:189
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3080
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the HasSIMDAdd type trait.
constexpr bool HasSIMDDiv_v
Auxiliary variable template for the HasSIMDDiv type trait.The HasSIMDDiv_v variable template provides...
Definition: HasSIMDDiv.h:172
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:370
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:446
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:253
Header file for all SIMD functionality.
constexpr bool Contains_v
Auxiliary variable template for the Contains type trait.The Contains_v variable template provides a c...
Definition: Contains.h:139
Header file for the IsLower type trait.
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > storea(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned store of a vector of 1-byte integral values.
Definition: Storea.h:78
Constraint on the data type.
Header file for the IsTriangular type trait.
#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
Constraint on the data type.
constexpr bool IsStrictlyLower_v
Auxiliary variable template for the IsStrictlyLower type trait.The IsStrictlyLower_v variable templat...
Definition: IsStrictlyLower.h:172
Header file for the exception macros of the math module.
MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:438
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8908
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:611
Header file for the IsPadded type trait.
Constraint on the data type.
Header file for the IsSIMDCombinable type trait.
Header file for the IsSparseVector 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.
constexpr bool IsUniLower_v
Auxiliary variable template for the IsUniLower type trait.The IsUniLower_v variable template provides...
Definition: IsUniLower.h:172
Header file for the cross product trait.
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
Header file for the Unique class template.
Check< false > Unchecked
Type of the blaze::unchecked instance.blaze::Unchecked is the type of the blaze::unchecked instance...
Definition: Check.h:96
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
constexpr bool IsStrictlyUpper_v
Auxiliary variable template for the IsStrictlyUpper type trait.The IsStrictlyUpper_v variable templat...
Definition: IsStrictlyUpper.h:172
constexpr bool IsLower_v
Auxiliary variable template for the IsLower type trait.The IsLower_v variable template provides a con...
Definition: IsLower.h:174
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
Header file for the column trait.
Header file for the isDefault shim.
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
Constraint on the data type.
Constraint on the data type.
Header file for the HasSIMDSub type trait.
Constraints on the storage order of matrix types.
Header file for the HasMutableDataAccess type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
Header file for the IsReference type trait.
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
constexpr const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:718
Header file for the RemoveReference type trait.
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
BLAZE_ALWAYS_INLINE EnableIf_t< IsIntegral_v< T1 > &&HasSize_v< T1, 1UL > > stream(T1 *address, const SIMDi8< T2 > &value) noexcept
Aligned, non-temporal store of a vector of 1-byte integral values.
Definition: Stream.h:74
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:61
constexpr bool IsExpression_v
Auxiliary variable template for the IsExpression type trait.The IsExpression_v variable template prov...
Definition: IsExpression.h:131
Header file for the HasSIMDDiv type trait.
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3082
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.The HasSIMDAdd_v variable template provides...
Definition: HasSIMDAdd.h:188
auto operator*=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:290
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
Header file for the IsUpper type trait.
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
Header file for the implementation of the ColumnData class template.
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
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:191
Header file for the TrueType type/value trait base class.
Header file for the clear shim.
Header file for the IsExpression type trait class.
Constraint on the data type.