35#ifndef _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_H_
36#define _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_H_
117template< RelaxationFlag RF,
typename MT,
bool SO,
bool DF >
118bool isDefault(
const UniLowerMatrix<MT,SO,DF>& m );
120template<
typename MT,
bool SO,
bool DF >
121bool isIntact(
const UniLowerMatrix<MT,SO,DF>& m );
123template<
typename MT,
bool SO,
bool DF >
124void swap( UniLowerMatrix<MT,SO,DF>& a, UniLowerMatrix<MT,SO,DF>& b )
noexcept;
159inline bool isDefault(
const UniLowerMatrix<MT,SO,DF>& m )
162 return m.rows() == 0UL;
163 else return isIdentity<RF>( m );
192inline bool isIntact(
const UniLowerMatrix<MT,SO,DF>& m )
210inline void swap( UniLowerMatrix<MT,SO,DF>& a, UniLowerMatrix<MT,SO,DF>& b )
noexcept
243inline void invert( UniLowerMatrix<MT,SO,true>& m )
256 invert<flag>( derestrict( m ) );
283template<
typename MT1,
bool SO1,
typename MT2,
typename MT3,
typename MT4,
bool SO2 >
284inline void lu(
const UniLowerMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
285 DenseMatrix<MT3,SO1>& U, Matrix<MT4,SO2>& P )
299 using ET3 = ElementType_t<MT3>;
300 using ET4 = ElementType_t<MT4>;
302 const size_t n( (*A).rows() );
304 decltype(
auto) U2( derestrict( *U ) );
314 for(
size_t i=0UL; i<n; ++i ) {
343inline bool trySet(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
351 ( i == j &&
isOne( value ) ) ||
381 trySet(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
390 return ( m == 0UL ) ||
420inline bool tryAdd(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
456 tryAdd(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
465 return ( m == 0UL ) ||
494inline bool trySub(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
496 return tryAdd( mat, i, j, value );
525 trySub(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
527 return tryAdd( mat,
row,
column, m, n, value );
553inline bool tryMult(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
560 return ( i != j ||
isOne( value ) );
589 tryMult(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
598 return ( m == 0UL ) ||
628inline bool tryDiv(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
630 return tryMult( mat, i, j, value );
659 tryDiv(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
661 return tryMult( mat,
row,
column, m, n, value );
686inline bool tryShift(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
int count )
721 tryShift(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
int count )
730 return ( m == 0UL ) ||
760inline bool tryBitand(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
767 return ( i != j ) || ( ElementType_t<MT>(1) & value );
796 tryBitand(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
805 return ( m == 0UL ) ||
809 ( ElementType_t<MT>(1) & value );
835inline bool tryBitor(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
837 return trySet( mat, i, j, value );
866 tryBitor(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
868 return trySet( mat,
row,
column, m, n, value );
894inline bool tryBitxor(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
896 return tryAdd( mat, i, j, value );
925 tryBitxor(
const UniLowerMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
927 return tryAdd( mat,
row,
column, m, n, value );
953inline bool tryAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
954 const DenseVector<VT,false>& rhs,
size_t row,
size_t column )
967 const bool containsDiagonal(
column <
row + (*rhs).size() );
968 const size_t iend(
min(
column -
row, (*rhs).size() ) );
970 for(
size_t i=0UL; i<iend; ++i ) {
975 if( containsDiagonal && !
isOne( (*rhs)[iend] ) )
1000template<
typename MT
1004inline bool tryAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
1005 const DenseVector<VT,true>& rhs,
size_t row,
size_t column )
1018 const bool containsDiagonal(
row >=
column );
1019 const size_t ibegin( ( !containsDiagonal )?( 0UL ):(
row -
column + 1UL ) );
1024 for(
size_t i=ibegin; i<(*rhs).size(); ++i ) {
1053template<
typename MT
1058inline bool tryAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
1071 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
1072 if( !
isOne( (*rhs)[i] ) )
1076 else if(
band > 0L ) {
1077 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
1105template<
typename MT
1109inline bool tryAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
1110 const SparseVector<VT,false>& rhs,
size_t row,
size_t column )
1123 const bool containsDiagonal(
column <
row + (*rhs).size() );
1125 const auto last( (*rhs).lowerBound( index ) );
1127 if( containsDiagonal ) {
1128 if( last == (*rhs).end() || last->index() != index || !
isOne( last->value() ) )
1132 for(
auto element=(*rhs).begin(); element!=last; ++element ) {
1159template<
typename MT
1163inline bool tryAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
1164 const SparseVector<VT,true>& rhs,
size_t row,
size_t column )
1177 const bool containsDiagonal(
row >=
column );
1178 const size_t index( ( containsDiagonal )?(
row -
column ):( 0UL ) );
1179 const auto last( (*rhs).end() );
1180 auto element( (*rhs).lowerBound( index ) );
1182 if( containsDiagonal ) {
1183 if( element == last || element->index() != index || !
isOne( element->value() ) )
1188 for( ; element!=last; ++element ) {
1217template<
typename MT
1222inline bool tryAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
1235 if( (*rhs).nonZeros() != (*rhs).size() )
1237 for(
const auto& element : *rhs ) {
1238 if( !
isOne( element.value() ) )
1242 else if(
band > 0L ) {
1243 for(
const auto& element : *rhs ) {
1271template<
typename MT1
1275inline bool tryAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
1276 const DenseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1287 const size_t M( (*rhs).rows() );
1288 const size_t N( (*rhs).columns() );
1295 for(
size_t i=0UL; i<iend; ++i )
1297 const bool containsDiagonal(
row + i >=
column );
1302 const size_t jbegin( ( containsDiagonal )?(
row + i -
column + 1UL ):( 0UL ) );
1304 for(
size_t j=jbegin; j<N; ++j ) {
1332template<
typename MT1
1336inline bool tryAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
1337 const DenseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
1348 const size_t M( (*rhs).rows() );
1349 const size_t N( (*rhs).columns() );
1356 for(
size_t j=jbegin; j<N; ++j )
1360 for(
size_t i=0UL; i<iend; ++i ) {
1365 const bool containsDiagonal(
column + j <
row + M );
1367 if( containsDiagonal && !
isOne( (*rhs)(iend,j) ) )
1393template<
typename MT1
1397inline bool tryAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
1398 const SparseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1409 const size_t M( (*rhs).rows() );
1410 const size_t N( (*rhs).columns() );
1417 for(
size_t i=0UL; i<iend; ++i )
1419 const bool containsDiagonal(
row + i >=
column );
1420 const size_t index( ( containsDiagonal )?(
row + i -
column ):( 0UL ) );
1422 const auto last( (*rhs).end(i) );
1423 auto element( (*rhs).lowerBound( i, index ) );
1425 if( containsDiagonal ) {
1426 if( element == last || ( element->index() != index ) || !
isOne( element->value() ) )
1431 for( ; element!=last; ++element ) {
1459template<
typename MT1
1463inline bool tryAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
1464 const SparseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
1475 const size_t M( (*rhs).rows() );
1476 const size_t N( (*rhs).columns() );
1483 for(
size_t j=jbegin; j<N; ++j )
1485 const bool containsDiagonal(
column + j <
row + M );
1488 const auto last( (*rhs).lowerBound(
min( index, M ), j ) );
1490 if( containsDiagonal ) {
1491 if( last == (*rhs).end(j) || ( last->index() != index ) || !
isOne( last->value() ) )
1495 for(
auto element=(*rhs).begin(j); element!=last; ++element ) {
1524template<
typename MT
1528inline bool tryAddAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
1529 const DenseVector<VT,false>& rhs,
size_t row,
size_t column )
1542 const size_t iend(
min(
column -
row + 1UL, (*rhs).size() ) );
1544 for(
size_t i=0UL; i<iend; ++i ) {
1572template<
typename MT
1576inline bool tryAddAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
1577 const DenseVector<VT,true>& rhs,
size_t row,
size_t column )
1589 for(
size_t i=ibegin; i<(*rhs).size(); ++i ) {
1617template<
typename MT
1622inline bool tryAddAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
1635 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
1664template<
typename MT
1668inline bool tryAddAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
1669 const SparseVector<VT,false>& rhs,
size_t row,
size_t column )
1682 const auto last( (*rhs).lowerBound(
column -
row + 1UL ) );
1684 for(
auto element=(*rhs).begin(); element!=last; ++element ) {
1712template<
typename MT
1716inline bool tryAddAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
1717 const SparseVector<VT,true>& rhs,
size_t row,
size_t column )
1727 const auto last( (*rhs).end() );
1730 for( ; element!=last; ++element ) {
1758template<
typename MT
1763inline bool tryAddAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
1776 for(
const auto& element : *rhs ) {
1805template<
typename MT1
1809inline bool tryAddAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
1810 const DenseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1821 const size_t M( (*rhs).rows() );
1822 const size_t N( (*rhs).columns() );
1829 for(
size_t i=0UL; i<iend; ++i )
1831 const bool containsDiagonal(
row + i >=
column );
1832 const size_t jbegin( ( containsDiagonal )?(
row + i -
column ):( 0UL ) );
1834 for(
size_t j=jbegin; j<N; ++j ) {
1863template<
typename MT1
1867inline bool tryAddAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
1868 const DenseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
1879 const size_t M( (*rhs).rows() );
1880 const size_t N( (*rhs).columns() );
1887 for(
size_t j=jbegin; j<N; ++j )
1891 for(
size_t i=0UL; i<iend; ++i ) {
1920template<
typename MT1
1924inline bool tryAddAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
1925 const SparseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1936 const size_t M( (*rhs).rows() );
1937 const size_t N( (*rhs).columns() );
1944 for(
size_t i=0UL; i<iend; ++i )
1946 const bool containsDiagonal(
row + i >=
column );
1947 const size_t index( ( containsDiagonal )?(
row + i -
column ):( 0UL ) );
1949 const auto last( (*rhs).end(i) );
1950 auto element( (*rhs).lowerBound( i, index ) );
1952 for( ; element!=last; ++element ) {
1981template<
typename MT1
1985inline bool tryAddAssign(
const UniLowerMatrix<MT1,SO,DF>& lhs,
1986 const SparseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
1997 const size_t M( (*rhs).rows() );
1998 const size_t N( (*rhs).columns() );
2005 for(
size_t j=jbegin; j<N; ++j )
2007 const size_t index(
column + j -
row + 1UL );
2008 const auto last( (*rhs).lowerBound(
min( index, M ), j ) );
2010 for(
auto element=(*rhs).begin(j); element!=last; ++element ) {
2039template<
typename MT
2044inline bool trySubAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2045 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
2047 return tryAddAssign( lhs, *rhs,
row,
column );
2071template<
typename MT
2076inline bool trySubAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
2102template<
typename MT1
2107inline bool trySubAssign(
const UniLowerMatrix<MT1,SO1,DF>& lhs,
2108 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2110 return tryAddAssign( lhs, *rhs,
row,
column );
2133template<
typename MT
2137inline bool tryMultAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2138 const Vector<VT,false>& rhs,
size_t row,
size_t column )
2173template<
typename MT
2177inline bool tryMultAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2178 const Vector<VT,true>& rhs,
size_t row,
size_t column )
2213template<
typename MT
2218inline bool tryMultAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
2231 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
2232 if( !
isOne( (*rhs)[i] ) )
2260template<
typename MT
2265inline bool tryMultAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
2278 if( (*rhs).nonZeros() != (*rhs).size() )
2280 for(
const auto& element : *rhs ) {
2281 if( !
isOne( element.value() ) )
2309template<
typename MT1
2314inline bool trySchurAssign(
const UniLowerMatrix<MT1,SO1,DF>& lhs,
2315 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2326 const size_t M( (*rhs).rows() );
2327 const size_t N( (*rhs).columns() );
2335 for( ; i<M && j<N; ++i, ++j )
2337 if( !
isOne( (*rhs)(i,j) ) )
2363template<
typename MT
2368inline bool tryDivAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2369 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
2371 return tryMultAssign( lhs, *rhs,
row,
column );
2394template<
typename MT
2399inline bool tryDivAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
2424template<
typename MT
2428inline bool tryShiftAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2429 const Vector<VT,false>& rhs,
size_t row,
size_t column )
2463template<
typename MT
2467inline bool tryShiftAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2468 const Vector<VT,true>& rhs,
size_t row,
size_t column )
2503template<
typename MT
2508inline bool tryShiftAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
2521 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
2550template<
typename MT
2555inline bool tryShiftAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
2568 if( (*rhs).nonZeros() != (*rhs).size() )
2570 for(
const auto& element : *rhs ) {
2598template<
typename MT1
2603inline bool tryShiftAssign(
const UniLowerMatrix<MT1,SO1,DF>& lhs,
2604 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2615 const size_t M( (*rhs).rows() );
2616 const size_t N( (*rhs).columns() );
2624 for( ; i<M && j<N; ++i, ++j )
2653template<
typename MT
2657inline bool tryBitandAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2658 const Vector<VT,false>& rhs,
size_t row,
size_t column )
2670 ( ElementType_t<MT>(1) & (*rhs)[
column-
row] );
2693template<
typename MT
2697inline bool tryBitandAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2698 const Vector<VT,true>& rhs,
size_t row,
size_t column )
2710 ( ElementType_t<MT>(1) & (*rhs)[
row-
column] );
2733template<
typename MT
2738inline bool tryBitandAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
2751 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
2752 if( !( ElementType_t<MT>(1) & (*rhs)[i] ) )
2780template<
typename MT
2785inline bool tryBitandAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
2798 if( (*rhs).nonZeros() != (*rhs).size() )
2800 for(
const auto& element : *rhs ) {
2801 if( !( ElementType_t<MT>(1) & element.value() ) )
2829template<
typename MT1
2834inline bool tryBitandAssign(
const UniLowerMatrix<MT1,SO1,DF>& lhs,
2835 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2846 const size_t M( (*rhs).rows() );
2847 const size_t N( (*rhs).columns() );
2855 for( ; i<M && j<N; ++i, ++j )
2857 if( !( ElementType_t<MT1>(1) & (*rhs)(i,j) ) )
2884template<
typename MT
2889inline bool tryBitorAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2890 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
2892 return tryAssign( lhs, *rhs,
row,
column );
2915template<
typename MT
2920inline bool tryBitorAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
2946template<
typename MT1
2951inline bool tryBitorAssign(
const UniLowerMatrix<MT1,SO1,DF>& lhs,
2952 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2954 return tryAssign( lhs, *rhs,
row,
column );
2977template<
typename MT
2982inline bool tryBitxorAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
2983 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
2985 return tryAddAssign( lhs, *rhs,
row,
column );
3008template<
typename MT
3013inline bool tryBitxorAssign(
const UniLowerMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
3039template<
typename MT1
3044inline bool tryBitxorAssign(
const UniLowerMatrix<MT1,SO1,DF>& lhs,
3045 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
3047 return tryAddAssign( lhs, *rhs,
row,
column );
3067template<
typename MT
3070inline MT& derestrict( UniLowerMatrix<MT,SO,DF>& m )
3088template<
typename MT,
bool SO,
bool DF >
3089struct Size< UniLowerMatrix<MT,SO,DF>, 0UL >
3090 :
public Size<MT,0UL>
3093template<
typename MT,
bool SO,
bool DF >
3094struct Size< UniLowerMatrix<MT,SO,DF>, 1UL >
3095 :
public Size<MT,1UL>
3111template<
typename MT,
bool SO,
bool DF >
3112struct MaxSize< UniLowerMatrix<MT,SO,DF>, 0UL >
3113 :
public MaxSize<MT,0UL>
3116template<
typename MT,
bool SO,
bool DF >
3117struct MaxSize< UniLowerMatrix<MT,SO,DF>, 1UL >
3118 :
public MaxSize<MT,1UL>
3134template<
typename MT,
bool SO,
bool DF >
3135struct IsSquare< UniLowerMatrix<MT,SO,DF> >
3152template<
typename MT,
bool SO,
bool DF >
3153struct IsUniLower< UniLowerMatrix<MT,SO,DF> >
3170template<
typename MT,
bool SO,
bool DF >
3171struct IsAdaptor< UniLowerMatrix<MT,SO,DF> >
3188template<
typename MT,
bool SO,
bool DF >
3189struct IsRestricted< UniLowerMatrix<MT,SO,DF> >
3206template<
typename MT,
bool SO >
3207struct HasConstDataAccess< UniLowerMatrix<MT,SO,true> >
3224template<
typename MT,
bool SO,
bool DF >
3225struct IsAligned< UniLowerMatrix<MT,SO,DF> >
3226 :
public IsAligned<MT>
3242template<
typename MT,
bool SO,
bool DF >
3243struct IsContiguous< UniLowerMatrix<MT,SO,DF> >
3244 :
public IsContiguous<MT>
3260template<
typename MT,
bool SO,
bool DF >
3261struct IsPadded< UniLowerMatrix<MT,SO,DF> >
3262 :
public IsPadded<MT>
3278template<
typename MT,
bool SO,
bool DF >
3279struct RemoveAdaptor< UniLowerMatrix<MT,SO,DF> >
3297template<
typename T1,
typename T2 >
3298struct AddTraitEval1< T1, T2
3301 ( ( IsUniLower_v<T1> && IsStrictlyLower_v<T2> &&
3302 !( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> ) ) ||
3303 ( IsStrictlyLower_v<T1> && IsUniLower_v<T2> &&
3304 !( IsStrictlyUpper_v<T1> && IsUniUpper_v<T2> ) ) ) &&
3305 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3307 using Type = UniLowerMatrix< typename AddTraitEval2<T1,T2>::Type >;
3323template<
typename T1,
typename T2 >
3324struct SubTraitEval1< T1, T2
3327 ( IsUniLower_v<T1> && IsStrictlyLower_v<T2> &&
3328 !( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> ) ) &&
3329 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3331 using Type = UniLowerMatrix< typename SubTraitEval2<T1,T2>::Type >;
3347template<
typename T1,
typename T2 >
3348struct SchurTraitEval1< T1, T2
3351 ( IsUniLower_v<T1> && IsUniLower_v<T2> ) &&
3352 !( IsDiagonal_v<T1> || IsDiagonal_v<T2> ) &&
3353 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3355 using Type = UniLowerMatrix< typename SchurTraitEval2<T1,T2>::Type >;
3371template<
typename T1,
typename T2 >
3372struct MultTraitEval1< T1, T2
3375 ( IsUniLower_v<T1> && IsUniLower_v<T2> ) &&
3376 !( IsIdentity_v<T1> || IsIdentity_v<T2> ) > >
3378 using Type = UniLowerMatrix< typename MultTraitEval2<T1,T2>::Type >;
3394template<
typename T1,
typename T2 >
3395struct KronTraitEval1< T1, T2
3398 ( IsUniLower_v<T1> && IsUniLower_v<T2> ) &&
3399 !( IsIdentity_v<T1> && IsIdentity_v<T2> ) &&
3400 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3402 using Type = UniLowerMatrix< typename KronTraitEval2<T1,T2>::Type >;
3418template<
typename T,
typename OP >
3419struct UnaryMapTraitEval1< T, OP
3421 !YieldsIdentity_v<OP,T> > >
3423 using Type = UniLowerMatrix< typename UnaryMapTraitEval2<T,OP>::Type, StorageOrder_v<T> >;
3431template<
typename T1,
typename T2,
typename OP >
3432struct BinaryMapTraitEval1< T1, T2, OP
3434 !YieldsIdentity_v<OP,T1,T2> > >
3436 using Type = UniLowerMatrix< typename BinaryMapTraitEval2<T1,T2,OP>::Type >;
3452template<
typename MT,
bool SO,
bool DF >
3453struct DeclSymTrait< UniLowerMatrix<MT,SO,DF> >
3455 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3471template<
typename MT,
bool SO,
bool DF >
3472struct DeclHermTrait< UniLowerMatrix<MT,SO,DF> >
3474 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3490template<
typename MT,
bool SO,
bool DF >
3491struct DeclLowTrait< UniLowerMatrix<MT,SO,DF> >
3493 using Type = UniLowerMatrix<MT,SO,DF>;
3509template<
typename MT,
bool SO,
bool DF >
3510struct DeclUniLowTrait< UniLowerMatrix<MT,SO,DF> >
3512 using Type = UniLowerMatrix<MT,SO,DF>;
3528template<
typename MT,
bool SO,
bool DF >
3529struct DeclStrLowTrait< UniLowerMatrix<MT,SO,DF> >
3531 using Type = INVALID_TYPE;
3547template<
typename MT,
bool SO,
bool DF >
3548struct DeclUppTrait< UniLowerMatrix<MT,SO,DF> >
3550 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3566template<
typename MT,
bool SO,
bool DF >
3567struct DeclUniUppTrait< UniLowerMatrix<MT,SO,DF> >
3569 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3585template<
typename MT,
bool SO,
bool DF >
3586struct DeclStrUppTrait< UniLowerMatrix<MT,SO,DF> >
3588 using Type = INVALID_TYPE;
3604template<
typename MT,
bool SO,
bool DF >
3605struct DeclDiagTrait< UniLowerMatrix<MT,SO,DF> >
3607 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3623template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
3624struct HighType< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
3626 using Type = UniLowerMatrix< typename HighType<MT1,MT2>::Type >;
3642template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
3643struct LowType< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
3645 using Type = UniLowerMatrix< typename LowType<MT1,MT2>::Type >;
3661template<
typename MT,
size_t I,
size_t N >
3662struct SubmatrixTraitEval1< MT, I, I, N, N
3665 !IsIdentity_v<MT> > >
3667 using Type = UniLowerMatrix< typename SubmatrixTraitEval2<MT,I,I,N,N>::Type >;
Header file for the addition trait.
Header file for auxiliary alias declarations.
Header file for run time assertion macros.
Constraint on the data type.
Header file for the decldiag trait.
Header file for the declherm trait.
Header file for the decllow trait.
Header file for the declstrlow trait.
Header file for the declstrupp trait.
Header file for the declsym trait.
Header file for the declunilow trait.
Header file for the decluniupp trait.
Header file for the declupp trait.
Header file for the EnableIf class template.
Header file for the HasConstDataAccess type trait.
Constraint on the data type.
Header file for the HighType type trait.
Header file for the IntegralConstant class template.
Utility type for generic codes.
Header file for the dense matrix inversion flags.
Header file for the IsAdaptor type trait.
Header file for the IsAligned type trait.
Header file for the IsContiguous type trait.
Header file for the isDefault shim.
Header file for the IsDiagonal type trait.
Header file for the IsIdentity type trait.
Header file for the IsMatrix type trait.
Header file for the isOne shim.
Header file for the IsPadded type trait.
Header file for the IsRestricted type trait.
Header file for the IsSquare type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsUniLower type trait.
Header file for the IsUniUpper type trait.
Header file for the Kron product trait.
Header file for the LowType type trait.
Constraint on the data type.
Header file for the map trait.
Header file for the MaxSize type trait.
Header file for the MAYBE_UNUSED function template.
Header file for the multiplication trait.
Header file for the relaxation flag enumeration.
Header file for the RemoveAdaptor type trait.
Header file for the Schur product trait.
Header file for the subtraction trait.
Header file for the submatrix trait.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the YieldsIdentity type trait.
Header file for the YieldsUniLower type trait.
Header file for the implementation of the base template of the UniLowerMatrix.
UniLowerMatrix specialization for dense matrices.
UniLowerMatrix specialization for sparse matrices.
Pointer difference type of the Blaze library.
Constraint on the data type.
decltype(auto) band(Matrix< MT, SO > &matrix, RBAs... args)
Creating a view on a specific band of the given matrix.
Definition: Band.h:140
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:137
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
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:1339
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an identity matrix.
Definition: DenseMatrix.h:2561
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:207
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:225
bool isDefault(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the given diagonal matrix is in default state.
Definition: DiagonalMatrix.h:169
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:693
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE(T)
Constraint on the data type.
Definition: BLASCompatible.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition: RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Hermitian.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Upper.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: UniTriangular.h:81
constexpr bool YieldsUniLower_v
Auxiliary variable template for the YieldsUniLower type trait.
Definition: YieldsUniLower.h:124
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition: Size.h:72
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.
Definition: IsMatrix.h:124
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition: RelaxationFlag.h:66
constexpr Infinity inf
Global Infinity instance.
Definition: Infinity.h:1080
bool isOne(const Proxy< PT, RT > &proxy)
Returns whether the represented element is 1.
Definition: Proxy.h:2337
InversionFlag
Inversion flag.
Definition: InversionFlag.h:102
@ asUniLower
Flag for the inversion of a lower unitriangular matrix.
Definition: InversionFlag.h:112
@ asLower
Flag for the inversion of a lower triangular matrix.
Definition: InversionFlag.h:111
@ asUpper
Flag for the inversion of a upper triangular matrix.
Definition: InversionFlag.h:113
@ asUniUpper
Flag for the inversion of a upper unitriangular matrix.
Definition: InversionFlag.h:114
@ asDiagonal
Flag for the inversion of a diagonal matrix.
Definition: InversionFlag.h:115
@ byLU
Flag for the LU-based matrix inversion.
Definition: InversionFlag.h:103
@ asGeneral
Flag for the inversion of a general matrix (same as byLU).
Definition: InversionFlag.h:108
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition: Matrix.h:806
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:1108
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:137
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
BoolConstant< true > TrueType
Type traits base class.
Definition: IntegralConstant.h:132
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Header file for all forward declarations of the math module.
Header file for the Size type trait.
Header file for the StorageOrder type trait.
Header file for the IsZero type trait.
Header file for the generic min algorithm.