22 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECDVECCROSSEXPR_H_
23 #define _BLAZE_MATH_EXPRESSIONS_SVECDVECCROSSEXPR_H_
67 template<
typename VT1
69 class SVecDVecCrossExpr :
public DenseVector< SVecDVecCrossExpr<VT1,VT2>, false >
75 typedef typename VT1::ResultType
RT1;
76 typedef typename VT2::ResultType
RT2;
77 typedef typename VT1::ReturnType
RN1;
78 typedef typename VT2::ReturnType
RN2;
79 typedef typename VT1::CompositeType
CT1;
80 typedef typename VT2::CompositeType
CT2;
81 typedef typename VT1::ElementType
ET1;
82 typedef typename VT2::ElementType
ET2;
127 enum { vectorizable = 0 };
156 else if( index == 1UL )
157 return lhs_[2UL] * rhs_[0UL] -
lhs_[0UL] * rhs_[2UL];
159 return lhs_[0UL] * rhs_[1UL] -
lhs_[1UL] * rhs_[0UL];
199 template<
typename T >
201 return (
lhs_.canAlias( alias ) ) ||
212 template<
typename T >
214 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
238 template<
typename VT >
249 (~lhs)[0] = x[1UL]*y[2UL] - x[2UL]*y[1UL];
250 (~lhs)[1] = x[2UL]*y[0UL] - x[0UL]*y[2UL];
251 (~lhs)[2] = x[0UL]*y[1UL] - x[1UL]*y[0UL];
270 template<
typename VT >
302 template<
typename VT >
313 (~lhs)[0] += x[1UL]*y[2UL] - x[2UL]*y[1UL];
314 (~lhs)[1] += x[2UL]*y[0UL] - x[0UL]*y[2UL];
315 (~lhs)[2] += x[0UL]*y[1UL] - x[1UL]*y[0UL];
338 template<
typename VT >
349 (~lhs)[0] -= x[1UL]*y[2UL] - x[2UL]*y[1UL];
350 (~lhs)[1] -= x[2UL]*y[0UL] - x[0UL]*y[2UL];
351 (~lhs)[2] -= x[0UL]*y[1UL] - x[1UL]*y[0UL];
374 template<
typename VT >
385 (~lhs)[0] *= x[1UL]*y[2UL] - x[2UL]*y[1UL];
386 (~lhs)[1] *= x[2UL]*y[0UL] - x[0UL]*y[2UL];
387 (~lhs)[2] *= x[0UL]*y[1UL] - x[1UL]*y[0UL];
443 template<
typename T1
445 inline const SVecDVecCrossExpr<T1,T2>
450 if( (~lhs).size() != 3UL || (~rhs).size() != 3UL )
451 throw std::invalid_argument(
"Invalid vector size for cross product" );