22 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECSVECCROSSEXPR_H_
23 #define _BLAZE_MATH_EXPRESSIONS_SVECSVECCROSSEXPR_H_
64 template<
typename VT1
72 typedef typename VT1::ResultType
RT1;
73 typedef typename VT2::ResultType
RT2;
74 typedef typename VT1::ReturnType
RN1;
75 typedef typename VT2::ReturnType
RN2;
76 typedef typename VT1::CompositeType
CT1;
77 typedef typename VT2::CompositeType
CT2;
78 typedef typename VT1::ElementType
ET1;
79 typedef typename VT2::ElementType
ET2;
124 enum { vectorizable = 0 };
127 enum { canAlias = 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 >
225 template<
typename VT >
234 (~lhs)[0] = x[1UL]*y[2UL] - x[2UL]*y[1UL];
235 (~lhs)[1] = x[2UL]*y[0UL] - x[0UL]*y[2UL];
236 (~lhs)[2] = x[0UL]*y[1UL] - x[1UL]*y[0UL];
255 template<
typename VT >
285 template<
typename VT >
294 (~lhs)[0] += x[1UL]*y[2UL] - x[2UL]*y[1UL];
295 (~lhs)[1] += x[2UL]*y[0UL] - x[0UL]*y[2UL];
296 (~lhs)[2] += x[0UL]*y[1UL] - x[1UL]*y[0UL];
319 template<
typename VT >
328 (~lhs)[0] -= x[1UL]*y[2UL] - x[2UL]*y[1UL];
329 (~lhs)[1] -= x[2UL]*y[0UL] - x[0UL]*y[2UL];
330 (~lhs)[2] -= x[0UL]*y[1UL] - x[1UL]*y[0UL];
353 template<
typename VT >
362 (~lhs)[0] *= x[1UL]*y[2UL] - x[2UL]*y[1UL];
363 (~lhs)[1] *= x[2UL]*y[0UL] - x[0UL]*y[2UL];
364 (~lhs)[2] *= x[0UL]*y[1UL] - x[1UL]*y[0UL];
418 template<
typename T1
423 if( (~lhs).size() != 3UL || (~rhs).size() != 3UL )
424 throw std::invalid_argument(
"Invalid vector size for cross product" );