35 #ifndef _BLAZE_MATH_EXPRESSIONS_TSMATDMATMULTEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_TSMATDMATMULTEXPR_H_ 143 template<
typename MT1
149 class TSMatDMatMultExpr :
public DenseMatrix< TSMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF>, true >
150 ,
private MatMatMultExpr
151 ,
private Computation
176 SYM = ( SF && !( HF || LF || UF ) ),
177 HERM = ( HF && !( LF || UF ) ),
178 LOW = ( LF || ( ( SF || HF ) && UF ) ),
179 UPP = ( UF || ( ( SF || HF ) && LF ) )
190 template<
typename T1,
typename T2,
typename T3 >
191 struct CanExploitSymmetry {
203 template<
typename T1,
typename T2,
typename T3 >
204 struct IsEvaluationRequired {
205 enum :
bool { value = ( evaluateLeft || evaluateRight ) &&
206 !CanExploitSymmetry<T1,T2,T3>::value };
217 template<
typename T1,
typename T2,
typename T3 >
218 struct UseOptimizedKernel {
232 template<
typename T1,
typename T2,
typename T3 >
233 struct UseDefaultKernel {
234 enum :
bool { value = !UseOptimizedKernel<T1,T2,T3>::value };
254 ,
Noop > > > > ForwardFunctor;
285 enum :
bool { simdEnabled =
false };
288 enum :
bool { smpAssignable = !evaluateLeft && MT1::smpAssignable &&
289 !evaluateRight && MT2::smpAssignable };
339 :(
lhs_.columns() ) ) );
343 const size_t n(
end - begin );
361 inline ReturnType
at(
size_t i,
size_t j )
const {
362 if( i >=
lhs_.rows() ) {
365 if( j >=
rhs_.columns() ) {
377 inline size_t rows() const noexcept {
388 return rhs_.columns();
418 template<
typename T >
419 inline bool canAlias(
const T* alias )
const noexcept {
420 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
430 template<
typename T >
431 inline bool isAliased(
const T* alias )
const noexcept {
432 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
442 return rhs_.isAligned();
475 template<
typename MT
485 LT A(
serial( rhs.lhs_ ) );
486 RT B(
serial( rhs.rhs_ ) );
495 TSMatDMatMultExpr::selectAssignKernel( ~lhs, A, B );
511 template<
typename MT3
514 static inline void selectAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
516 const size_t size( C.rows() * C.columns() );
520 selectSmallAssignKernel( C, A, B );
522 selectLargeAssignKernel( C, A, B );
542 template<
typename MT3
545 static inline void selectDefaultAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
553 for(
size_t i=0UL; i<A.columns(); ++i )
555 const ConstIterator
end( A.end(i) );
556 ConstIterator element( A.begin(i) );
558 for( ; element!=
end; ++element ) {
559 C(element->index(),i) = element->value() * B(i,i);
567 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
569 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
571 for(
size_t i=0UL; i<A.columns(); ++i )
573 const ConstIterator
end( A.end(i) );
574 ConstIterator element( A.begin(i) );
576 for( ; element!=
end; ++element )
578 const size_t i1( element->index() );
581 ?( ( SYM || HERM || UPP )
584 :( SYM || HERM || UPP ?
max(i1,jj) : jj ) );
589 :( LOW ?
min(i1+1UL,jpos) : jpos ) );
594 for(
size_t j=jbegin; j<jend; ++j ) {
596 C(i1,j) = element->value() * B(i,j);
598 C(i1,j) += element->value() * B(i,j);
606 for(
size_t j=0UL; j<B.columns(); ++j ) {
607 for(
size_t i=j+1UL; i<A.rows(); ++i ) {
608 C(i,j) = HERM ?
conj( C(j,i) ) : C(j,i);
630 template<
typename MT3
634 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
636 selectDefaultAssignKernel( C, A, B );
656 template<
typename MT3
660 selectSmallAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
668 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
670 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
672 for(
size_t i=0UL; i<A.columns(); ++i )
674 const ConstIterator
end( A.end(i) );
675 ConstIterator element( A.begin(i) );
677 const size_t nonzeros( A.nonZeros(i) );
678 const size_t kpos( nonzeros &
size_t(-4) );
681 for(
size_t k=0UL; k<kpos; k+=4UL )
683 const size_t i1( element->index() );
684 const ET1 v1( element->value() );
686 const size_t i2( element->index() );
687 const ET1 v2( element->value() );
689 const size_t i3( element->index() );
690 const ET1 v3( element->value() );
692 const size_t i4( element->index() );
693 const ET1 v4( element->value() );
699 ?( ( SYM || HERM || UPP )
702 :( SYM || HERM || UPP ?
max(i1,jj) : jj ) );
707 :( LOW ?
min(i4+1UL,jpos) : jpos ) );
712 for(
size_t j=jbegin; j<jend; ++j ) {
713 C(i1,j) += v1 * B(i,j);
714 C(i2,j) += v2 * B(i,j);
715 C(i3,j) += v3 * B(i,j);
716 C(i4,j) += v4 * B(i,j);
720 for( ; element!=
end; ++element )
722 const size_t i1( element->index() );
725 ?( ( SYM || HERM || UPP )
728 :( SYM || HERM || UPP ?
max(i1,jj) : jj ) );
733 :( LOW ?
min(i1+1UL,jpos) : jpos ) );
738 for(
size_t j=jbegin; j<jend; ++j ) {
739 C(i1,j) += element->value() * B(i,j);
746 for(
size_t j=0UL; j<B.columns(); ++j ) {
747 for(
size_t i=j+1UL; i<A.rows(); ++i ) {
748 C(i,j) = HERM ?
conj( C(j,i) ) : C(j,i);
770 template<
typename MT3
774 selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
776 selectDefaultAssignKernel( C, A, B );
796 template<
typename MT3
800 selectLargeAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
804 const ForwardFunctor fwd;
807 assign( C, fwd( tmp * B ) );
825 template<
typename MT
844 const ForwardFunctor fwd;
846 const TmpType tmp(
serial( rhs ) );
847 assign( ~lhs, fwd( tmp ) );
867 template<
typename MT
879 const ForwardFunctor fwd;
881 assign( ~lhs, fwd(
trans( rhs.lhs_ ) * rhs.rhs_ ) );
899 template<
typename MT
909 LT A(
serial( rhs.lhs_ ) );
910 RT B(
serial( rhs.rhs_ ) );
919 TSMatDMatMultExpr::selectAddAssignKernel( ~lhs, A, B );
935 template<
typename MT3
938 static inline void selectAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
940 const size_t size( C.rows() * C.columns() );
944 selectSmallAddAssignKernel( C, A, B );
946 selectLargeAddAssignKernel( C, A, B );
966 template<
typename MT3
969 static inline void selectDefaultAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
975 for(
size_t i=0UL; i<A.columns(); ++i )
977 const ConstIterator
end( A.end(i) );
978 ConstIterator element( A.begin(i) );
980 for( ; element!=
end; ++element ) {
981 C(element->index(),i) += element->value() * B(i,i);
989 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
991 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
993 for(
size_t i=0UL; i<A.columns(); ++i )
995 const ConstIterator
end( A.end(i) );
996 ConstIterator element( A.begin(i) );
998 for( ; element!=
end; ++element )
1000 const size_t i1( element->index() );
1006 :( UPP ?
max(i1,jj) : jj ) );
1011 :( LOW ?
min(i1+1UL,jpos) : jpos ) );
1013 if( jbegin >= jend )
1016 for(
size_t j=jbegin; j<jend; ++j ) {
1017 C(i1,j) += element->value() * B(i,j);
1041 template<
typename MT3
1045 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1047 selectDefaultAddAssignKernel( C, A, B );
1067 template<
typename MT3
1071 selectSmallAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1077 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1079 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
1081 for(
size_t i=0UL; i<A.columns(); ++i )
1083 const ConstIterator
end( A.end(i) );
1084 ConstIterator element( A.begin(i) );
1086 const size_t nonzeros( A.nonZeros(i) );
1087 const size_t kpos( nonzeros &
size_t(-4) );
1090 for(
size_t k=0UL; k<kpos; k+=4UL )
1092 const size_t i1( element->index() );
1093 const ET1 v1( element->value() );
1095 const size_t i2( element->index() );
1096 const ET1 v2( element->value() );
1098 const size_t i3( element->index() );
1099 const ET1 v3( element->value() );
1101 const size_t i4( element->index() );
1102 const ET1 v4( element->value() );
1111 :( UPP ?
max(i1,jj) : jj ) );
1116 :( LOW ?
min(i4+1UL,jpos) : jpos ) );
1118 if( jbegin >= jend )
1121 for(
size_t j=jbegin; j<jend; ++j ) {
1122 C(i1,j) += v1 * B(i,j);
1123 C(i2,j) += v2 * B(i,j);
1124 C(i3,j) += v3 * B(i,j);
1125 C(i4,j) += v4 * B(i,j);
1129 for( ; element!=
end; ++element )
1131 const size_t i1( element->index() );
1137 :( UPP ?
max(i1,jj) : jj ) );
1142 :( LOW ?
min(i1+1UL,jpos) : jpos ) );
1144 if( jbegin >= jend )
1147 for(
size_t j=jbegin; j<jend; ++j ) {
1148 C(i1,j) += element->value() * B(i,j);
1171 template<
typename MT3
1175 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1177 selectDefaultAddAssignKernel( C, A, B );
1197 template<
typename MT3
1201 selectLargeAddAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1205 const ForwardFunctor fwd;
1208 addAssign( C, fwd( tmp * B ) );
1228 template<
typename MT
1240 const ForwardFunctor fwd;
1242 addAssign( ~lhs, fwd(
trans( rhs.lhs_ ) * rhs.rhs_ ) );
1264 template<
typename MT
1274 LT A(
serial( rhs.lhs_ ) );
1275 RT B(
serial( rhs.rhs_ ) );
1284 TSMatDMatMultExpr::selectSubAssignKernel( ~lhs, A, B );
1300 template<
typename MT3
1303 static inline void selectSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1305 const size_t size( C.rows() * C.columns() );
1309 selectSmallSubAssignKernel( C, A, B );
1311 selectLargeSubAssignKernel( C, A, B );
1331 template<
typename MT3
1334 static inline void selectDefaultSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1340 for(
size_t i=0UL; i<A.columns(); ++i )
1342 const ConstIterator
end( A.end(i) );
1343 ConstIterator element( A.begin(i) );
1345 for( ; element!=
end; ++element ) {
1346 C(element->index(),i) -= element->value() * B(i,i);
1354 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1356 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
1358 for(
size_t i=0UL; i<A.columns(); ++i )
1360 const ConstIterator
end( A.end(i) );
1361 ConstIterator element( A.begin(i) );
1363 for( ; element!=
end; ++element )
1365 const size_t i1( element->index() );
1371 :( UPP ?
max(i1,jj) : jj ) );
1376 :( LOW ?
min(i1+1UL,jpos) : jpos ) );
1378 if( jbegin >= jend )
1381 for(
size_t j=jbegin; j<jend; ++j ) {
1382 C(i1,j) -= element->value() * B(i,j);
1406 template<
typename MT3
1410 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1412 selectDefaultSubAssignKernel( C, A, B );
1432 template<
typename MT3
1436 selectSmallSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1442 for(
size_t jj=0UL; jj<B.columns(); jj+=block )
1444 const size_t jpos( ( jj+block > B.columns() )?( B.columns() ):( jj+block ) );
1446 for(
size_t i=0UL; i<A.columns(); ++i )
1448 const ConstIterator
end( A.end(i) );
1449 ConstIterator element( A.begin(i) );
1451 const size_t nonzeros( A.nonZeros(i) );
1452 const size_t kpos( nonzeros &
size_t(-4) );
1455 for(
size_t k=0UL; k<kpos; k+=4UL )
1457 const size_t i1( element->index() );
1458 const ET1 v1( element->value() );
1460 const size_t i2( element->index() );
1461 const ET1 v2( element->value() );
1463 const size_t i3( element->index() );
1464 const ET1 v3( element->value() );
1466 const size_t i4( element->index() );
1467 const ET1 v4( element->value() );
1476 :( UPP ?
max(i1,jj) : jj ) );
1481 :( LOW ?
min(i4+1UL,jpos) : jpos ) );
1483 if( jbegin >= jend )
1486 for(
size_t j=jbegin; j<jend; ++j ) {
1487 C(i1,j) -= v1 * B(i,j);
1488 C(i2,j) -= v2 * B(i,j);
1489 C(i3,j) -= v3 * B(i,j);
1490 C(i4,j) -= v4 * B(i,j);
1494 for( ; element!=
end; ++element )
1496 const size_t i1( element->index() );
1502 :( UPP ?
max(i1,jj) : jj ) );
1507 :( LOW ?
min(i1+1UL,jpos) : jpos ) );
1509 if( jbegin >= jend )
1512 for(
size_t j=jbegin; j<jend; ++j ) {
1513 C(i1,j) -= element->value() * B(i,j);
1536 template<
typename MT3
1540 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1542 selectDefaultSubAssignKernel( C, A, B );
1562 template<
typename MT3
1566 selectLargeSubAssignKernel( MT3& C,
const MT4& A,
const MT5& B )
1570 const ForwardFunctor fwd;
1573 subAssign( C, fwd( tmp * B ) );
1593 template<
typename MT
1605 const ForwardFunctor fwd;
1607 subAssign( ~lhs, fwd(
trans( rhs.lhs_ ) * rhs.rhs_ ) );
1640 template<
typename MT
1681 template<
typename MT
1700 const ForwardFunctor fwd;
1702 const TmpType tmp( rhs );
1723 template<
typename MT
1733 const ForwardFunctor fwd;
1756 template<
typename MT
1796 template<
typename MT
1806 const ForwardFunctor fwd;
1833 template<
typename MT
1873 template<
typename MT
1883 const ForwardFunctor fwd;
1954 template<
typename T1
2004 template<
typename MT1
2051 template<
typename MT1
2098 template<
typename MT1
2145 template<
typename MT1
2192 template<
typename MT1
2223 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2224 struct Rows< TSMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF> > :
public Rows<MT1>
2240 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2241 struct Columns< TSMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF> > :
public Columns<MT2>
2257 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2258 struct IsAligned< TSMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2275 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2276 struct IsSymmetric< TSMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2279 , IsBuiltin< ElementType_< TSMatDMatMultExpr<MT1,MT2,false,true,false,false> > > >
2280 , And< Bool<LF>, Bool<UF> > >::value >
2296 template<
typename MT1,
typename MT2,
bool SF,
bool LF,
bool UF >
2297 struct IsHermitian< TSMatDMatMultExpr<MT1,MT2,SF,true,LF,UF> >
2314 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2315 struct IsLower< TSMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2317 , And< IsLower<MT1>, IsLower<MT2> >
2318 , And< Or< Bool<SF>, Bool<HF> >
2319 , IsUpper<MT1>, IsUpper<MT2> > >::value >
2335 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2336 struct IsUniLower< TSMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2337 :
public BoolConstant< Or< And< IsUniLower<MT1>, IsUniLower<MT2> >
2338 , And< Or< Bool<SF>, Bool<HF> >
2339 , IsUniUpper<MT1>, IsUniUpper<MT2> > >::value >
2355 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2357 :
public BoolConstant< Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
2358 , And< IsStrictlyLower<MT2>, IsLower<MT1> >
2359 , And< Or< Bool<SF>, Bool<HF> >
2360 , Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
2361 , And< IsStrictlyUpper<MT2>, IsUpper<MT1> > > > >::value >
2377 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2378 struct IsUpper< TSMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2380 , And< IsUpper<MT1>, IsUpper<MT2> >
2381 , And< Or< Bool<SF>, Bool<HF> >
2382 , IsLower<MT1>, IsLower<MT2> > >::value >
2398 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2399 struct IsUniUpper< TSMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2400 :
public BoolConstant< Or< And< IsUniUpper<MT1>, IsUniUpper<MT2> >
2401 , And< Or< Bool<SF>, Bool<HF> >
2402 , IsUniLower<MT1>, IsUniLower<MT2> > >::value >
2418 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2420 :
public BoolConstant< Or< And< IsStrictlyUpper<MT1>, IsUpper<MT2> >
2421 , And< IsStrictlyUpper<MT2>, IsUpper<MT1> >
2422 , And< Or< Bool<SF>, Bool<HF> >
2423 , Or< And< IsStrictlyLower<MT1>, IsLower<MT2> >
2424 , And< IsStrictlyLower<MT2>, IsLower<MT1> > > > >::value >
2440 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF,
typename VT >
2458 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF,
typename VT >
2476 template<
typename VT,
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2494 template<
typename VT,
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2512 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2529 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2546 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2563 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2580 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2597 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF,
bool AF >
2612 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
2613 struct RowExprTrait< TSMatDMatMultExpr<MT1,MT2,SF,HF,LF,UF> >
2626 template<
typename MT1,
typename MT2,
bool SF,
bool HF,
bool LF,
bool UF >
typename SubmatrixExprTrait< MT, AF >::Type SubmatrixExprTrait_
Auxiliary alias declaration for the SubmatrixExprTrait type trait.The SubmatrixExprTrait_ alias decla...
Definition: SubmatrixExprTrait.h:134
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: TSMatDMatMultExpr.h:265
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Evaluation of the expression type of a dense matrix declherm operation.Via this type trait it is poss...
Definition: TDMatDeclHermExprTrait.h:75
If_< IsExpression< MT1 >, const MT1, const MT1 &> LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatDMatMultExpr.h:271
Compile time check for row vector types.This type trait tests whether or not the given template argum...
Definition: IsRowVector.h:80
const DMatForEachExpr< MT, Conj, SO > conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatForEachExpr.h:1214
Header file for auxiliary alias declarations.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:72
Evaluation of the expression type of a dense matrix decllow operation.Via this type trait it is possi...
Definition: TDMatDeclLowExprTrait.h:75
Header file for mathematical functions.
constexpr bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: TSMatDMatMultExpr.h:441
Header file for the Rows type trait.
Header file for the IsUniUpper type trait.
Compile time check for triangular matrix types.This type trait tests whether or not the given templat...
Definition: IsTriangular.h:87
Header file for basic type definitions.
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the IsSparseMatrix type trait.
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: TSMatDMatMultExpr.h:313
Header file for the serial shim.
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition: TSMatDMatMultExpr.h:387
Header file for the IsDiagonal type trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:261
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
Header file for the ColumnExprTrait class template.
Header file for the DeclUpp functor.
LeftOperand lhs_
Left-hand side sparse matrix of the multiplication expression.
Definition: TSMatDMatMultExpr.h:458
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:194
Header file for the IsColumnMajorMatrix type trait.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
Header file for the TSVecTSMatMultExprTrait class template.
ResultType_< MT2 > RT2
Result type of the right-hand side dense matrix expression.
Definition: TSMatDMatMultExpr.h:156
Header file for the IsRowVector type trait.
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
ElementType_< RT2 > ET2
Element type of the right-hand side sparse matrix expression.
Definition: TSMatDMatMultExpr.h:158
Header file for the And class template.
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1755
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
IfTrue_< evaluateLeft, const RT1, CT1 > LT
Type for the assignment of the left-hand side sparse matrix operand.
Definition: TSMatDMatMultExpr.h:277
Evaluation of the expression type of a sparse vector/transpose dense matrix multiplication.Via this type trait it is possible to evaluate the resulting expression type of a sparse vector/transpose dense matrix multiplication. Given the transpose sparse vector type VT and the column-major dense matrix type MT, the nested type Type corresponds to the resulting expression type. In case either VT is not a transpose sparse vector type or MT is not a column-major dense matrix type, the resulting data type Type is set to INVALID_TYPE.
Definition: TSVecTDMatMultExprTrait.h:81
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
CompositeType_< MT2 > CT2
Composite type of the right-hand side dense matrix expression.
Definition: TSMatDMatMultExpr.h:160
Flag for lower matrices.
Definition: TSMatDMatMultExpr.h:178
LeftOperand leftOperand() const noexcept
Returns the left-hand side transpose sparse matrix operand.
Definition: TSMatDMatMultExpr.h:397
Header file for the Computation base class.
Header file for the MatMatMultExpr base class.
DisableIf_< IsSymmetric< MT >, const DMatDeclSymExpr< MT, SO > > declsym(const DenseMatrix< MT, SO > &dm)
Declares the given non-symmetric dense matrix expression dm as symmetric.
Definition: DMatDeclSymExpr.h:841
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:88
Constraints on the storage order of matrix types.
Header file for the TDMatDeclDiagExprTrait class template.
Header file for the RequiresEvaluation type trait.
System settings for performance optimizations.
CompositeType_< MT1 > CT1
Composite type of the left-hand side sparse matrix expression.
Definition: TSMatDMatMultExpr.h:159
const ElementType ReturnType
Return type for expression template evaluations.
Definition: TSMatDMatMultExpr.h:267
Header file for the IsUniLower type trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
const ElementType_< MT > max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1802
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition: TSMatDMatMultExpr.h:377
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:71
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:119
Constraint on the data type.
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
RightOperand rhs_
Right-hand side dense matrix of the multiplication expression.
Definition: TSMatDMatMultExpr.h:459
MultTrait_< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition: TSMatDMatMultExpr.h:263
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Constraint on the data type.
Constraint on the data type.
typename MultExprTrait< T1, T2 >::Type MultExprTrait_
Auxiliary alias declaration for the MultExprTrait class template.The MultExprTrait_ alias declaration...
Definition: MultExprTrait.h:344
Header file for the MultExprTrait class template.
DisableIf_< IsHermitian< MT >, const DMatDeclHermExpr< MT, SO > > declherm(const DenseMatrix< MT, SO > &dm)
Declares the given non-Hermitian dense matrix expression dm as Hermitian.
Definition: DMatDeclHermExpr.h:841
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
SubvectorExprTrait_< VT, unaligned > subvector(Vector< VT, TF > &vector, size_t index, size_t size)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:152
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
IfTrue_< evaluateRight, const RT2, CT2 > RT
Type for the assignment of the right-hand side dense matrix operand.
Definition: TSMatDMatMultExpr.h:280
OppositeType_< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: TSMatDMatMultExpr.h:264
Header file for the DisableIf class template.
Compile time check for dense vector types.This type trait tests whether or not the given template par...
Definition: IsDenseVector.h:78
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the DeclLow functor.
Header file for the If class template.
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:83
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a column-major dense or sparse matri...
Definition: ColumnMajorMatrix.h:61
Flag for Hermitian matrices.
Definition: TSMatDMatMultExpr.h:177
Flag for upper matrices.
Definition: TSMatDMatMultExpr.h:179
Header file for the TSVecTDMatMultExprTrait class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2939
Evaluation of the expression type of a dense matrix declupp operation.Via this type trait it is possi...
Definition: TDMatDeclUppExprTrait.h:75
Generic wrapper for the decllow() function.
Definition: DeclLow.h:58
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
Header file for the Or class template.
Header file for the TDMatSVecMultExprTrait class template.
Header file for the TDVecTSMatMultExprTrait class template.
Header file for the TDMatDeclHermExprTrait class template.
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
Header file for the TSMatDVecMultExprTrait class template.
Header file for the TDMatDeclUppExprTrait class template.
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Evaluation of the expression type of a dense matrix decldiag operation.Via this type trait it is poss...
Definition: TDMatDeclDiagExprTrait.h:75
Compile time check for sparse vector types.This type trait tests whether or not the given template pa...
Definition: IsSparseVector.h:78
Evaluation of the expression type type of a submatrix operation.Via this type trait it is possible to...
Definition: SubmatrixExprTrait.h:80
Header file for the DMatDVecMultExprTrait class template.
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
Compile time check for diagonal matrices.This type trait tests whether or not the given template para...
Definition: IsDiagonal.h:90
typename TSMatDVecMultExprTrait< MT, VT >::Type TSMatDVecMultExprTrait_
Auxiliary alias declaration for the TSMatDVecMultExprTrait class template.The TSMatDVecMultExprTrait_...
Definition: TSMatDVecMultExprTrait.h:124
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT >, IsDeclExpr< MT > >, RowExprTrait_< MT > > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:128
const ResultType CompositeType
Data type for composite expression templates.
Definition: TSMatDMatMultExpr.h:268
#define BLAZE_CONSTRAINT_MUST_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:60
Generic wrapper for the null function.
Definition: Noop.h:58
Header file for the IsTriangular type trait.
Compile time check for column vector types.This type trait tests whether or not the given template ar...
Definition: IsColumnVector.h:80
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition: TSMatDMatMultExpr.h:361
Evaluation of the expression type of a dense matrix declsym operation.Via this type trait it is possi...
Definition: TDMatDeclSymExprTrait.h:75
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: TSMatDMatMultExpr.h:451
Constraints on the storage order of matrix types.
typename TDVecDMatMultExprTrait< VT, MT >::Type TDVecDMatMultExprTrait_
Auxiliary alias declaration for the TDVecDMatMultExprTrait class template.The TDVecDMatMultExprTrait_...
Definition: TDVecDMatMultExprTrait.h:119
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
Header file for the exception macros of the math module.
DisableIf_< IsLower< MT >, const DMatDeclLowExpr< MT, SO > > decllow(const DenseMatrix< MT, SO > &dm)
Declares the given non-lower dense matrix expression dm as lower.
Definition: DMatDeclLowExpr.h:842
Compile time check for strictly upper triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyUpper.h:86
Evaluation of the expression type type of a row operation.Via this type trait it is possible to evalu...
Definition: RowExprTrait.h:79
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:260
Header file for the DeclDiag functor.
Compile time check for dense matrix types.This type trait tests whether or not the given template par...
Definition: IsDenseMatrix.h:78
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT >, IsDeclExpr< MT > >, ColumnExprTrait_< MT > > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:128
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATMATMULTEXPR(T1, T2)
Constraint on the data type.In case the given data types T1 and T2 do not form a valid matrix/matrix ...
Definition: MatMatMultExpr.h:109
RightOperand rightOperand() const noexcept
Returns the right-hand side dense matrix operand.
Definition: TSMatDMatMultExpr.h:407
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
Header file for the conjugate shim.
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
ResultType_< MT1 > RT1
Result type of the left-hand side sparse matrix expression.
Definition: TSMatDMatMultExpr.h:155
Evaluation of the expression type of a transpose dense matrix/sparse vector multiplication.Via this type trait it is possible to evaluate the resulting expression type of a transpose dense matrix/sparse vector multiplication. Given the column-major dense matrix type MT and the non-transpose sparse vector type VT, the nested type Type corresponds to the resulting expression type. In case either MT is not a column-major dense matrix type or VT is not a non-transpose sparse vector type, the resulting data type Type is set to INVALID_TYPE.
Definition: TDMatSVecMultExprTrait.h:79
Header file for the IsSparseVector type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
Header file for the SubmatrixExprTrait class template.
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a row-major dense or sparse matrix t...
Definition: RowMajorMatrix.h:61
Header file for run time assertion macros.
Compile time check for column-major matrix types.This type trait tests whether or not the given templ...
Definition: IsColumnMajorMatrix.h:83
Flag for symmetric matrices.
Definition: TSMatDMatMultExpr.h:176
Utility type for generic codes.
Header file for the TDMatDeclLowExprTrait class template.
ElementType_< RT1 > ET1
Element type of the left-hand side dense matrix expression.
Definition: TSMatDMatMultExpr.h:157
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:160
TSMatDMatMultExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the TSMatDMatMultExpr class.
Definition: TSMatDMatMultExpr.h:298
Header file for the reset shim.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:93
Header file for the isDefault shim.
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:94
Constraints on the storage order of matrix types.
Generic wrapper for the declherm() function.
Definition: DeclHerm.h:58
Header file for the TDMatDeclSymExprTrait class template.
Header file for the Noop functor.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
typename T::OppositeType OppositeType_
Alias declaration for nested OppositeType type definitions.The OppositeType_ alias declaration provid...
Definition: Aliases.h:243
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.In case either of the two given data types T1 or T2 is not a matrix type ...
Definition: StorageOrder.h:84
Header file for the IsDenseVector type trait.
Generic wrapper for the declupp() function.
Definition: DeclUpp.h:58
Compile time check for strictly lower triangular matrices.This type trait tests whether or not the gi...
Definition: IsStrictlyLower.h:86
ElementType_< ResultType > ElementType
Resulting element type.
Definition: TSMatDMatMultExpr.h:266
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: TSMatDMatMultExpr.h:431
Evaluation of the expression type of a dense vector/transpose dense matrix multiplication.Via this type trait it is possible to evaluate the resulting expression type of a dense vector/transpose dense matrix multiplication. Given the transpose dense vector type VT and the column-major dense matrix type MT, the nested type Type corresponds to the resulting expression type. In case either VT is not a transpose dense vector type or MT is not a column-major dense matrix type, the resulting data type Type is set to INVALID_TYPE.
Definition: TDVecTDMatMultExprTrait.h:79
Header file for the IsRowMajorMatrix type trait.
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:733
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
Expression object for transpose sparse matrix-dense matrix multiplications.The TSMatDMatMultExpr clas...
Definition: Forward.h:150
Header file for the TDVecDMatMultExprTrait class template.
Header file for the TDMatDVecMultExprTrait class template.
Evaluation of the expression type of a transpose dense matrix/dense vector multiplication.Via this type trait it is possible to evaluate the resulting expression type of a transpose dense matrix/dense vector multiplication. Given the column-major dense matrix type MT and the non-transpose dense vector type VT, the nested type Type corresponds to the resulting expression type. In case either MT is not a column-major dense matrix type or VT is not a non-transpose dense vector type, the resulting data type Type is set to INVALID_TYPE.
Definition: TDMatDVecMultExprTrait.h:79
Header file for the IntegralConstant class template.
Compile time evaluation of the number of columns of a matrix.The Columns type trait evaluates the num...
Definition: Columns.h:76
Generic wrapper for the decldiag() function.
Definition: DeclDiag.h:58
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:76
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: TSMatDMatMultExpr.h:419
Header file for the TSVecDMatMultExprTrait class template.
Compile time check for sparse matrix types.This type trait tests whether or not the given template pa...
Definition: IsSparseMatrix.h:78
Header file for the DeclHerm functor.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
Header file for the IsUpper type trait.
Header file for the DMatSVecMultExprTrait class template.
Header file for the IsColumnVector type trait.
Constraint on the data type.
TSMatDMatMultExpr< MT1, MT2, SF, HF, LF, UF > This
Type of this TSMatDMatMultExpr instance.
Definition: TSMatDMatMultExpr.h:261
Generic wrapper for the declsym() function.
Definition: DeclSym.h:58
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:677
Header file for the IsResizable type trait.
const DMatDMatMultExpr< T1, T2, false, false, false, false > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7505
If_< IsExpression< MT2 >, const MT2, const MT2 &> RightOperand
Composite type of the right-hand side dense matrix expression.
Definition: TSMatDMatMultExpr.h:274
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
DisableIf_< IsDiagonal< MT >, const DMatDeclDiagExpr< MT, SO > > decldiag(const DenseMatrix< MT, SO > &dm)
Declares the given non-diagonal dense matrix expression dm as diagonal.
Definition: DMatDeclDiagExpr.h:841
DisableIf_< IsUpper< MT >, const DMatDeclUppExpr< MT, SO > > declupp(const DenseMatrix< MT, SO > &dm)
Declares the given non-upper dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:842
Evaluation of the expression type type of a column operation.Via this type trait it is possible to ev...
Definition: ColumnExprTrait.h:78
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the Bool class template.
Header file for the TDVecTDMatMultExprTrait class template.
Header file for the DeclSym functor.
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:61
Header file for the IsExpression type trait class.
Header file for the function trace functionality.