22 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECDVECCROSSEXPR_H_
23 #define _BLAZE_MATH_EXPRESSIONS_DVECDVECCROSSEXPR_H_
65 template<
typename VT1
73 typedef typename VT1::ResultType
RT1;
74 typedef typename VT2::ResultType
RT2;
75 typedef typename VT1::ReturnType
RN1;
76 typedef typename VT2::ReturnType
RN2;
77 typedef typename VT1::CompositeType
CT1;
78 typedef typename VT2::CompositeType
CT2;
79 typedef typename VT1::ElementType
ET1;
80 typedef typename VT2::ElementType
ET2;
125 enum { vectorizable = 0 };
157 else if( index == 1UL )
158 return lhs_[2UL] * rhs_[0UL] -
lhs_[0UL] * rhs_[2UL];
160 return lhs_[0UL] * rhs_[1UL] -
lhs_[1UL] * rhs_[0UL];
200 template<
typename T >
227 template<
typename VT >
236 (~lhs)[0] = x[1UL]*y[2UL] - x[2UL]*y[1UL];
237 (~lhs)[1] = x[2UL]*y[0UL] - x[0UL]*y[2UL];
238 (~lhs)[2] = x[0UL]*y[1UL] - x[1UL]*y[0UL];
257 template<
typename VT >
287 template<
typename VT >
296 (~lhs)[0] += x[1UL]*y[2UL] - x[2UL]*y[1UL];
297 (~lhs)[1] += x[2UL]*y[0UL] - x[0UL]*y[2UL];
298 (~lhs)[2] += x[0UL]*y[1UL] - x[1UL]*y[0UL];
321 template<
typename VT >
330 (~lhs)[0] -= x[1UL]*y[2UL] - x[2UL]*y[1UL];
331 (~lhs)[1] -= x[2UL]*y[0UL] - x[0UL]*y[2UL];
332 (~lhs)[2] -= x[0UL]*y[1UL] - x[1UL]*y[0UL];
355 template<
typename VT >
364 (~lhs)[0] *= x[1UL]*y[2UL] - x[2UL]*y[1UL];
365 (~lhs)[1] *= x[2UL]*y[0UL] - x[0UL]*y[2UL];
366 (~lhs)[2] *= x[0UL]*y[1UL] - x[1UL]*y[0UL];
420 template<
typename T1
422 inline const DVecDVecCrossExpr<T1,T2>
425 if( (~lhs).
size() != 3UL || (~rhs).
size() != 3UL )
426 throw std::invalid_argument(
"Invalid vector size for cross product" );