22 #ifndef _BLAZE_MATH_EXPRESSIONS_TDMATSMATADDEXPR_H_
23 #define _BLAZE_MATH_EXPRESSIONS_TDMATSMATADDEXPR_H_
67 template<
typename MT1
69 class TDMatSMatAddExpr :
public DenseMatrix< TDMatSMatAddExpr<MT1,MT2>, false >
75 typedef typename MT1::ResultType
RT1;
76 typedef typename MT2::ResultType
RT2;
77 typedef typename MT1::ReturnType
RN1;
78 typedef typename MT2::ReturnType
RN2;
117 enum { vectorizable = 0 };
165 return lhs_.columns();
195 template<
typename T >
198 (
rhs_.canAlias( alias ) );
208 template<
typename T >
210 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
232 template<
typename MT
245 assign ( ~lhs, rhs.lhs_ );
264 template<
typename MT
282 const TmpType tmp( rhs );
301 template<
typename MT
333 template<
typename MT
411 template<
typename T1
413 const TDMatSMatAddExpr<T1,T2>
419 throw std::invalid_argument(
"Matrix sizes do not match" );
457 template<
typename T1
459 const TDMatSMatAddExpr<T1,T2>
465 throw std::invalid_argument(
"Matrix sizes do not match" );
493 template<
typename T1
497 inline const typename AddExprTrait< TDMatSMatAddExpr<T1,T2>, T3 >::Type
498 operator+(
const TDMatSMatAddExpr<T1,T2>& lhs,
const DenseMatrix<T3,SO>& rhs )
502 return ( lhs.leftOperand() + (~rhs) ) + lhs.rightOperand();
521 template<
typename T1
525 inline const typename SubExprTrait< TDMatSMatAddExpr<T1,T2>, T3 >::Type
526 operator-(
const TDMatSMatAddExpr<T1,T2>& lhs,
const DenseMatrix<T3,SO>& rhs )
530 return ( lhs.leftOperand() - (~rhs) ) + lhs.rightOperand();
557 template<
typename MT1
559 inline typename RowExprTrait< TDMatSMatAddExpr<MT1,MT2> >::Type
560 row(
const TDMatSMatAddExpr<MT1,MT2>& dm,
size_t index )
564 return row( dm.leftOperand(), index ) +
row( dm.rightOperand(), index );
583 template<
typename MT1
585 inline typename ColumnExprTrait< TDMatSMatAddExpr<MT1,MT2> >::Type
586 column(
const TDMatSMatAddExpr<MT1,MT2>& dm,
size_t index )
590 return column( dm.leftOperand(), index ) +
column( dm.rightOperand(), index );
606 template<
typename MT1,
typename MT2,
typename MT3 >
607 struct DMatDMatAddExprTrait< TDMatSMatAddExpr<MT1,MT2>, MT3 >
612 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
613 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
614 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
615 ,
typename DMatSMatAddExprTrait< typename TDMatDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
616 , INVALID_TYPE >::Type Type;
626 template<
typename MT1,
typename MT2,
typename MT3 >
627 struct DMatTDMatAddExprTrait< TDMatSMatAddExpr<MT1,MT2>, MT3 >
632 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
633 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
634 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
635 ,
typename TDMatSMatAddExprTrait< typename TDMatTDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
636 , INVALID_TYPE >::Type Type;
646 template<
typename MT1,
typename MT2,
typename MT3 >
647 struct DMatDMatSubExprTrait< TDMatSMatAddExpr<MT1,MT2>, MT3 >
652 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
653 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
654 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
655 ,
typename DMatSMatAddExprTrait< typename TDMatDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
656 , INVALID_TYPE >::Type Type;
666 template<
typename MT1,
typename MT2,
typename MT3 >
667 struct DMatTDMatSubExprTrait< TDMatSMatAddExpr<MT1,MT2>, MT3 >
672 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
673 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
674 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
675 ,
typename TDMatSMatAddExprTrait< typename TDMatTDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
676 , INVALID_TYPE >::Type Type;
686 template<
typename MT1,
typename MT2 >
687 struct RowExprTrait< TDMatSMatAddExpr<MT1,MT2> >
691 typedef typename AddExprTrait< typename RowExprTrait<const MT1>::Type
692 ,
typename RowExprTrait<const MT2>::Type >::Type Type;
701 template<
typename MT1,
typename MT2 >
702 struct ColumnExprTrait< TDMatSMatAddExpr<MT1,MT2> >
706 typedef typename AddExprTrait< typename ColumnExprTrait<const MT1>::Type
707 ,
typename ColumnExprTrait<const MT2>::Type >::Type Type;