35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECSCALARMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECSCALARMULTEXPR_H_
112 template<
typename VT
151 template<
typename VT2 >
154 enum { value = useAssign };
167 template<
typename VT2 >
168 struct UseSMPAssign {
169 enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
226 : iterator_( iterator )
312 inline IntrinsicType
load()
const {
440 enum { vectorizable = VT::vectorizable &&
447 enum { smpAssignable = VT::smpAssignable };
481 inline ReturnType
at(
size_t index )
const {
482 if( index >=
vector_.size() ) {
485 return (*
this)[index];
559 template<
typename T >
571 template<
typename T >
573 return vector_.isAliased( alias );
593 return vector_.canSMPAssign() || (
size() > SMP_DVECSCALARMULT_THRESHOLD );
617 template<
typename VT2 >
626 assign( ~lhs, (~lhs) * rhs.
scalar_ );
645 template<
typename VT2 >
673 template<
typename VT2 >
674 friend inline typename EnableIf< UseAssign<VT2> >::Type
685 const ResultType tmp(
serial( rhs ) );
686 addAssign( ~lhs, tmp );
709 template<
typename VT2 >
710 friend inline typename EnableIf< UseAssign<VT2> >::Type
721 const ResultType tmp(
serial( rhs ) );
722 subAssign( ~lhs, tmp );
745 template<
typename VT2 >
746 friend inline typename EnableIf< UseAssign<VT2> >::Type
757 const ResultType tmp(
serial( rhs ) );
758 multAssign( ~lhs, tmp );
781 template<
typename VT2 >
782 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
809 template<
typename VT2 >
810 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
818 (~lhs) *= rhs.scalar_;
837 template<
typename VT2 >
838 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
849 const ResultType tmp( rhs );
873 template<
typename VT2 >
874 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
885 const ResultType tmp( rhs );
909 template<
typename VT2 >
910 friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
921 const ResultType tmp( rhs );
968 template<
typename VT
970 inline const DVecScalarMultExpr<VT,typename UnderlyingBuiltin<VT>::Type,TF>
1011 template<
typename T1
1014 inline const typename EnableIf< IsNumeric<T2>,
typename MultExprTrait<T1,T2>::Type >::Type
1020 return Type( ~vec, scalar );
1047 template<
typename T1
1050 inline const typename EnableIf< IsNumeric<T1>,
typename MultExprTrait<T1,T2>::Type >::Type
1056 return Type( ~vec, scalar );
1087 template<
typename VT
1089 inline const DVecScalarMultExpr<VT,typename VT::ElementType,TF>
1096 const ElementType len (
length( ~vec ) );
1124 template<
typename VT
1127 inline const DVecScalarMultExpr<VT,ST,TF>
1128 operator-(
const DVecScalarMultExpr<VT,ST,TF>& dv )
1132 return DVecScalarMultExpr<VT,ST,TF>( dv.leftOperand(), -dv.rightOperand() );
1159 template<
typename VT
1163 inline const typename EnableIf< IsNumeric<ST2>
1164 ,
typename MultExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
1165 operator*(
const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1169 return vec.leftOperand() * ( vec.rightOperand() * scalar );
1188 template<
typename ST1
1192 inline const typename EnableIf< IsNumeric<ST1>
1193 ,
typename MultExprTrait< ST1, DVecScalarMultExpr<VT,ST2,TF> >::Type >::Type
1194 operator*( ST1 scalar,
const DVecScalarMultExpr<VT,ST2,TF>& vec )
1198 return vec.leftOperand() * ( scalar * vec.rightOperand() );
1217 template<
typename VT
1221 inline const typename EnableIf< And< IsNumeric<ST2>, IsInvertible< typename DivTrait<ST1,ST2>::Type > >
1222 ,
typename DivExprTrait< DVecScalarMultExpr<VT,ST1,TF>, ST2 >::Type >::Type
1223 operator/(
const DVecScalarMultExpr<VT,ST1,TF>& vec, ST2 scalar )
1227 return vec.leftOperand() * ( vec.rightOperand() / scalar );
1247 template<
typename VT1
1251 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
1252 operator*(
const DVecScalarMultExpr<VT1,ST,TF>& lhs,
const DenseVector<VT2,TF>& rhs )
1256 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1276 template<
typename VT1
1280 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
1281 operator*(
const DenseVector<VT1,TF>& lhs,
const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1285 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1305 template<
typename VT1
1310 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
1311 operator*(
const DVecScalarMultExpr<VT1,ST1,TF>& lhs,
const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1315 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1335 template<
typename VT1
1338 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1339 operator*(
const DVecScalarMultExpr<VT1,ST,false>& lhs,
const DenseVector<VT2,true>& rhs )
1343 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1363 template<
typename VT1
1366 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
1367 operator*(
const DenseVector<VT1,false>& lhs,
const DVecScalarMultExpr<VT2,ST,true>& rhs )
1371 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1391 template<
typename VT1
1395 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
1396 operator*(
const DVecScalarMultExpr<VT1,ST1,false>& lhs,
const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1400 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1420 template<
typename VT1
1424 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,TF>, VT2 >::Type
1425 operator*(
const DVecScalarMultExpr<VT1,ST,TF>& lhs,
const SparseVector<VT2,TF>& rhs )
1429 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1449 template<
typename VT1
1453 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,TF> >::Type
1454 operator*(
const SparseVector<VT1,TF>& lhs,
const DVecScalarMultExpr<VT2,ST,TF>& rhs )
1458 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1479 template<
typename VT1
1484 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,TF>, SVecScalarMultExpr<VT2,ST2,TF> >::Type
1485 operator*(
const DVecScalarMultExpr<VT1,ST1,TF>& lhs,
const SVecScalarMultExpr<VT2,ST2,TF>& rhs )
1489 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1510 template<
typename VT1
1515 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,TF>, DVecScalarMultExpr<VT2,ST2,TF> >::Type
1516 operator*(
const SVecScalarMultExpr<VT1,ST1,TF>& lhs,
const DVecScalarMultExpr<VT2,ST2,TF>& rhs )
1520 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1540 template<
typename VT1
1543 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST,false>, VT2 >::Type
1544 operator*(
const DVecScalarMultExpr<VT1,ST,false>& lhs,
const SparseVector<VT2,true>& rhs )
1548 return ( lhs.leftOperand() * (~rhs) ) * lhs.rightOperand();
1568 template<
typename VT1
1571 inline const typename MultExprTrait< VT1, DVecScalarMultExpr<VT2,ST,true> >::Type
1572 operator*(
const SparseVector<VT1,false>& lhs,
const DVecScalarMultExpr<VT2,ST,true>& rhs )
1576 return ( (~lhs) * rhs.leftOperand() ) * rhs.rightOperand();
1597 template<
typename VT1
1601 inline const typename MultExprTrait< DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >::Type
1602 operator*(
const DVecScalarMultExpr<VT1,ST1,false>& lhs,
const SVecScalarMultExpr<VT2,ST2,true>& rhs )
1606 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1627 template<
typename VT1
1631 inline const typename MultExprTrait< SVecScalarMultExpr<VT1,ST1,false>, DVecScalarMultExpr<VT2,ST2,true> >::Type
1632 operator*(
const SVecScalarMultExpr<VT1,ST1,false>& lhs,
const DVecScalarMultExpr<VT2,ST2,true>& rhs )
1636 return ( lhs.leftOperand() * rhs.leftOperand() ) * ( lhs.rightOperand() * rhs.rightOperand() );
1656 template<
typename MT
1660 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1661 operator*(
const DenseMatrix<MT,SO>& mat,
const DVecScalarMultExpr<VT,ST,false>& vec )
1665 return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1685 template<
typename VT
1689 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1690 operator*(
const DVecScalarMultExpr<VT,ST,true>& vec,
const DenseMatrix<MT,SO>& mat )
1694 return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1714 template<
typename MT
1718 inline const typename MultExprTrait< MT, DVecScalarMultExpr<VT,ST,false> >::Type
1719 operator*(
const SparseMatrix<MT,SO>& mat,
const DVecScalarMultExpr<VT,ST,false>& vec )
1723 return ( (~mat) * vec.leftOperand() ) * vec.rightOperand();
1743 template<
typename VT
1747 inline const typename MultExprTrait< DVecScalarMultExpr<VT,ST,true>, MT >::Type
1748 operator*(
const DVecScalarMultExpr<VT,ST,true>& vec,
const SparseMatrix<MT,SO>& mat )
1752 return ( vec.leftOperand() * (~mat) ) * vec.rightOperand();
1768 template<
typename VT,
typename ST,
bool TF >
1785 template<
typename VT,
typename ST,
bool TF >
1786 struct IsAligned<
DVecScalarMultExpr<VT,ST,TF> > :
public IsTrue< IsAligned<VT>::value >
1802 template<
typename VT,
typename ST,
bool TF >
1803 struct IsPadded<
DVecScalarMultExpr<VT,ST,TF> > :
public IsTrue< IsPadded<VT>::value >
1819 template<
typename VT,
typename ST1,
typename ST2 >
1824 typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1825 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1826 ,
typename DVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1827 , INVALID_TYPE >::Type Type;
1844 template<
typename VT,
typename ST1,
typename ST2 >
1849 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1850 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1851 ,
typename TDVecScalarMultExprTrait<VT,typename MultTrait<ST1,ST2>::Type>::Type
1852 , INVALID_TYPE >::Type Type;
1869 template<
typename VT,
typename ST1,
typename ST2 >
1874 typedef typename DivTrait<ST1,ST2>::Type ScalarType;
1878 enum { condition = IsInvertible<ScalarType>::value };
1882 typedef typename DVecScalarMultExprTrait<VT,ScalarType>::Type T1;
1883 typedef typename DVecScalarDivExprTrait<VT,ScalarType>::Type T2;
1888 typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
1889 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1890 ,
typename SelectType<condition,T1,T2>::Type
1891 , INVALID_TYPE >::Type Type;
1908 template<
typename VT,
typename ST1,
typename ST2 >
1913 typedef typename DivTrait<ST1,ST2>::Type ScalarType;
1917 enum { condition = IsInvertible<ScalarType>::value };
1921 typedef typename TDVecScalarMultExprTrait<VT,ScalarType>::Type T1;
1922 typedef typename TDVecScalarDivExprTrait<VT,ScalarType>::Type T2;
1927 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
1928 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1929 ,
typename SelectType<condition,T1,T2>::Type
1930 , INVALID_TYPE >::Type Type;
1947 template<
typename VT1,
typename ST,
typename VT2 >
1952 typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1953 IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1954 IsNumeric<ST>::value
1955 ,
typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1956 , INVALID_TYPE >::Type Type;
1965 template<
typename VT1,
typename VT2,
typename ST >
1970 typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1971 IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1972 IsNumeric<ST>::value
1973 ,
typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
1974 , INVALID_TYPE >::Type Type;
1983 template<
typename VT1,
typename ST1,
typename VT2,
typename ST2 >
1988 typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
1989 IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
1990 IsNumeric<ST1>::value && IsNumeric<ST2>::value
1991 ,
typename DVecScalarMultExprTrait<typename DVecDVecMultExprTrait<VT1,VT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
1992 , INVALID_TYPE >::Type Type;
2009 template<
typename VT1,
typename ST,
typename VT2 >
2014 typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2015 IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2016 IsNumeric<ST>::value
2017 ,
typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2018 , INVALID_TYPE >::Type Type;
2027 template<
typename VT1,
typename VT2,
typename ST >
2032 typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2033 IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2034 IsNumeric<ST>::value
2035 ,
typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2036 , INVALID_TYPE >::Type Type;
2045 template<
typename VT1,
typename ST1,
typename VT2,
typename ST2 >
2050 typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2051 IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2052 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2053 ,
typename DMatScalarMultExprTrait<typename DVecTDVecMultExprTrait<VT1,VT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2054 , INVALID_TYPE >::Type Type;
2071 template<
typename VT1,
typename ST,
typename VT2 >
2076 typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2077 IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2078 IsNumeric<ST>::value
2079 ,
typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2080 , INVALID_TYPE >::Type Type;
2089 template<
typename VT1,
typename VT2,
typename ST >
2094 typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2095 IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2096 IsNumeric<ST>::value
2097 ,
typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2098 , INVALID_TYPE >::Type Type;
2107 template<
typename VT1,
typename ST1,
typename VT2,
typename ST2 >
2112 typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2113 IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2114 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2115 ,
typename TDVecScalarMultExprTrait<typename TDVecTDVecMultExprTrait<VT1,VT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2116 , INVALID_TYPE >::Type Type;
2133 template<
typename VT1,
typename VT2,
typename ST >
2138 typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2139 IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
2140 IsNumeric<ST>::value
2141 ,
typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2142 , INVALID_TYPE >::Type Type;
2151 template<
typename VT1,
typename ST1,
typename VT2,
typename ST2 >
2152 struct DVecSVecMultExprTrait<
DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,false> >
2156 typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2157 IsSparseVector<VT2>::value && IsColumnVector<VT2>::value &&
2158 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2159 ,
typename SVecScalarMultExprTrait<typename DVecSVecMultExprTrait<VT1,VT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2160 , INVALID_TYPE >::Type Type;
2177 template<
typename VT1,
typename ST,
typename VT2 >
2182 typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2183 IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2184 IsNumeric<ST>::value
2185 ,
typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2186 , INVALID_TYPE >::Type Type;
2195 template<
typename VT1,
typename ST1,
typename VT2,
typename ST2 >
2196 struct DVecTSVecMultExprTrait<
DVecScalarMultExpr<VT1,ST1,false>, SVecScalarMultExpr<VT2,ST2,true> >
2200 typedef typename SelectType< IsDenseVector<VT1>::value && IsColumnVector<VT1>::value &&
2201 IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2202 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2203 ,
typename SMatScalarMultExprTrait<typename DVecTSVecMultExprTrait<VT1,VT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2204 , INVALID_TYPE >::Type Type;
2221 template<
typename VT1,
typename ST,
typename VT2 >
2226 typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2227 IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2228 IsNumeric<ST>::value
2229 ,
typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2230 , INVALID_TYPE >::Type Type;
2239 template<
typename VT1,
typename ST1,
typename VT2,
typename ST2 >
2240 struct TDVecTSVecMultExprTrait<
DVecScalarMultExpr<VT1,ST1,true>, SVecScalarMultExpr<VT2,ST2,true> >
2244 typedef typename SelectType< IsDenseVector<VT1>::value && IsRowVector<VT1>::value &&
2245 IsSparseVector<VT2>::value && IsRowVector<VT2>::value &&
2246 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2247 ,
typename TSVecScalarMultExprTrait<typename TDVecTSVecMultExprTrait<VT1,VT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2248 , INVALID_TYPE >::Type Type;
2265 template<
typename VT1,
typename VT2,
typename ST >
2270 typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2271 IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
2272 IsNumeric<ST>::value
2273 ,
typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2274 , INVALID_TYPE >::Type Type;
2283 template<
typename VT1,
typename ST1,
typename VT2,
typename ST2 >
2284 struct SVecDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>,
DVecScalarMultExpr<VT2,ST2,false> >
2288 typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2289 IsDenseVector<VT2>::value && IsColumnVector<VT2>::value &&
2290 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2291 ,
typename SVecScalarMultExprTrait<typename SVecDVecMultExprTrait<VT1,VT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2292 , INVALID_TYPE >::Type Type;
2309 template<
typename VT1,
typename VT2,
typename ST >
2314 typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2315 IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2316 IsNumeric<ST>::value
2317 ,
typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2318 , INVALID_TYPE >::Type Type;
2327 template<
typename VT1,
typename ST1,
typename VT2,
typename ST2 >
2328 struct SVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,false>,
DVecScalarMultExpr<VT2,ST2,true> >
2332 typedef typename SelectType< IsSparseVector<VT1>::value && IsColumnVector<VT1>::value &&
2333 IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2334 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2335 ,
typename TSMatScalarMultExprTrait<typename SVecTDVecMultExprTrait<VT1,VT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2336 , INVALID_TYPE >::Type Type;
2353 template<
typename VT1,
typename VT2,
typename ST >
2358 typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
2359 IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2360 IsNumeric<ST>::value
2361 ,
typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,ST>::Type
2362 , INVALID_TYPE >::Type Type;
2371 template<
typename VT1,
typename ST1,
typename VT2,
typename ST2 >
2372 struct TSVecTDVecMultExprTrait< SVecScalarMultExpr<VT1,ST1,true>,
DVecScalarMultExpr<VT2,ST2,true> >
2376 typedef typename SelectType< IsSparseVector<VT1>::value && IsRowVector<VT1>::value &&
2377 IsDenseVector<VT2>::value && IsRowVector<VT2>::value &&
2378 IsNumeric<ST1>::value && IsNumeric<ST2>::value
2379 ,
typename TSVecScalarMultExprTrait<typename TSVecTDVecMultExprTrait<VT1,VT2>::Type,
typename MultTrait<ST1,ST2>::Type>::Type
2380 , INVALID_TYPE >::Type Type;
2397 template<
typename MT,
typename VT,
typename ST >
2402 typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2403 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2404 IsNumeric<ST>::value
2405 ,
typename DVecScalarMultExprTrait<typename DMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2406 , INVALID_TYPE >::Type Type;
2423 template<
typename MT,
typename VT,
typename ST >
2428 typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2429 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2430 IsNumeric<ST>::value
2431 ,
typename DVecScalarMultExprTrait<typename TDMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2432 , INVALID_TYPE >::Type Type;
2449 template<
typename VT,
typename MT,
typename ST >
2454 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2455 IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2456 IsNumeric<ST>::value
2457 ,
typename TDVecScalarMultExprTrait<typename TDVecDMatMultExprTrait<VT,MT>::Type,ST>::Type
2458 , INVALID_TYPE >::Type Type;
2475 template<
typename VT,
typename MT,
typename ST >
2480 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2481 IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2482 IsNumeric<ST>::value
2483 ,
typename TDVecScalarMultExprTrait<typename TDVecTDMatMultExprTrait<VT,MT>::Type,ST>::Type
2484 , INVALID_TYPE >::Type Type;
2501 template<
typename MT,
typename VT,
typename ST >
2506 typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2507 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2508 IsNumeric<ST>::value
2509 ,
typename DVecScalarMultExprTrait<typename SMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2510 , INVALID_TYPE >::Type Type;
2527 template<
typename MT,
typename VT,
typename ST >
2532 typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2533 IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
2534 IsNumeric<ST>::value
2535 ,
typename DVecScalarMultExprTrait<typename TSMatDVecMultExprTrait<MT,VT>::Type,ST>::Type
2536 , INVALID_TYPE >::Type Type;
2553 template<
typename VT,
typename MT,
typename ST >
2558 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2559 IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
2560 IsNumeric<ST>::value
2561 ,
typename TDVecScalarMultExprTrait<typename TDVecSMatMultExprTrait<VT,MT>::Type,ST>::Type
2562 , INVALID_TYPE >::Type Type;
2579 template<
typename VT,
typename MT,
typename ST >
2584 typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value &&
2585 IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
2586 IsNumeric<ST>::value
2587 ,
typename TDVecScalarMultExprTrait<typename TDVecTSMatMultExprTrait<VT,MT>::Type,ST>::Type
2588 , INVALID_TYPE >::Type Type;
2605 template<
typename VT,
typename ST,
bool TF,
bool AF >
2610 typedef typename MultExprTrait< typename SubvectorExprTrait<const VT,AF>::Type, ST >::Type Type;
Pointer difference type of the Blaze library.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type set(T value)
Sets all values in the vector to the given 2-byte integral value.
Definition: Set.h:73
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:98
Constraint on the data type.
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
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:7820
const EnableIf< IsNumeric< T2 >, typename DivExprTrait< T1, T2 >::Type >::Type operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:962
Header file for basic type definitions.
Header file for the SparseVector base class.
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DVecScalarMultExpr.h:180
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecScalarMultExpr.h:302
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
Header file for the IsSparseMatrix type trait.
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecScalarMultExpr.h:518
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecScalarMultExpr.h:271
Header file for the IsSame and IsStrictlySame type traits.
Header file for the IsColumnMajorMatrix type trait.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:259
Header file for the And class template.
Header file for the DenseVector base class.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecScalarMultExpr.h:468
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:158
Header file for the UnderlyingElement type trait.
Header file for the RequiresEvaluation type trait.
MultExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecScalarMultExpr.h:137
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:334
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DVecScalarMultExpr.h:225
Header file for the VecScalarMultExpr base class.
LeftOperand leftOperand() const
Returns the left-hand side dense vector operand.
Definition: DVecScalarMultExpr.h:538
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecScalarMultExpr.h:179
Constraint on the data type.
ValueType value_type
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:210
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:367
Header file for the SparseMatrix base class.
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecScalarMultExpr.h:481
Header file for the DivExprTrait class template.
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecScalarMultExpr.h:582
PointerType pointer
Pointer return type.
Definition: DVecScalarMultExpr.h:211
VT::ConstIterator IteratorType
ConstIterator type of the dense vector expression.
Definition: DVecScalarMultExpr.h:216
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecScalarMultExpr.h:189
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:261
Evaluation of the underlying builtin element type of a given data type.Via this type trait it is poss...
Definition: UnderlyingBuiltin.h:80
DVecScalarMultExpr(const VT &vector, ST scalar)
Constructor for the DVecScalarMultExpr class.
Definition: DVecScalarMultExpr.h:456
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecScalarMultExpr.h:206
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 IsTemporary type trait class.
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the UnderlyingBuiltin type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecScalarMultExpr.h:560
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t index) const
Access to the intrinsic elements of the vector.
Definition: DVecScalarMultExpr.h:495
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
Iterator over the elements of the dense vector.
Definition: DVecScalarMultExpr.h:198
Header file for the DenseMatrix base class.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecScalarMultExpr.h:183
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:356
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecScalarMultExpr.h:178
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:378
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DVecScalarMultExpr.h:192
VT::ResultType RT
Result type of the dense vector expression.
Definition: DVecScalarMultExpr.h:121
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE(A, B)
Data type constraint.In case the two types A and B are not the same (ignoring all cv-qualifiers of bo...
Definition: SameType.h:89
Header file for the IsAligned type trait.
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:642
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:78
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecScalarMultExpr.h:202
Constraint on the data type.
DVecScalarMultExpr< VT, ST, TF > This
Type of this DVecScalarMultExpr instance.
Definition: DVecScalarMultExpr.h:176
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:345
Header file for the SelectType class template.
LeftOperand vector_
Left-hand side dense vector of the multiplication expression.
Definition: DVecScalarMultExpr.h:599
Header file for all forward declarations for expression class templates.
CMathTrait< typename VT::ElementType >::Type length(const DenseVector< VT, TF > &dv)
Calculation of the dense vector length .
Definition: DenseVector.h:516
Header file for the IsDenseMatrix type trait.
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecScalarMultExpr.h:528
Header file for the EnableIf class template.
ReferenceType reference
Reference return type.
Definition: DVecScalarMultExpr.h:212
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecScalarMultExpr.h:260
Header file for the IsPadded type trait.
Header file for the serial shim.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecScalarMultExpr.h:592
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:401
Header file for the IsNumeric type trait.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:600
ElementType ValueType
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:203
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:323
Base class for all vector/scalar multiplication expression templates.The VecScalarMultExpr class serv...
Definition: VecScalarMultExpr.h:66
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the IsSparseVector type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
Utility type for generic codes.
Base template for the MultTrait class.
Definition: MultTrait.h:138
Header file for the division trait.
IteratorType iterator_
Iterator to the current element.
Definition: DVecScalarMultExpr.h:432
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecScalarMultExpr.h:572
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:79
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: DVecScalarMultExpr.h:548
VT::ElementType ET
Element type of the dense vector expression.
Definition: DVecScalarMultExpr.h:123
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecScalarMultExpr.h:413
ElementType * PointerType
Pointer return type.
Definition: DVecScalarMultExpr.h:204
VT::ReturnType RN
Return type of the dense vector expression.
Definition: DVecScalarMultExpr.h:122
Header file for the IsInvertible type trait.
Header file for the IsDenseVector type trait.
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:425
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
ElementType & ReferenceType
Reference return type.
Definition: DVecScalarMultExpr.h:205
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecScalarMultExpr.h:508
IntrinsicType load() const
Access to the intrinsic elements of the vector.
Definition: DVecScalarMultExpr.h:312
Header file for the IsRowMajorMatrix type trait.
Header file for the IsComputation type trait class.
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecScalarMultExpr.h:292
Expression object for dense vector-scalar multiplications.The DVecScalarMultExpr class represents the...
Definition: DVecScalarMultExpr.h:115
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecScalarMultExpr.h:237
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:118
#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
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecScalarMultExpr.h:249
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
Header file for the SubvectorExprTrait class template.
SelectType< useAssign, const ResultType, const DVecScalarMultExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecScalarMultExpr.h:186
const DVecScalarMultExpr< VT, typename VT::ElementType, TF > normalize(const DenseVector< VT, TF > &vec)
Normalization of the dense vector ( ).
Definition: DVecScalarMultExpr.h:1090
Header file for exception macros.
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: DVecScalarMultExpr.h:177
Header file for the IsColumnVector type trait.
IteratorCategory iterator_category
The iterator category.
Definition: DVecScalarMultExpr.h:209
VT::CompositeType CT
Composite type of the dense vector expression.
Definition: DVecScalarMultExpr.h:124
System settings for the inline keywords.
EnableIf< IsDenseVector< VT1 > >::Type smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:189
Header file for the Size type trait.
Evaluation of the resulting expression type of a multiplication.Via this type trait it is possible to...
Definition: MultExprTrait.h:137
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:433
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:81
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
#define BLAZE_CONSTRAINT_MUST_BE_FLOATING_POINT_TYPE(T)
Constraint on the data type.In case the given data type T is not a floating point data type...
Definition: FloatingPoint.h:79
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
DifferenceType difference_type
Difference between two iterators.
Definition: DVecScalarMultExpr.h:213
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecScalarMultExpr.h:389
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecScalarMultExpr.h:281