22 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATTSMATADDEXPR_H_
23 #define _BLAZE_MATH_EXPRESSIONS_DMATTSMATADDEXPR_H_
71 template<
typename MT1
79 typedef typename MT1::ResultType
RT1;
80 typedef typename MT2::ResultType
RT2;
81 typedef typename MT1::ReturnType
RN1;
82 typedef typename MT2::ReturnType
RN2;
121 enum { vectorizable = 0 };
169 return lhs_.columns();
199 template<
typename T >
202 (
rhs_.canAlias( alias ) );
212 template<
typename T >
214 return (
lhs_.canAlias( alias ) ||
rhs_.canAlias( alias ) );
236 template<
typename MT
268 template<
typename MT
286 const TmpType tmp( rhs );
305 template<
typename MT
337 template<
typename MT
414 template<
typename T1
416 const DMatTSMatAddExpr<T1,T2>
422 throw std::invalid_argument(
"Matrix sizes do not match" );
459 template<
typename T1
461 const DMatTSMatAddExpr<T1,T2>
467 throw std::invalid_argument(
"Matrix sizes do not match" );
495 template<
typename T1
499 inline const typename AddExprTrait< DMatTSMatAddExpr<T1,T2>, T3 >::Type
500 operator+(
const DMatTSMatAddExpr<T1,T2>& lhs,
const DenseMatrix<T3,SO>& rhs )
504 return ( lhs.leftOperand() + (~rhs) ) + lhs.rightOperand();
523 template<
typename T1
527 inline const typename SubExprTrait< DMatTSMatAddExpr<T1,T2>, T3 >::Type
528 operator-(
const DMatTSMatAddExpr<T1,T2>& lhs,
const DenseMatrix<T3,SO>& rhs )
532 return ( lhs.leftOperand() - (~rhs) ) + lhs.rightOperand();
559 template<
typename MT1
561 inline typename RowExprTrait< DMatTSMatAddExpr<MT1,MT2> >::Type
562 row(
const DMatTSMatAddExpr<MT1,MT2>& dm,
size_t index )
566 return row( dm.leftOperand(), index ) +
row( dm.rightOperand(), index );
585 template<
typename MT1
587 inline typename ColumnExprTrait< DMatTSMatAddExpr<MT1,MT2> >::Type
588 column(
const DMatTSMatAddExpr<MT1,MT2>& dm,
size_t index )
592 return column( dm.leftOperand(), index ) +
column( dm.rightOperand(), index );
608 template<
typename MT1,
typename MT2,
typename MT3 >
609 struct DMatDMatAddExprTrait< DMatTSMatAddExpr<MT1,MT2>, MT3 >
614 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
615 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
616 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
617 ,
typename DMatTSMatAddExprTrait< typename DMatDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
618 , INVALID_TYPE >::Type Type;
628 template<
typename MT1,
typename MT2,
typename MT3 >
629 struct DMatTDMatAddExprTrait< DMatTSMatAddExpr<MT1,MT2>, MT3 >
634 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
635 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
636 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
637 ,
typename DMatTSMatAddExprTrait< typename DMatTDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
638 , INVALID_TYPE >::Type Type;
648 template<
typename MT1,
typename MT2,
typename MT3 >
649 struct DMatDMatSubExprTrait< DMatTSMatAddExpr<MT1,MT2>, MT3 >
654 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
655 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
656 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
657 ,
typename DMatTSMatAddExprTrait< typename DMatDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
658 , INVALID_TYPE >::Type Type;
668 template<
typename MT1,
typename MT2,
typename MT3 >
669 struct DMatTDMatSubExprTrait< DMatTSMatAddExpr<MT1,MT2>, MT3 >
674 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
675 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
676 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
677 ,
typename DMatTSMatAddExprTrait< typename DMatTDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
678 , INVALID_TYPE >::Type Type;
688 template<
typename MT1,
typename MT2 >
689 struct RowExprTrait< DMatTSMatAddExpr<MT1,MT2> >
693 typedef typename AddExprTrait< typename RowExprTrait<const MT1>::Type
694 ,
typename RowExprTrait<const MT2>::Type >::Type Type;
703 template<
typename MT1,
typename MT2 >
704 struct ColumnExprTrait< DMatTSMatAddExpr<MT1,MT2> >
708 typedef typename AddExprTrait< typename ColumnExprTrait<const MT1>::Type
709 ,
typename ColumnExprTrait<const MT2>::Type >::Type Type;