| 249 | //Cwise-evaluation if this product op is an outer product |
| 250 | template<typename Dummy = Type, typename = std::enable_if<internal::traits<Dummy>::IsOuterProduct> > |
| 251 | CUMAT_STRONG_INLINE __device__ Scalar coeff(Index row, Index col, Index batch, Index index) const |
| 252 | { |
| 253 | //all the following index transformations should be optimized out (compile-time if) |
| 254 | Index r = TransposedOutput ? col : row; |
| 255 | Index c = TransposedOutput ? row : col; |
| 256 | //access left |
| 257 | typedef typename internal::traits<Type>::LeftScalar LeftScalar; |
| 258 | LeftScalar left = left_.coeff( |
| 259 | TransposedLeft ? 0 : r, TransposedLeft ? r : 0, |
| 260 | internal::traits<Type>::BroadcastBatchesLeft ? 0 : batch, |
| 261 | -1); |
| 262 | left = ConjugateLeft ? internal::NumOps<LeftScalar>::conj(left) : left; |
| 263 | //access right |
| 264 | typedef typename internal::traits<Type>::RightScalar RightScalar; |
| 265 | RightScalar right = right_.coeff( |
| 266 | TransposedRight ? c : 0, TransposedRight ? 0 : c, |
| 267 | internal::traits<Type>::BroadcastBatchesRight ? 0 : batch, |
| 268 | -1); |
| 269 | right = ConjugateRight ? internal::NumOps<RightScalar>::conj(right) : right; |
| 270 | //output |
| 271 | Scalar output = internal::ProductElementFunctor<LeftScalar, RightScalar, _OpLeft, _OpRight, _OpOutput>::mult(left, right); |
| 272 | output = ConjugateOutput ? internal::NumOps<Scalar>::conj(output) : output; |
| 273 | return output; |
| 274 | } |
| 275 | }; |
| 276 | |
| 277 | namespace internal |