| 173 | |
| 174 | public: |
| 175 | ProductOp(const MatrixBase<_Left>& left, const MatrixBase<_Right>& right) |
| 176 | : left_(left.derived()), right_(right.derived()) |
| 177 | { |
| 178 | CUMAT_STATIC_ASSERT((std::is_same< |
| 179 | typename internal::NumTraits<typename internal::traits<_Left>::Scalar>::ElementalType, |
| 180 | typename internal::NumTraits<typename internal::traits<_Right>::Scalar>::ElementalType>::value), |
| 181 | "No implicit casting is allowed in binary operations."); |
| 182 | |
| 183 | if (ColumnsLeft == Dynamic || RowsRight == Dynamic) |
| 184 | { |
| 185 | CUMAT_ASSERT_ARGUMENT((TransposedLeft ? left_.rows() : left_.cols()) == (TransposedRight ? right_.cols() : right_.rows())); |
| 186 | } |
| 187 | CUMAT_STATIC_ASSERT(CUMAT_IMPLIES((ColumnsLeft >= 1 && RowsRight >= 1), |
| 188 | (TransposedLeft ? RowsLeft : ColumnsLeft) == (TransposedRight ? ColumnsRight : RowsRight)), |
| 189 | "matrix sizes not compatible"); |
| 190 | |
| 191 | if (BatchesLeft == Dynamic && BatchesRight == Dynamic) { |
| 192 | CUMAT_ASSERT_ARGUMENT(left.batches() == right.batches()); |
| 193 | } |
| 194 | CUMAT_STATIC_ASSERT(!(BatchesLeft > 1 && BatchesRight > 1) || (BatchesLeft == BatchesRight), "batch sizes don't match"); |
| 195 | } |
| 196 | |
| 197 | const LeftType& left() const { return left_; } |
| 198 | const RightType& right() const { return right_; } |