22 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATSMATADDEXPR_H_
23 #define _BLAZE_MATH_EXPRESSIONS_DMATSMATADDEXPR_H_
71 template<
typename MT1
80 typedef typename MT1::ResultType
RT1;
81 typedef typename MT2::ResultType
RT2;
82 typedef typename MT1::ReturnType
RN1;
83 typedef typename MT2::ReturnType
RN2;
122 enum { vectorizable = 0 };
170 return lhs_.columns();
200 template<
typename T >
203 (
rhs_.canAlias( alias ) );
213 template<
typename T >
215 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
237 template<
typename MT
269 template<
typename MT
287 const TmpType tmp( rhs );
305 template<
typename MT
336 template<
typename MT
408 template<
typename T1
411 inline const DMatSMatAddExpr<T1,T2,SO>
417 throw std::invalid_argument(
"Matrix sizes do not match" );
450 template<
typename T1
453 inline const DMatSMatAddExpr<T2,T1,SO>
459 throw std::invalid_argument(
"Matrix sizes do not match" );
487 template<
typename T1
492 inline const typename AddExprTrait< DMatSMatAddExpr<T1,T2,SO1>, T3 >::Type
493 operator+(
const DMatSMatAddExpr<T1,T2,SO1>& lhs,
const DenseMatrix<T3,SO2>& rhs )
497 return ( lhs.leftOperand() + (~rhs) ) + lhs.rightOperand();
516 template<
typename T1
521 inline const typename SubExprTrait< DMatSMatAddExpr<T1,T2,SO1>, T3 >::Type
522 operator-(
const DMatSMatAddExpr<T1,T2,SO1>& lhs,
const DenseMatrix<T3,SO2>& rhs )
526 return ( lhs.leftOperand() - (~rhs) ) + lhs.rightOperand();
542 template<
typename MT1,
typename MT2,
typename MT3 >
543 struct DMatDMatAddExprTrait< DMatSMatAddExpr<MT1,MT2,false>, MT3 >
548 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
549 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
550 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
551 ,
typename DMatSMatAddExprTrait< typename DMatDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
552 , INVALID_TYPE >::Type Type;
562 template<
typename MT1,
typename MT2,
typename MT3 >
563 struct DMatTDMatAddExprTrait< DMatSMatAddExpr<MT1,MT2,false>, MT3 >
568 typedef typename SelectType< IsDenseMatrix <MT1>::value && IsRowMajorMatrix<MT1>::value &&
569 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
570 IsDenseMatrix <MT3>::value && IsColumnMajorMatrix<MT3>::value
571 ,
typename DMatSMatAddExprTrait< typename DMatTDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
572 , INVALID_TYPE >::Type Type;
582 template<
typename MT1,
typename MT2,
typename MT3 >
583 struct TDMatDMatAddExprTrait< DMatSMatAddExpr<MT1,MT2,true>, MT3 >
588 typedef typename SelectType< IsDenseMatrix <MT1>::value && IsColumnMajorMatrix<MT1>::value &&
589 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
590 IsDenseMatrix <MT3>::value && IsRowMajorMatrix<MT3>::value
591 ,
typename DMatTSMatAddExprTrait< typename TDMatDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
592 , INVALID_TYPE >::Type Type;
602 template<
typename MT1,
typename MT2,
typename MT3 >
603 struct TDMatTDMatAddExprTrait< DMatSMatAddExpr<MT1,MT2,true>, MT3 >
608 typedef typename SelectType< IsDenseMatrix <MT1>::value && IsColumnMajorMatrix<MT1>::value &&
609 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
610 IsDenseMatrix <MT3>::value && IsColumnMajorMatrix<MT3>::value
611 ,
typename TDMatTSMatAddExprTrait< typename TDMatTDMatAddExprTrait<MT1,MT3>::Type, MT2 >::Type
612 , INVALID_TYPE >::Type Type;
622 template<
typename MT1,
typename MT2,
typename MT3 >
623 struct DMatDMatSubExprTrait< DMatSMatAddExpr<MT1,MT2,false>, MT3 >
628 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
629 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
630 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
631 ,
typename DMatSMatAddExprTrait< typename DMatDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
632 , INVALID_TYPE >::Type Type;
642 template<
typename MT1,
typename MT2,
typename MT3 >
643 struct DMatTDMatSubExprTrait< DMatSMatAddExpr<MT1,MT2,false>, MT3 >
648 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsRowMajorMatrix<MT1>::value &&
649 IsSparseMatrix<MT2>::value && IsRowMajorMatrix<MT2>::value &&
650 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
651 ,
typename DMatSMatAddExprTrait< typename DMatTDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
652 , INVALID_TYPE >::Type Type;
662 template<
typename MT1,
typename MT2,
typename MT3 >
663 struct TDMatDMatSubExprTrait< DMatSMatAddExpr<MT1,MT2,true>, MT3 >
668 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
669 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
670 IsDenseMatrix<MT3>::value && IsRowMajorMatrix<MT3>::value
671 ,
typename DMatTSMatAddExprTrait< typename TDMatDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
672 , INVALID_TYPE >::Type Type;
682 template<
typename MT1,
typename MT2,
typename MT3 >
683 struct TDMatTDMatSubExprTrait< DMatSMatAddExpr<MT1,MT2,true>, MT3 >
688 typedef typename SelectType< IsDenseMatrix<MT1>::value && IsColumnMajorMatrix<MT1>::value &&
689 IsSparseMatrix<MT2>::value && IsColumnMajorMatrix<MT2>::value &&
690 IsDenseMatrix<MT3>::value && IsColumnMajorMatrix<MT3>::value
691 ,
typename TDMatTSMatAddExprTrait< typename TDMatTDMatSubExprTrait<MT1,MT3>::Type, MT2 >::Type
692 , INVALID_TYPE >::Type Type;
702 template<
typename MT1,
typename MT2,
bool SO >
703 struct RowExprTrait< DMatSMatAddExpr<MT1,MT2,SO> >
707 typedef typename AddExprTrait< typename RowExprTrait<const MT1>::Type
708 ,
typename RowExprTrait<const MT2>::Type >::Type Type;
717 template<
typename MT1,
typename MT2,
bool SO >
718 struct ColumnExprTrait< DMatSMatAddExpr<MT1,MT2,SO> >
722 typedef typename AddExprTrait< typename ColumnExprTrait<const MT1>::Type
723 ,
typename ColumnExprTrait<const MT2>::Type >::Type Type;