35 #ifndef _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_H_ 36 #define _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_H_ 114 template<
typename MT,
bool SO,
bool DF >
115 void reset( UniLowerMatrix<MT,SO,DF>& m );
117 template<
typename MT,
bool SO,
bool DF >
118 void reset( UniLowerMatrix<MT,SO,DF>& m,
size_t i );
120 template<
typename MT,
bool SO,
bool DF >
121 void clear( UniLowerMatrix<MT,SO,DF>& m );
123 template<
bool RF,
typename MT,
bool SO,
bool DF >
124 bool isDefault(
const UniLowerMatrix<MT,SO,DF>& m );
126 template<
typename MT,
bool SO,
bool DF >
127 bool isIntact(
const UniLowerMatrix<MT,SO,DF>& m );
129 template<
typename MT,
bool SO,
bool DF >
130 void swap( UniLowerMatrix<MT,SO,DF>& a, UniLowerMatrix<MT,SO,DF>& b ) noexcept;
142 template<
typename MT
165 template<
typename MT
182 template<
typename MT
206 inline bool isDefault_backend(
const UniLowerMatrix<MT,SO,DF>& m,
TrueType )
208 return ( m.rows() == 0UL );
228 inline bool isDefault_backend(
const UniLowerMatrix<MT,SO,DF>& m,
FalseType )
230 return isIdentity<RF>( m );
294 template<
typename MT
312 template<
typename MT
348 inline void invert( UniLowerMatrix<MT,SO,true>& m )
361 invert<flag>( derestrict( m ) );
388 template<
typename MT1,
bool SO1,
typename MT2,
typename MT3,
typename MT4,
bool SO2 >
389 inline void lu(
const UniLowerMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
390 DenseMatrix<MT3,SO1>& U, Matrix<MT4,SO2>& P )
404 using ET3 = ElementType_t<MT3>;
405 using ET4 = ElementType_t<MT4>;
407 const size_t n( (~A).
rows() );
409 decltype(
auto) U2( derestrict( ~U ) );
419 for(
size_t i=0UL; i<n; ++i ) {
444 template<
typename MT
448 inline bool trySet(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
456 ( i == j &&
isOne( value ) ) ||
481 template<
typename MT
486 trySet(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
495 return ( m == 0UL ) ||
521 template<
typename MT
525 inline bool tryAdd(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
556 template<
typename MT
561 tryAdd(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
570 return ( m == 0UL ) ||
595 template<
typename MT
599 inline bool trySub(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
601 return tryAdd( mat, i, j, value );
625 template<
typename MT
630 trySub(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
632 return tryAdd( mat,
row,
column, m, n, value );
654 template<
typename MT
658 inline bool tryMult(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
665 return ( i != j ||
isOne( value ) );
689 template<
typename MT
694 tryMult(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
703 return ( m == 0UL ) ||
729 template<
typename MT
733 inline bool tryDiv(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
735 return tryMult( mat, i, j, value );
759 template<
typename MT
764 tryDiv(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
766 return tryMult( mat,
row,
column, m, n, value );
788 template<
typename MT
791 inline bool tryShift(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
int count )
822 template<
typename MT
826 tryShift(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
int count )
835 return ( m == 0UL ) ||
861 template<
typename MT
865 inline bool tryBitand(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
872 return ( i != j ) || ( ElementType_t<MT>(1) & value );
896 template<
typename MT
901 tryBitand(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
910 return ( m == 0UL ) ||
914 ( ElementType_t<MT>(1) & value );
936 template<
typename MT
940 inline bool tryBitor(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
942 return trySet( mat, i, j, value );
966 template<
typename MT
971 tryBitor(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
973 return trySet( mat,
row,
column, m, n, value );
995 template<
typename MT
999 inline bool tryBitxor(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
1001 return tryAdd( mat, i, j, value );
1025 template<
typename MT
1030 tryBitxor(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
1032 return tryAdd( mat,
row,
column, m, n, value );
1054 template<
typename MT
1058 inline bool tryAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
1059 const DenseVector<VT,false>& rhs,
size_t row,
size_t column )
1072 const bool containsDiagonal(
column <
row + (~rhs).
size() );
1075 for(
size_t i=0UL; i<iend; ++i ) {
1080 if( containsDiagonal && !
isOne( (~rhs)[iend] ) )
1105 template<
typename MT
1109 inline bool tryAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
1110 const DenseVector<VT,true>& rhs,
size_t row,
size_t column )
1123 const bool containsDiagonal(
row >=
column );
1124 const size_t ibegin( ( !containsDiagonal )?( 0UL ):(
row -
column + 1UL ) );
1129 for(
size_t i=ibegin; i<(~rhs).
size(); ++i ) {
1158 template<
typename MT
1163 inline bool tryAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
1176 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
1177 if( !
isOne( (~rhs)[i] ) )
1181 else if(
band > 0L ) {
1182 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
1210 template<
typename MT
1214 inline bool tryAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
1215 const SparseVector<VT,false>& rhs,
size_t row,
size_t column )
1228 const bool containsDiagonal(
column <
row + (~rhs).
size() );
1230 const auto last( (~rhs).lowerBound( index ) );
1232 if( containsDiagonal ) {
1233 if( last == (~rhs).
end() || last->index() != index || !
isOne( last->value() ) )
1237 for(
auto element=(~rhs).begin(); element!=last; ++element ) {
1264 template<
typename MT
1268 inline bool tryAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
1269 const SparseVector<VT,true>& rhs,
size_t row,
size_t column )
1282 const bool containsDiagonal(
row >=
column );
1283 const size_t index( ( containsDiagonal )?(
row -
column ):( 0UL ) );
1284 const auto last( (~rhs).
end() );
1285 auto element( (~rhs).lowerBound( index ) );
1287 if( containsDiagonal ) {
1288 if( element == last || element->index() != index || !
isOne( element->value() ) )
1293 for( ; element!=last; ++element ) {
1322 template<
typename MT
1327 inline bool tryAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
1342 for(
const auto& element : ~rhs ) {
1343 if( !
isOne( element.value() ) )
1347 else if(
band > 0L ) {
1348 for(
const auto& element : ~rhs ) {
1376 template<
typename MT1
1380 inline bool tryAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
1381 const DenseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1392 const size_t M( (~rhs).
rows() );
1393 const size_t N( (~rhs).
columns() );
1400 for(
size_t i=0UL; i<iend; ++i )
1402 const bool containsDiagonal(
row + i >=
column );
1407 const size_t jbegin( ( containsDiagonal )?(
row + i -
column + 1UL ):( 0UL ) );
1409 for(
size_t j=jbegin; j<N; ++j ) {
1437 template<
typename MT1
1441 inline bool tryAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
1442 const DenseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
1453 const size_t M( (~rhs).
rows() );
1454 const size_t N( (~rhs).
columns() );
1461 for(
size_t j=jbegin; j<N; ++j )
1465 for(
size_t i=0UL; i<iend; ++i ) {
1470 const bool containsDiagonal(
column + j <
row + M );
1472 if( containsDiagonal && !
isOne( (~rhs)(iend,j) ) )
1498 template<
typename MT1
1502 inline bool tryAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
1503 const SparseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1514 const size_t M( (~rhs).
rows() );
1515 const size_t N( (~rhs).
columns() );
1522 for(
size_t i=0UL; i<iend; ++i )
1524 const bool containsDiagonal(
row + i >=
column );
1525 const size_t index( ( containsDiagonal )?(
row + i -
column ):( 0UL ) );
1527 const auto last( (~rhs).
end(i) );
1528 auto element( (~rhs).lowerBound( i, index ) );
1530 if( containsDiagonal ) {
1531 if( element == last || ( element->index() != index ) || !
isOne( element->value() ) )
1536 for( ; element!=last; ++element ) {
1564 template<
typename MT1
1568 inline bool tryAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
1569 const SparseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
1580 const size_t M( (~rhs).
rows() );
1581 const size_t N( (~rhs).
columns() );
1588 for(
size_t j=jbegin; j<N; ++j )
1590 const bool containsDiagonal(
column + j <
row + M );
1593 const auto last( (~rhs).lowerBound(
min( index, M ), j ) );
1595 if( containsDiagonal ) {
1596 if( last == (~rhs).
end(j) || ( last->index() != index ) || !
isOne( last->value() ) )
1600 for(
auto element=(~rhs).begin(j); element!=last; ++element ) {
1629 template<
typename MT
1633 inline bool tryAddAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
1634 const DenseVector<VT,false>& rhs,
size_t row,
size_t column )
1649 for(
size_t i=0UL; i<iend; ++i ) {
1677 template<
typename MT
1681 inline bool tryAddAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
1682 const DenseVector<VT,true>& rhs,
size_t row,
size_t column )
1694 for(
size_t i=ibegin; i<(~rhs).
size(); ++i ) {
1722 template<
typename MT
1727 inline bool tryAddAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
1740 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
1769 template<
typename MT
1773 inline bool tryAddAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
1774 const SparseVector<VT,false>& rhs,
size_t row,
size_t column )
1787 const auto last( (~rhs).lowerBound(
column -
row + 1UL ) );
1789 for(
auto element=(~rhs).
begin(); element!=last; ++element ) {
1817 template<
typename MT
1821 inline bool tryAddAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
1822 const SparseVector<VT,true>& rhs,
size_t row,
size_t column )
1832 const auto last( (~rhs).
end() );
1835 for( ; element!=last; ++element ) {
1863 template<
typename MT
1868 inline bool tryAddAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
1881 for(
const auto& element : ~rhs ) {
1910 template<
typename MT1
1914 inline bool tryAddAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
1915 const DenseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1926 const size_t M( (~rhs).
rows() );
1927 const size_t N( (~rhs).
columns() );
1934 for(
size_t i=0UL; i<iend; ++i )
1936 const bool containsDiagonal(
row + i >=
column );
1937 const size_t jbegin( ( containsDiagonal )?(
row + i -
column ):( 0UL ) );
1939 for(
size_t j=jbegin; j<N; ++j ) {
1968 template<
typename MT1
1972 inline bool tryAddAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
1973 const DenseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
1984 const size_t M( (~rhs).
rows() );
1985 const size_t N( (~rhs).
columns() );
1992 for(
size_t j=jbegin; j<N; ++j )
1996 for(
size_t i=0UL; i<iend; ++i ) {
2025 template<
typename MT1
2029 inline bool tryAddAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
2030 const SparseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
2041 const size_t M( (~rhs).
rows() );
2042 const size_t N( (~rhs).
columns() );
2049 for(
size_t i=0UL; i<iend; ++i )
2051 const bool containsDiagonal(
row + i >=
column );
2052 const size_t index( ( containsDiagonal )?(
row + i -
column ):( 0UL ) );
2054 const auto last( (~rhs).
end(i) );
2055 auto element( (~rhs).lowerBound( i, index ) );
2057 for( ; element!=last; ++element ) {
2086 template<
typename MT1
2090 inline bool tryAddAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
2091 const SparseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
2102 const size_t M( (~rhs).
rows() );
2103 const size_t N( (~rhs).
columns() );
2110 for(
size_t j=jbegin; j<N; ++j )
2112 const size_t index(
column + j -
row + 1UL );
2113 const auto last( (~rhs).lowerBound(
min( index, M ), j ) );
2115 for(
auto element=(~rhs).
begin(j); element!=last; ++element ) {
2144 template<
typename MT
2149 inline bool trySubAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2150 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
2152 return tryAddAssign( lhs, ~rhs,
row,
column );
2176 template<
typename MT
2181 inline bool trySubAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
2207 template<
typename MT1
2212 inline bool trySubAssign(
const UniLowerMatrix<MT1,SO1,DF>& lhs,
2213 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2215 return tryAddAssign( lhs, ~rhs,
row,
column );
2238 template<
typename MT
2242 inline bool tryMultAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2243 const Vector<VT,false>& rhs,
size_t row,
size_t column )
2278 template<
typename MT
2282 inline bool tryMultAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2283 const Vector<VT,true>& rhs,
size_t row,
size_t column )
2318 template<
typename MT
2323 inline bool tryMultAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
2336 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
2337 if( !
isOne( (~rhs)[i] ) )
2365 template<
typename MT
2370 inline bool tryMultAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
2385 for(
const auto& element : ~rhs ) {
2386 if( !
isOne( element.value() ) )
2414 template<
typename MT1
2419 inline bool trySchurAssign(
const UniLowerMatrix<MT1,SO1,DF>& lhs,
2420 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2431 const size_t M( (~rhs).
rows() );
2432 const size_t N( (~rhs).
columns() );
2440 for( ; i<M && j<N; ++i, ++j )
2442 if( !
isOne( (~rhs)(i,j) ) )
2468 template<
typename MT
2473 inline bool tryDivAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2474 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
2476 return tryMultAssign( lhs, ~rhs,
row,
column );
2499 template<
typename MT
2504 inline bool tryDivAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
2529 template<
typename MT
2533 inline bool tryShiftAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2534 const Vector<VT,false>& rhs,
size_t row,
size_t column )
2568 template<
typename MT
2572 inline bool tryShiftAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2573 const Vector<VT,true>& rhs,
size_t row,
size_t column )
2608 template<
typename MT
2613 inline bool tryShiftAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
2626 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
2655 template<
typename MT
2660 inline bool tryShiftAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
2675 for(
const auto& element : ~rhs ) {
2703 template<
typename MT1
2708 inline bool tryShiftAssign(
const UniLowerMatrix<MT1,SO1,DF>& lhs,
2709 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2720 const size_t M( (~rhs).
rows() );
2721 const size_t N( (~rhs).
columns() );
2729 for( ; i<M && j<N; ++i, ++j )
2758 template<
typename MT
2762 inline bool tryBitandAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2763 const Vector<VT,false>& rhs,
size_t row,
size_t column )
2775 ( ElementType_t<MT>(1) & (~rhs)[
column-
row] );
2798 template<
typename MT
2802 inline bool tryBitandAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2803 const Vector<VT,true>& rhs,
size_t row,
size_t column )
2815 ( ElementType_t<MT>(1) & (~rhs)[
row-
column] );
2838 template<
typename MT
2843 inline bool tryBitandAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
2856 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
2857 if( !( ElementType_t<MT>(1) & (~rhs)[i] ) )
2885 template<
typename MT
2890 inline bool tryBitandAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
2905 for(
const auto& element : ~rhs ) {
2906 if( !( ElementType_t<MT>(1) & element.value() ) )
2934 template<
typename MT1
2939 inline bool tryBitandAssign(
const UniLowerMatrix<MT1,SO1,DF>& lhs,
2940 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2951 const size_t M( (~rhs).
rows() );
2952 const size_t N( (~rhs).
columns() );
2960 for( ; i<M && j<N; ++i, ++j )
2962 if( !( ElementType_t<MT1>(1) & (~rhs)(i,j) ) )
2989 template<
typename MT
2994 inline bool tryBitorAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2995 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
2997 return tryAssign( lhs, ~rhs,
row,
column );
3020 template<
typename MT
3025 inline bool tryBitorAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
3051 template<
typename MT1
3056 inline bool tryBitorAssign(
const UniLowerMatrix<MT1,SO1,DF>& lhs,
3057 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
3059 return tryAssign( lhs, ~rhs,
row,
column );
3082 template<
typename MT
3087 inline bool tryBitxorAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
3088 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
3090 return tryAddAssign( lhs, ~rhs,
row,
column );
3113 template<
typename MT
3118 inline bool tryBitxorAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
3144 template<
typename MT1
3149 inline bool tryBitxorAssign(
const UniLowerMatrix<MT1,SO1,DF>& lhs,
3150 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
3152 return tryAddAssign( lhs, ~rhs,
row,
column );
3172 template<
typename MT
3175 inline MT& derestrict( UniLowerMatrix<MT,SO,DF>& m )
3193 template<
typename MT,
bool SO,
bool DF >
3194 struct Size< UniLowerMatrix<MT,SO,DF>, 0UL >
3195 :
public Size<MT,0UL>
3198 template<
typename MT,
bool SO,
bool DF >
3199 struct Size< UniLowerMatrix<MT,SO,DF>, 1UL >
3200 :
public Size<MT,1UL>
3216 template<
typename MT,
bool SO,
bool DF >
3217 struct MaxSize< UniLowerMatrix<MT,SO,DF>, 0UL >
3218 :
public MaxSize<MT,0UL>
3221 template<
typename MT,
bool SO,
bool DF >
3222 struct MaxSize< UniLowerMatrix<MT,SO,DF>, 1UL >
3223 :
public MaxSize<MT,1UL>
3239 template<
typename MT,
bool SO,
bool DF >
3240 struct IsSquare< UniLowerMatrix<MT,SO,DF> >
3257 template<
typename MT,
bool SO,
bool DF >
3258 struct IsUniLower< UniLowerMatrix<MT,SO,DF> >
3275 template<
typename MT,
bool SO,
bool DF >
3276 struct IsAdaptor< UniLowerMatrix<MT,SO,DF> >
3293 template<
typename MT,
bool SO,
bool DF >
3294 struct IsRestricted< UniLowerMatrix<MT,SO,DF> >
3311 template<
typename MT,
bool SO >
3312 struct HasConstDataAccess< UniLowerMatrix<MT,SO,true> >
3329 template<
typename MT,
bool SO,
bool DF >
3330 struct IsAligned< UniLowerMatrix<MT,SO,DF> >
3331 :
public IsAligned<MT>
3347 template<
typename MT,
bool SO,
bool DF >
3348 struct IsContiguous< UniLowerMatrix<MT,SO,DF> >
3349 :
public IsContiguous<MT>
3365 template<
typename MT,
bool SO,
bool DF >
3366 struct IsPadded< UniLowerMatrix<MT,SO,DF> >
3367 :
public IsPadded<MT>
3383 template<
typename MT,
bool SO,
bool DF >
3384 struct IsResizable< UniLowerMatrix<MT,SO,DF> >
3385 :
public IsResizable<MT>
3401 template<
typename MT,
bool SO,
bool DF >
3402 struct IsShrinkable< UniLowerMatrix<MT,SO,DF> >
3403 :
public IsShrinkable<MT>
3419 template<
typename MT,
bool SO,
bool DF >
3420 struct RemoveAdaptor< UniLowerMatrix<MT,SO,DF> >
3438 template<
typename T1,
typename T2 >
3439 struct AddTraitEval1< T1, T2
3442 ( ( IsUniLower_v<T1> && IsStrictlyLower_v<T2> &&
3443 !( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> ) ) ||
3444 ( IsStrictlyLower_v<T1> && IsUniLower_v<T2> &&
3445 !( IsStrictlyUpper_v<T1> && IsUniUpper_v<T2> ) ) ) &&
3446 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3448 using Type = UniLowerMatrix< typename AddTraitEval2<T1,T2>::Type >;
3464 template<
typename T1,
typename T2 >
3465 struct SubTraitEval1< T1, T2
3468 ( IsUniLower_v<T1> && IsStrictlyLower_v<T2> &&
3469 !( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> ) ) &&
3470 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3472 using Type = UniLowerMatrix< typename SubTraitEval2<T1,T2>::Type >;
3488 template<
typename T1,
typename T2 >
3489 struct SchurTraitEval1< T1, T2
3492 ( IsUniLower_v<T1> && IsUniLower_v<T2> ) &&
3493 !( IsDiagonal_v<T1> || IsDiagonal_v<T2> ) &&
3494 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3496 using Type = UniLowerMatrix< typename SchurTraitEval2<T1,T2>::Type >;
3512 template<
typename T1,
typename T2 >
3513 struct MultTraitEval1< T1, T2
3516 ( IsUniLower_v<T1> && IsUniLower_v<T2> ) &&
3517 !( IsIdentity_v<T1> || IsIdentity_v<T2> ) > >
3519 using Type = UniLowerMatrix< typename MultTraitEval2<T1,T2>::Type >;
3535 template<
typename T1,
typename T2 >
3536 struct KronTraitEval1< T1, T2
3539 ( IsUniLower_v<T1> && IsUniLower_v<T2> ) &&
3540 !( IsIdentity_v<T1> && IsIdentity_v<T2> ) &&
3541 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3543 using Type = UniLowerMatrix< typename KronTraitEval2<T1,T2>::Type >;
3559 template<
typename T,
typename OP >
3560 struct UnaryMapTraitEval1< T, OP
3562 !YieldsIdentity_v<OP,T> > >
3564 using Type = UniLowerMatrix< typename UnaryMapTraitEval2<T,OP>::Type, StorageOrder_v<T> >;
3572 template<
typename T1,
typename T2,
typename OP >
3573 struct BinaryMapTraitEval1< T1, T2, OP
3575 !YieldsIdentity_v<OP,T1,T2> > >
3577 using Type = UniLowerMatrix< typename BinaryMapTraitEval2<T1,T2,OP>::Type >;
3593 template<
typename MT,
bool SO,
bool DF >
3594 struct DeclSymTrait< UniLowerMatrix<MT,SO,DF> >
3596 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3612 template<
typename MT,
bool SO,
bool DF >
3613 struct DeclHermTrait< UniLowerMatrix<MT,SO,DF> >
3615 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3631 template<
typename MT,
bool SO,
bool DF >
3632 struct DeclLowTrait< UniLowerMatrix<MT,SO,DF> >
3634 using Type = UniLowerMatrix<MT,SO,DF>;
3650 template<
typename MT,
bool SO,
bool DF >
3651 struct DeclUppTrait< UniLowerMatrix<MT,SO,DF> >
3653 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3669 template<
typename MT,
bool SO,
bool DF >
3670 struct DeclDiagTrait< UniLowerMatrix<MT,SO,DF> >
3672 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3688 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
3689 struct HighType< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
3691 using Type = UniLowerMatrix< typename HighType<MT1,MT2>::Type >;
3707 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
3708 struct LowType< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
3710 using Type = UniLowerMatrix< typename LowType<MT1,MT2>::Type >;
3726 template<
typename MT,
size_t I,
size_t N >
3727 struct SubmatrixTraitEval1< MT, I, I, N, N
3729 !IsIdentity_v<MT> > >
3731 using Type = UniLowerMatrix< typename SubmatrixTraitEval2<MT,I,I,N,N>::Type >;
BoolConstant< false > FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: IntegralConstant.h:121
Header file for the implementation of the base template of the UniLowerMatrix.
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
Headerfile for the generic min algorithm.
Header file for the decldiag trait.
Header file for the Schur product trait.
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.The IsMatrix_v variable template provides a c...
Definition: IsMatrix.h:138
Header file for the IsUniUpper type trait.
Header file for the subtraction trait.
Flag for the inversion of a diagonal matrix.
Definition: InversionFlag.h:115
Flag for the inversion of a general matrix (same as byLU).
Definition: InversionFlag.h:108
Header file for the declherm trait.
Flag for the inversion of a upper unitriangular matrix.
Definition: InversionFlag.h:114
Flag for the inversion of a lower unitriangular matrix.
Definition: InversionFlag.h:112
Header file for the IsDiagonal type trait.
Header file for the dense matrix inversion flags.
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
Header file for the YieldsIdentity type trait.
#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
Header file for the MAYBE_UNUSED function template.
Header file for the IsIdentity type trait.
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: IntegralConstant.h:132
Header file for all forward declarations of the math module.
Constraint on the data type.
Header file for the IsUniLower type trait.
Header file for the MaxSize type trait.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is an identity matrix.
Definition: DenseMatrix.h:2433
Constraint on the data type.
Header file for the IsMatrix type trait.
Header file for the IsSquare type trait.
constexpr bool YieldsUniLower_v
Auxiliary variable template for the YieldsUniLower type trait.The YieldsUniLower_v variable template ...
Definition: YieldsUniLower.h:124
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:779
Flag for the inversion of a upper triangular matrix.
Definition: InversionFlag.h:113
Constraint on the data type.
Header file for the LowType type trait.
Flag for the inversion of a lower triangular matrix.
Definition: InversionFlag.h:111
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Flag for the LU-based matrix inversion.
Definition: InversionFlag.h:103
Header file for the IsShrinkable type trait.
UniLowerMatrix specialization for dense matrices.
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1162
Header file for the YieldsUniLower type trait.
Header file for the decllow trait.
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:222
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Header file for the IsAligned type trait.
Header file for the Kron product trait.
#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
UniLowerMatrix specialization for sparse matrices.
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
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:438
Header file for the RemoveAdaptor type trait.
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:615
Header file for the IsPadded type trait.
Header file for the IsAdaptor type trait.
decltype(auto) band(Matrix< MT, SO > &matrix, RBAs... args)
Creating a view on a specific band of the given matrix.
Definition: Band.h:137
Header file for the isOne shim.
Constraint on the data type.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:74
Header file for the declupp 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,...
Definition: Symmetric.h:79
Header file for run time assertion macros.
Header file for the addition trait.
Header file for the submatrix trait.
Constraint on the data type.
Header file for the IsContiguous type trait.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
constexpr bool IsUniLower_v
Auxiliary variable template for the IsUniLower type trait.The IsUniLower_v variable template provides...
Definition: IsUniLower.h:173
Header file for the IsZero type trait.
#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 declsym trait.
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:697
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:282
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
#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
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
Header file for the StorageOrder type trait.
Header file for the IntegralConstant class template.
Matrix adapter for lower unitriangular matrices.
Definition: BaseTemplate.h:577
Header file for the map trait.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
#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,...
Definition: Hermitian.h:79
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
Header file for the Size type trait.
InversionFlag
Inversion flag.The InversionFlag type enumeration represents the different types of matrix inversion ...
Definition: InversionFlag.h:101
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101
Header file for the HighType type trait.