35#ifndef _BLAZE_MATH_EXPRESSIONS_TDVECDMATMULTEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_TDVECDMATMULTEXPR_H_
127 :
public TVecMatMultExpr< DenseVector< TDVecDMatMultExpr<VT,MT>, true > >
158 template<
typename T1 >
168 template<
typename T1,
typename T2,
typename T3 >
169 static constexpr bool UseBlasKernel_v =
175 T1::simdEnabled && T2::simdEnabled && T3::simdEnabled &&
190 template<
typename T1,
typename T2,
typename T3 >
191 static constexpr bool UseVectorizedDefaultKernel_v =
192 ( useOptimizedKernels &&
194 T1::simdEnabled && T2::simdEnabled && T3::simdEnabled &&
235 VT::simdEnabled && MT::simdEnabled &&
274 return vec_[index] *
mat_(index,index);
304 if( index >=
mat_.columns() ) {
307 return (*
this)[index];
316 inline size_t size() const noexcept {
317 return mat_.columns();
347 template<
typename T >
348 inline bool canAlias(
const T* alias )
const noexcept {
349 return (
vec_.isAliased( alias ) ||
mat_.isAliased( alias ) );
359 template<
typename T >
360 inline bool isAliased(
const T* alias )
const noexcept {
361 return (
vec_.isAliased( alias ) ||
mat_.isAliased( alias ) );
371 return vec_.isAligned() &&
mat_.isAligned();
385 (
mat_.rows() *
mat_.columns() < TDVECDMATMULT_THRESHOLD ) ) &&
386 (
size() > SMP_TDVECDMATMULT_THRESHOLD );
409 template<
typename VT1 >
416 if( rhs.
mat_.rows() == 0UL ||
421 else if( rhs.
mat_.columns() == 0UL ) {
433 TDVecDMatMultExpr::selectAssignKernel( *lhs, x, A );
449 template<
typename VT1
452 static inline void selectAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
456 ( A.rows() * A.columns() < TDVECDMATMULT_THRESHOLD ) )
457 selectSmallAssignKernel( y, x, A );
459 selectBlasAssignKernel( y, x, A );
478 template<
typename VT1
481 static inline void selectDefaultAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
483 const size_t M( A.rows() );
484 const size_t N( A.columns() );
493 for(
size_t j=jbegin; j<N; ++j ) {
494 y[j] = x[0UL] * A(0UL,j);
502 y[i] = x[i] * A(i,i);
514 const size_t jnum( jend - jbegin );
515 const size_t jpos( jbegin +
prevMultiple( jnum, 2UL ) );
518 for(
size_t j=jbegin; j<jpos; j+=2UL ) {
519 y[j ] += x[i] * A(i,j );
520 y[j+1UL] += x[i] * A(i,j+1UL);
523 y[jpos] += x[i] * A(i,jpos);
526 y[jend] = x[i] * A(i,jend);
552 template<
typename VT1
555 static inline auto selectSmallAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
558 selectDefaultAssignKernel( y, x, A );
577 template<
typename VT1
580 static inline auto selectSmallAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
585 const size_t M( A.rows() );
586 const size_t N( A.columns() );
604 SIMDType xmm1( x1 * A.load(ibegin,j ) );
613 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
615 xmm1 += x1 * A.load(i,j );
617 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
618 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
619 xmm5 += x1 * A.load(i,j+
SIMDSIZE*4UL);
620 xmm6 += x1 * A.load(i,j+
SIMDSIZE*5UL);
621 xmm7 += x1 * A.load(i,j+
SIMDSIZE*6UL);
622 xmm8 += x1 * A.load(i,j+
SIMDSIZE*7UL);
646 SIMDType xmm1( x1 * A.load(ibegin,j ) );
651 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
653 xmm1 += x1 * A.load(i,j );
655 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
656 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
676 SIMDType xmm1( x1 * A.load(ibegin,j ) );
680 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
682 xmm1 += x1 * A.load(i,j );
684 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
703 SIMDType xmm1( x1 * A.load(ibegin,j ) );
706 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
708 xmm1 += x1 * A.load(i,j );
726 SIMDType xmm1(
set( x[ibegin] ) * A.load(ibegin,j) );
728 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
729 xmm1 +=
set( x[i] ) * A.load(i,j);
735 for( ; remainder && j<N; ++j )
743 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
744 value += x[i] * A(i,j);
767 template<
typename VT1
770 static inline auto selectLargeAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
773 selectDefaultAssignKernel( y, x, A );
792 template<
typename VT1
795 static inline auto selectLargeAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
800 const size_t M( A.rows() );
801 const size_t N( A.columns() );
803 const size_t jblock( 32768UL /
sizeof(
ElementType ) );
804 const size_t iblock( ( N < jblock )?( 8UL ):( 4UL ) );
810 for(
size_t jj=0U; jj<N; jj+=jblock ) {
811 for(
size_t ii=0UL; ii<M; ii+=iblock )
813 const size_t iend(
min( ii+iblock, M ) );
814 const size_t jtmp(
min( jj+jblock, N ) );
829 SIMDType xmm1( x1 * A.load(ii,j ) );
838 for(
size_t i=ii+1UL; i<iend; ++i ) {
840 xmm1 += x1 * A.load(i,j );
842 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
843 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
844 xmm5 += x1 * A.load(i,j+
SIMDSIZE*4UL);
845 xmm6 += x1 * A.load(i,j+
SIMDSIZE*5UL);
846 xmm7 += x1 * A.load(i,j+
SIMDSIZE*6UL);
847 xmm8 += x1 * A.load(i,j+
SIMDSIZE*7UL);
850 y.store( j , y.load(j ) + xmm1 );
863 SIMDType xmm1( x1 * A.load(ii,j ) );
868 for(
size_t i=ii+1UL; i<iend; ++i ) {
870 xmm1 += x1 * A.load(i,j );
872 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
873 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
876 y.store( j , y.load(j ) + xmm1 );
885 SIMDType xmm1( x1 * A.load(ii,j ) );
889 for(
size_t i=ii+1UL; i<iend; ++i ) {
891 xmm1 += x1 * A.load(i,j );
893 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
896 y.store( j , y.load(j ) + xmm1 );
904 SIMDType xmm1( x1 * A.load(ii,j ) );
907 for(
size_t i=ii+1UL; i<iend; ++i ) {
909 xmm1 += x1 * A.load(i,j );
913 y.store( j , y.load(j ) + xmm1 );
921 for(
size_t i=ii+1UL; i<iend; ++i ) {
922 xmm1 +=
set( x[i] ) * A.load(i,j);
925 y.store( j, y.load(j) + xmm1 );
928 for( ; remainder && j<jend; ++j )
932 for(
size_t i=ii+1UL; i<iend; ++i ) {
933 value += x[i] * A(i,j);
958 template<
typename VT1
961 static inline auto selectBlasAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
964 selectLargeAssignKernel( y, x, A );
970#if BLAZE_BLAS_MODE && BLAZE_USE_BLAS_MATRIX_VECTOR_MULTIPLICATION
984 template<
typename VT1
987 static inline auto selectBlasAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
990 using ET = ElementType_t<VT1>;
997 gemv( y, x, A, ET(1), ET(0) );
1017 template<
typename VT1 >
1018 friend inline void assign( SparseVector<VT1,true>& lhs,
const TDVecDMatMultExpr& rhs )
1029 assign( *lhs, tmp );
1047 template<
typename VT1 >
1048 friend inline void addAssign( DenseVector<VT1,true>& lhs,
const TDVecDMatMultExpr& rhs )
1054 if( rhs.mat_.rows() == 0UL || rhs.mat_.columns() == 0UL ||
1067 TDVecDMatMultExpr::selectAddAssignKernel( *lhs, x, A );
1083 template<
typename VT1
1086 static inline void selectAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1090 ( A.rows() * A.columns() < TDVECDMATMULT_THRESHOLD ) )
1091 selectSmallAddAssignKernel( y, x, A );
1093 selectBlasAddAssignKernel( y, x, A );
1112 template<
typename VT1
1115 static inline void selectDefaultAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1117 const size_t M( A.rows() );
1118 const size_t N( A.columns() );
1120 for(
size_t i=0UL; i<M; ++i )
1124 y[i] += x[i] * A(i,i);
1136 const size_t jnum( jend - jbegin );
1137 const size_t jpos( jbegin +
prevMultiple( jnum, 2UL ) );
1140 for(
size_t j=jbegin; j<jpos; j+=2UL ) {
1141 y[j ] += x[i] * A(i,j );
1142 y[j+1UL] += x[i] * A(i,j+1UL);
1145 y[jpos] += x[i] * A(i,jpos);
1167 template<
typename VT1
1170 static inline auto selectSmallAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1173 selectDefaultAddAssignKernel( y, x, A );
1192 template<
typename VT1
1195 static inline auto selectSmallAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1200 const size_t M( A.rows() );
1201 const size_t N( A.columns() );
1227 for(
size_t i=ibegin; i<iend; ++i ) {
1229 xmm1 += x1 * A.load(i,j );
1230 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
1231 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
1232 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
1233 xmm5 += x1 * A.load(i,j+
SIMDSIZE*4UL);
1234 xmm6 += x1 * A.load(i,j+
SIMDSIZE*5UL);
1235 xmm7 += x1 * A.load(i,j+
SIMDSIZE*6UL);
1236 xmm8 += x1 * A.load(i,j+
SIMDSIZE*7UL);
1239 y.store( j , xmm1 );
1264 for(
size_t i=ibegin; i<iend; ++i ) {
1266 xmm1 += x1 * A.load(i,j );
1267 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
1268 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
1269 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
1272 y.store( j , xmm1 );
1292 for(
size_t i=ibegin; i<iend; ++i ) {
1294 xmm1 += x1 * A.load(i,j );
1295 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
1296 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
1299 y.store( j , xmm1 );
1317 for(
size_t i=ibegin; i<iend; ++i ) {
1319 xmm1 += x1 * A.load(i,j );
1323 y.store( j , xmm1 );
1339 for(
size_t i=ibegin; i<iend; ++i ) {
1340 xmm1 +=
set( x[i] ) * A.load(i,j);
1346 for( ; remainder && j<N; ++j )
1354 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
1355 value += x[i] * A(i,j);
1378 template<
typename VT1
1381 static inline auto selectLargeAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1384 selectDefaultAddAssignKernel( y, x, A );
1403 template<
typename VT1
1406 static inline auto selectLargeAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1411 const size_t M( A.rows() );
1412 const size_t N( A.columns() );
1414 const size_t jblock( 32768UL /
sizeof(
ElementType ) );
1415 const size_t iblock( ( N < jblock )?( 8UL ):( 4UL ) );
1419 for(
size_t jj=0U; jj<N; jj+=jblock ) {
1420 for(
size_t ii=0UL; ii<M; ii+=iblock )
1422 const size_t iend(
min( ii+iblock, M ) );
1423 const size_t jtmp(
min( jj+jblock, N ) );
1438 SIMDType xmm1( x1 * A.load(ii,j ) );
1447 for(
size_t i=ii+1UL; i<iend; ++i ) {
1449 xmm1 += x1 * A.load(i,j );
1450 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
1451 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
1452 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
1453 xmm5 += x1 * A.load(i,j+
SIMDSIZE*4UL);
1454 xmm6 += x1 * A.load(i,j+
SIMDSIZE*5UL);
1455 xmm7 += x1 * A.load(i,j+
SIMDSIZE*6UL);
1456 xmm8 += x1 * A.load(i,j+
SIMDSIZE*7UL);
1459 y.store( j , y.load(j ) + xmm1 );
1472 SIMDType xmm1( x1 * A.load(ii,j ) );
1477 for(
size_t i=ii+1UL; i<iend; ++i ) {
1479 xmm1 += x1 * A.load(i,j );
1480 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
1481 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
1482 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
1485 y.store( j , y.load(j ) + xmm1 );
1494 SIMDType xmm1( x1 * A.load(ii,j ) );
1498 for(
size_t i=ii+1UL; i<iend; ++i ) {
1500 xmm1 += x1 * A.load(i,j );
1501 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
1502 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
1505 y.store( j , y.load(j ) + xmm1 );
1513 SIMDType xmm1( x1 * A.load(ii,j ) );
1516 for(
size_t i=ii+1UL; i<iend; ++i ) {
1518 xmm1 += x1 * A.load(i,j );
1522 y.store( j , y.load(j ) + xmm1 );
1530 for(
size_t i=ii+1UL; i<iend; ++i ) {
1531 xmm1 +=
set( x[i] ) * A.load(i,j);
1534 y.store( j, y.load(j) + xmm1 );
1537 for( ; remainder && j<jend; ++j )
1541 for(
size_t i=ii+1UL; i<iend; ++i ) {
1542 value += x[i] * A(i,j);
1567 template<
typename VT1
1570 static inline auto selectBlasAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1573 selectLargeAddAssignKernel( y, x, A );
1579#if BLAZE_BLAS_MODE && BLAZE_USE_BLAS_MATRIX_VECTOR_MULTIPLICATION
1593 template<
typename VT1
1596 static inline auto selectBlasAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1599 using ET = ElementType_t<VT1>;
1602 ResultType_t<VT1> tmp(
serial( x ) );
1603 trmv( tmp, A, (
IsLower_v<MT1> )?( CblasLower ):( CblasUpper ) );
1604 addAssign( y, tmp );
1607 gemv( y, x, A, ET(1), ET(1) );
1631 template<
typename VT1 >
1632 friend inline void subAssign( DenseVector<VT1,true>& lhs,
const TDVecDMatMultExpr& rhs )
1638 if( rhs.mat_.rows() == 0UL || rhs.mat_.columns() == 0UL ||
1651 TDVecDMatMultExpr::selectSubAssignKernel( *lhs, x, A );
1667 template<
typename VT1
1670 static inline void selectSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1674 ( A.rows() * A.columns() < TDVECDMATMULT_THRESHOLD ) )
1675 selectSmallSubAssignKernel( y, x, A );
1677 selectBlasSubAssignKernel( y, x, A );
1696 template<
typename VT1
1699 static inline void selectDefaultSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1701 const size_t M( A.rows() );
1702 const size_t N( A.columns() );
1704 for(
size_t i=0UL; i<M; ++i )
1708 y[i] -= x[i] * A(i,i);
1720 const size_t jnum( jend - jbegin );
1721 const size_t jpos( jbegin +
prevMultiple( jnum, 2UL ) );
1724 for(
size_t j=jbegin; j<jpos; j+=2UL ) {
1725 y[j ] -= x[i] * A(i,j );
1726 y[j+1UL] -= x[i] * A(i,j+1UL);
1729 y[jpos] -= x[i] * A(i,jpos);
1751 template<
typename VT1
1754 static inline auto selectSmallSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1757 selectDefaultSubAssignKernel( y, x, A );
1777 template<
typename VT1
1780 static inline auto selectSmallSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1785 const size_t M( A.rows() );
1786 const size_t N( A.columns() );
1812 for(
size_t i=ibegin; i<iend; ++i ) {
1814 xmm1 -= x1 * A.load(i,j );
1815 xmm2 -= x1 * A.load(i,j+
SIMDSIZE );
1816 xmm3 -= x1 * A.load(i,j+
SIMDSIZE*2UL);
1817 xmm4 -= x1 * A.load(i,j+
SIMDSIZE*3UL);
1818 xmm5 -= x1 * A.load(i,j+
SIMDSIZE*4UL);
1819 xmm6 -= x1 * A.load(i,j+
SIMDSIZE*5UL);
1820 xmm7 -= x1 * A.load(i,j+
SIMDSIZE*6UL);
1821 xmm8 -= x1 * A.load(i,j+
SIMDSIZE*7UL);
1824 y.store( j , xmm1 );
1849 for(
size_t i=ibegin; i<iend; ++i ) {
1851 xmm1 -= x1 * A.load(i,j );
1852 xmm2 -= x1 * A.load(i,j+
SIMDSIZE );
1853 xmm3 -= x1 * A.load(i,j+
SIMDSIZE*2UL);
1854 xmm4 -= x1 * A.load(i,j+
SIMDSIZE*3UL);
1857 y.store( j , xmm1 );
1877 for(
size_t i=ibegin; i<iend; ++i ) {
1879 xmm1 -= x1 * A.load(i,j );
1880 xmm2 -= x1 * A.load(i,j+
SIMDSIZE );
1881 xmm3 -= x1 * A.load(i,j+
SIMDSIZE*2UL);
1884 y.store( j , xmm1 );
1902 for(
size_t i=ibegin; i<iend; ++i ) {
1904 xmm1 -= x1 * A.load(i,j );
1908 y.store( j , xmm1 );
1924 for(
size_t i=ibegin; i<iend; ++i ) {
1925 xmm1 -=
set( x[i] ) * A.load(i,j);
1931 for( ; remainder && j<N; ++j )
1939 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
1940 value += x[i] * A(i,j);
1963 template<
typename VT1
1966 static inline auto selectLargeSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1969 selectDefaultSubAssignKernel( y, x, A );
1989 template<
typename VT1
1992 static inline auto selectLargeSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
1997 const size_t M( A.rows() );
1998 const size_t N( A.columns() );
2000 const size_t jblock( 32768UL /
sizeof(
ElementType ) );
2001 const size_t iblock( ( N < jblock )?( 8UL ):( 4UL ) );
2005 for(
size_t jj=0U; jj<N; jj+=jblock ) {
2006 for(
size_t ii=0UL; ii<M; ii+=iblock )
2008 const size_t iend(
min( ii+iblock, M ) );
2009 const size_t jtmp(
min( jj+jblock, N ) );
2024 SIMDType xmm1( x1 * A.load(ii,j ) );
2033 for(
size_t i=ii+1UL; i<iend; ++i ) {
2035 xmm1 += x1 * A.load(i,j );
2036 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
2037 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
2038 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
2039 xmm5 += x1 * A.load(i,j+
SIMDSIZE*4UL);
2040 xmm6 += x1 * A.load(i,j+
SIMDSIZE*5UL);
2041 xmm7 += x1 * A.load(i,j+
SIMDSIZE*6UL);
2042 xmm8 += x1 * A.load(i,j+
SIMDSIZE*7UL);
2045 y.store( j , y.load(j ) - xmm1 );
2058 SIMDType xmm1( x1 * A.load(ii,j ) );
2063 for(
size_t i=ii+1UL; i<iend; ++i ) {
2065 xmm1 += x1 * A.load(i,j );
2066 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
2067 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
2068 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
2071 y.store( j , y.load(j ) - xmm1 );
2080 SIMDType xmm1( x1 * A.load(ii,j ) );
2084 for(
size_t i=ii+1UL; i<iend; ++i ) {
2086 xmm1 += x1 * A.load(i,j );
2087 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
2088 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
2091 y.store( j , y.load(j ) - xmm1 );
2099 SIMDType xmm1( x1 * A.load(ii,j ) );
2102 for(
size_t i=ii+1UL; i<iend; ++i ) {
2104 xmm1 += x1 * A.load(i,j );
2108 y.store( j , y.load(j ) - xmm1 );
2116 for(
size_t i=ii+1UL; i<iend; ++i ) {
2117 xmm1 +=
set( x[i] ) * A.load(i,j);
2120 y.store( j, y.load(j) - xmm1 );
2123 for( ; remainder && j<jend; ++j )
2127 for(
size_t i=ii+1UL; i<iend; ++i ) {
2128 value += x[i] * A(i,j);
2153 template<
typename VT1
2156 static inline auto selectBlasSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
2159 selectLargeSubAssignKernel( y, x, A );
2165#if BLAZE_BLAS_MODE && BLAZE_USE_BLAS_MATRIX_VECTOR_MULTIPLICATION
2179 template<
typename VT1
2182 static inline auto selectBlasSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A )
2185 using ET = ElementType_t<VT1>;
2188 ResultType_t<VT1> tmp(
serial( x ) );
2189 trmv( tmp, A, (
IsLower_v<MT1> )?( CblasLower ):( CblasUpper ) );
2190 subAssign( y, tmp );
2193 gemv( y, x, A, ET(-1), ET(1) );
2217 template<
typename VT1 >
2218 friend inline void multAssign( DenseVector<VT1,true>& lhs,
const TDVecDMatMultExpr& rhs )
2229 multAssign( *lhs, tmp );
2251 template<
typename VT1 >
2252 friend inline void divAssign( DenseVector<VT1,true>& lhs,
const TDVecDMatMultExpr& rhs )
2263 divAssign( *lhs, tmp );
2287 template<
typename VT1 >
2295 if( rhs.mat_.rows() == 0UL ||
2300 else if( rhs.mat_.columns() == 0UL ) {
2332 template<
typename VT1 >
2365 template<
typename VT1 >
2373 if( rhs.mat_.rows() == 0UL || rhs.mat_.columns() == 0UL ||
2410 template<
typename VT1 >
2418 if( rhs.mat_.rows() == 0UL || rhs.mat_.columns() == 0UL ||
2455 template<
typename VT1 >
2492 template<
typename VT1 >
2543template<
typename VT
2547 :
public VecScalarMultExpr< DenseVector< DVecScalarMultExpr< TDVecDMatMultExpr<VT,MT>, ST, true >, true > >
2552 using VMM = TDVecDMatMultExpr<VT,MT>;
2553 using RES = ResultType_t<VMM>;
2554 using VRT = ResultType_t<VT>;
2555 using MRT = ResultType_t<MT>;
2556 using VET = ElementType_t<VRT>;
2557 using MET = ElementType_t<MRT>;
2558 using VCT = CompositeType_t<VT>;
2559 using MCT = CompositeType_t<MT>;
2569 static constexpr bool evaluateMatrix =
2579 template<
typename T1 >
2580 static constexpr bool UseSMPAssign_v = ( evaluateVector || evaluateMatrix );
2587 template<
typename T1,
typename T2,
typename T3,
typename T4 >
2588 static constexpr bool UseBlasKernel_v =
2594 T1::simdEnabled && T2::simdEnabled && T3::simdEnabled &&
2608 template<
typename T1,
typename T2,
typename T3,
typename T4 >
2609 static constexpr bool UseVectorizedDefaultKernel_v =
2610 ( useOptimizedKernels &&
2612 T1::simdEnabled && T2::simdEnabled && T3::simdEnabled &&
2627 using BaseType = VecScalarMultExpr< DenseVector<This,true> >;
2637 using LeftOperand =
const TDVecDMatMultExpr<VT,MT>;
2653 VT::simdEnabled && MT::simdEnabled &&
2660 ( !evaluateVector && VT::smpAssignable && !evaluateMatrix && MT::smpAssignable );
2665 static constexpr size_t SIMDSIZE = SIMDTrait<ElementType>::size;
2700 if( index >=
vector_.size() ) {
2703 return (*
this)[index];
2712 inline size_t size()
const {
2743 template<
typename T >
2744 inline bool canAlias(
const T* alias )
const {
2745 return vector_.canAlias( alias );
2755 template<
typename T >
2756 inline bool isAliased(
const T* alias )
const {
2757 return vector_.isAliased( alias );
2777 RightOperand_t<VMM> A(
vector_.rightOperand() );
2782 ( A.rows() * A.columns() < TDVECDMATMULT_THRESHOLD ) ) &&
2783 (
size() > SMP_TDVECDMATMULT_THRESHOLD );
2805 template<
typename VT1 >
2806 friend inline void assign( DenseVector<VT1,true>& lhs,
const DVecScalarMultExpr& rhs )
2812 LeftOperand_t<VMM> left ( rhs.vector_.leftOperand() );
2813 RightOperand_t<VMM> right( rhs.vector_.rightOperand() );
2815 if( right.rows() == 0UL ||
2820 else if( right.columns() == 0UL ) {
2832 DVecScalarMultExpr::selectAssignKernel( *lhs, x, A, rhs.scalar_ );
2847 template<
typename VT1
2851 static inline void selectAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
2855 ( A.rows() * A.columns() < TDVECDMATMULT_THRESHOLD ) )
2856 selectSmallAssignKernel( y, x, A, scalar );
2858 selectBlasAssignKernel( y, x, A, scalar );
2876 template<
typename VT1
2880 static inline void selectDefaultAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
2882 const size_t M( A.rows() );
2883 const size_t N( A.columns() );
2892 y[j] = x[0UL] * A(0UL,j);
2900 y[i] = x[i] * A(i,i) * scalar;
2912 const size_t jnum( jend - jbegin );
2913 const size_t jpos( jbegin +
prevMultiple( jnum, 2UL ) );
2916 for(
size_t j=jbegin; j<jpos; j+=2UL ) {
2917 y[j ] += x[i] * A(i,j );
2918 y[j+1UL] += x[i] * A(i,j+1UL);
2921 y[jpos] += x[i] * A(i,jpos);
2924 y[jend] = x[i] * A(i,jend);
2957 template<
typename VT1
2961 static inline auto selectSmallAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
2964 selectDefaultAssignKernel( y, x, A, scalar );
2982 template<
typename VT1
2986 static inline auto selectSmallAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
2991 const size_t M( A.rows() );
2992 const size_t N( A.columns() );
2997 const SIMDType factor(
set( scalar ) );
3011 SIMDType x1(
set( x[ibegin] ) );
3012 SIMDType xmm1( x1 * A.load(ibegin,j ) );
3013 SIMDType xmm2( x1 * A.load(ibegin,j+
SIMDSIZE ) );
3014 SIMDType xmm3( x1 * A.load(ibegin,j+
SIMDSIZE*2UL) );
3015 SIMDType xmm4( x1 * A.load(ibegin,j+
SIMDSIZE*3UL) );
3016 SIMDType xmm5( x1 * A.load(ibegin,j+
SIMDSIZE*4UL) );
3017 SIMDType xmm6( x1 * A.load(ibegin,j+
SIMDSIZE*5UL) );
3018 SIMDType xmm7( x1 * A.load(ibegin,j+
SIMDSIZE*6UL) );
3019 SIMDType xmm8( x1 * A.load(ibegin,j+
SIMDSIZE*7UL) );
3021 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
3023 xmm1 += x1 * A.load(i,j );
3024 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
3025 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
3026 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
3027 xmm5 += x1 * A.load(i,j+
SIMDSIZE*4UL);
3028 xmm6 += x1 * A.load(i,j+
SIMDSIZE*5UL);
3029 xmm7 += x1 * A.load(i,j+
SIMDSIZE*6UL);
3030 xmm8 += x1 * A.load(i,j+
SIMDSIZE*7UL);
3033 y.store( j , xmm1*factor );
3034 y.store( j+
SIMDSIZE , xmm2*factor );
3035 y.store( j+
SIMDSIZE*2UL, xmm3*factor );
3036 y.store( j+
SIMDSIZE*3UL, xmm4*factor );
3037 y.store( j+
SIMDSIZE*4UL, xmm5*factor );
3038 y.store( j+
SIMDSIZE*5UL, xmm6*factor );
3039 y.store( j+
SIMDSIZE*6UL, xmm7*factor );
3040 y.store( j+
SIMDSIZE*7UL, xmm8*factor );
3053 SIMDType x1(
set( x[ibegin] ) );
3054 SIMDType xmm1( x1 * A.load(ibegin,j ) );
3055 SIMDType xmm2( x1 * A.load(ibegin,j+
SIMDSIZE ) );
3056 SIMDType xmm3( x1 * A.load(ibegin,j+
SIMDSIZE*2UL) );
3057 SIMDType xmm4( x1 * A.load(ibegin,j+
SIMDSIZE*3UL) );
3059 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
3061 xmm1 += x1 * A.load(i,j );
3062 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
3063 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
3064 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
3067 y.store( j , xmm1*factor );
3068 y.store( j+
SIMDSIZE , xmm2*factor );
3069 y.store( j+
SIMDSIZE*2UL, xmm3*factor );
3070 y.store( j+
SIMDSIZE*3UL, xmm4*factor );
3083 SIMDType x1(
set( x[ibegin] ) );
3084 SIMDType xmm1( x1 * A.load(ibegin,j ) );
3085 SIMDType xmm2( x1 * A.load(ibegin,j+
SIMDSIZE ) );
3086 SIMDType xmm3( x1 * A.load(ibegin,j+
SIMDSIZE*2UL) );
3088 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
3090 xmm1 += x1 * A.load(i,j );
3091 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
3092 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
3095 y.store( j , xmm1*factor );
3096 y.store( j+
SIMDSIZE , xmm2*factor );
3097 y.store( j+
SIMDSIZE*2UL, xmm3*factor );
3110 SIMDType x1(
set( x[ibegin] ) );
3111 SIMDType xmm1( x1 * A.load(ibegin,j ) );
3112 SIMDType xmm2( x1 * A.load(ibegin,j+
SIMDSIZE) );
3114 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
3116 xmm1 += x1 * A.load(i,j );
3120 y.store( j , xmm1*factor );
3121 y.store( j+
SIMDSIZE, xmm2*factor );
3134 SIMDType xmm1(
set( x[ibegin] ) * A.load(ibegin,j) );
3136 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
3137 xmm1 +=
set( x[i] ) * A.load(i,j);
3140 y.store( j, xmm1*factor );
3143 for( ; remainder && j<N; ++j )
3151 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
3152 value += x[i] * A(i,j);
3155 y[j] = value * scalar;
3174 template<
typename VT1
3178 static inline auto selectLargeAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
3181 selectDefaultAssignKernel( y, x, A, scalar );
3199 template<
typename VT1
3203 static inline auto selectLargeAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
3208 const size_t M( A.rows() );
3209 const size_t N( A.columns() );
3211 const size_t jblock( 32768UL /
sizeof(
ElementType ) );
3212 const size_t iblock( ( N < jblock )?( 8UL ):( 4UL ) );
3214 const SIMDType factor(
set( scalar ) );
3220 for(
size_t jj=0U; jj<N; jj+=jblock ) {
3221 for(
size_t ii=0UL; ii<M; ii+=iblock )
3223 const size_t iend(
min( ii+iblock, M ) );
3224 const size_t jtmp(
min( jj+jblock, N ) );
3238 SIMDType x1(
set( x[ii] ) );
3239 SIMDType xmm1( x1 * A.load(ii,j ) );
3240 SIMDType xmm2( x1 * A.load(ii,j+
SIMDSIZE ) );
3241 SIMDType xmm3( x1 * A.load(ii,j+
SIMDSIZE*2UL) );
3242 SIMDType xmm4( x1 * A.load(ii,j+
SIMDSIZE*3UL) );
3243 SIMDType xmm5( x1 * A.load(ii,j+
SIMDSIZE*4UL) );
3244 SIMDType xmm6( x1 * A.load(ii,j+
SIMDSIZE*5UL) );
3245 SIMDType xmm7( x1 * A.load(ii,j+
SIMDSIZE*6UL) );
3246 SIMDType xmm8( x1 * A.load(ii,j+
SIMDSIZE*7UL) );
3248 for(
size_t i=ii+1UL; i<iend; ++i ) {
3250 xmm1 += x1 * A.load(i,j );
3251 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
3252 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
3253 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
3254 xmm5 += x1 * A.load(i,j+
SIMDSIZE*4UL);
3255 xmm6 += x1 * A.load(i,j+
SIMDSIZE*5UL);
3256 xmm7 += x1 * A.load(i,j+
SIMDSIZE*6UL);
3257 xmm8 += x1 * A.load(i,j+
SIMDSIZE*7UL);
3260 y.store( j , y.load(j ) + xmm1*factor );
3272 SIMDType x1(
set( x[ii] ) );
3273 SIMDType xmm1( x1 * A.load(ii,j ) );
3274 SIMDType xmm2( x1 * A.load(ii,j+
SIMDSIZE ) );
3275 SIMDType xmm3( x1 * A.load(ii,j+
SIMDSIZE*2UL) );
3276 SIMDType xmm4( x1 * A.load(ii,j+
SIMDSIZE*3UL) );
3278 for(
size_t i=ii+1UL; i<iend; ++i ) {
3280 xmm1 += x1 * A.load(i,j );
3281 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
3282 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
3283 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
3286 y.store( j , y.load(j ) + xmm1*factor );
3294 SIMDType x1(
set( x[ii] ) );
3295 SIMDType xmm1( x1 * A.load(ii,j ) );
3296 SIMDType xmm2( x1 * A.load(ii,j+
SIMDSIZE ) );
3297 SIMDType xmm3( x1 * A.load(ii,j+
SIMDSIZE*2UL) );
3299 for(
size_t i=ii+1UL; i<iend; ++i ) {
3301 xmm1 += x1 * A.load(i,j );
3302 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
3303 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
3306 y.store( j , y.load(j ) + xmm1*factor );
3313 SIMDType x1(
set( x[ii] ) );
3314 SIMDType xmm1( x1 * A.load(ii,j ) );
3315 SIMDType xmm2( x1 * A.load(ii,j+
SIMDSIZE) );
3317 for(
size_t i=ii+1UL; i<iend; ++i ) {
3319 xmm1 += x1 * A.load(i,j );
3323 y.store( j , y.load(j ) + xmm1*factor );
3329 SIMDType xmm1(
set( x[ii] ) * A.load(ii,j) );
3331 for(
size_t i=ii+1UL; i<iend; ++i ) {
3332 xmm1 +=
set( x[i] ) * A.load(i,j);
3335 y.store( j, y.load(j) + xmm1*factor );
3338 for( ; remainder && j<jend; ++j )
3342 for(
size_t i=ii+1UL; i<iend; ++i ) {
3343 value += x[i] * A(i,j);
3346 y[j] += value * scalar;
3366 template<
typename VT1
3370 static inline auto selectBlasAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
3373 selectLargeAssignKernel( y, x, A, scalar );
3378#if BLAZE_BLAS_MODE && BLAZE_USE_BLAS_MATRIX_VECTOR_MULTIPLICATION
3392 template<
typename VT1
3396 static inline auto selectBlasAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
3399 using ET = ElementType_t<VT1>;
3402 assign( y, scalar * x );
3406 gemv( y, x, A,
ET(scalar),
ET(0) );
3424 template<
typename VT1 >
3425 friend inline void assign( SparseVector<VT1,true>& lhs,
const DVecScalarMultExpr& rhs )
3436 assign( *lhs, tmp );
3452 template<
typename VT1 >
3453 friend inline void addAssign( DenseVector<VT1,true>& lhs,
const DVecScalarMultExpr& rhs )
3459 LeftOperand_t<VMM> left ( rhs.vector_.leftOperand() );
3460 RightOperand_t<VMM> right( rhs.vector_.rightOperand() );
3462 if( right.rows() == 0UL || right.columns() == 0UL ||
3475 DVecScalarMultExpr::selectAddAssignKernel( *lhs, x, A, rhs.scalar_ );
3490 template<
typename VT1
3494 static inline void selectAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
3498 ( A.rows() * A.columns() < TDVECDMATMULT_THRESHOLD ) )
3499 selectSmallAddAssignKernel( y, x, A, scalar );
3501 selectBlasAddAssignKernel( y, x, A, scalar );
3519 template<
typename VT1
3523 static inline void selectDefaultAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
3525 y.addAssign( x * A * scalar );
3543 template<
typename VT1
3547 static inline auto selectSmallAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
3550 selectDefaultAddAssignKernel( y, x, A, scalar );
3569 template<
typename VT1
3573 static inline auto selectSmallAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
3578 const size_t M( A.rows() );
3579 const size_t N( A.columns() );
3584 const SIMDType factor(
set( scalar ) );
3598 SIMDType x1(
set( x[ibegin] ) );
3599 SIMDType xmm1( x1 * A.load(ibegin,j ) );
3600 SIMDType xmm2( x1 * A.load(ibegin,j+
SIMDSIZE ) );
3601 SIMDType xmm3( x1 * A.load(ibegin,j+
SIMDSIZE*2UL) );
3602 SIMDType xmm4( x1 * A.load(ibegin,j+
SIMDSIZE*3UL) );
3603 SIMDType xmm5( x1 * A.load(ibegin,j+
SIMDSIZE*4UL) );
3604 SIMDType xmm6( x1 * A.load(ibegin,j+
SIMDSIZE*5UL) );
3605 SIMDType xmm7( x1 * A.load(ibegin,j+
SIMDSIZE*6UL) );
3606 SIMDType xmm8( x1 * A.load(ibegin,j+
SIMDSIZE*7UL) );
3608 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
3610 xmm1 += x1 * A.load(i,j );
3611 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
3612 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
3613 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
3614 xmm5 += x1 * A.load(i,j+
SIMDSIZE*4UL);
3615 xmm6 += x1 * A.load(i,j+
SIMDSIZE*5UL);
3616 xmm7 += x1 * A.load(i,j+
SIMDSIZE*6UL);
3617 xmm8 += x1 * A.load(i,j+
SIMDSIZE*7UL);
3620 y.store( j , y.load(j ) + xmm1*factor );
3640 SIMDType x1(
set( x[ibegin] ) );
3641 SIMDType xmm1( x1 * A.load(ibegin,j ) );
3642 SIMDType xmm2( x1 * A.load(ibegin,j+
SIMDSIZE ) );
3643 SIMDType xmm3( x1 * A.load(ibegin,j+
SIMDSIZE*2UL) );
3644 SIMDType xmm4( x1 * A.load(ibegin,j+
SIMDSIZE*3UL) );
3646 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
3648 xmm1 += x1 * A.load(i,j );
3649 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
3650 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
3651 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
3654 y.store( j , y.load(j ) + xmm1*factor );
3670 SIMDType x1(
set( x[ibegin] ) );
3671 SIMDType xmm1( x1 * A.load(ibegin,j ) );
3672 SIMDType xmm2( x1 * A.load(ibegin,j+
SIMDSIZE ) );
3673 SIMDType xmm3( x1 * A.load(ibegin,j+
SIMDSIZE*2UL) );
3675 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
3677 xmm1 += x1 * A.load(i,j );
3678 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
3679 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
3682 y.store( j , y.load(j ) + xmm1*factor );
3697 SIMDType x1(
set( x[ibegin] ) );
3698 SIMDType xmm1( x1 * A.load(ibegin,j ) );
3699 SIMDType xmm2( x1 * A.load(ibegin,j+
SIMDSIZE) );
3701 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
3703 xmm1 += x1 * A.load(i,j );
3707 y.store( j , y.load(j ) + xmm1*factor );
3721 SIMDType xmm1(
set( x[ibegin] ) * A.load(ibegin,j) );
3723 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
3724 xmm1 +=
set( x[i] ) * A.load(i,j);
3727 y.store( j, y.load(j) + xmm1*factor );
3730 for( ; remainder && j<N; ++j )
3738 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
3739 value += x[i] * A(i,j);
3742 y[j] += value * scalar;
3761 template<
typename VT1
3765 static inline auto selectLargeAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
3768 selectDefaultAddAssignKernel( y, x, A, scalar );
3787 template<
typename VT1
3791 static inline auto selectLargeAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
3796 const size_t M( A.rows() );
3797 const size_t N( A.columns() );
3799 const size_t jblock( 32768UL /
sizeof(
ElementType ) );
3800 const size_t iblock( ( N < jblock )?( 8UL ):( 4UL ) );
3802 const SIMDType factor(
set( scalar ) );
3806 for(
size_t jj=0U; jj<N; jj+=jblock ) {
3807 for(
size_t ii=0UL; ii<M; ii+=iblock )
3809 const size_t iend(
min( ii+iblock, M ) );
3810 const size_t jtmp(
min( jj+jblock, N ) );
3824 SIMDType x1(
set( x[ii] ) );
3825 SIMDType xmm1( x1 * A.load(ii,j ) );
3826 SIMDType xmm2( x1 * A.load(ii,j+
SIMDSIZE ) );
3827 SIMDType xmm3( x1 * A.load(ii,j+
SIMDSIZE*2UL) );
3828 SIMDType xmm4( x1 * A.load(ii,j+
SIMDSIZE*3UL) );
3829 SIMDType xmm5( x1 * A.load(ii,j+
SIMDSIZE*4UL) );
3830 SIMDType xmm6( x1 * A.load(ii,j+
SIMDSIZE*5UL) );
3831 SIMDType xmm7( x1 * A.load(ii,j+
SIMDSIZE*6UL) );
3832 SIMDType xmm8( x1 * A.load(ii,j+
SIMDSIZE*7UL) );
3834 for(
size_t i=ii+1UL; i<iend; ++i ) {
3836 xmm1 += x1 * A.load(i,j );
3837 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
3838 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
3839 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
3840 xmm5 += x1 * A.load(i,j+
SIMDSIZE*4UL);
3841 xmm6 += x1 * A.load(i,j+
SIMDSIZE*5UL);
3842 xmm7 += x1 * A.load(i,j+
SIMDSIZE*6UL);
3843 xmm8 += x1 * A.load(i,j+
SIMDSIZE*7UL);
3846 y.store( j , y.load(j ) + xmm1*factor );
3858 SIMDType x1(
set( x[ii] ) );
3859 SIMDType xmm1( x1 * A.load(ii,j ) );
3860 SIMDType xmm2( x1 * A.load(ii,j+
SIMDSIZE ) );
3861 SIMDType xmm3( x1 * A.load(ii,j+
SIMDSIZE*2UL) );
3862 SIMDType xmm4( x1 * A.load(ii,j+
SIMDSIZE*3UL) );
3864 for(
size_t i=ii+1UL; i<iend; ++i ) {
3866 xmm1 += x1 * A.load(i,j );
3867 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
3868 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
3869 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
3872 y.store( j , y.load(j ) + xmm1*factor );
3880 SIMDType x1(
set( x[ii] ) );
3881 SIMDType xmm1( x1 * A.load(ii,j ) );
3882 SIMDType xmm2( x1 * A.load(ii,j+
SIMDSIZE ) );
3883 SIMDType xmm3( x1 * A.load(ii,j+
SIMDSIZE*2UL) );
3885 for(
size_t i=ii+1UL; i<iend; ++i ) {
3887 xmm1 += x1 * A.load(i,j );
3888 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
3889 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
3892 y.store( j , y.load(j ) + xmm1*factor );
3899 SIMDType x1(
set( x[ii] ) );
3900 SIMDType xmm1( x1 * A.load(ii,j ) );
3901 SIMDType xmm2( x1 * A.load(ii,j+
SIMDSIZE) );
3903 for(
size_t i=ii+1UL; i<iend; ++i ) {
3905 xmm1 += x1 * A.load(i,j );
3909 y.store( j , y.load(j ) + xmm1*factor );
3915 SIMDType xmm1(
set( x[ii] ) * A.load(ii,j) );
3917 for(
size_t i=ii+1UL; i<iend; ++i ) {
3918 xmm1 +=
set( x[i] ) * A.load(i,j);
3921 y.store( j, y.load(j) + xmm1*factor );
3924 for( ; remainder && j<jend; ++j )
3928 for(
size_t i=ii+1UL; i<iend; ++i ) {
3929 value += x[i] * A(i,j);
3932 y[j] += value * scalar;
3953 template<
typename VT1
3957 static inline auto selectBlasAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
3960 selectLargeAddAssignKernel( y, x, A, scalar );
3965#if BLAZE_BLAS_MODE && BLAZE_USE_BLAS_MATRIX_VECTOR_MULTIPLICATION
3979 template<
typename VT1
3983 static inline auto selectBlasAddAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
3986 using ET = ElementType_t<VT1>;
3989 ResultType_t<VT1> tmp(
serial( scalar * x ) );
3990 trmv( tmp, A, (
IsLower_v<MT1> )?( CblasLower ):( CblasUpper ) );
3991 addAssign( y, tmp );
3994 gemv( y, x, A,
ET(scalar),
ET(1) );
4016 template<
typename VT1 >
4017 friend inline void subAssign( DenseVector<VT1,true>& lhs,
const DVecScalarMultExpr& rhs )
4023 LeftOperand_t<VMM> left ( rhs.vector_.leftOperand() );
4024 RightOperand_t<VMM> right( rhs.vector_.rightOperand() );
4026 if( right.rows() == 0UL || right.columns() == 0UL ||
4039 DVecScalarMultExpr::selectSubAssignKernel( *lhs, x, A, rhs.scalar_ );
4054 template<
typename VT1
4058 static inline void selectSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
4062 ( A.rows() * A.columns() < TDVECDMATMULT_THRESHOLD ) )
4063 selectSmallSubAssignKernel( y, x, A, scalar );
4065 selectBlasSubAssignKernel( y, x, A, scalar );
4083 template<
typename VT1
4087 static inline void selectDefaultSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
4089 y.subAssign( x * A * scalar );
4107 template<
typename VT1
4111 static inline auto selectSmallSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
4114 selectDefaultSubAssignKernel( y, x, A, scalar );
4133 template<
typename VT1
4137 static inline auto selectSmallSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
4142 const size_t M( A.rows() );
4143 const size_t N( A.columns() );
4148 const SIMDType factor(
set( scalar ) );
4162 SIMDType x1(
set( x[ibegin] ) );
4163 SIMDType xmm1( x1 * A.load(ibegin,j ) );
4164 SIMDType xmm2( x1 * A.load(ibegin,j+
SIMDSIZE ) );
4165 SIMDType xmm3( x1 * A.load(ibegin,j+
SIMDSIZE*2UL) );
4166 SIMDType xmm4( x1 * A.load(ibegin,j+
SIMDSIZE*3UL) );
4167 SIMDType xmm5( x1 * A.load(ibegin,j+
SIMDSIZE*4UL) );
4168 SIMDType xmm6( x1 * A.load(ibegin,j+
SIMDSIZE*5UL) );
4169 SIMDType xmm7( x1 * A.load(ibegin,j+
SIMDSIZE*6UL) );
4170 SIMDType xmm8( x1 * A.load(ibegin,j+
SIMDSIZE*7UL) );
4172 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
4174 xmm1 += x1 * A.load(i,j );
4175 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
4176 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
4177 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
4178 xmm5 += x1 * A.load(i,j+
SIMDSIZE*4UL);
4179 xmm6 += x1 * A.load(i,j+
SIMDSIZE*5UL);
4180 xmm7 += x1 * A.load(i,j+
SIMDSIZE*6UL);
4181 xmm8 += x1 * A.load(i,j+
SIMDSIZE*7UL);
4184 y.store( j , y.load(j ) - xmm1*factor );
4204 SIMDType x1(
set( x[ibegin] ) );
4205 SIMDType xmm1( x1 * A.load(ibegin,j ) );
4206 SIMDType xmm2( x1 * A.load(ibegin,j+
SIMDSIZE ) );
4207 SIMDType xmm3( x1 * A.load(ibegin,j+
SIMDSIZE*2UL) );
4208 SIMDType xmm4( x1 * A.load(ibegin,j+
SIMDSIZE*3UL) );
4210 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
4212 xmm1 += x1 * A.load(i,j );
4213 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
4214 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
4215 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
4218 y.store( j , y.load(j ) - xmm1*factor );
4234 SIMDType x1(
set( x[ibegin] ) );
4235 SIMDType xmm1( x1 * A.load(ibegin,j ) );
4236 SIMDType xmm2( x1 * A.load(ibegin,j+
SIMDSIZE ) );
4237 SIMDType xmm3( x1 * A.load(ibegin,j+
SIMDSIZE*2UL) );
4239 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
4241 xmm1 += x1 * A.load(i,j );
4242 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
4243 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
4246 y.store( j , y.load(j ) - xmm1*factor );
4261 SIMDType x1(
set( x[ibegin] ) );
4262 SIMDType xmm1( x1 * A.load(ibegin,j ) );
4263 SIMDType xmm2( x1 * A.load(ibegin,j+
SIMDSIZE) );
4265 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
4267 xmm1 += x1 * A.load(i,j );
4271 y.store( j , y.load(j ) - xmm1*factor );
4285 SIMDType xmm1(
set( x[ibegin] ) * A.load(ibegin,j) );
4287 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
4288 xmm1 +=
set( x[i] ) * A.load(i,j);
4291 y.store( j, y.load(j) - xmm1*factor );
4294 for( ; remainder && j<N; ++j )
4302 for(
size_t i=ibegin+1UL; i<iend; ++i ) {
4303 value += x[i] * A(i,j);
4306 y[j] -= value * scalar;
4325 template<
typename VT1
4329 static inline auto selectLargeSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
4332 selectDefaultSubAssignKernel( y, x, A, scalar );
4351 template<
typename VT1
4355 static inline auto selectLargeSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
4360 const size_t M( A.rows() );
4361 const size_t N( A.columns() );
4363 const size_t jblock( 32768UL /
sizeof(
ElementType ) );
4364 const size_t iblock( ( N < jblock )?( 8UL ):( 4UL ) );
4366 const SIMDType factor(
set( scalar ) );
4370 for(
size_t jj=0U; jj<N; jj+=jblock ) {
4371 for(
size_t ii=0UL; ii<M; ii+=iblock )
4373 const size_t iend(
min( ii+iblock, M ) );
4374 const size_t jtmp(
min( jj+jblock, N ) );
4388 SIMDType x1(
set( x[ii] ) );
4389 SIMDType xmm1( x1 * A.load(ii,j ) );
4390 SIMDType xmm2( x1 * A.load(ii,j+
SIMDSIZE ) );
4391 SIMDType xmm3( x1 * A.load(ii,j+
SIMDSIZE*2UL) );
4392 SIMDType xmm4( x1 * A.load(ii,j+
SIMDSIZE*3UL) );
4393 SIMDType xmm5( x1 * A.load(ii,j+
SIMDSIZE*4UL) );
4394 SIMDType xmm6( x1 * A.load(ii,j+
SIMDSIZE*5UL) );
4395 SIMDType xmm7( x1 * A.load(ii,j+
SIMDSIZE*6UL) );
4396 SIMDType xmm8( x1 * A.load(ii,j+
SIMDSIZE*7UL) );
4398 for(
size_t i=ii+1UL; i<iend; ++i ) {
4400 xmm1 += x1 * A.load(i,j );
4401 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
4402 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
4403 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
4404 xmm5 += x1 * A.load(i,j+
SIMDSIZE*4UL);
4405 xmm6 += x1 * A.load(i,j+
SIMDSIZE*5UL);
4406 xmm7 += x1 * A.load(i,j+
SIMDSIZE*6UL);
4407 xmm8 += x1 * A.load(i,j+
SIMDSIZE*7UL);
4410 y.store( j , y.load(j ) - xmm1*factor );
4422 SIMDType x1(
set( x[ii] ) );
4423 SIMDType xmm1( x1 * A.load(ii,j ) );
4424 SIMDType xmm2( x1 * A.load(ii,j+
SIMDSIZE ) );
4425 SIMDType xmm3( x1 * A.load(ii,j+
SIMDSIZE*2UL) );
4426 SIMDType xmm4( x1 * A.load(ii,j+
SIMDSIZE*3UL) );
4428 for(
size_t i=ii+1UL; i<iend; ++i ) {
4430 xmm1 += x1 * A.load(i,j );
4431 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
4432 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
4433 xmm4 += x1 * A.load(i,j+
SIMDSIZE*3UL);
4436 y.store( j , y.load(j ) - xmm1*factor );
4444 SIMDType x1(
set( x[ii] ) );
4445 SIMDType xmm1( x1 * A.load(ii,j ) );
4446 SIMDType xmm2( x1 * A.load(ii,j+
SIMDSIZE ) );
4447 SIMDType xmm3( x1 * A.load(ii,j+
SIMDSIZE*2UL) );
4449 for(
size_t i=ii+1UL; i<iend; ++i ) {
4451 xmm1 += x1 * A.load(i,j );
4452 xmm2 += x1 * A.load(i,j+
SIMDSIZE );
4453 xmm3 += x1 * A.load(i,j+
SIMDSIZE*2UL);
4456 y.store( j , y.load(j ) - xmm1*factor );
4463 SIMDType x1(
set( x[ii] ) );
4464 SIMDType xmm1( x1 * A.load(ii,j ) );
4465 SIMDType xmm2( x1 * A.load(ii,j+
SIMDSIZE) );
4467 for(
size_t i=ii+1UL; i<iend; ++i ) {
4469 xmm1 += x1 * A.load(i,j );
4473 y.store( j , y.load(j ) - xmm1*factor );
4479 SIMDType xmm1(
set( x[ii] ) * A.load(ii,j) );
4481 for(
size_t i=ii+1UL; i<iend; ++i ) {
4482 xmm1 +=
set( x[i] ) * A.load(i,j);
4485 y.store( j, y.load(j) - xmm1*factor );
4488 for( ; remainder && j<jend; ++j )
4492 for(
size_t i=ii+1UL; i<iend; ++i ) {
4493 value += x[i] * A(i,j);
4496 y[j] -= value * scalar;
4517 template<
typename VT1
4521 static inline auto selectBlasSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
4524 selectLargeSubAssignKernel( y, x, A, scalar );
4529#if BLAZE_BLAS_MODE && BLAZE_USE_BLAS_MATRIX_VECTOR_MULTIPLICATION
4543 template<
typename VT1
4547 static inline auto selectBlasSubAssignKernel( VT1& y,
const VT2& x,
const MT1& A, ST2 scalar )
4550 using ET = ElementType_t<VT1>;
4553 ResultType_t<VT1> tmp(
serial( scalar * x ) );
4554 trmv( tmp, A, (
IsLower_v<MT1> )?( CblasLower ):( CblasUpper ) );
4555 subAssign( y, tmp );
4558 gemv( y, x, A,
ET(-scalar),
ET(1) );
4580 template<
typename VT1 >
4581 friend inline void multAssign( DenseVector<VT1,true>& lhs,
const DVecScalarMultExpr& rhs )
4592 multAssign( *lhs, tmp );
4612 template<
typename VT1 >
4613 friend inline void divAssign( DenseVector<VT1,true>& lhs,
const DVecScalarMultExpr& rhs )
4624 divAssign( *lhs, tmp );
4646 template<
typename VT1 >
4654 LeftOperand_t<VMM> left ( rhs.vector_.leftOperand() );
4655 RightOperand_t<VMM> right( rhs.vector_.rightOperand() );
4657 if( right.rows() == 0UL ||
4662 else if( right.columns() == 0UL ) {
4692 template<
typename VT1 >
4723 template<
typename VT1 >
4731 LeftOperand_t<VMM> left ( rhs.vector_.leftOperand() );
4732 RightOperand_t<VMM> right( rhs.vector_.rightOperand() );
4734 if( right.rows() == 0UL || right.columns() == 0UL ||
4769 template<
typename VT1 >
4777 LeftOperand_t<VMM> left ( rhs.vector_.leftOperand() );
4778 RightOperand_t<VMM> right( rhs.vector_.rightOperand() );
4780 if( right.rows() == 0UL || right.columns() == 0UL ||
4816 template<
typename VT1 >
4851 template<
typename VT1 >
4926template<
typename VT
4928inline decltype(
auto)
4935 if( (*vec).size() != (*mat).rows() ) {
4940 return ReturnType( *vec, *mat );
4955template<
typename VT,
typename MT >
4956struct IsAligned< TDVecDMatMultExpr<VT,MT> >
4957 :
public BoolConstant< IsAligned_v<VT> && IsAligned_v<MT> >
Header file for auxiliary alias declarations.
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.
Definition Aliases.h:110
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition Aliases.h:550
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition Aliases.h:190
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition Aliases.h:450
Header file for run time assertion macros.
Header file for the blaze::checked and blaze::unchecked instances.
Header file for the complex data type.
Header file for the EnableIf class template.
Header file for the function trace functionality.
Header file for the HasConstDataAccess type trait.
Header file for the HasMutableDataAccess type trait.
Header file for the HasSIMDAdd type trait.
Header file for the HasSIMDMult type trait.
Header file for the If class template.
Header file for the IntegralConstant class template.
Header file for the IsAligned type trait.
Header file for the IsBLASCompatible type trait.
Header file for the IsBuiltin type trait.
Header file for the IsComplexDouble type trait.
Header file for the IsComplexFloat type trait.
Header file for the IsComplex type trait.
Header file for the IsComputation type trait class.
Header file for the IsContiguous type trait.
Header file for the IsDiagonal type trait.
Header file for the IsDouble type trait.
Header file for the IsExpression type trait class.
Header file for the IsFloat type trait.
Header file for the IsLower type trait.
Header file for the IsPadded type trait.
Header file for the IsSIMDCombinable type trait.
Header file for the IsSame and IsStrictlySame type traits.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyTriangular type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsTriangular type trait.
Header file for the IsUpper type trait.
Deactivation of problematic macros.
Header file for the multiplication trait.
Header file for the prevMultiple shim.
Constraints on the storage order of matrix types.
Constraint on the transpose flag of vector types.
Header file for all SIMD functionality.
Constraint on the data type.
Expression object for dense vector-scalar multiplications.
Definition DVecScalarMultExpr.h:107
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition DVecScalarMultExpr.h:530
LeftOperand vector_
Left-hand side dense vector of the multiplication expression.
Definition DVecScalarMultExpr.h:591
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition DVecScalarMultExpr.h:430
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition DVecScalarMultExpr.h:461
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition DVecScalarMultExpr.h:520
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition DVecScalarMultExpr.h:540
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition DVecScalarMultExpr.h:584
DVecScalarMultExpr< VT, ST, TF > This
Type of this DVecScalarMultExpr instance.
Definition DVecScalarMultExpr.h:163
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition DVecScalarMultExpr.h:169
VecScalarMultExpr< DenseVector< This, TF > > BaseType
Base type of this DVecScalarMultExpr instance.
Definition DVecScalarMultExpr.h:166
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition DVecScalarMultExpr.h:440
ResultType_t< VT > RT
Result type of the dense vector expression.
Definition DVecScalarMultExpr.h:110
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition DVecScalarMultExpr.h:474
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition DVecScalarMultExpr.h:552
If_t< useAssign, const ResultType, const DVecScalarMultExpr & > CompositeType
Data type for composite expression templates.
Definition DVecScalarMultExpr.h:176
If_t< IsExpression_v< VT >, const VT, const VT & > LeftOperand
Composite type of the left-hand side dense vector expression.
Definition DVecScalarMultExpr.h:179
ElementType_t< VT > ET
Element type of the dense vector expression.
Definition DVecScalarMultExpr.h:112
ElementType_t< ResultType > ElementType
Resulting element type.
Definition DVecScalarMultExpr.h:170
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition DVecScalarMultExpr.h:435
DVecScalarMultExpr(const VT &vector, ST scalar) noexcept
Constructor for the DVecScalarMultExpr class.
Definition DVecScalarMultExpr.h:449
ST RightOperand
Composite type of the right-hand side scalar value.
Definition DVecScalarMultExpr.h:182
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition DVecScalarMultExpr.h:574
MultTrait_t< RT, ST > ResultType
Result type for expression template evaluations.
Definition DVecScalarMultExpr.h:168
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition DVecScalarMultExpr.h:564
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition DVecScalarMultExpr.h:592
const If_t< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition DVecScalarMultExpr.h:173
Base class for dense matrices.
Definition DenseMatrix.h:82
Base class for N-dimensional dense vectors.
Definition DenseVector.h:77
SIMD characteristics of data types.
Definition SIMDTrait.h:297
Expression object for transpose dense vector-dense matrix multiplications.
Definition TDVecDMatMultExpr.h:129
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition TDVecDMatMultExpr.h:269
TVecMatMultExpr< DenseVector< This, true > > BaseType
Base type of this TDVecDMatMultExpr instance.
Definition TDVecDMatMultExpr.h:209
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition TDVecDMatMultExpr.h:240
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition TDVecDMatMultExpr.h:348
ElementType_t< ResultType > ElementType
Resulting element type.
Definition TDVecDMatMultExpr.h:213
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition TDVecDMatMultExpr.h:303
LeftOperand vec_
Left-hand side dense vector of the multiplication expression.
Definition TDVecDMatMultExpr.h:392
If_t< evaluateMatrix, const MRT, MCT > RT
Type for the assignment of the right-hand side dense vector operand.
Definition TDVecDMatMultExpr.h:228
const ResultType CompositeType
Data type for composite expression templates.
Definition TDVecDMatMultExpr.h:216
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition TDVecDMatMultExpr.h:212
ResultType_t< VT > VRT
Result type of the left-hand side dense vector expression.
Definition TDVecDMatMultExpr.h:132
const ElementType ReturnType
Return type for expression template evaluations.
Definition TDVecDMatMultExpr.h:215
RightOperand rightOperand() const noexcept
Returns the right-hand side dense matrix operand.
Definition TDVecDMatMultExpr.h:336
static constexpr bool evaluateMatrix
Compilation switch for the composite type of the right-hand side dense matrix expression.
Definition TDVecDMatMultExpr.h:147
MultTrait_t< VRT, MRT > ResultType
Result type for expression template evaluations.
Definition TDVecDMatMultExpr.h:211
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition TDVecDMatMultExpr.h:233
CompositeType_t< MT > MCT
Composite type of the right-hand side dense matrix expression.
Definition TDVecDMatMultExpr.h:137
TDVecDMatMultExpr(const VT &vec, const MT &mat) noexcept
Constructor for the TDVecDMatMultExpr class.
Definition TDVecDMatMultExpr.h:255
SIMDTrait_t< ElementType > SIMDType
Resulting SIMD element type.
Definition TDVecDMatMultExpr.h:214
RightOperand mat_
Right-hand side dense matrix of the multiplication expression.
Definition TDVecDMatMultExpr.h:393
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition TDVecDMatMultExpr.h:360
TDVecDMatMultExpr< VT, MT > This
Type of this TDVecDMatMultExpr instance.
Definition TDVecDMatMultExpr.h:206
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition TDVecDMatMultExpr.h:326
If_t< evaluateVector, const VRT, VCT > LT
Type for the assignment of the left-hand side dense matrix operand.
Definition TDVecDMatMultExpr.h:225
If_t< IsExpression_v< MT >, const MT, const MT & > RightOperand
Composite type of the right-hand side dense matrix expression.
Definition TDVecDMatMultExpr.h:222
ElementType_t< MRT > MET
Element type of the right-hand side dense matrix expression.
Definition TDVecDMatMultExpr.h:135
static constexpr bool evaluateVector
Compilation switch for the composite type of the left-hand side dense vector expression.
Definition TDVecDMatMultExpr.h:142
CompositeType_t< VT > VCT
Composite type of the left-hand side dense vector expression.
Definition TDVecDMatMultExpr.h:136
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition TDVecDMatMultExpr.h:380
If_t< IsExpression_v< VT >, const VT, const VT & > LeftOperand
Composite type of the left-hand side dense vector expression.
Definition TDVecDMatMultExpr.h:219
ElementType_t< VRT > VET
Element type of the left-hand side dense vector epxression.
Definition TDVecDMatMultExpr.h:134
static constexpr size_t SIMDSIZE
The number of elements packed within a single SIMD element.
Definition TDVecDMatMultExpr.h:246
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition TDVecDMatMultExpr.h:370
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition TDVecDMatMultExpr.h:316
ResultType_t< MT > MRT
Result type of the right-hand side dense matrix expression.
Definition TDVecDMatMultExpr.h:133
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the Computation base class.
Header file for the DenseVector base class.
Header file for the MatMatMultExpr base class.
Header file for the TVecMatMultExpr base class.
Header file for the VecScalarMultExpr base class.
Header file for BLAS general matrix/vector multiplication functions (gemv).
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition Column.h:137
#define BLAZE_BLAS_MODE
Compilation switch for the BLAS mode.
Definition BLAS.h:68
#define BLAZE_BLAS_IS_PARALLEL
Compilation switch for the parallel BLAS mode.
Definition BLAS.h:136
#define BLAZE_USE_BLAS_MATRIX_VECTOR_MULTIPLICATION
Compilation switch for the BLAS matrix/vector multiplication kernels (gemv).
Definition BLAS.h:169
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE(A, B)
Data type constraint.
Definition SameType.h:71
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition DMatDMatMapExpr.h:1339
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition DMatDMatMapExpr.h:1375
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition DMatSerialExpr.h:812
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition RowMajorMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_TVECMATMULTEXPR(T1, T2)
Constraint on the data type.
Definition TVecMatMultExpr.h:104
#define BLAZE_CONSTRAINT_MUST_NOT_BE_MATMATMULTEXPR_TYPE(T)
Constraint on the data type.
Definition MatMatMultExpr.h:83
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition DenseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.
Definition DenseVector.h:61
#define BLAZE_CONSTRAINT_MUST_BE_SCALAR_TYPE(T)
Constraint on the data type.
Definition Scalar.h:61
#define BLAZE_CONSTRAINT_MUST_BE_ROW_VECTOR_TYPE(T)
Constraint on the data type.
Definition RowVector.h:61
typename MultTrait< T1, T2 >::Type MultTrait_t
Auxiliary alias declaration for the MultTrait class template.
Definition MultTrait.h:165
constexpr bool RequiresEvaluation_v
Auxiliary variable template for the RequiresEvaluation type trait.
Definition RequiresEvaluation.h:91
constexpr bool IsStrictlyUpper_v
Auxiliary variable template for the IsStrictlyUpper type trait.
Definition IsStrictlyUpper.h:173
constexpr bool IsTriangular_v
Auxiliary variable template for the IsTriangular type trait.
Definition IsTriangular.h:106
constexpr bool HasMutableDataAccess_v
Auxiliary variable template for the HasMutableDataAccess type trait.
Definition HasMutableDataAccess.h:133
constexpr bool IsStrictlyLower_v
Auxiliary variable template for the IsStrictlyLower type trait.
Definition IsStrictlyLower.h:173
constexpr bool IsUpper_v
Auxiliary variable template for the IsUpper type trait.
Definition IsUpper.h:175
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.
Definition IsSIMDCombinable.h:137
constexpr bool IsDiagonal_v
Auxiliary variable template for the IsDiagonal type trait.
Definition IsDiagonal.h:148
constexpr bool IsComputation_v
Auxiliary variable template for the IsComputation type trait.
Definition IsComputation.h:90
constexpr bool HasConstDataAccess_v
Auxiliary variable template for the HasConstDataAccess type trait.
Definition HasConstDataAccess.h:133
constexpr bool HasSIMDAdd_v
Auxiliary variable template for the HasSIMDAdd type trait.
Definition HasSIMDAdd.h:187
constexpr bool HasSIMDMult_v
Auxiliary variable template for the HasSIMDMult type trait.
Definition HasSIMDMult.h:188
constexpr bool IsStrictlyTriangular_v
Auxiliary variable template for the IsStrictlyTriangular type trait.
Definition IsStrictlyTriangular.h:106
constexpr bool IsPadded_v
Auxiliary variable template for the IsPadded type trait.
Definition IsPadded.h:134
constexpr bool IsLower_v
Auxiliary variable template for the IsLower type trait.
Definition IsLower.h:175
constexpr bool IsBLASCompatible_v
Auxiliary variable template for the IsBLASCompatible type trait.
Definition IsBLASCompatible.h:99
constexpr bool IsContiguous_v
Auxiliary variable template for the IsContiguous type trait.
Definition IsContiguous.h:144
BLAZE_ALWAYS_INLINE constexpr auto prevMultiple(T1 value, T2 factor) noexcept
Rounds down an integral value to the previous multiple of a given factor.
Definition PrevMultiple.h:68
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition Matrix.h:806
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition Matrix.h:518
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition Assert.h:101
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition Set.h:75
typename SIMDTrait< T >::Type SIMDTrait_t
Auxiliary alias declaration for the SIMDTrait class template.
Definition SIMDTrait.h:315
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:221
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
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
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:192
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
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition Subvector.h:158
constexpr bool IsSame_v
Auxiliary variable template for the IsSame type trait.
Definition IsSame.h:159
constexpr bool IsBuiltin_v
Auxiliary variable template for the IsBuiltin type trait.
Definition IsBuiltin.h:95
constexpr bool IsComplex_v
Auxiliary variable template for the IsComplex type trait.
Definition IsComplex.h:139
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:138
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition Exception.h:235
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition FunctionTrace.h:94
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition If.h:108
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:175
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition IntegralConstant.h:110
constexpr Unchecked unchecked
Global Unchecked instance.
Definition Check.h:146
Header file for the exception macros of the math module.
Header file for all forward declarations for expression class templates.
Header file for the reset shim.
Header file for the serial shim.
Base class for all compute expression templates.
Definition Computation.h:68
Base class for all vector/matrix multiplication expression templates.
Definition TVecMatMultExpr.h:69
Base class for all vector/scalar multiplication expression templates.
Definition VecScalarMultExpr.h:76
System settings for the BLAS mode.
System settings for performance optimizations.
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
Header file for BLAS triangular matrix/vector multiplication functions (trmv).
Header file for the RequiresEvaluation type trait.
Header file for basic type definitions.
Header file for the generic max algorithm.
Header file for the generic min algorithm.