22 #ifndef _BLAZE_MATH_VIEWS_DENSECOLUMN_H_
23 #define _BLAZE_MATH_VIEWS_DENSECOLUMN_H_
277 template<
typename MT
278 ,
bool SO = IsColumnMajorMatrix<MT>::value >
329 enum { vectorizable = MT::vectorizable };
335 explicit inline DenseColumn( MT& matrix,
size_t index );
370 template<
typename Other >
372 operator*=( Other rhs );
374 template<
typename Other >
376 operator/=( Other rhs );
383 inline size_t size()
const;
387 template<
typename Other >
inline DenseColumn& scale(
const Other& scalar );
395 template<
typename VT >
396 struct VectorizedAssign {
397 enum { value = vectorizable && VT::vectorizable &&
406 template<
typename VT >
407 struct VectorizedAddAssign {
408 enum { value = vectorizable && VT::vectorizable &&
409 IsSame<ElementType,typename VT::ElementType>::value &&
410 IntrinsicTrait<ElementType>::addition };
418 template<
typename VT >
419 struct VectorizedSubAssign {
420 enum { value = vectorizable && VT::vectorizable &&
421 IsSame<ElementType,typename VT::ElementType>::value &&
422 IntrinsicTrait<ElementType>::subtraction };
430 template<
typename VT >
431 struct VectorizedMultAssign {
432 enum { value = vectorizable && VT::vectorizable &&
433 IsSame<ElementType,typename VT::ElementType>::value &&
434 IntrinsicTrait<ElementType>::multiplication };
443 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
444 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
447 template<
typename VT >
448 inline typename DisableIf< VectorizedAssign<VT> >::Type
449 assign(
const DenseVector<VT,false>& rhs );
451 template<
typename VT >
452 inline typename EnableIf< VectorizedAssign<VT> >::Type
453 assign(
const DenseVector<VT,false>& rhs );
455 template<
typename VT >
inline void assign(
const SparseVector<VT,false>& rhs );
457 template<
typename VT >
458 inline typename DisableIf< VectorizedAddAssign<VT> >::Type
459 addAssign(
const DenseVector<VT,false>& rhs );
461 template<
typename VT >
462 inline typename EnableIf< VectorizedAddAssign<VT> >::Type
463 addAssign(
const DenseVector<VT,false>& rhs );
465 template<
typename VT >
inline void addAssign(
const SparseVector<VT,false>& rhs );
467 template<
typename VT >
468 inline typename DisableIf< VectorizedSubAssign<VT> >::Type
469 subAssign(
const DenseVector<VT,false>& rhs );
471 template<
typename VT >
472 inline typename EnableIf< VectorizedSubAssign<VT> >::Type
473 subAssign(
const DenseVector<VT,false>& rhs );
475 template<
typename VT >
inline void subAssign(
const SparseVector<VT,false>& rhs );
477 template<
typename VT >
478 inline typename DisableIf< VectorizedMultAssign<VT> >::Type
479 multAssign(
const DenseVector<VT,false>& rhs );
481 template<
typename VT >
482 inline typename EnableIf< VectorizedMultAssign<VT> >::Type
483 multAssign(
const DenseVector<VT,false>& rhs );
485 template<
typename VT >
inline void multAssign(
const SparseVector<VT,false>& rhs );
524 template<
typename MT
530 if(
matrix_.columns() <= index )
531 throw std::invalid_argument(
"Invalid column access index" );
550 template<
typename MT
555 return matrix_(index,col_);
566 template<
typename MT
571 return matrix_(index,col_);
581 template<
typename MT
585 return matrix_.data( col_ );
595 template<
typename MT
599 return matrix_.data( col_ );
611 template<
typename MT
615 return matrix_.begin( col_ );
627 template<
typename MT
631 return matrix_.begin( col_ );
643 template<
typename MT
647 return matrix_.begin( col_ );
659 template<
typename MT
663 return matrix_.end( col_ );
675 template<
typename MT
679 return matrix_.end( col_ );
691 template<
typename MT
695 return matrix_.end( col_ );
714 template<
typename MT
718 const size_t rows( size() );
720 for(
size_t i=0UL; i<
rows; ++i )
721 matrix_(i,col_) = rhs;
738 template<
typename MT
742 if( &rhs ==
this )
return *
this;
744 if( size() != rhs.
size() )
745 throw std::invalid_argument(
"Column sizes do not match" );
747 const size_t rows( size() );
749 for(
size_t i=0UL; i<
rows; ++i )
750 matrix_(i,col_) = rhs[i];
767 template<
typename MT
769 template<
typename VT >
777 if( size() != (~rhs).size() )
778 throw std::invalid_argument(
"Vector sizes do not match" );
780 if( (~rhs).canAlias(
this ) ) {
781 const typename VT::ResultType tmp( ~rhs );
805 template<
typename MT
807 template<
typename VT >
815 if( size() != (~rhs).size() )
816 throw std::invalid_argument(
"Vector sizes do not match" );
818 if( (~rhs).canAlias(
this ) ) {
819 const typename VT::ResultType tmp( ~rhs );
841 template<
typename MT
843 template<
typename VT >
851 if( size() != (~rhs).size() )
852 throw std::invalid_argument(
"Vector sizes do not match" );
854 if( (~rhs).canAlias(
this ) ) {
855 const typename VT::ResultType tmp( ~rhs );
878 template<
typename MT
880 template<
typename VT >
888 if( size() != (~rhs).size() )
889 throw std::invalid_argument(
"Vector sizes do not match" );
892 const typename VT::ResultType tmp( ~rhs );
911 template<
typename MT
913 template<
typename Other >
917 return operator=( (*
this) * rhs );
931 template<
typename MT
933 template<
typename Other >
939 return operator=( (*
this) / rhs );
957 template<
typename MT
961 return matrix_.rows();
971 template<
typename MT
975 return matrix_.capacity( col_ );
988 template<
typename MT
992 return matrix_.nonZeros( col_ );
1002 template<
typename MT
1006 matrix_.reset( col_ );
1017 template<
typename MT
1019 template<
typename Other >
1022 for(
size_t j=0UL; j<size(); ++j ) {
1023 matrix_(j,col_) *= scalar;
1048 template<
typename MT
1050 template<
typename Other >
1053 return static_cast<const void*
>( &matrix_ ) == static_cast<const void*>( alias );
1068 template<
typename MT
1070 template<
typename Other >
1073 return static_cast<const void*
>( &matrix_ ) == static_cast<const void*>( alias );
1089 template<
typename MT
1093 return matrix_.get( index, col_ );
1109 template<
typename MT
1111 template<
typename VT >
1117 const size_t iend( (~rhs).size() &
size_t(-2) );
1118 for(
size_t i=0UL; i<iend; i+=2UL ) {
1119 matrix_(i ,col_) = (~rhs)[i ];
1120 matrix_(i+1UL,col_) = (~rhs)[i+1UL];
1122 if( iend < (~rhs).size() )
1123 matrix_(iend,col_) = (~rhs)[iend];
1139 template<
typename MT
1141 template<
typename VT >
1149 const size_t rows( size() );
1153 for(
size_t i=0UL; i<
rows; i+=IT::size ) {
1154 stream( &matrix_(i,col_), (~rhs).
get(i) );
1159 BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == ( rows &
size_t(-IT::size*4) ),
"Invalid end calculation" );
1160 const size_t iend( rows &
size_t(-IT::size*4) );
1162 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1163 store( &matrix_(i ,col_), (~rhs).
get(i ) );
1164 store( &matrix_(i+IT::size ,col_), (~rhs).
get(i+IT::size ) );
1165 store( &matrix_(i+IT::size*2UL,col_), (~rhs).
get(i+IT::size*2UL) );
1166 store( &matrix_(i+IT::size*3UL,col_), (~rhs).
get(i+IT::size*3UL) );
1168 for(
size_t i=iend; i<
rows; i+=IT::size ) {
1169 store( &matrix_(i,col_), (~rhs).
get(i) );
1187 template<
typename MT
1189 template<
typename VT >
1194 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1195 matrix_(element->index(),col_) = element->value();
1211 template<
typename MT
1213 template<
typename VT >
1219 const size_t iend( (~rhs).size() &
size_t(-2) );
1220 for(
size_t i=0UL; i<iend; i+=2UL ) {
1221 matrix_(i ,col_) += (~rhs)[i ];
1222 matrix_(i+1UL,col_) += (~rhs)[i+1UL];
1224 if( iend < (~rhs).size() )
1225 matrix_(iend,col_) += (~rhs)[iend];
1241 template<
typename MT
1243 template<
typename VT >
1251 const size_t rows( size() );
1253 BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == ( rows &
size_t(-IT::size*4) ),
"Invalid end calculation" );
1254 const size_t iend( rows &
size_t(-IT::size*4) );
1256 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1257 store( &matrix_(i ,col_),
load( &matrix_(i ,col_) ) + (~rhs).
get(i ) );
1258 store( &matrix_(i+IT::size ,col_),
load( &matrix_(i+IT::size ,col_) ) + (~rhs).
get(i+IT::size ) );
1259 store( &matrix_(i+IT::size*2UL,col_),
load( &matrix_(i+IT::size*2UL,col_) ) + (~rhs).
get(i+IT::size*2UL) );
1260 store( &matrix_(i+IT::size*3UL,col_),
load( &matrix_(i+IT::size*3UL,col_) ) + (~rhs).
get(i+IT::size*3UL) );
1262 for(
size_t i=iend; i<
rows; i+=IT::size ) {
1263 store( &matrix_(i,col_),
load( &matrix_(i,col_) ) + (~rhs).
get(i) );
1280 template<
typename MT
1282 template<
typename VT >
1287 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1288 matrix_(element->index(),col_) += element->value();
1304 template<
typename MT
1306 template<
typename VT >
1312 const size_t iend( (~rhs).size() &
size_t(-2) );
1313 for(
size_t i=0UL; i<iend; i+=2UL ) {
1314 matrix_(i ,col_) -= (~rhs)[i ];
1315 matrix_(i+1UL,col_) -= (~rhs)[i+1UL];
1317 if( iend < (~rhs).size() )
1318 matrix_(iend,col_) -= (~rhs)[iend];
1334 template<
typename MT
1336 template<
typename VT >
1344 const size_t rows( size() );
1346 BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == ( rows &
size_t(-IT::size*4) ),
"Invalid end calculation" );
1347 const size_t iend( rows &
size_t(-IT::size*4) );
1349 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1350 store( &matrix_(i ,col_),
load( &matrix_(i ,col_) ) - (~rhs).
get(i ) );
1351 store( &matrix_(i+IT::size ,col_),
load( &matrix_(i+IT::size ,col_) ) - (~rhs).
get(i+IT::size ) );
1352 store( &matrix_(i+IT::size*2UL,col_),
load( &matrix_(i+IT::size*2UL,col_) ) - (~rhs).
get(i+IT::size*2UL) );
1353 store( &matrix_(i+IT::size*3UL,col_),
load( &matrix_(i+IT::size*3UL,col_) ) - (~rhs).
get(i+IT::size*3UL) );
1355 for(
size_t i=iend; i<
rows; i+=IT::size ) {
1356 store( &matrix_(i,col_),
load( &matrix_(i,col_) ) - (~rhs).
get(i) );
1373 template<
typename MT
1375 template<
typename VT >
1380 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1381 matrix_(element->index(),col_) -= element->value();
1397 template<
typename MT
1399 template<
typename VT >
1405 const size_t iend( (~rhs).size() &
size_t(-2) );
1406 for(
size_t i=0UL; i<iend; i+=2UL ) {
1407 matrix_(i ,col_) *= (~rhs)[i ];
1408 matrix_(i+1UL,col_) *= (~rhs)[i+1UL];
1410 if( iend < (~rhs).size() )
1411 matrix_(iend,col_) *= (~rhs)[iend];
1427 template<
typename MT
1429 template<
typename VT >
1437 const size_t rows( size() );
1439 BLAZE_INTERNAL_ASSERT( ( rows - ( rows % (IT::size*4UL) ) ) == ( rows &
size_t(-IT::size*4) ),
"Invalid end calculation" );
1440 const size_t iend( rows &
size_t(-IT::size*4) );
1442 for(
size_t i=0UL; i<iend; i+=IT::size*4UL ) {
1443 store( &matrix_(i ,col_),
load( &matrix_(i ,col_) ) * (~rhs).
get(i ) );
1444 store( &matrix_(i+IT::size ,col_),
load( &matrix_(i+IT::size ,col_) ) * (~rhs).
get(i+IT::size ) );
1445 store( &matrix_(i+IT::size*2UL,col_),
load( &matrix_(i+IT::size*2UL,col_) ) * (~rhs).
get(i+IT::size*2UL) );
1446 store( &matrix_(i+IT::size*3UL,col_),
load( &matrix_(i+IT::size*3UL,col_) ) * (~rhs).
get(i+IT::size*3UL) );
1448 for(
size_t i=iend; i<
rows; i+=IT::size ) {
1449 store( &matrix_(i,col_),
load( &matrix_(i,col_) ) * (~rhs).
get(i) );
1466 template<
typename MT
1468 template<
typename VT >
1477 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1478 matrix_(element->index(),col_) = tmp[element->index()] * element->value();
1503 template<
typename MT >
1521 typedef DenseColumn<MT,false>
This;
1522 typedef typename ColumnTrait<MT>::Type
ResultType;
1532 typedef typename SelectType< useConst, ConstReference, typename MT::Reference >::Type
Reference;
1538 template<
typename MatrixType >
1539 class ColumnIterator
1549 enum { returnConst = IsConst<MatrixType>::value };
1555 typedef typename SelectType< returnConst, typename MT::ConstReference, typename MT::Reference >::Type
Reference;
1557 typedef std::forward_iterator_tag IteratorCategory;
1558 typedef RemoveReference<Reference> ValueType;
1559 typedef ValueType* PointerType;
1561 typedef ptrdiff_t DifferenceType;
1564 typedef IteratorCategory iterator_category;
1565 typedef ValueType value_type;
1566 typedef PointerType pointer;
1567 typedef ReferenceType reference;
1568 typedef DifferenceType difference_type;
1578 inline ColumnIterator( MatrixType& matrix,
size_t row,
size_t column )
1590 template<
typename MatrixType2 >
1591 inline ColumnIterator(
const ColumnIterator<MatrixType2>& it )
1594 , column_( it.column_ )
1603 inline ColumnIterator& operator++() {
1614 inline const ColumnIterator operator++(
int ) {
1615 const ColumnIterator tmp( *
this );
1626 inline ReferenceType
operator*()
const {
1636 inline PointerType operator->()
const {
1637 return &
matrix_(row_,column_);
1647 template<
typename MatrixType2 >
1648 inline bool operator==(
const ColumnIterator<MatrixType2>& rhs )
const {
1649 return ( &
matrix_ == &rhs.matrix_ ) && ( row_ == rhs.row_ ) && ( column_ == rhs.column_ );
1659 template<
typename MatrixType2 >
1660 inline bool operator!=(
const ColumnIterator<MatrixType2>& rhs )
const {
1661 return !( *
this == rhs );
1671 inline DifferenceType
operator-(
const ColumnIterator& rhs )
const {
1672 return row_ - rhs.row_;
1685 template<
typename MatrixType2 >
friend class ColumnIterator;
1696 typedef typename SelectType< useConst, ConstIterator, ColumnIterator<MT> >::Type
Iterator;
1701 enum { vectorizable = 0 };
1707 explicit inline DenseColumn( MT& matrix,
size_t index );
1736 template<
typename VT >
inline DenseColumn& operator+=(
const Vector<VT,false>& rhs );
1737 template<
typename VT >
inline DenseColumn& operator-=(
const Vector<VT,false>& rhs );
1738 template<
typename VT >
inline DenseColumn& operator*=(
const Vector<VT,false>& rhs );
1740 template<
typename Other >
1741 inline typename EnableIf< IsNumeric<Other>,
DenseColumn >::Type&
1742 operator*=( Other rhs );
1744 template<
typename Other >
1745 inline typename EnableIf< IsNumeric<Other>,
DenseColumn >::Type&
1746 operator/=( Other rhs );
1753 inline size_t size()
const;
1756 inline void reset();
1757 template<
typename Other >
inline DenseColumn& scale(
const Other& scalar );
1765 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
1766 template<
typename Other >
inline bool isAliased (
const Other* alias )
const;
1767 template<
typename VT >
inline void assign (
const DenseVector <VT,false>& rhs );
1768 template<
typename VT >
inline void assign (
const SparseVector<VT,false>& rhs );
1769 template<
typename VT >
inline void addAssign (
const DenseVector <VT,false>& rhs );
1770 template<
typename VT >
inline void addAssign (
const SparseVector<VT,false>& rhs );
1771 template<
typename VT >
inline void subAssign (
const DenseVector <VT,false>& rhs );
1772 template<
typename VT >
inline void subAssign (
const SparseVector<VT,false>& rhs );
1773 template<
typename VT >
inline void multAssign(
const DenseVector <VT,false>& rhs );
1774 template<
typename VT >
inline void multAssign(
const SparseVector<VT,false>& rhs );
1815 template<
typename MT >
1820 if(
matrix_.columns() <= index )
1821 throw std::invalid_argument(
"Invalid column access index" );
1842 template<
typename MT >
1846 return matrix_(index,col_);
1859 template<
typename MT >
1863 return matrix_(index,col_);
1877 template<
typename MT >
1880 return Iterator( matrix_, 0UL, col_ );
1894 template<
typename MT >
1897 return ConstIterator( matrix_, 0UL, col_ );
1911 template<
typename MT >
1914 return ConstIterator( matrix_, 0UL, col_ );
1928 template<
typename MT >
1931 return Iterator( matrix_, size(), col_ );
1945 template<
typename MT >
1948 return ConstIterator( matrix_, size(), col_ );
1962 template<
typename MT >
1965 return ConstIterator( matrix_, size(), col_ );
1986 template<
typename MT >
1989 const size_t rows( size() );
1991 for(
size_t i=0UL; i<
rows; ++i )
1992 matrix_(i,col_) = rhs;
2011 template<
typename MT >
2014 if( &rhs ==
this )
return *
this;
2016 if( size() != rhs.size() )
2017 throw std::invalid_argument(
"Column sizes do not match" );
2019 const size_t rows( size() );
2021 for(
size_t i=0UL; i<
rows; ++i )
2022 matrix_(i,col_) = rhs[i];
2041 template<
typename MT >
2042 template<
typename VT >
2047 if( size() != (~rhs).size() )
2048 throw std::invalid_argument(
"Vector sizes do not match" );
2050 if( (~rhs).canAlias(
this ) ) {
2051 const ResultType tmp( ~rhs );
2055 if( IsSparseVector<VT>::value )
2077 template<
typename MT >
2078 template<
typename VT >
2079 inline DenseColumn<MT,false>& DenseColumn<MT,false>::operator+=(
const Vector<VT,false>& rhs )
2086 if( size() != (~rhs).size() )
2087 throw std::invalid_argument(
"Vector sizes do not match" );
2089 if( (~rhs).canAlias(
this ) ) {
2090 const typename VT::ResultType tmp( ~rhs );
2114 template<
typename MT >
2115 template<
typename VT >
2116 inline DenseColumn<MT,false>& DenseColumn<MT,false>::operator-=(
const Vector<VT,false>& rhs )
2123 if( size() != (~rhs).size() )
2124 throw std::invalid_argument(
"Vector sizes do not match" );
2126 if( (~rhs).canAlias(
this ) ) {
2127 const typename VT::ResultType tmp( ~rhs );
2152 template<
typename MT >
2153 template<
typename VT >
2154 inline DenseColumn<MT,false>& DenseColumn<MT,false>::operator*=(
const Vector<VT,false>& rhs )
2161 if( size() != (~rhs).size() )
2162 throw std::invalid_argument(
"Vector sizes do not match" );
2164 if( (~rhs).canAlias(
this ) || IsSparseVector<VT>::value ) {
2165 const typename VT::ResultType tmp( ~rhs );
2186 template<
typename MT >
2187 template<
typename Other >
2188 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false> >::Type&
2189 DenseColumn<MT,false>::operator*=( Other rhs )
2191 return operator=( (*
this) * rhs );
2207 template<
typename MT >
2208 template<
typename Other >
2209 inline typename EnableIf< IsNumeric<Other>, DenseColumn<MT,false> >::Type&
2210 DenseColumn<MT,false>::operator/=( Other rhs )
2214 return operator=( (*
this) / rhs );
2234 template<
typename MT >
2237 return matrix_.rows();
2249 template<
typename MT >
2252 return matrix_.rows();
2267 template<
typename MT >
2270 const size_t rows( size() );
2271 size_t nonzeros( 0UL );
2273 for(
size_t i=0UL; i<
rows; ++i )
2289 template<
typename MT >
2293 const size_t rows( size() );
2294 for(
size_t i=0UL; i<
rows; ++i )
2295 reset( matrix_(i,col_) );
2308 template<
typename MT >
2309 template<
typename Other >
2310 inline DenseColumn<MT,false>& DenseColumn<MT,false>::scale(
const Other& scalar )
2312 for(
size_t i=0UL; i<size(); ++i ) {
2313 matrix_(i,col_) *= scalar;
2340 template<
typename MT >
2341 template<
typename Other >
2344 return static_cast<const void*
>( &matrix_ ) == static_cast<const void*>( alias );
2361 template<
typename MT >
2362 template<
typename Other >
2365 return static_cast<const void*
>( &matrix_ ) == static_cast<const void*>( alias );
2383 template<
typename MT >
2384 template<
typename VT >
2389 const size_t iend( (~rhs).size() &
size_t(-2) );
2390 for(
size_t i=0UL; i<iend; i+=2UL ) {
2391 matrix_(i ,col_) = (~rhs)[i ];
2392 matrix_(i+1UL,col_) = (~rhs)[i+1UL];
2394 if( iend < (~rhs).size() )
2395 matrix_(iend,col_) = (~rhs)[iend];
2413 template<
typename MT >
2414 template<
typename VT >
2419 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2420 matrix_(element->index(),col_) = element->value();
2438 template<
typename MT >
2439 template<
typename VT >
2444 const size_t iend( (~rhs).size() &
size_t(-2) );
2445 for(
size_t i=0UL; i<iend; i+=2UL ) {
2446 matrix_(i ,col_) += (~rhs)[i ];
2447 matrix_(i+1UL,col_) += (~rhs)[i+1UL];
2449 if( iend < (~rhs).size() )
2450 matrix_(iend,col_) += (~rhs)[iend];
2468 template<
typename MT >
2469 template<
typename VT >
2474 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2475 matrix_(element->index(),col_) += element->value();
2493 template<
typename MT >
2494 template<
typename VT >
2499 const size_t iend( (~rhs).size() &
size_t(-2) );
2500 for(
size_t i=0UL; i<iend; i+=2UL ) {
2501 matrix_(i ,col_) -= (~rhs)[i ];
2502 matrix_(i+1UL,col_) -= (~rhs)[i+1UL];
2504 if( iend < (~rhs).size() )
2505 matrix_(iend,col_) -= (~rhs)[iend];
2523 template<
typename MT >
2524 template<
typename VT >
2529 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2530 matrix_(element->index(),col_) -= element->value();
2548 template<
typename MT >
2549 template<
typename VT >
2554 const size_t iend( (~rhs).size() &
size_t(-2) );
2555 for(
size_t i=0UL; i<iend; i+=2UL ) {
2556 matrix_(i ,col_) *= (~rhs)[i ];
2557 matrix_(i+1UL,col_) *= (~rhs)[i+1UL];
2559 if( iend < (~rhs).size() )
2560 matrix_(iend,col_) *= (~rhs)[iend];
2578 template<
typename MT >
2579 template<
typename VT >
2584 const ResultType tmp( *
this );
2588 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2589 matrix_(element->index(),col_) = tmp[element->index()] * element->value();
2610 template<
typename MT,
bool SO >
2613 template<
typename MT,
bool SO >
2616 template<
typename MT,
bool SO >
2617 inline bool isnan(
const DenseColumn<MT,SO>&
column );
2619 template<
typename MT,
bool SO >
2632 template<
typename MT
2648 template<
typename MT
2673 template<
typename MT
2677 for(
size_t i=0UL; i<column.
size(); ++i ) {
2678 if(
isnan( column[i] ) )
return true;
2703 template<
typename MT
2707 for(
size_t i=0UL; i<column.
size(); ++i )
2708 if( !
isDefault( column[i] ) )
return false;
2741 template<
typename MT
2771 template<
typename MT
2792 template<
typename T1,
bool SO,
typename T2,
size_t N >
2793 struct AddTrait< DenseColumn<T1,SO>, StaticVector<T2,N,false> >
2795 typedef typename AddTrait< typename DenseColumn<T1,SO>::ResultType,
2796 StaticVector<T2,N,false> >::Type Type;
2799 template<
typename T1,
size_t N,
typename T2,
bool SO >
2800 struct AddTrait< StaticVector<T1,N,false>, DenseColumn<T2,SO> >
2802 typedef typename AddTrait< StaticVector<T1,N,false>,
2803 typename DenseColumn<T2,SO>::ResultType >::Type Type;
2806 template<
typename T1,
bool SO,
typename T2 >
2807 struct AddTrait< DenseColumn<T1,SO>, DynamicVector<T2,false> >
2809 typedef typename AddTrait< typename DenseColumn<T1,SO>::ResultType,
2810 DynamicVector<T2,false> >::Type Type;
2813 template<
typename T1,
typename T2,
bool SO >
2814 struct AddTrait< DynamicVector<T1,false>, DenseColumn<T2,SO> >
2816 typedef typename AddTrait< DynamicVector<T1,false>,
2817 typename DenseColumn<T2,SO>::ResultType >::Type Type;
2820 template<
typename T1,
bool SO,
typename T2 >
2821 struct AddTrait< DenseColumn<T1,SO>, CompressedVector<T2,false> >
2823 typedef typename AddTrait< typename DenseColumn<T1,SO>::ResultType,
2824 CompressedVector<T2,false> >::Type Type;
2827 template<
typename T1,
typename T2,
bool SO >
2828 struct AddTrait< CompressedVector<T1,false>, DenseColumn<T2,SO> >
2830 typedef typename AddTrait< CompressedVector<T1,false>,
2831 typename DenseColumn<T2,SO>::ResultType >::Type Type;
2834 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
2835 struct AddTrait< DenseColumn<T1,SO1>, DenseColumn<T2,SO2> >
2837 typedef typename AddTrait< typename DenseColumn<T1,SO1>::ResultType,
2838 typename DenseColumn<T2,SO2>::ResultType >::Type Type;
2854 template<
typename T1,
bool SO,
typename T2,
size_t N >
2855 struct SubTrait< DenseColumn<T1,SO>, StaticVector<T2,N,false> >
2857 typedef typename SubTrait< typename DenseColumn<T1,SO>::ResultType,
2858 StaticVector<T2,N,false> >::Type Type;
2861 template<
typename T1,
size_t N,
typename T2,
bool SO >
2862 struct SubTrait< StaticVector<T1,N,false>, DenseColumn<T2,SO> >
2864 typedef typename SubTrait< StaticVector<T1,N,false>,
2865 typename DenseColumn<T2,SO>::ResultType >::Type Type;
2868 template<
typename T1,
bool SO,
typename T2 >
2869 struct SubTrait< DenseColumn<T1,SO>, DynamicVector<T2,false> >
2871 typedef typename SubTrait< typename DenseColumn<T1,SO>::ResultType,
2872 DynamicVector<T2,false> >::Type Type;
2875 template<
typename T1,
typename T2,
bool SO >
2876 struct SubTrait< DynamicVector<T1,false>, DenseColumn<T2,SO> >
2878 typedef typename SubTrait< DynamicVector<T1,false>,
2879 typename DenseColumn<T2,SO>::ResultType >::Type Type;
2882 template<
typename T1,
bool SO,
typename T2 >
2883 struct SubTrait< DenseColumn<T1,SO>, CompressedVector<T2,false> >
2885 typedef typename SubTrait< typename DenseColumn<T1,SO>::ResultType,
2886 CompressedVector<T2,false> >::Type Type;
2889 template<
typename T1,
typename T2,
bool SO >
2890 struct SubTrait< CompressedVector<T1,false>, DenseColumn<T2,SO> >
2892 typedef typename SubTrait< CompressedVector<T1,false>,
2893 typename DenseColumn<T2,SO>::ResultType >::Type Type;
2896 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
2897 struct SubTrait< DenseColumn<T1,SO1>, DenseColumn<T2,SO2> >
2899 typedef typename SubTrait< typename DenseColumn<T1,SO1>::ResultType,
2900 typename DenseColumn<T2,SO2>::ResultType >::Type Type;
2916 template<
typename T1,
bool SO,
typename T2 >
2917 struct MultTrait< DenseColumn<T1,SO>, T2 >
2919 typedef typename MultTrait< typename DenseColumn<T1,SO>::ResultType, T2 >::Type Type;
2923 template<
typename T1,
typename T2,
bool SO >
2924 struct MultTrait< T1, DenseColumn<T2,SO> >
2926 typedef typename MultTrait< T1, typename DenseColumn<T2,SO>::ResultType >::Type Type;
2930 template<
typename T1,
bool SO,
typename T2,
size_t N,
bool TF >
2931 struct MultTrait< DenseColumn<T1,SO>, StaticVector<T2,N,TF> >
2933 typedef typename MultTrait< typename DenseColumn<T1,SO>::ResultType,
2934 StaticVector<T2,N,TF> >::Type Type;
2937 template<
typename T1,
size_t N,
bool TF,
typename T2,
bool SO >
2938 struct MultTrait< StaticVector<T1,N,TF>, DenseColumn<T2,SO> >
2940 typedef typename MultTrait< StaticVector<T1,N,TF>,
2941 typename DenseColumn<T2,SO>::ResultType >::Type Type;
2944 template<
typename T1,
bool SO,
typename T2,
bool TF >
2945 struct MultTrait< DenseColumn<T1,SO>, DynamicVector<T2,TF> >
2947 typedef typename MultTrait< typename DenseColumn<T1,SO>::ResultType,
2948 DynamicVector<T2,TF> >::Type Type;
2951 template<
typename T1,
bool TF,
typename T2,
bool SO >
2952 struct MultTrait< DynamicVector<T1,TF>, DenseColumn<T2,SO> >
2954 typedef typename MultTrait< DynamicVector<T1,TF>,
2955 typename DenseColumn<T2,SO>::ResultType >::Type Type;
2958 template<
typename T1,
bool SO,
typename T2,
bool TF >
2959 struct MultTrait< DenseColumn<T1,SO>, CompressedVector<T2,TF> >
2961 typedef typename MultTrait< typename DenseColumn<T1,SO>::ResultType,
2962 CompressedVector<T2,TF> >::Type Type;
2965 template<
typename T1,
bool TF,
typename T2,
bool SO >
2966 struct MultTrait< CompressedVector<T1,TF>, DenseColumn<T2,SO> >
2968 typedef typename MultTrait< CompressedVector<T1,TF>,
2969 typename DenseColumn<T2,SO>::ResultType >::Type Type;
2972 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
2973 struct MultTrait< DenseColumn<T1,SO1>, DenseColumn<T2,SO2> >
2975 typedef typename MultTrait< typename DenseColumn<T1,SO1>::ResultType,
2976 typename DenseColumn<T2,SO2>::ResultType >::Type Type;
2979 template<
typename T1,
size_t M,
size_t N,
bool SO1,
typename T2,
bool SO2 >
2980 struct MultTrait< StaticMatrix<T1,M,N,SO1>, DenseColumn<T2,SO2> >
2982 typedef typename MultTrait< StaticMatrix<T1,M,N,SO1>,
2983 typename DenseColumn<T2,SO2>::ResultType >::Type Type;
2986 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
2987 struct MultTrait< DynamicMatrix<T1,SO1>, DenseColumn<T2,SO2> >
2989 typedef typename MultTrait< DynamicMatrix<T1,SO1>,
2990 typename DenseColumn<T2,SO2>::ResultType >::Type Type;
2993 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
2994 struct MultTrait< CompressedMatrix<T1,SO1>, DenseColumn<T2,SO2> >
2996 typedef typename MultTrait< CompressedMatrix<T1,SO1>,
2997 typename DenseColumn<T2,SO2>::ResultType >::Type Type;
3013 template<
typename T1,
bool SO,
typename T2 >
3014 struct DivTrait< DenseColumn<T1,SO>, T2 >
3016 typedef typename DivTrait< typename DenseColumn<T1,SO>::ResultType, T2 >::Type Type;