22 #ifndef _BLAZE_MATH_VIEWS_DENSEROW_H_
23 #define _BLAZE_MATH_VIEWS_DENSEROW_H_
277 template<
typename MT
278 ,
bool SO = IsRowMajorMatrix<MT>::value >
329 enum { vectorizable = MT::vectorizable };
335 explicit inline DenseRow( 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 DenseRow& 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,true>& rhs );
451 template<
typename VT >
452 inline typename EnableIf< VectorizedAssign<VT> >::Type
453 assign(
const DenseVector<VT,true>& rhs );
455 template<
typename VT >
inline void assign(
const SparseVector<VT,true>& rhs );
457 template<
typename VT >
458 inline typename DisableIf< VectorizedAddAssign<VT> >::Type
459 addAssign(
const DenseVector<VT,true>& rhs );
461 template<
typename VT >
462 inline typename EnableIf< VectorizedAddAssign<VT> >::Type
463 addAssign(
const DenseVector<VT,true>& rhs );
465 template<
typename VT >
inline void addAssign(
const SparseVector<VT,true>& rhs );
467 template<
typename VT >
468 inline typename DisableIf< VectorizedSubAssign<VT> >::Type
469 subAssign(
const DenseVector<VT,true>& rhs );
471 template<
typename VT >
472 inline typename EnableIf< VectorizedSubAssign<VT> >::Type
473 subAssign(
const DenseVector<VT,true>& rhs );
475 template<
typename VT >
inline void subAssign(
const SparseVector<VT,true>& rhs );
477 template<
typename VT >
478 inline typename DisableIf< VectorizedMultAssign<VT> >::Type
479 multAssign(
const DenseVector<VT,true>& rhs );
481 template<
typename VT >
482 inline typename EnableIf< VectorizedMultAssign<VT> >::Type
483 multAssign(
const DenseVector<VT,true>& rhs );
485 template<
typename VT >
inline void multAssign(
const SparseVector<VT,true>& rhs );
524 template<
typename MT
531 throw std::invalid_argument(
"Invalid row access index" );
550 template<
typename MT
555 return matrix_(row_,index);
566 template<
typename MT
571 return matrix_(row_,index);
581 template<
typename MT
585 return matrix_.data( row_ );
595 template<
typename MT
599 return matrix_.data( row_ );
611 template<
typename MT
615 return matrix_.begin( row_ );
627 template<
typename MT
631 return matrix_.begin( row_ );
643 template<
typename MT
647 return matrix_.begin( row_ );
659 template<
typename MT
663 return matrix_.end( row_ );
675 template<
typename MT
679 return matrix_.end( row_ );
691 template<
typename MT
695 return matrix_.end( row_ );
714 template<
typename MT
718 const size_t columns( size() );
720 for(
size_t j=0UL; j<
columns; ++j )
721 matrix_(row_,j) = rhs;
738 template<
typename MT
742 if( &rhs ==
this )
return *
this;
744 if( size() != rhs.
size() )
745 throw std::invalid_argument(
"Row sizes do not match" );
747 const size_t columns( size() );
749 for(
size_t j=0UL; j<
columns; ++j )
750 matrix_(row_,j) = rhs[j];
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( &matrix_ ) ) {
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( &matrix_ ) ) {
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( &matrix_ ) ) {
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_.columns();
971 template<
typename MT
975 return matrix_.capacity( row_ );
988 template<
typename MT
992 return matrix_.nonZeros( row_ );
1002 template<
typename MT
1006 matrix_.reset( row_ );
1017 template<
typename MT
1019 template<
typename Other >
1022 for(
size_t j=0UL; j<size(); ++j ) {
1023 matrix_(row_,j) *= 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( row_, index );
1109 template<
typename MT
1111 template<
typename VT >
1117 const size_t jend( (~rhs).size() &
size_t(-2) );
1118 for(
size_t j=0UL; j<jend; j+=2UL ) {
1119 matrix_(row_,j ) = (~rhs)[j ];
1120 matrix_(row_,j+1UL) = (~rhs)[j+1UL];
1122 if( jend < (~rhs).size() )
1123 matrix_(row_,jend) = (~rhs)[jend];
1139 template<
typename MT
1141 template<
typename VT >
1149 const size_t columns( size() );
1153 for(
size_t j=0UL; j<
columns; j+=IT::size ) {
1154 stream( &matrix_(row_,j), (~rhs).
get(j) );
1159 BLAZE_INTERNAL_ASSERT( ( columns - ( columns % (IT::size*4UL) ) ) == ( columns &
size_t(-IT::size*4) ),
"Invalid end calculation" );
1160 const size_t jend( columns &
size_t(-IT::size*4) );
1162 for(
size_t j=0UL; j<jend; j+=IT::size*4UL ) {
1163 store( &matrix_(row_,j ), (~rhs).
get(j ) );
1164 store( &matrix_(row_,j+IT::size ), (~rhs).
get(j+IT::size ) );
1165 store( &matrix_(row_,j+IT::size*2UL), (~rhs).
get(j+IT::size*2UL) );
1166 store( &matrix_(row_,j+IT::size*3UL), (~rhs).
get(j+IT::size*3UL) );
1168 for(
size_t j=jend; j<
columns; j+=IT::size ) {
1169 store( &matrix_(row_,j), (~rhs).
get(j) );
1187 template<
typename MT
1189 template<
typename VT >
1194 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1195 matrix_(row_,element->index()) = element->value();
1211 template<
typename MT
1213 template<
typename VT >
1219 const size_t jend( (~rhs).size() &
size_t(-2) );
1220 for(
size_t j=0UL; j<jend; j+=2UL ) {
1221 matrix_(row_,j ) += (~rhs)[j ];
1222 matrix_(row_,j+1UL) += (~rhs)[j+1UL];
1224 if( jend < (~rhs).size() )
1225 matrix_(row_,jend) += (~rhs)[jend];
1241 template<
typename MT
1243 template<
typename VT >
1251 const size_t columns( size() );
1253 BLAZE_INTERNAL_ASSERT( ( columns - ( columns % (IT::size*4UL) ) ) == ( columns &
size_t(-IT::size*4) ),
"Invalid end calculation" );
1254 const size_t jend( columns &
size_t(-IT::size*4) );
1256 for(
size_t j=0UL; j<jend; j+=IT::size*4UL ) {
1257 store( &matrix_(row_,j ),
load( &matrix_(row_,j ) ) + (~rhs).
get(j ) );
1258 store( &matrix_(row_,j+IT::size ),
load( &matrix_(row_,j+IT::size ) ) + (~rhs).
get(j+IT::size ) );
1259 store( &matrix_(row_,j+IT::size*2UL),
load( &matrix_(row_,j+IT::size*2UL) ) + (~rhs).
get(j+IT::size*2UL) );
1260 store( &matrix_(row_,j+IT::size*3UL),
load( &matrix_(row_,j+IT::size*3UL) ) + (~rhs).
get(j+IT::size*3UL) );
1262 for(
size_t j=jend; j<
columns; j+=IT::size ) {
1263 store( &matrix_(row_,j),
load( &matrix_(row_,j) ) + (~rhs).
get(j) );
1280 template<
typename MT
1282 template<
typename VT >
1287 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1288 matrix_(row_,element->index()) += element->value();
1304 template<
typename MT
1306 template<
typename VT >
1312 const size_t jend( (~rhs).size() &
size_t(-2) );
1313 for(
size_t j=0UL; j<jend; j+=2UL ) {
1314 matrix_(row_,j ) -= (~rhs)[j ];
1315 matrix_(row_,j+1UL) -= (~rhs)[j+1UL];
1317 if( jend < (~rhs).size() )
1318 matrix_(row_,jend) -= (~rhs)[jend];
1334 template<
typename MT
1336 template<
typename VT >
1344 const size_t columns( size() );
1346 BLAZE_INTERNAL_ASSERT( ( columns - ( columns % (IT::size*4UL) ) ) == ( columns &
size_t(-IT::size*4) ),
"Invalid end calculation" );
1347 const size_t jend( columns &
size_t(-IT::size*4) );
1349 for(
size_t j=0UL; j<jend; j+=IT::size*4UL ) {
1350 store( &matrix_(row_,j ),
load( &matrix_(row_,j ) ) - (~rhs).
get(j ) );
1351 store( &matrix_(row_,j+IT::size ),
load( &matrix_(row_,j+IT::size ) ) - (~rhs).
get(j+IT::size ) );
1352 store( &matrix_(row_,j+IT::size*2UL),
load( &matrix_(row_,j+IT::size*2UL) ) - (~rhs).
get(j+IT::size*2UL) );
1353 store( &matrix_(row_,j+IT::size*3UL),
load( &matrix_(row_,j+IT::size*3UL) ) - (~rhs).
get(j+IT::size*3UL) );
1355 for(
size_t j=jend; j<
columns; j+=IT::size ) {
1356 store( &matrix_(row_,j),
load( &matrix_(row_,j) ) - (~rhs).
get(j) );
1373 template<
typename MT
1375 template<
typename VT >
1380 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1381 matrix_(row_,element->index()) -= element->value();
1397 template<
typename MT
1399 template<
typename VT >
1405 const size_t jend( (~rhs).size() &
size_t(-2) );
1406 for(
size_t j=0UL; j<jend; j+=2UL ) {
1407 matrix_(row_,j ) *= (~rhs)[j ];
1408 matrix_(row_,j+1UL) *= (~rhs)[j+1UL];
1410 if( jend < (~rhs).size() )
1411 matrix_(row_,jend) *= (~rhs)[jend];
1427 template<
typename MT
1429 template<
typename VT >
1437 const size_t columns( size() );
1439 BLAZE_INTERNAL_ASSERT( ( columns - ( columns % (IT::size*4UL) ) ) == ( columns &
size_t(-IT::size*4) ),
"Invalid end calculation" );
1440 const size_t jend( columns &
size_t(-IT::size*4) );
1442 for(
size_t j=0UL; j<jend; j+=IT::size*4UL ) {
1443 store( &matrix_(row_,j ),
load( &matrix_(row_,j ) ) * (~rhs).
get(j ) );
1444 store( &matrix_(row_,j+IT::size ),
load( &matrix_(row_,j+IT::size ) ) * (~rhs).
get(j+IT::size ) );
1445 store( &matrix_(row_,j+IT::size*2UL),
load( &matrix_(row_,j+IT::size*2UL) ) * (~rhs).
get(j+IT::size*2UL) );
1446 store( &matrix_(row_,j+IT::size*3UL),
load( &matrix_(row_,j+IT::size*3UL) ) * (~rhs).
get(j+IT::size*3UL) );
1448 for(
size_t j=jend; j<
columns; j+=IT::size ) {
1449 store( &matrix_(row_,j),
load( &matrix_(row_,j) ) * (~rhs).
get(j) );
1466 template<
typename MT
1468 template<
typename VT >
1477 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1478 matrix_(row_,element->index()) = tmp[element->index()] * element->value();
1503 template<
typename MT >
1521 typedef DenseRow<MT,false>
This;
1522 typedef typename RowTrait<MT>::Type
ResultType;
1532 typedef typename SelectType< useConst, ConstReference, typename MT::Reference >::Type
Reference;
1538 template<
typename MatrixType >
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 RowIterator( MatrixType& matrix,
size_t row,
size_t column )
1590 template<
typename MatrixType2 >
1591 inline RowIterator(
const RowIterator<MatrixType2>& it )
1594 , column_( it.column_ )
1603 inline RowIterator& operator++() {
1614 inline const RowIterator operator++(
int ) {
1615 const RowIterator tmp( *
this );
1626 inline ReferenceType
operator*()
const {
1636 inline PointerType operator->()
const {
1647 template<
typename MatrixType2 >
1648 inline bool operator==(
const RowIterator<MatrixType2>& rhs )
const {
1649 return ( &
matrix_ == &rhs.matrix_ ) && (
row_ == rhs.row_ ) && ( column_ == rhs.column_ );
1659 template<
typename MatrixType2 >
1660 inline bool operator!=(
const RowIterator<MatrixType2>& rhs )
const {
1661 return !( *
this == rhs );
1671 inline DifferenceType
operator-(
const RowIterator& rhs )
const {
1672 return column_ - rhs.column_;
1685 template<
typename MatrixType2 >
friend class RowIterator;
1696 typedef typename SelectType< useConst, ConstIterator, RowIterator<MT> >::Type
Iterator;
1701 enum { vectorizable = 0 };
1707 explicit inline DenseRow( MT& matrix,
size_t index );
1735 template<
typename VT >
inline DenseRow&
operator= (
const Vector<VT,true>& rhs );
1736 template<
typename VT >
inline DenseRow& operator+=(
const Vector<VT,true>& rhs );
1737 template<
typename VT >
inline DenseRow& operator-=(
const Vector<VT,true>& rhs );
1738 template<
typename VT >
inline DenseRow& operator*=(
const Vector<VT,true>& rhs );
1740 template<
typename Other >
1741 inline typename EnableIf< IsNumeric<Other>,
DenseRow >::Type&
1742 operator*=( Other rhs );
1744 template<
typename Other >
1745 inline typename EnableIf< IsNumeric<Other>,
DenseRow >::Type&
1746 operator/=( Other rhs );
1753 inline size_t size()
const;
1756 inline void reset();
1757 template<
typename Other >
inline DenseRow& 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,true>& rhs );
1768 template<
typename VT >
inline void assign (
const SparseVector<VT,true>& rhs );
1769 template<
typename VT >
inline void addAssign (
const DenseVector <VT,true>& rhs );
1770 template<
typename VT >
inline void addAssign (
const SparseVector<VT,true>& rhs );
1771 template<
typename VT >
inline void subAssign (
const DenseVector <VT,true>& rhs );
1772 template<
typename VT >
inline void subAssign (
const SparseVector<VT,true>& rhs );
1773 template<
typename VT >
inline void multAssign(
const DenseVector <VT,true>& rhs );
1774 template<
typename VT >
inline void multAssign(
const SparseVector<VT,true>& rhs );
1815 template<
typename MT >
1821 throw std::invalid_argument(
"Invalid row access index" );
1842 template<
typename MT >
1846 return matrix_(row_,index);
1859 template<
typename MT >
1863 return matrix_(row_,index);
1877 template<
typename MT >
1880 return Iterator( matrix_, row_, 0UL );
1894 template<
typename MT >
1897 return ConstIterator( matrix_, row_, 0UL );
1911 template<
typename MT >
1914 return ConstIterator( matrix_, row_, 0UL );
1928 template<
typename MT >
1931 return Iterator( matrix_, row_, size() );
1945 template<
typename MT >
1948 return ConstIterator( matrix_, row_, size() );
1962 template<
typename MT >
1965 return ConstIterator( matrix_, row_, size() );
1986 template<
typename MT >
1989 const size_t columns( size() );
1991 for(
size_t j=0UL; j<
columns; ++j )
1992 matrix_(row_,j) = rhs;
2011 template<
typename MT >
2014 if( &rhs ==
this )
return *
this;
2016 if( size() != rhs.size() )
2017 throw std::invalid_argument(
"Row sizes do not match" );
2019 const size_t columns( size() );
2021 for(
size_t j=0UL; j<
columns; ++j )
2022 matrix_(row_,j) = rhs[j];
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( &matrix_ ) ) {
2051 const ResultType tmp( ~rhs );
2055 if( IsSparseVector<VT>::value )
2077 template<
typename MT >
2078 template<
typename VT >
2079 inline DenseRow<MT,false>& DenseRow<MT,false>::operator+=(
const Vector<VT,true>& rhs )
2086 if( size() != (~rhs).size() )
2087 throw std::invalid_argument(
"Vector sizes do not match" );
2089 if( (~rhs).canAlias( &matrix_ ) ) {
2090 const typename VT::ResultType tmp( ~rhs );
2114 template<
typename MT >
2115 template<
typename VT >
2116 inline DenseRow<MT,false>& DenseRow<MT,false>::operator-=(
const Vector<VT,true>& rhs )
2123 if( size() != (~rhs).size() )
2124 throw std::invalid_argument(
"Vector sizes do not match" );
2126 if( (~rhs).canAlias( &matrix_ ) ) {
2127 const typename VT::ResultType tmp( ~rhs );
2152 template<
typename MT >
2153 template<
typename VT >
2154 inline DenseRow<MT,false>& DenseRow<MT,false>::operator*=(
const Vector<VT,true>& rhs )
2161 if( size() != (~rhs).size() )
2162 throw std::invalid_argument(
"Vector sizes do not match" );
2164 if( (~rhs).canAlias( &matrix_ ) || IsSparseVector<VT>::value ) {
2165 const typename VT::ResultType tmp( ~rhs );
2186 template<
typename MT >
2187 template<
typename Other >
2188 inline typename EnableIf< IsNumeric<Other>, DenseRow<MT,false> >::Type&
2189 DenseRow<MT,false>::operator*=( Other rhs )
2191 return operator=( (*
this) * rhs );
2207 template<
typename MT >
2208 template<
typename Other >
2209 inline typename EnableIf< IsNumeric<Other>, DenseRow<MT,false> >::Type&
2210 DenseRow<MT,false>::operator/=( Other rhs )
2214 return operator=( (*
this) / rhs );
2234 template<
typename MT >
2237 return matrix_.columns();
2249 template<
typename MT >
2252 return matrix_.columns();
2267 template<
typename MT >
2270 const size_t columns( size() );
2271 size_t nonzeros( 0UL );
2273 for(
size_t j=0UL; j<
columns; ++j )
2289 template<
typename MT >
2293 const size_t columns( size() );
2294 for(
size_t j=0UL; j<
columns; ++j )
2295 reset( matrix_(row_,j) );
2308 template<
typename MT >
2309 template<
typename Other >
2310 inline DenseRow<MT,false>& DenseRow<MT,false>::scale(
const Other& scalar )
2312 for(
size_t j=0UL; j<size(); ++j ) {
2313 matrix_(row_,j) *= 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 jend( (~rhs).size() &
size_t(-2) );
2390 for(
size_t j=0UL; j<jend; j+=2UL ) {
2391 matrix_(row_,j ) = (~rhs)[j ];
2392 matrix_(row_,j+1UL) = (~rhs)[j+1UL];
2394 if( jend < (~rhs).size() )
2395 matrix_(row_,jend) = (~rhs)[jend];
2413 template<
typename MT >
2414 template<
typename VT >
2419 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2420 matrix_(row_,element->index()) = element->value();
2438 template<
typename MT >
2439 template<
typename VT >
2444 const size_t jend( (~rhs).size() &
size_t(-2) );
2445 for(
size_t j=0UL; j<jend; j+=2UL ) {
2446 matrix_(row_,j ) += (~rhs)[j ];
2447 matrix_(row_,j+1UL) += (~rhs)[j+1UL];
2449 if( jend < (~rhs).size() )
2450 matrix_(row_,jend) += (~rhs)[jend];
2468 template<
typename MT >
2469 template<
typename VT >
2474 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2475 matrix_(row_,element->index()) += element->value();
2493 template<
typename MT >
2494 template<
typename VT >
2499 const size_t jend( (~rhs).size() &
size_t(-2) );
2500 for(
size_t j=0UL; j<jend; j+=2UL ) {
2501 matrix_(row_,j ) -= (~rhs)[j ];
2502 matrix_(row_,j+1UL) -= (~rhs)[j+1UL];
2504 if( jend < (~rhs).size() )
2505 matrix_(row_,jend) -= (~rhs)[jend];
2523 template<
typename MT >
2524 template<
typename VT >
2529 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2530 matrix_(row_,element->index()) -= element->value();
2548 template<
typename MT >
2549 template<
typename VT >
2554 const size_t jend( (~rhs).size() &
size_t(-2) );
2555 for(
size_t j=0UL; j<jend; j+=2UL ) {
2556 matrix_(row_,j ) *= (~rhs)[j ];
2557 matrix_(row_,j+1UL) *= (~rhs)[j+1UL];
2559 if( jend < (~rhs).size() )
2560 matrix_(row_,jend) *= (~rhs)[jend];
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_(row_,element->index()) = tmp[element->index()] * element->value();
2610 template<
typename MT,
bool SO >
2611 inline void reset( DenseRow<MT,SO>&
row );
2613 template<
typename MT,
bool SO >
2614 inline void clear( DenseRow<MT,SO>&
row );
2616 template<
typename MT,
bool SO >
2617 inline bool isnan(
const DenseRow<MT,SO>&
row );
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<row.
size(); ++i ) {
2678 if(
isnan( row[i] ) )
return true;
2703 template<
typename MT
2707 for(
size_t i=0UL; i<row.
size(); ++i )
2708 if( !
isDefault( row[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< DenseRow<T1,SO>, StaticVector<T2,N,true> >
2795 typedef typename AddTrait< typename DenseRow<T1,SO>::ResultType,
2796 StaticVector<T2,N,true> >::Type Type;
2799 template<
typename T1,
size_t N,
typename T2,
bool SO >
2800 struct AddTrait< StaticVector<T1,N,true>, DenseRow<T2,SO> >
2802 typedef typename AddTrait< StaticVector<T1,N,true>,
2803 typename DenseRow<T2,SO>::ResultType >::Type Type;
2806 template<
typename T1,
bool SO,
typename T2 >
2807 struct AddTrait< DenseRow<T1,SO>, DynamicVector<T2,true> >
2809 typedef typename AddTrait< typename DenseRow<T1,SO>::ResultType,
2810 DynamicVector<T2,true> >::Type Type;
2813 template<
typename T1,
typename T2,
bool SO >
2814 struct AddTrait< DynamicVector<T1,true>, DenseRow<T2,SO> >
2816 typedef typename AddTrait< DynamicVector<T1,true>,
2817 typename DenseRow<T2,SO>::ResultType >::Type Type;
2820 template<
typename T1,
bool SO,
typename T2 >
2821 struct AddTrait< DenseRow<T1,SO>, CompressedVector<T2,true> >
2823 typedef typename AddTrait< typename DenseRow<T1,SO>::ResultType,
2824 CompressedVector<T2,true> >::Type Type;
2827 template<
typename T1,
typename T2,
bool SO >
2828 struct AddTrait< CompressedVector<T1,true>, DenseRow<T2,SO> >
2830 typedef typename AddTrait< CompressedVector<T1,true>,
2831 typename DenseRow<T2,SO>::ResultType >::Type Type;
2834 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
2835 struct AddTrait< DenseRow<T1,SO1>, DenseRow<T2,SO2> >
2837 typedef typename AddTrait< typename DenseRow<T1,SO1>::ResultType,
2838 typename DenseRow<T2,SO2>::ResultType >::Type Type;
2854 template<
typename T1,
bool SO,
typename T2,
size_t N >
2855 struct SubTrait< DenseRow<T1,SO>, StaticVector<T2,N,true> >
2857 typedef typename SubTrait< typename DenseRow<T1,SO>::ResultType,
2858 StaticVector<T2,N,true> >::Type Type;
2861 template<
typename T1,
size_t N,
typename T2,
bool SO >
2862 struct SubTrait< StaticVector<T1,N,true>, DenseRow<T2,SO> >
2864 typedef typename SubTrait< StaticVector<T1,N,true>,
2865 typename DenseRow<T2,SO>::ResultType >::Type Type;
2868 template<
typename T1,
bool SO,
typename T2 >
2869 struct SubTrait< DenseRow<T1,SO>, DynamicVector<T2,true> >
2871 typedef typename SubTrait< typename DenseRow<T1,SO>::ResultType,
2872 DynamicVector<T2,true> >::Type Type;
2875 template<
typename T1,
typename T2,
bool SO >
2876 struct SubTrait< DynamicVector<T1,true>, DenseRow<T2,SO> >
2878 typedef typename SubTrait< DynamicVector<T1,true>,
2879 typename DenseRow<T2,SO>::ResultType >::Type Type;
2882 template<
typename T1,
bool SO,
typename T2 >
2883 struct SubTrait< DenseRow<T1,SO>, CompressedVector<T2,true> >
2885 typedef typename SubTrait< typename DenseRow<T1,SO>::ResultType,
2886 CompressedVector<T2,true> >::Type Type;
2889 template<
typename T1,
typename T2,
bool SO >
2890 struct SubTrait< CompressedVector<T1,true>, DenseRow<T2,SO> >
2892 typedef typename SubTrait< CompressedVector<T1,true>,
2893 typename DenseRow<T2,SO>::ResultType >::Type Type;
2896 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
2897 struct SubTrait< DenseRow<T1,SO1>, DenseRow<T2,SO2> >
2899 typedef typename SubTrait< typename DenseRow<T1,SO1>::ResultType,
2900 typename DenseRow<T2,SO2>::ResultType >::Type Type;
2916 template<
typename T1,
bool SO,
typename T2 >
2917 struct MultTrait< DenseRow<T1,SO>, T2 >
2919 typedef typename MultTrait< typename DenseRow<T1,SO>::ResultType, T2 >::Type Type;
2923 template<
typename T1,
typename T2,
bool SO >
2924 struct MultTrait< T1, DenseRow<T2,SO> >
2926 typedef typename MultTrait< T1, typename DenseRow<T2,SO>::ResultType >::Type Type;
2930 template<
typename T1,
bool SO,
typename T2,
size_t N,
bool TF >
2931 struct MultTrait< DenseRow<T1,SO>, StaticVector<T2,N,TF> >
2933 typedef typename MultTrait< typename DenseRow<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>, DenseRow<T2,SO> >
2940 typedef typename MultTrait< StaticVector<T1,N,TF>,
2941 typename DenseRow<T2,SO>::ResultType >::Type Type;
2944 template<
typename T1,
bool SO,
typename T2,
bool TF >
2945 struct MultTrait< DenseRow<T1,SO>, DynamicVector<T2,TF> >
2947 typedef typename MultTrait< typename DenseRow<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>, DenseRow<T2,SO> >
2954 typedef typename MultTrait< DynamicVector<T1,TF>,
2955 typename DenseRow<T2,SO>::ResultType >::Type Type;
2958 template<
typename T1,
bool SO,
typename T2,
bool TF >
2959 struct MultTrait< DenseRow<T1,SO>, CompressedVector<T2,TF> >
2961 typedef typename MultTrait< typename DenseRow<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>, DenseRow<T2,SO> >
2968 typedef typename MultTrait< CompressedVector<T1,TF>,
2969 typename DenseRow<T2,SO>::ResultType >::Type Type;
2972 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
2973 struct MultTrait< DenseRow<T1,SO1>, DenseRow<T2,SO2> >
2975 typedef typename MultTrait< typename DenseRow<T1,SO1>::ResultType,
2976 typename DenseRow<T2,SO2>::ResultType >::Type Type;
2979 template<
typename T1,
bool SO1,
typename T2,
size_t M,
size_t N,
bool SO2 >
2980 struct MultTrait< DenseRow<T1,SO1>, StaticMatrix<T2,M,N,SO2> >
2982 typedef typename MultTrait< typename DenseRow<T1,SO1>::ResultType,
2983 StaticMatrix<T2,M,N,SO2> >::Type Type;
2986 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
2987 struct MultTrait< DenseRow<T1,SO1>, DynamicMatrix<T2,SO2> >
2989 typedef typename MultTrait< typename DenseRow<T1,SO1>::ResultType,
2990 DynamicMatrix<T2,SO2> >::Type Type;
2993 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
2994 struct MultTrait< DenseRow<T1,SO1>, CompressedMatrix<T2,SO2> >
2996 typedef typename MultTrait< typename DenseRow<T1,SO1>::ResultType,
2997 CompressedMatrix<T2,SO2> >::Type Type;
3013 template<
typename T1,
bool SO,
typename T2 >
3014 struct DivTrait< DenseRow<T1,SO>, T2 >
3016 typedef typename DivTrait< typename DenseRow<T1,SO>::ResultType, T2 >::Type Type;