35 #ifndef _BLAZE_MATH_ADAPTORS_UPPERMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_UPPERMATRIX_H_
101 template<
typename MT,
bool SO,
bool DF >
102 inline void reset( UpperMatrix<MT,SO,DF>& m );
104 template<
typename MT,
bool SO,
bool DF >
105 inline void reset( UpperMatrix<MT,SO,DF>& m,
size_t i );
107 template<
typename MT,
bool SO,
bool DF >
108 inline void clear( UpperMatrix<MT,SO,DF>& m );
110 template<
typename MT,
bool SO,
bool DF >
111 inline bool isDefault(
const UpperMatrix<MT,SO,DF>& m );
113 template<
typename MT,
bool SO,
bool DF >
114 inline bool isIntact(
const UpperMatrix<MT,SO,DF>& m );
116 template<
typename MT,
bool SO,
bool DF >
117 inline void swap( UpperMatrix<MT,SO,DF>& a, UpperMatrix<MT,SO,DF>& b ) noexcept;
129 template<
typename MT
152 template<
typename MT
169 template<
typename MT
200 template<
typename MT
231 template<
typename MT
249 template<
typename MT
285 inline void invert( UpperMatrix<MT,SO,true>& m )
300 invert<flag>( derestrict( m ) );
327 template<
typename MT1,
bool SO1,
typename MT2,
typename MT3,
typename MT4,
bool SO2 >
328 inline void lu(
const UpperMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
329 DenseMatrix<MT3,SO1>& U, Matrix<MT4,SO2>& P )
343 typedef ElementType_<MT2> ET2;
344 typedef ElementType_<MT4> ET4;
346 const size_t n( (~A).
rows() );
348 DerestrictTrait_<MT2> L2( derestrict( ~L ) );
358 for(
size_t i=0UL; i<n; ++i ) {
383 template<
typename MT
387 inline bool tryAssign(
const UpperMatrix<MT,SO,DF>& lhs,
388 const DenseVector<VT,false>& rhs,
size_t row,
size_t column )
398 const size_t ibegin( ( column < row )?( 0UL ):( column - row + 1UL ) );
400 for(
size_t i=ibegin; i<(~rhs).
size(); ++i ) {
427 template<
typename MT
431 inline bool tryAssign(
const UpperMatrix<MT,SO,DF>& lhs,
432 const DenseVector<VT,true>& rhs,
size_t row,
size_t column )
445 const size_t iend(
min( row - column, (~rhs).
size() ) );
447 for(
size_t i=0UL; i<iend; ++i ) {
474 template<
typename MT
478 inline bool tryAssign(
const UpperMatrix<MT,SO,DF>& lhs,
479 const SparseVector<VT,false>& rhs,
size_t row,
size_t column )
491 const RhsIterator last( (~rhs).
end() );
492 RhsIterator element( (~rhs).lowerBound( ( column < row )?( 0UL ):( column - row + 1UL ) ) );
494 for( ; element!=last; ++element ) {
521 template<
typename MT
525 inline bool tryAssign(
const UpperMatrix<MT,SO,DF>& lhs,
526 const SparseVector<VT,true>& rhs,
size_t row,
size_t column )
541 const RhsIterator last( (~rhs).lowerBound( row - column ) );
543 for( RhsIterator element=(~rhs).
begin(); element!=last; ++element ) {
570 template<
typename MT1
574 inline bool tryAssign(
const UpperMatrix<MT1,SO,DF>& lhs,
575 const DenseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
586 const size_t M( (~rhs).
rows() );
587 const size_t N( (~rhs).
columns() );
589 if( column + 1UL >= row + M )
592 const size_t ibegin( ( column < row )?( 0UL ):( column - row + 1UL ) );
594 for(
size_t i=ibegin; i<M; ++i )
596 const size_t jend(
min( row + i - column, N ) );
598 for(
size_t j=0UL; j<jend; ++j ) {
626 template<
typename MT1
630 inline bool tryAssign(
const UpperMatrix<MT1,SO,DF>& lhs,
631 const DenseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
642 const size_t M( (~rhs).
rows() );
643 const size_t N( (~rhs).
columns() );
645 if( column + 1UL >= row + M )
648 const size_t jend(
min( row + M - column - 1UL, N ) );
650 for(
size_t j=0UL; j<jend; ++j )
652 const bool containsDiagonal( column + j >= row );
653 const size_t ibegin( ( containsDiagonal )?( column + j - row + 1UL ):( 0UL ) );
655 for(
size_t i=ibegin; i<M; ++i ) {
683 template<
typename MT1
687 inline bool tryAssign(
const UpperMatrix<MT1,SO,DF>& lhs,
688 const SparseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
701 const size_t M( (~rhs).
rows() );
702 const size_t N( (~rhs).
columns() );
704 if( column + 1UL >= row + M )
707 const size_t ibegin( ( column < row )?( 0UL ):( column - row + 1UL ) );
709 for(
size_t i=ibegin; i<M; ++i )
711 const size_t index( row + i - column );
712 const RhsIterator last( (~rhs).lowerBound( i,
min( index, N ) ) );
714 for( RhsIterator element=(~rhs).
begin(i); element!=last; ++element ) {
742 template<
typename MT1
746 inline bool tryAssign(
const UpperMatrix<MT1,SO,DF>& lhs,
747 const SparseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
760 const size_t M( (~rhs).
rows() );
761 const size_t N( (~rhs).
columns() );
763 if( column + 1UL >= row + M )
766 const size_t jend(
min( row + M - column - 1UL, N ) );
768 for(
size_t j=0UL; j<jend; ++j )
770 const bool containsDiagonal( column + j >= row );
771 const size_t index( ( containsDiagonal )?( column + j - row + 1UL ):( 0UL ) );
773 const RhsIterator last( (~rhs).
end(j) );
774 RhsIterator element( (~rhs).lowerBound( index, j ) );
776 for( ; element!=last; ++element ) {
804 template<
typename MT
809 inline bool tryAddAssign(
const UpperMatrix<MT,SO,DF>& lhs,
810 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
812 return tryAssign( lhs, ~rhs, row, column );
834 template<
typename MT1
839 inline bool tryAddAssign(
const UpperMatrix<MT1,SO1,DF>& lhs,
840 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
842 return tryAssign( lhs, ~rhs, row, column );
864 template<
typename MT
869 inline bool trySubAssign(
const UpperMatrix<MT,SO,DF>& lhs,
870 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
872 return tryAssign( lhs, ~rhs, row, column );
894 template<
typename MT1
899 inline bool trySubAssign(
const UpperMatrix<MT1,SO1,DF>& lhs,
900 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
902 return tryAssign( lhs, ~rhs, row, column );
922 template<
typename MT
925 inline MT& derestrict( UpperMatrix<MT,SO,DF>& m )
943 template<
typename MT,
bool SO,
bool DF >
944 struct Rows< UpperMatrix<MT,SO,DF> > :
public Rows<MT>
960 template<
typename MT,
bool SO,
bool DF >
961 struct Columns< UpperMatrix<MT,SO,DF> > :
public Columns<MT>
977 template<
typename MT,
bool SO,
bool DF >
978 struct IsSquare< UpperMatrix<MT,SO,DF> > :
public TrueType
994 template<
typename MT,
bool SO,
bool DF >
995 struct IsUpper< UpperMatrix<MT,SO,DF> > :
public TrueType
1011 template<
typename MT,
bool SO,
bool DF >
1012 struct IsAdaptor< UpperMatrix<MT,SO,DF> > :
public TrueType
1028 template<
typename MT,
bool SO,
bool DF >
1029 struct IsRestricted< UpperMatrix<MT,SO,DF> > :
public TrueType
1045 template<
typename MT,
bool SO >
1046 struct HasConstDataAccess< UpperMatrix<MT,SO,true> > :
public TrueType
1062 template<
typename MT,
bool SO,
bool DF >
1063 struct IsAligned< UpperMatrix<MT,SO,DF> > :
public BoolConstant< IsAligned<MT>::value >
1079 template<
typename MT,
bool SO,
bool DF >
1080 struct IsPadded< UpperMatrix<MT,SO,DF> > :
public BoolConstant< IsPadded<MT>::value >
1096 template<
typename MT,
bool SO,
bool DF >
1097 struct IsResizable< UpperMatrix<MT,SO,DF> > :
public BoolConstant< IsResizable<MT>::value >
1113 template<
typename MT,
bool SO,
bool DF >
1114 struct RemoveAdaptor< UpperMatrix<MT,SO,DF> >
1132 template<
typename MT,
bool SO,
bool DF >
1133 struct DerestrictTrait< UpperMatrix<MT,SO,DF> >
1151 template<
typename MT,
bool SO1,
bool DF,
typename T,
size_t M,
size_t N,
bool SO2 >
1152 struct AddTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1154 using Type = AddTrait_< MT, StaticMatrix<T,M,N,SO2> >;
1157 template<
typename T,
size_t M,
size_t N,
bool SO1,
typename MT,
bool SO2,
bool DF >
1158 struct AddTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1160 using Type = AddTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1163 template<
typename MT,
bool SO1,
bool DF,
typename T,
size_t M,
size_t N,
bool SO2 >
1164 struct AddTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1166 using Type = AddTrait_< MT, HybridMatrix<T,M,N,SO2> >;
1169 template<
typename T,
size_t M,
size_t N,
bool SO1,
typename MT,
bool SO2,
bool DF >
1170 struct AddTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1172 using Type = AddTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1175 template<
typename MT,
bool SO1,
bool DF,
typename T,
bool SO2 >
1176 struct AddTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1178 using Type = AddTrait_< MT, DynamicMatrix<T,SO2> >;
1181 template<
typename T,
bool SO1,
typename MT,
bool SO2,
bool DF >
1182 struct AddTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1184 using Type = AddTrait_< DynamicMatrix<T,SO1>, MT >;
1187 template<
typename MT,
bool SO1,
bool DF,
typename T,
bool AF,
bool PF,
bool SO2 >
1188 struct AddTrait< UpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1190 using Type = AddTrait_< MT, CustomMatrix<T,AF,PF,SO2> >;
1193 template<
typename T,
bool AF,
bool PF,
bool SO1,
typename MT,
bool SO2,
bool DF >
1194 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, UpperMatrix<MT,SO2,DF> >
1196 using Type = AddTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1199 template<
typename MT,
bool SO1,
bool DF,
typename T,
bool SO2 >
1200 struct AddTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1202 using Type = AddTrait_< MT, CompressedMatrix<T,SO2> >;
1205 template<
typename T,
bool SO1,
typename MT,
bool SO2,
bool DF >
1206 struct AddTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1208 using Type = AddTrait_< CompressedMatrix<T,SO1>, MT >;
1211 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2,
bool NF >
1212 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1214 using Type = AddTrait_<MT1,MT2>;
1217 template<
typename MT1,
bool SO1,
bool DF1,
bool NF,
typename MT2,
bool SO2,
bool DF2 >
1218 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
1220 using Type = AddTrait_<MT1,MT2>;
1223 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1224 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1226 using Type = AddTrait_<MT1,MT2>;
1229 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1230 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1232 using Type = AddTrait_<MT1,MT2>;
1235 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1236 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1238 using Type = AddTrait_<MT1,MT2>;
1241 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1242 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1244 using Type = AddTrait_<MT1,MT2>;
1247 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1248 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1250 using Type = AddTrait_<MT1,MT2>;
1253 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1254 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1256 using Type = AddTrait_<MT1,MT2>;
1259 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1260 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1262 using Type = AddTrait_<MT1,MT2>;
1265 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1266 struct AddTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1268 using Type = AddTrait_<MT1,MT2>;
1271 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1272 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1274 using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1290 template<
typename MT,
bool SO1,
bool DF,
typename T,
size_t M,
size_t N,
bool SO2 >
1291 struct SubTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1293 using Type = SubTrait_< MT, StaticMatrix<T,M,N,SO2> >;
1296 template<
typename T,
size_t M,
size_t N,
bool SO1,
typename MT,
bool SO2,
bool DF >
1297 struct SubTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1299 using Type = SubTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1302 template<
typename MT,
bool SO1,
bool DF,
typename T,
size_t M,
size_t N,
bool SO2 >
1303 struct SubTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1305 using Type = SubTrait_< MT, HybridMatrix<T,M,N,SO2> >;
1308 template<
typename T,
size_t M,
size_t N,
bool SO1,
typename MT,
bool SO2,
bool DF >
1309 struct SubTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1311 using Type = SubTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1314 template<
typename MT,
bool SO1,
bool DF,
typename T,
bool SO2 >
1315 struct SubTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1317 using Type = SubTrait_< MT, DynamicMatrix<T,SO2> >;
1320 template<
typename T,
bool SO1,
typename MT,
bool SO2,
bool DF >
1321 struct SubTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1323 using Type = SubTrait_< DynamicMatrix<T,SO1>, MT >;
1326 template<
typename MT,
bool SO1,
bool DF,
typename T,
bool AF,
bool PF,
bool SO2 >
1327 struct SubTrait< UpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1329 using Type = SubTrait_< MT, CustomMatrix<T,AF,PF,SO2> >;
1332 template<
typename T,
bool AF,
bool PF,
bool SO1,
typename MT,
bool SO2,
bool DF >
1333 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, UpperMatrix<MT,SO2,DF> >
1335 using Type = SubTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1338 template<
typename MT,
bool SO1,
bool DF,
typename T,
bool SO2 >
1339 struct SubTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1341 using Type = SubTrait_< MT, CompressedMatrix<T,SO2> >;
1344 template<
typename T,
bool SO1,
typename MT,
bool SO2,
bool DF >
1345 struct SubTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1347 using Type = SubTrait_< CompressedMatrix<T,SO1>, MT >;
1350 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2,
bool NF >
1351 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1353 using Type = SubTrait_<MT1,MT2>;
1356 template<
typename MT1,
bool SO1,
bool DF1,
bool NF,
typename MT2,
bool SO2,
bool DF2 >
1357 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
1359 using Type = SubTrait_<MT1,MT2>;
1362 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1363 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1365 using Type = SubTrait_<MT1,MT2>;
1368 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1369 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1371 using Type = SubTrait_<MT1,MT2>;
1374 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1375 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1377 using Type = SubTrait_<MT1,MT2>;
1380 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1381 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1383 using Type = SubTrait_<MT1,MT2>;
1386 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1387 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1389 using Type = SubTrait_<MT1,MT2>;
1392 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1393 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1395 using Type = SubTrait_<MT1,MT2>;
1398 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1399 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1401 using Type = SubTrait_<MT1,MT2>;
1404 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1405 struct SubTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1407 using Type = SubTrait_<MT1,MT2>;
1410 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1411 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1413 using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
1429 template<
typename MT,
bool SO,
bool DF,
typename T >
1430 struct MultTrait< UpperMatrix<MT,SO,DF>, T,
EnableIf_< IsNumeric<T> > >
1432 using Type = UpperMatrix< MultTrait_<MT,T> >;
1435 template<
typename T,
typename MT,
bool SO,
bool DF >
1436 struct MultTrait< T, UpperMatrix<MT,SO,DF>,
EnableIf_< IsNumeric<T> > >
1438 using Type = UpperMatrix< MultTrait_<T,MT> >;
1441 template<
typename MT,
bool SO,
bool DF,
typename T,
size_t N >
1442 struct MultTrait< UpperMatrix<MT,SO,DF>, StaticVector<T,N,false> >
1444 using Type = MultTrait_< MT, StaticVector<T,N,false> >;
1447 template<
typename T,
size_t N,
typename MT,
bool SO,
bool DF >
1448 struct MultTrait< StaticVector<T,N,true>, UpperMatrix<MT,SO,DF> >
1450 using Type = MultTrait_< StaticVector<T,N,true>, MT >;
1453 template<
typename MT,
bool SO,
bool DF,
typename T,
size_t N >
1454 struct MultTrait< UpperMatrix<MT,SO,DF>, HybridVector<T,N,false> >
1456 using Type = MultTrait_< MT, HybridVector<T,N,false> >;
1459 template<
typename T,
size_t N,
typename MT,
bool SO,
bool DF >
1460 struct MultTrait< HybridVector<T,N,true>, UpperMatrix<MT,SO,DF> >
1462 using Type = MultTrait_< HybridVector<T,N,true>, MT >;
1465 template<
typename MT,
bool SO,
bool DF,
typename T >
1466 struct MultTrait< UpperMatrix<MT,SO,DF>, DynamicVector<T,false> >
1468 using Type = MultTrait_< MT, DynamicVector<T,false> >;
1471 template<
typename T,
typename MT,
bool SO,
bool DF >
1472 struct MultTrait< DynamicVector<T,true>, UpperMatrix<MT,SO,DF> >
1474 using Type = MultTrait_< DynamicVector<T,true>, MT >;
1477 template<
typename MT,
bool SO,
bool DF,
typename T,
bool AF,
bool PF >
1478 struct MultTrait< UpperMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
1480 using Type = MultTrait_< MT, CustomVector<T,AF,PF,false> >;
1483 template<
typename T,
bool AF,
bool PF,
typename MT,
bool SO,
bool DF >
1484 struct MultTrait< CustomVector<T,AF,PF,true>, UpperMatrix<MT,SO,DF> >
1486 using Type = MultTrait_< CustomVector<T,AF,PF,true>, MT >;
1489 template<
typename MT,
bool SO,
bool DF,
typename T >
1490 struct MultTrait< UpperMatrix<MT,SO,DF>, CompressedVector<T,false> >
1492 using Type = MultTrait_< MT, CompressedVector<T,false> >;
1495 template<
typename T,
typename MT,
bool SO,
bool DF >
1496 struct MultTrait< CompressedVector<T,true>, UpperMatrix<MT,SO,DF> >
1498 using Type = MultTrait_< CompressedVector<T,true>, MT >;
1501 template<
typename MT,
bool SO1,
bool DF,
typename T,
size_t M,
size_t N,
bool SO2 >
1502 struct MultTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1504 using Type = MultTrait_< MT, StaticMatrix<T,M,N,SO2> >;
1507 template<
typename T,
size_t M,
size_t N,
bool SO1,
typename MT,
bool SO2,
bool DF >
1508 struct MultTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1510 using Type = MultTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1513 template<
typename MT,
bool SO1,
bool DF,
typename T,
size_t M,
size_t N,
bool SO2 >
1514 struct MultTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1516 using Type = MultTrait_< MT, HybridMatrix<T,M,N,SO2> >;
1519 template<
typename T,
size_t M,
size_t N,
bool SO1,
typename MT,
bool SO2,
bool DF >
1520 struct MultTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1522 using Type = MultTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1525 template<
typename MT,
bool SO1,
bool DF,
typename T,
bool SO2 >
1526 struct MultTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1528 using Type = MultTrait_< MT, DynamicMatrix<T,SO2> >;
1531 template<
typename T,
bool SO1,
typename MT,
bool SO2,
bool DF >
1532 struct MultTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1534 using Type = MultTrait_< DynamicMatrix<T,SO1>, MT >;
1537 template<
typename MT,
bool SO1,
bool DF,
typename T,
bool AF,
bool PF,
bool SO2 >
1538 struct MultTrait< UpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1540 using Type = MultTrait_< MT, CustomMatrix<T,AF,PF,SO2> >;
1543 template<
typename T,
bool AF,
bool PF,
bool SO1,
typename MT,
bool SO2,
bool DF >
1544 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, UpperMatrix<MT,SO2,DF> >
1546 using Type = MultTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1549 template<
typename MT,
bool SO1,
bool DF,
typename T,
bool SO2 >
1550 struct MultTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1552 using Type = MultTrait_< MT, CompressedMatrix<T,SO2> >;
1555 template<
typename T,
bool SO1,
typename MT,
bool SO2,
bool DF >
1556 struct MultTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1558 using Type = MultTrait_< CompressedMatrix<T,SO1>, MT >;
1561 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2,
bool NF >
1562 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1564 using Type = MultTrait_<MT1,MT2>;
1567 template<
typename MT1,
bool SO1,
bool DF1,
bool NF,
typename MT2,
bool SO2,
bool DF2 >
1568 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
1570 using Type = MultTrait_<MT1,MT2>;
1573 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1574 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1576 using Type = MultTrait_<MT1,MT2>;
1579 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1580 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1582 using Type = MultTrait_<MT1,MT2>;
1585 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1586 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1588 using Type = MultTrait_<MT1,MT2>;
1591 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1592 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1594 using Type = MultTrait_<MT1,MT2>;
1597 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1598 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1600 using Type = MultTrait_<MT1,MT2>;
1603 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1604 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1606 using Type = MultTrait_<MT1,MT2>;
1609 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1610 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1612 using Type = MultTrait_<MT1,MT2>;
1615 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1616 struct MultTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1618 using Type = MultTrait_<MT1,MT2>;
1621 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1622 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1624 using Type = UpperMatrix< MultTrait_<MT1,MT2> >;
1640 template<
typename MT,
bool SO,
bool DF,
typename T >
1641 struct DivTrait< UpperMatrix<MT,SO,DF>, T,
EnableIf_< IsNumeric<T> > >
1643 using Type = UpperMatrix< DivTrait_<MT,T> >;
1659 template<
typename MT,
bool SO,
bool DF >
1660 struct ForEachTrait< UpperMatrix<MT,SO,DF>, Abs >
1662 using Type = UpperMatrix< ForEachTrait_<MT,Abs> >;
1665 template<
typename MT,
bool SO,
bool DF >
1666 struct ForEachTrait< UpperMatrix<MT,SO,DF>, Floor >
1668 using Type = UpperMatrix< ForEachTrait_<MT,Floor> >;
1671 template<
typename MT,
bool SO,
bool DF >
1672 struct ForEachTrait< UpperMatrix<MT,SO,DF>, Ceil >
1674 using Type = UpperMatrix< ForEachTrait_<MT,Ceil> >;
1677 template<
typename MT,
bool SO,
bool DF >
1678 struct ForEachTrait< UpperMatrix<MT,SO,DF>, Conj >
1680 using Type = UpperMatrix< ForEachTrait_<MT,Conj> >;
1683 template<
typename MT,
bool SO,
bool DF >
1684 struct ForEachTrait< UpperMatrix<MT,SO,DF>, Real >
1686 using Type = UpperMatrix< ForEachTrait_<MT,Real> >;
1689 template<
typename MT,
bool SO,
bool DF >
1690 struct ForEachTrait< UpperMatrix<MT,SO,DF>, Imag >
1692 using Type = UpperMatrix< ForEachTrait_<MT,Imag> >;
1695 template<
typename MT,
bool SO,
bool DF >
1696 struct ForEachTrait< UpperMatrix<MT,SO,DF>, Sin >
1698 using Type = UpperMatrix< ForEachTrait_<MT,Sin> >;
1701 template<
typename MT,
bool SO,
bool DF >
1702 struct ForEachTrait< UpperMatrix<MT,SO,DF>, Asin >
1704 using Type = UpperMatrix< ForEachTrait_<MT,Asin> >;
1707 template<
typename MT,
bool SO,
bool DF >
1708 struct ForEachTrait< UpperMatrix<MT,SO,DF>, Sinh >
1710 using Type = UpperMatrix< ForEachTrait_<MT,Sinh> >;
1713 template<
typename MT,
bool SO,
bool DF >
1714 struct ForEachTrait< UpperMatrix<MT,SO,DF>, Asinh >
1716 using Type = UpperMatrix< ForEachTrait_<MT,Asinh> >;
1719 template<
typename MT,
bool SO,
bool DF >
1720 struct ForEachTrait< UpperMatrix<MT,SO,DF>, Tan >
1722 using Type = UpperMatrix< ForEachTrait_<MT,Tan> >;
1725 template<
typename MT,
bool SO,
bool DF >
1726 struct ForEachTrait< UpperMatrix<MT,SO,DF>, Atan >
1728 using Type = UpperMatrix< ForEachTrait_<MT,Atan> >;
1731 template<
typename MT,
bool SO,
bool DF >
1732 struct ForEachTrait< UpperMatrix<MT,SO,DF>, Tanh >
1734 using Type = UpperMatrix< ForEachTrait_<MT,Tanh> >;
1737 template<
typename MT,
bool SO,
bool DF >
1738 struct ForEachTrait< UpperMatrix<MT,SO,DF>, Atanh >
1740 using Type = UpperMatrix< ForEachTrait_<MT,Atanh> >;
1743 template<
typename MT,
bool SO,
bool DF >
1744 struct ForEachTrait< UpperMatrix<MT,SO,DF>, Erf >
1746 using Type = UpperMatrix< ForEachTrait_<MT,Erf> >;
1762 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
1763 struct MathTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1765 using HighType = UpperMatrix< typename MathTrait<MT1,MT2>::HighType >;
1766 using LowType = UpperMatrix< typename MathTrait<MT1,MT2>::LowType >;
1782 template<
typename MT,
bool SO,
bool DF >
1783 struct SubmatrixTrait< UpperMatrix<MT,SO,DF> >
1785 using Type = SubmatrixTrait_<MT>;
1801 template<
typename MT,
bool SO,
bool DF >
1802 struct RowTrait< UpperMatrix<MT,SO,DF> >
1804 using Type = RowTrait_<MT>;
1820 template<
typename MT,
bool SO,
bool DF >
1821 struct ColumnTrait< UpperMatrix<MT,SO,DF> >
1823 using Type = ColumnTrait_<MT>;
Header file for auxiliary alias declarations.
Header file for mathematical functions.
Header file for the Rows type trait.
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
Header file for the row trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
Header file for the dense matrix inversion flags.
UpperMatrix specialization for dense matrices.
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:188
Flag for the inversion of a diagonal matrix.
Definition: InversionFlag.h:115
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
Flag for the inversion of a general matrix (same as byLU).
Definition: InversionFlag.h:108
UpperMatrix specialization for sparse matrices.
Flag for the inversion of a upper unitriangular matrix.
Definition: InversionFlag.h:114
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1669
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower or upper unitriangular matrix ty...
Definition: UniTriangular.h:81
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Flag for the inversion of a upper triangular matrix.
Definition: InversionFlag.h:113
Constraint on the data type.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< 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:126
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Constraint on the data type.
Header file for the IsSquare type trait.
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:741
Constraint on the data type.
Flag for the LU-based matrix inversion.
Definition: InversionFlag.h:103
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
void lu(const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO1 > &L, DenseMatrix< MT3, SO1 > &U, Matrix< MT4, SO2 > &P)
LU decomposition of the given dense matrix.
Definition: LU.h:219
Header file for the Columns type trait.
Header file for the implementation of a fixed-size matrix.
Header file for the IsAligned type trait.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:330
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type...
Definition: Upper.h:81
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:538
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:254
Header file for the RemoveAdaptor type trait.
Constraint on the data type.
Matrix adapter for upper triangular matrices.
Definition: Forward.h:55
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
Header file for the IsPadded type trait.
Header file for the IsAdaptor type trait.
InversionFlag
Inversion flag.The InversionFlag type enumeration represents the different types of matrix inversion ...
Definition: InversionFlag.h:101
Header file for the DerestrictTrait class template.
Constraint on the data type.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< 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:126
#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 run time assertion macros.
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
Header file for the column trait.
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:258
#define BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a BLAS compatible data type (i...
Definition: BLASCompatible.h:61
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:81
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
Header file for the mathematical trait.
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:314
Header file for the for-each trait.
Header file for the isDivisor shim.
Header file for the IntegralConstant class template.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
Header file for the IsUpper type trait.
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the implementation of the base template of the UpperMatrix.
Flag for the inversion of a lower unitriangular matrix.
Definition: InversionFlag.h:112
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
#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 TrueType type/value trait base class.
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is an identity matrix.
Definition: DenseMatrix.h:1593