35 #ifndef _BLAZE_MATH_VIEWS_DENSEROW_H_
36 #define _BLAZE_MATH_VIEWS_DENSEROW_H_
304 template<
typename MT
305 ,
bool SO = IsRowMajorMatrix<MT>::value >
360 enum { vectorizable = MT::vectorizable };
363 enum { smpAssignable = 0 };
369 explicit inline DenseRow( MT& matrix,
size_t index );
399 template<
typename VT >
inline DenseRow&
operator= (
const Vector<VT,true>& rhs );
400 template<
typename VT >
inline DenseRow& operator+=(
const Vector<VT,true>& rhs );
401 template<
typename VT >
inline DenseRow& operator-=(
const Vector<VT,true>& rhs );
402 template<
typename VT >
inline DenseRow& operator*=(
const Vector<VT,true>& rhs );
404 template<
typename Other >
405 inline typename EnableIf< IsNumeric<Other>,
DenseRow >::Type&
406 operator*=( Other rhs );
408 template<
typename Other >
409 inline typename EnableIf< IsNumeric<Other>,
DenseRow >::Type&
410 operator/=( Other rhs );
417 inline size_t size()
const;
421 template<
typename Other >
inline DenseRow& scale(
const Other& scalar );
428 template<
typename VT >
430 struct VectorizedAssign {
431 enum { value = vectorizable && VT::vectorizable &&
432 IsSame<ElementType,typename VT::ElementType>::value };
439 template<
typename VT >
441 struct VectorizedAddAssign {
442 enum { value = vectorizable && VT::vectorizable &&
443 IsSame<ElementType,typename VT::ElementType>::value &&
444 IntrinsicTrait<ElementType>::addition };
451 template<
typename VT >
453 struct VectorizedSubAssign {
454 enum { value = vectorizable && VT::vectorizable &&
455 IsSame<ElementType,typename VT::ElementType>::value &&
456 IntrinsicTrait<ElementType>::subtraction };
463 template<
typename VT >
465 struct VectorizedMultAssign {
466 enum { value = vectorizable && VT::vectorizable &&
467 IsSame<ElementType,typename VT::ElementType>::value &&
468 IntrinsicTrait<ElementType>::multiplication };
477 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
478 template<
typename Other >
inline bool isAliased(
const Other* alias )
const;
486 template<
typename VT >
487 inline typename DisableIf< VectorizedAssign<VT> >::Type
488 assign(
const DenseVector<VT,true>& rhs );
490 template<
typename VT >
491 inline typename EnableIf< VectorizedAssign<VT> >::Type
492 assign(
const DenseVector<VT,true>& rhs );
494 template<
typename VT >
inline void assign(
const SparseVector<VT,true>& rhs );
496 template<
typename VT >
497 inline typename DisableIf< VectorizedAddAssign<VT> >::Type
498 addAssign(
const DenseVector<VT,true>& rhs );
500 template<
typename VT >
501 inline typename EnableIf< VectorizedAddAssign<VT> >::Type
502 addAssign(
const DenseVector<VT,true>& rhs );
504 template<
typename VT >
inline void addAssign(
const SparseVector<VT,true>& rhs );
506 template<
typename VT >
507 inline typename DisableIf< VectorizedSubAssign<VT> >::Type
508 subAssign(
const DenseVector<VT,true>& rhs );
510 template<
typename VT >
511 inline typename EnableIf< VectorizedSubAssign<VT> >::Type
512 subAssign(
const DenseVector<VT,true>& rhs );
514 template<
typename VT >
inline void subAssign(
const SparseVector<VT,true>& rhs );
516 template<
typename VT >
517 inline typename DisableIf< VectorizedMultAssign<VT> >::Type
518 multAssign(
const DenseVector<VT,true>& rhs );
520 template<
typename VT >
521 inline typename EnableIf< VectorizedMultAssign<VT> >::Type
522 multAssign(
const DenseVector<VT,true>& rhs );
524 template<
typename VT >
inline void multAssign(
const SparseVector<VT,true>& rhs );
564 template<
typename MT
571 throw std::invalid_argument(
"Invalid row access index" );
590 template<
typename MT
606 template<
typename MT
623 template<
typename MT
639 template<
typename MT
655 template<
typename MT
671 template<
typename MT
687 template<
typename MT
703 template<
typename MT
719 template<
typename MT
735 template<
typename MT
758 template<
typename MT
762 const size_t columns( size() );
764 for(
size_t j=0UL; j<
columns; ++j )
782 template<
typename MT
786 if( &rhs ==
this )
return *
this;
788 if( size() != rhs.
size() )
789 throw std::invalid_argument(
"Row sizes do not match" );
791 const size_t columns( size() );
793 for(
size_t j=0UL; j<
columns; ++j )
811 template<
typename MT
813 template<
typename VT >
821 if( size() != (~rhs).size() )
822 throw std::invalid_argument(
"Vector sizes do not match" );
824 if( (~rhs).canAlias( &
matrix_ ) ) {
849 template<
typename MT
851 template<
typename VT >
859 if( size() != (~rhs).size() )
860 throw std::invalid_argument(
"Vector sizes do not match" );
862 if( (~rhs).canAlias( &
matrix_ ) ) {
885 template<
typename MT
887 template<
typename VT >
895 if( size() != (~rhs).size() )
896 throw std::invalid_argument(
"Vector sizes do not match" );
898 if( (~rhs).canAlias( &
matrix_ ) ) {
922 template<
typename MT
924 template<
typename VT >
932 if( size() != (~rhs).size() )
933 throw std::invalid_argument(
"Vector sizes do not match" );
955 template<
typename MT
957 template<
typename Other >
961 return operator=( (*
this) * rhs );
975 template<
typename MT
977 template<
typename Other >
983 return operator=( (*
this) / rhs );
1001 template<
typename MT
1015 template<
typename MT
1032 template<
typename MT
1046 template<
typename MT
1061 template<
typename MT
1063 template<
typename Other >
1066 for(
size_t j=0UL; j<size(); ++j ) {
1092 template<
typename MT
1094 template<
typename Other >
1097 return static_cast<const void*
>( &
matrix_ ) == static_cast<const void*>( alias );
1112 template<
typename MT
1114 template<
typename Other >
1117 return static_cast<const void*
>( &
matrix_ ) == static_cast<const void*>( alias );
1134 template<
typename MT
1155 template<
typename MT
1177 template<
typename MT
1199 template<
typename MT
1221 template<
typename MT
1241 template<
typename MT
1243 template<
typename VT >
1249 const size_t jend( (~rhs).size() &
size_t(-2) );
1250 for(
size_t j=0UL; j<jend; j+=2UL ) {
1254 if( jend < (~rhs).size() )
1271 template<
typename MT
1273 template<
typename VT >
1281 const size_t columns( size() );
1285 for(
size_t j=0UL; j<
columns; j+=IT::size ) {
1291 const size_t jend( columns &
size_t(-IT::size*4) );
1292 BLAZE_INTERNAL_ASSERT( ( columns - ( columns % (IT::size*4UL) ) ) == jend,
"Invalid end calculation" );
1295 for(
size_t j=0UL; j<jend; j+=IT::size*4UL ) {
1296 matrix_.store(
row_, j , it.load() ); it += IT::size;
1297 matrix_.store(
row_, j+IT::size , it.load() ); it += IT::size;
1298 matrix_.store(
row_, j+IT::size*2UL, it.load() ); it += IT::size;
1299 matrix_.store(
row_, j+IT::size*3UL, it.load() ); it += IT::size;
1301 for(
size_t j=jend; j<
columns; j+=IT::size, it+=IT::size ) {
1320 template<
typename MT
1322 template<
typename VT >
1327 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1328 matrix_(
row_,element->index()) = element->value();
1344 template<
typename MT
1346 template<
typename VT >
1352 const size_t jend( (~rhs).size() &
size_t(-2) );
1353 for(
size_t j=0UL; j<jend; j+=2UL ) {
1357 if( jend < (~rhs).size() )
1374 template<
typename MT
1376 template<
typename VT >
1384 const size_t columns( size() );
1386 const size_t jend( columns &
size_t(-IT::size*4) );
1387 BLAZE_INTERNAL_ASSERT( ( columns - ( columns % (IT::size*4UL) ) ) == jend,
"Invalid end calculation" );
1390 for(
size_t j=0UL; j<jend; j+=IT::size*4UL ) {
1396 for(
size_t j=jend; j<
columns; j+=IT::size, it+=IT::size ) {
1414 template<
typename MT
1416 template<
typename VT >
1421 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1422 matrix_(
row_,element->index()) += element->value();
1438 template<
typename MT
1440 template<
typename VT >
1446 const size_t jend( (~rhs).size() &
size_t(-2) );
1447 for(
size_t j=0UL; j<jend; j+=2UL ) {
1451 if( jend < (~rhs).size() )
1468 template<
typename MT
1470 template<
typename VT >
1478 const size_t columns( size() );
1480 const size_t jend( columns &
size_t(-IT::size*4) );
1481 BLAZE_INTERNAL_ASSERT( ( columns - ( columns % (IT::size*4UL) ) ) == jend,
"Invalid end calculation" );
1484 for(
size_t j=0UL; j<jend; j+=IT::size*4UL ) {
1490 for(
size_t j=jend; j<
columns; j+=IT::size, it+=IT::size ) {
1508 template<
typename MT
1510 template<
typename VT >
1515 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1516 matrix_(
row_,element->index()) -= element->value();
1532 template<
typename MT
1534 template<
typename VT >
1540 const size_t jend( (~rhs).size() &
size_t(-2) );
1541 for(
size_t j=0UL; j<jend; j+=2UL ) {
1545 if( jend < (~rhs).size() )
1562 template<
typename MT
1564 template<
typename VT >
1572 const size_t columns( size() );
1574 const size_t jend( columns &
size_t(-IT::size*4) );
1575 BLAZE_INTERNAL_ASSERT( ( columns - ( columns % (IT::size*4UL) ) ) == jend,
"Invalid end calculation" );
1578 for(
size_t j=0UL; j<jend; j+=IT::size*4UL ) {
1584 for(
size_t j=jend; j<
columns; j+=IT::size, it+=IT::size ) {
1602 template<
typename MT
1604 template<
typename VT >
1613 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
1614 matrix_(
row_,element->index()) = tmp[element->index()] * element->value();
1639 template<
typename MT >
1662 typedef DenseRow<MT,false>
This;
1663 typedef typename RowTrait<MT>::Type
ResultType;
1673 typedef typename SelectType< useConst, ConstReference, typename MT::Reference >::Type
Reference;
1679 template<
typename MatrixType >
1690 enum { returnConst = IsConst<MatrixType>::value };
1696 typedef typename SelectType< returnConst, typename MT::ConstReference, typename MT::Reference >::Type
Reference;
1698 typedef std::random_access_iterator_tag IteratorCategory;
1699 typedef RemoveReference<Reference> ValueType;
1700 typedef ValueType* PointerType;
1702 typedef ptrdiff_t DifferenceType;
1705 typedef IteratorCategory iterator_category;
1706 typedef ValueType value_type;
1707 typedef PointerType pointer;
1708 typedef ReferenceType reference;
1709 typedef DifferenceType difference_type;
1719 inline RowIterator( MatrixType& matrix,
size_t row,
size_t column )
1731 template<
typename MatrixType2 >
1732 inline RowIterator(
const RowIterator<MatrixType2>& it )
1745 inline RowIterator& operator+=(
size_t inc ) {
1757 inline RowIterator& operator-=(
size_t dec ) {
1768 inline RowIterator& operator++() {
1779 inline const RowIterator operator++(
int ) {
1780 const RowIterator tmp( *
this );
1791 inline RowIterator& operator--() {
1802 inline const RowIterator operator--(
int ) {
1803 const RowIterator tmp( *
this );
1815 inline ReferenceType
operator[](
size_t index )
const {
1825 inline ReferenceType
operator*()
const {
1835 inline PointerType operator->()
const {
1846 template<
typename MatrixType2 >
1847 inline bool operator==(
const RowIterator<MatrixType2>& rhs )
const {
1848 return (
matrix_ == rhs.matrix_ ) && (
row_ == rhs.row_ ) && (
column_ == rhs.column_ );
1858 template<
typename MatrixType2 >
1859 inline bool operator!=(
const RowIterator<MatrixType2>& rhs )
const {
1860 return !( *
this == rhs );
1870 template<
typename MatrixType2 >
1871 inline bool operator<( const RowIterator<MatrixType2>& rhs )
const {
1872 return (
matrix_ == rhs.matrix_ ) && (
row_ == rhs.row_ ) && (
column_ < rhs.column_ );
1882 template<
typename MatrixType2 >
1883 inline bool operator>(
const RowIterator<MatrixType2>& rhs )
const {
1884 return (
matrix_ == rhs.matrix_ ) && (
row_ == rhs.row_ ) && (
column_ > rhs.column_ );
1894 template<
typename MatrixType2 >
1895 inline bool operator<=( const RowIterator<MatrixType2>& rhs )
const {
1896 return (
matrix_ == rhs.matrix_ ) && (
row_ == rhs.row_ ) && (
column_ <= rhs.column_ );
1906 template<
typename MatrixType2 >
1907 inline bool operator>=(
const RowIterator<MatrixType2>& rhs )
const {
1908 return (
matrix_ == rhs.matrix_ ) && (
row_ == rhs.row_ ) && (
column_ >= rhs.column_ );
1918 inline DifferenceType
operator-(
const RowIterator& rhs )
const {
1930 friend inline const RowIterator
operator+(
const RowIterator& it,
size_t inc ) {
1931 return RowIterator( *it.matrix_, it.row_, it.column_+inc );
1942 friend inline const RowIterator
operator+(
size_t inc,
const RowIterator& it ) {
1943 return RowIterator( *it.matrix_, it.row_, it.column_+inc );
1954 friend inline const RowIterator
operator-(
const RowIterator& it,
size_t dec ) {
1955 return RowIterator( *it.matrix_, it.row_, it.column_-dec );
1968 template<
typename MatrixType2 >
friend class RowIterator;
1979 typedef typename SelectType< useConst, ConstIterator, RowIterator<MT> >::Type
Iterator;
1984 enum { vectorizable = 0 };
1987 enum { smpAssignable = 0 };
1993 explicit inline DenseRow( MT& matrix,
size_t index );
2021 template<
typename VT >
inline DenseRow&
operator= (
const Vector<VT,true>& rhs );
2022 template<
typename VT >
inline DenseRow& operator+=(
const Vector<VT,true>& rhs );
2023 template<
typename VT >
inline DenseRow& operator-=(
const Vector<VT,true>& rhs );
2024 template<
typename VT >
inline DenseRow& operator*=(
const Vector<VT,true>& rhs );
2026 template<
typename Other >
2027 inline typename EnableIf< IsNumeric<Other>,
DenseRow >::Type&
2028 operator*=( Other rhs );
2030 template<
typename Other >
2031 inline typename EnableIf< IsNumeric<Other>,
DenseRow >::Type&
2032 operator/=( Other rhs );
2039 inline size_t size()
const;
2042 inline void reset();
2043 template<
typename Other >
inline DenseRow& scale(
const Other& scalar );
2051 template<
typename Other >
inline bool canAlias (
const Other* alias )
const;
2052 template<
typename Other >
inline bool isAliased (
const Other* alias )
const;
2053 template<
typename VT >
inline void assign (
const DenseVector <VT,true>& rhs );
2054 template<
typename VT >
inline void assign (
const SparseVector<VT,true>& rhs );
2055 template<
typename VT >
inline void addAssign (
const DenseVector <VT,true>& rhs );
2056 template<
typename VT >
inline void addAssign (
const SparseVector<VT,true>& rhs );
2057 template<
typename VT >
inline void subAssign (
const DenseVector <VT,true>& rhs );
2058 template<
typename VT >
inline void subAssign (
const SparseVector<VT,true>& rhs );
2059 template<
typename VT >
inline void multAssign(
const DenseVector <VT,true>& rhs );
2060 template<
typename VT >
inline void multAssign(
const SparseVector<VT,true>& rhs );
2102 template<
typename MT >
2108 throw std::invalid_argument(
"Invalid row access index" );
2129 template<
typename MT >
2146 template<
typename MT >
2164 template<
typename MT >
2181 template<
typename MT >
2198 template<
typename MT >
2215 template<
typename MT >
2232 template<
typename MT >
2249 template<
typename MT >
2273 template<
typename MT >
2274 inline DenseRow<MT,false>& DenseRow<MT,false>::operator=(
const ElementType& rhs )
2276 const size_t columns( size() );
2278 for(
size_t j=0UL; j<
columns; ++j )
2298 template<
typename MT >
2299 inline DenseRow<MT,false>& DenseRow<MT,false>::operator=(
const DenseRow& rhs )
2301 if( &rhs ==
this )
return *
this;
2303 if( size() != rhs.size() )
2304 throw std::invalid_argument(
"Row sizes do not match" );
2306 const size_t columns( size() );
2308 for(
size_t j=0UL; j<
columns; ++j )
2328 template<
typename MT >
2329 template<
typename VT >
2330 inline DenseRow<MT,false>& DenseRow<MT,false>::operator=(
const Vector<VT,true>& rhs )
2338 if( size() != (~rhs).size() )
2339 throw std::invalid_argument(
"Vector sizes do not match" );
2341 if( (~rhs).canAlias( &
matrix_ ) ) {
2346 if( IsSparseVector<VT>::value )
2368 template<
typename MT >
2369 template<
typename VT >
2370 inline DenseRow<MT,false>& DenseRow<MT,false>::operator+=(
const Vector<VT,true>& rhs )
2377 if( size() != (~rhs).size() )
2378 throw std::invalid_argument(
"Vector sizes do not match" );
2380 if( (~rhs).canAlias( &
matrix_ ) ) {
2405 template<
typename MT >
2406 template<
typename VT >
2407 inline DenseRow<MT,false>& DenseRow<MT,false>::operator-=(
const Vector<VT,true>& rhs )
2414 if( size() != (~rhs).size() )
2415 throw std::invalid_argument(
"Vector sizes do not match" );
2417 if( (~rhs).canAlias( &
matrix_ ) ) {
2443 template<
typename MT >
2444 template<
typename VT >
2445 inline DenseRow<MT,false>& DenseRow<MT,false>::operator*=(
const Vector<VT,true>& rhs )
2452 if( size() != (~rhs).size() )
2453 throw std::invalid_argument(
"Vector sizes do not match" );
2455 if( (~rhs).canAlias( &
matrix_ ) || IsSparseVector<VT>::value ) {
2477 template<
typename MT >
2478 template<
typename Other >
2479 inline typename EnableIf< IsNumeric<Other>, DenseRow<MT,false> >::Type&
2480 DenseRow<MT,false>::operator*=( Other rhs )
2482 for(
size_t j=0UL; j<size(); ++j )
2500 template<
typename MT >
2501 template<
typename Other >
2502 inline typename EnableIf< IsNumeric<Other>, DenseRow<MT,false> >::Type&
2503 DenseRow<MT,false>::operator/=( Other rhs )
2507 typedef typename DivTrait<ElementType,Other>::Type DT;
2508 typedef typename If< IsNumeric<DT>, DT, Other >::Type Tmp;
2512 if( IsNumeric<DT>::value && IsFloatingPoint<DT>::value ) {
2513 const Tmp tmp( Tmp(1)/static_cast<Tmp>( rhs ) );
2514 for(
size_t j=0UL; j<size(); ++j )
2518 for(
size_t j=0UL; j<size(); ++j )
2542 template<
typename MT >
2543 inline size_t DenseRow<MT,false>::size()
const
2557 template<
typename MT >
2558 inline size_t DenseRow<MT,false>::capacity()
const
2575 template<
typename MT >
2576 inline size_t DenseRow<MT,false>::nonZeros()
const
2578 const size_t columns( size() );
2579 size_t nonzeros( 0UL );
2581 for(
size_t j=0UL; j<
columns; ++j )
2597 template<
typename MT >
2601 const size_t columns( size() );
2602 for(
size_t j=0UL; j<
columns; ++j )
2616 template<
typename MT >
2617 template<
typename Other >
2618 inline DenseRow<MT,false>& DenseRow<MT,false>::scale(
const Other& scalar )
2620 for(
size_t j=0UL; j<size(); ++j ) {
2648 template<
typename MT >
2649 template<
typename Other >
2650 inline bool DenseRow<MT,false>::canAlias(
const Other* alias )
const
2652 return static_cast<const void*
>( &
matrix_ ) == static_cast<const void*>( alias );
2669 template<
typename MT >
2670 template<
typename Other >
2671 inline bool DenseRow<MT,false>::isAliased(
const Other* alias )
const
2673 return static_cast<const void*
>( &
matrix_ ) == static_cast<const void*>( alias );
2691 template<
typename MT >
2692 template<
typename VT >
2697 const size_t jend( (~rhs).size() &
size_t(-2) );
2698 for(
size_t j=0UL; j<jend; j+=2UL ) {
2702 if( jend < (~rhs).size() )
2721 template<
typename MT >
2722 template<
typename VT >
2727 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2728 matrix_(
row_,element->index()) = element->value();
2746 template<
typename MT >
2747 template<
typename VT >
2752 const size_t jend( (~rhs).size() &
size_t(-2) );
2753 for(
size_t j=0UL; j<jend; j+=2UL ) {
2757 if( jend < (~rhs).size() )
2776 template<
typename MT >
2777 template<
typename VT >
2782 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2783 matrix_(
row_,element->index()) += element->value();
2801 template<
typename MT >
2802 template<
typename VT >
2807 const size_t jend( (~rhs).size() &
size_t(-2) );
2808 for(
size_t j=0UL; j<jend; j+=2UL ) {
2812 if( jend < (~rhs).size() )
2831 template<
typename MT >
2832 template<
typename VT >
2837 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2838 matrix_(
row_,element->index()) -= element->value();
2856 template<
typename MT >
2857 template<
typename VT >
2862 const size_t jend( (~rhs).size() &
size_t(-2) );
2863 for(
size_t j=0UL; j<jend; j+=2UL ) {
2867 if( jend < (~rhs).size() )
2886 template<
typename MT >
2887 template<
typename VT >
2896 for(
typename VT::ConstIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element )
2897 matrix_(
row_,element->index()) = tmp[element->index()] * element->value();
2918 template<
typename MT,
bool SO >
2919 inline void reset( DenseRow<MT,SO>&
row );
2921 template<
typename MT,
bool SO >
2922 inline void clear( DenseRow<MT,SO>&
row );
2924 template<
typename MT,
bool SO >
2937 template<
typename MT
2955 template<
typename MT
2982 template<
typename MT
2986 for(
size_t i=0UL; i<row.size(); ++i )
2987 if( !
isDefault( row[i] ) )
return false;
3022 template<
typename MT
3024 inline typename DisableIf< Or< IsComputation<MT>, IsTransExpr<MT> >, DenseRow<MT> >::Type
3025 row( DenseMatrix<MT,SO>& dm,
size_t index )
3029 return DenseRow<MT>( ~dm, index );
3055 template<
typename MT
3057 inline typename DisableIf< Or< IsComputation<MT>, IsTransExpr<MT> >, DenseRow<const MT> >::Type
3058 row(
const DenseMatrix<MT,SO>& dm,
size_t index )
3062 return DenseRow<const MT>( ~dm, index );
3077 template<
typename MT,
bool SO >
3078 struct SubvectorTrait< DenseRow<MT,SO> >
Constraint on the data type.
Constraint on the data type.
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, DenseColumn< MT > >::Type column(DenseMatrix< MT, SO > &dm, size_t index)
Creating a view on a specific column of the given dense matrix.
Definition: DenseColumn.h:3026
MT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DenseRow.h:336
void reset(DynamicMatrix< Type, SO > &m)
Resetting the given dense matrix.
Definition: DynamicMatrix.h:4512
#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
EnableIf< IsIntegral< T >, Load< T, sizeof(T)> >::Type::Type load(const T *address)
Loads a vector of integral values.
Definition: Load.h:222
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:3703
Header file for the View base class.
Header file for the row trait.
bool isDefault(const DynamicMatrix< Type, SO > &m)
Returns whether the given dense matrix is in default state.
Definition: DynamicMatrix.h:4555
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:196
#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:118
#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:79
Header file for the IsSame and IsStrictlySame type traits.
const bool useStreaming
Configuration of the streaming behavior.For large vectors and matrices non-temporal stores can provid...
Definition: Streaming.h:50
Iterator end()
Returns an iterator just past the last element of the row.
Definition: DenseRow.h:705
IT::Type IntrinsicType
Intrinsic type of the row elements.
Definition: DenseRow.h:335
bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:366
Header file for the DenseVector base class.
bool canAlias(const Other *alias) const
Returns whether the dense row can alias with the given address alias.
Definition: DenseRow.h:1095
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:442
const size_t row_
The first row of the submatrix.
Definition: DenseSubmatrix.h:2793
#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:118
void clear(DynamicMatrix< Type, SO > &m)
Clearing the given dense matrix.
Definition: DynamicMatrix.h:4528
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DenseRow.h:333
SelectType< useConst, ConstReference, typename MT::Reference >::Type Reference
Reference to a non-constant row value.
Definition: DenseRow.h:343
Constraint on the data type.
Base template for the RowTrait class.
Definition: RowTrait.h:114
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the DisableIf class template.
MT::ConstIterator ConstIterator
Iterator over constant elements.
Definition: DenseRow.h:352
Header file for nested template disabiguation.
Header file for the IsFloatingPoint type trait.
#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: StorageOrder.h:161
IntrinsicType load(size_t index) const
Aligned load of an intrinsic element of the dense row.
Definition: DenseRow.h:1136
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2379
Header file for the Or class template.
DenseRow & operator=(const ElementType &rhs)
Homogenous assignment to all row elements.
Definition: DenseRow.h:760
void storeu(size_t index, const IntrinsicType &value)
Unligned store of an intrinsic element of the dense row.
Definition: DenseRow.h:1201
Header file for the subvector trait.
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:179
const DenseIterator< Type > operator+(const DenseIterator< Type > &it, ptrdiff_t inc)
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:556
RowTrait< MT >::Type ResultType
Result type for expression template evaluations.
Definition: DenseRow.h:332
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Compile time check for sparse vector types.This type trait tests whether or not the given template pa...
Definition: IsSparseVector.h:103
Constraint on the data type.
Constraint on the data type.
ConstIterator cend() const
Returns an iterator just past the last element of the row.
Definition: DenseRow.h:737
Reference operator[](size_t index)
Subscript operator for the direct access to the row elements.
Definition: DenseRow.h:592
Operand matrix_
The dense matrix containing the column.
Definition: DenseColumn.h:2069
#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:79
ConstIterator cbegin() const
Returns an iterator to the first element of the row.
Definition: DenseRow.h:689
Constraints on the storage order of matrix types.
Constraint on the data type.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2373
MT::ElementType ElementType
Type of the row elements.
Definition: DenseRow.h:334
void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:269
Constraint on the data type.
const size_t column_
The first column of the submatrix.
Definition: DenseSubmatrix.h:2794
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2377
System settings for streaming (non-temporal stores)
Header file for the EnableIf class template.
size_t nonZeros() const
Returns the number of non-zero elements in the row.
Definition: DenseRow.h:1034
ColumnIterator< const MT > ConstIterator
Iterator over constant elements.
Definition: DenseColumn.h:1972
SelectType< useConst, ConstPointer, ElementType * >::Type Pointer
Pointer to a constant row value.
Definition: DenseRow.h:349
Header file for the IsNumeric type trait.
size_t size() const
Returns the current size/dimension of the row.
Definition: DenseRow.h:1003
Operand matrix_
The dense matrix containing the row.
Definition: DenseRow.h:532
const size_t row_
The index of the row in the matrix.
Definition: DenseRow.h:2069
Header file for the IsSparseVector type trait.
#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: StorageOrder.h:81
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2374
Header file for the IsConst type trait.
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:648
MT::ConstReference ConstReference
Reference to a constant row value.
Definition: DenseRow.h:340
Header file for run time assertion macros.
const size_t row_
The index of the row in the matrix.
Definition: DenseRow.h:533
Iterator begin()
Returns an iterator to the first element of the row.
Definition: DenseRow.h:657
void stream(size_t index, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the dense row.
Definition: DenseRow.h:1223
Header file for the division trait.
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:209
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the dense row.
Definition: DenseRow.h:1157
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Header file for the reset shim.
Reference to a specific row of a dense matrix.The DenseRow template represents a reference to a speci...
Definition: DenseRow.h:306
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, DenseRow< MT > >::Type row(DenseMatrix< MT, SO > &dm, size_t index)
Creating a view on a specific row of the given dense matrix.
Definition: DenseRow.h:3025
Header file for the cache size of the target architecture.
SelectType< useConst, ConstIterator, typename MT::Iterator >::Type Iterator
Iterator over non-constant elements.
Definition: DenseRow.h:355
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:239
void reset()
Reset to the default initial values.
Definition: DenseRow.h:1048
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2378
#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:118
void store(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the dense row.
Definition: DenseRow.h:1179
Header file for the RemoveReference type trait.
Substitution Failure Is Not An Error (SFINAE) class.The DisableIf class template is an auxiliary tool...
Definition: DisableIf.h:184
Compile time check for constant data types.The IsConst type trait tests whether or not the given temp...
Definition: IsConst.h:94
Header file for all intrinsic functionality.
#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:79
const ElementType * ConstPointer
Pointer to a constant row value.
Definition: DenseRow.h:346
const DenseRow & CompositeType
Data type for composite expression templates.
Definition: DenseRow.h:337
Header file for the IsRowMajorMatrix type trait.
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:147
Base class for all views.The View class serves as a tag for all views (subvectors, submatrices, rows, columns, ...). All classes that represent a view and that are used within the expression template environment of the Blaze library have to derive from this class in order to qualify as a view. Only in case a class is derived from the View base class, the IsView type trait recognizes the class as valid view.
Definition: View.h:64
IntrinsicTrait< typename MT::ElementType > IT
Intrinsic trait for the row element type.
Definition: DenseRow.h:315
CompressedMatrix< Type,!SO > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:247
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:105
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
DenseRow(MT &matrix, size_t index)
The constructor for DenseRow.
Definition: DenseRow.h:566
DenseRow< MT, SO > This
Type of this DenseRow instance.
Definition: DenseRow.h:331
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2370
size_t columns(const Matrix< MT, SO > &m)
Returns the current number of columns of the matrix.
Definition: Matrix.h:154
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
Header file for basic type definitions.
#define BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a row dense or sparse vector type (i...
Definition: TransposeFlag.h:81
size_t capacity() const
Returns the maximum capacity of the dense row.
Definition: DenseRow.h:1017
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2376
SelectType< useConst, ConstIterator, ColumnIterator< MT > >::Type Iterator
Iterator over non-constant elements.
Definition: DenseColumn.h:1980
const size_t cacheSize
Cache size of the target architecture.This setting specifies the available cache size in Byte of the ...
Definition: CacheSize.h:48
bool isAliased(const Other *alias) const
Returns whether the dense row is aliased with the given address alias.
Definition: DenseRow.h:1115
Pointer data()
Low-level data access to the row elements.
Definition: DenseRow.h:625
#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
Operand matrix_
The dense matrix containing the submatrix.
Definition: DenseSubmatrix.h:2792
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
SelectType< IsExpression< MT >::value, MT, MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: DenseRow.h:312