35#ifndef _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_H_
36#define _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_H_
116template< RelaxationFlag RF,
typename MT,
bool SO,
bool DF >
117bool isDefault(
const UniUpperMatrix<MT,SO,DF>& m );
119template<
typename MT,
bool SO,
bool DF >
120bool isIntact(
const UniUpperMatrix<MT,SO,DF>& m );
122template<
typename MT,
bool SO,
bool DF >
123void swap( UniUpperMatrix<MT,SO,DF>& a, UniUpperMatrix<MT,SO,DF>& b )
noexcept;
159inline bool isDefault(
const UniUpperMatrix<MT,SO,DF>& m )
162 return m.rows() == 0UL;
163 else return isIdentity<RF>( m );
192inline bool isIntact(
const UniUpperMatrix<MT,SO,DF>& m )
210inline void swap( UniUpperMatrix<MT,SO,DF>& a, UniUpperMatrix<MT,SO,DF>& b )
noexcept
243inline void invert( UniUpperMatrix<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 UniUpperMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
285 DenseMatrix<MT3,SO1>& U, Matrix<MT4,SO2>& P )
299 using ET2 = ElementType_t<MT2>;
300 using ET4 = ElementType_t<MT4>;
302 const size_t n( (*A).rows() );
304 decltype(
auto) L2( derestrict( *L ) );
314 for(
size_t i=0UL; i<n; ++i ) {
343inline bool trySet(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
351 ( i == j &&
isOne( value ) ) ||
381 trySet(
const UniUpperMatrix<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 UniUpperMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
456 tryAdd(
const UniUpperMatrix<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 UniUpperMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
496 return tryAdd( mat, i, j, value );
525 trySub(
const UniUpperMatrix<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 UniUpperMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
560 return ( i != j ||
isOne( value ) );
589 tryMult(
const UniUpperMatrix<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 UniUpperMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
630 return tryMult( mat, i, j, value );
659 tryDiv(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
693inline bool tryShift(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
int count )
728 tryShift(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
int count )
737 return ( m == 0UL ) ||
767inline bool tryBitand(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
774 return ( i != j ) || ( ElementType_t<MT>(1) & value );
803 tryBitand(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
812 return ( m == 0UL ) ||
816 ( ElementType_t<MT>(1) & value );
842inline bool tryBitor(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
844 return trySet( mat, i, j, value );
873 tryBitor(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
875 return trySet( mat,
row,
column, m, n, value );
901inline bool tryBitxor(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
903 return tryAdd( mat, i, j, value );
932 tryBitxor(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
934 return tryAdd( mat,
row,
column, m, n, value );
960inline bool tryAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
961 const DenseVector<VT,false>& rhs,
size_t row,
size_t column )
974 const bool containsDiagonal(
column >=
row );
975 const size_t ibegin( ( !containsDiagonal )?( 0UL ):(
column -
row + 1UL ) );
980 for(
size_t i=ibegin; i<(*rhs).size(); ++i ) {
1007template<
typename MT
1011inline bool tryAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
1012 const DenseVector<VT,true>& rhs,
size_t row,
size_t column )
1025 const bool containsDiagonal(
row <
column + (*rhs).size() );
1026 const size_t iend(
min(
row -
column, (*rhs).size() ) );
1028 for(
size_t i=0UL; i<iend; ++i ) {
1033 if( containsDiagonal && !
isOne( (*rhs)[iend] ) )
1060template<
typename MT
1065inline bool tryAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
1078 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
1079 if( !
isOne( (*rhs)[i] ) )
1083 else if(
band < 0L ) {
1084 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
1112template<
typename MT
1116inline bool tryAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
1117 const SparseVector<VT,false>& rhs,
size_t row,
size_t column )
1130 const bool containsDiagonal(
column >=
row );
1131 const size_t index( ( containsDiagonal )?(
column -
row ):( 0UL ) );
1132 const auto last( (*rhs).end() );
1133 auto element( (*rhs).lowerBound( index ) );
1135 if( containsDiagonal ) {
1136 if( element == last || element->index() != index || !
isOne( element->value() ) )
1141 for( ; element!=last; ++element ) {
1168template<
typename MT
1172inline bool tryAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
1173 const SparseVector<VT,true>& rhs,
size_t row,
size_t column )
1186 const bool containsDiagonal(
row <
column + (*rhs).size() );
1188 const auto last( (*rhs).lowerBound( index ) );
1190 if( containsDiagonal ) {
1191 if( last == (*rhs).end() || last->index() != index || !
isOne( last->value() ) )
1195 for(
auto element=(*rhs).begin(); element!=last; ++element ) {
1224template<
typename MT
1229inline bool tryAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
1242 if( (*rhs).nonZeros() != (*rhs).size() )
1244 for(
const auto& element : *rhs ) {
1245 if( !
isOne( element.value() ) )
1249 else if(
band < 0L ) {
1250 for(
const auto& element : *rhs ) {
1278template<
typename MT1
1282inline bool tryAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
1283 const DenseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1294 const size_t M( (*rhs).rows() );
1295 const size_t N( (*rhs).columns() );
1302 for(
size_t i=ibegin; i<M; ++i )
1306 for(
size_t j=0UL; j<jend; ++j ) {
1311 const bool containsDiagonal(
row + i <
column + N );
1313 if( containsDiagonal && !
isOne( (*rhs)(i,jend) ) )
1339template<
typename MT1
1343inline bool tryAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
1344 const DenseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
1355 const size_t M( (*rhs).rows() );
1356 const size_t N( (*rhs).columns() );
1363 for(
size_t j=0UL; j<jend; ++j )
1365 const bool containsDiagonal(
column + j >=
row );
1370 const size_t ibegin( ( containsDiagonal )?(
column + j -
row + 1UL ):( 0UL ) );
1372 for(
size_t i=ibegin; i<M; ++i ) {
1400template<
typename MT1
1404inline bool tryAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
1405 const SparseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1416 const size_t M( (*rhs).rows() );
1417 const size_t N( (*rhs).columns() );
1424 for(
size_t i=ibegin; i<M; ++i )
1426 const bool containsDiagonal(
row + i <
column + N );
1429 const auto last( (*rhs).lowerBound( i,
min( index, N ) ) );
1431 if( containsDiagonal ) {
1432 if( last == (*rhs).end(i) || ( last->index() != index ) || !
isOne( last->value() ) )
1436 for(
auto element=(*rhs).begin(i); element!=last; ++element ) {
1464template<
typename MT1
1468inline bool tryAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
1469 const SparseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
1480 const size_t M( (*rhs).rows() );
1481 const size_t N( (*rhs).columns() );
1488 for(
size_t j=0UL; j<jend; ++j )
1490 const bool containsDiagonal(
column + j >=
row );
1491 const size_t index( ( containsDiagonal )?(
column + j -
row ):( 0UL ) );
1493 const auto last( (*rhs).end(j) );
1494 auto element( (*rhs).lowerBound( index, j ) );
1496 if( containsDiagonal ) {
1497 if( element == last || ( element->index() != index ) || !
isOne( element->value() ) )
1502 for( ; element!=last; ++element ) {
1531template<
typename MT
1535inline bool tryAddAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
1536 const DenseVector<VT,false>& rhs,
size_t row,
size_t column )
1548 for(
size_t i=ibegin; i<(*rhs).size(); ++i ) {
1576template<
typename MT
1580inline bool tryAddAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
1581 const DenseVector<VT,true>& rhs,
size_t row,
size_t column )
1594 const size_t iend(
min(
row -
column + 1UL, (*rhs).size() ) );
1596 for(
size_t i=0UL; i<iend; ++i ) {
1624template<
typename MT
1629inline bool tryAddAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
1642 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
1671template<
typename MT
1675inline bool tryAddAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
1676 const SparseVector<VT,false>& rhs,
size_t row,
size_t column )
1686 const auto last( (*rhs).end() );
1689 for( ; element!=last; ++element ) {
1717template<
typename MT
1721inline bool tryAddAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
1722 const SparseVector<VT,true>& rhs,
size_t row,
size_t column )
1735 const auto last( (*rhs).lowerBound(
row -
column + 1UL ) );
1737 for(
auto element=(*rhs).begin(); element!=last; ++element ) {
1765template<
typename MT
1770inline bool tryAddAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
1783 for(
const auto& element : *rhs ) {
1812template<
typename MT1
1816inline bool tryAddAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
1817 const DenseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1828 const size_t M( (*rhs).rows() );
1829 const size_t N( (*rhs).columns() );
1836 for(
size_t i=ibegin; i<M; ++i )
1840 for(
size_t j=0UL; j<jend; ++j ) {
1869template<
typename MT1
1873inline bool tryAddAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
1874 const DenseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
1885 const size_t M( (*rhs).rows() );
1886 const size_t N( (*rhs).columns() );
1893 for(
size_t j=0UL; j<jend; ++j )
1895 const bool containsDiagonal(
column + j >=
row );
1896 const size_t ibegin( ( containsDiagonal )?(
column + j -
row ):( 0UL ) );
1898 for(
size_t i=ibegin; i<M; ++i ) {
1927template<
typename MT1
1931inline bool tryAddAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
1932 const SparseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1943 const size_t M( (*rhs).rows() );
1944 const size_t N( (*rhs).columns() );
1951 for(
size_t i=ibegin; i<M; ++i )
1953 const size_t index(
row + i -
column + 1UL );
1954 const auto last( (*rhs).lowerBound( i,
min( index, N ) ) );
1956 for(
auto element=(*rhs).begin(i); element!=last; ++element ) {
1985template<
typename MT1
1989inline bool tryAddAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
1990 const SparseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
2001 const size_t M( (*rhs).rows() );
2002 const size_t N( (*rhs).columns() );
2009 for(
size_t j=0UL; j<jend; ++j )
2011 const bool containsDiagonal(
column + j >=
row );
2012 const size_t index( ( containsDiagonal )?(
column + j -
row ):( 0UL ) );
2014 const auto last( (*rhs).end(j) );
2015 auto element( (*rhs).lowerBound( index, j ) );
2017 for( ; element!=last; ++element ) {
2046template<
typename MT
2051inline bool trySubAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2052 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
2054 return tryAddAssign( lhs, *rhs,
row,
column );
2078template<
typename MT
2083inline bool trySubAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
2109template<
typename MT1
2114inline bool trySubAssign(
const UniUpperMatrix<MT1,SO1,DF>& lhs,
2115 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2117 return tryAddAssign( lhs, *rhs,
row,
column );
2140template<
typename MT
2144inline bool tryMultAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2145 const Vector<VT,false>& rhs,
size_t row,
size_t column )
2180template<
typename MT
2184inline bool tryMultAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2185 const Vector<VT,true>& rhs,
size_t row,
size_t column )
2220template<
typename MT
2225inline bool tryMultAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
2238 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
2239 if( !
isOne( (*rhs)[i] ) )
2267template<
typename MT
2272inline bool tryMultAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
2285 if( (*rhs).nonZeros() != (*rhs).size() )
2287 for(
const auto& element : *rhs ) {
2288 if( !
isOne( element.value() ) )
2316template<
typename MT1
2321inline bool trySchurAssign(
const UniUpperMatrix<MT1,SO1,DF>& lhs,
2322 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2333 const size_t M( (*rhs).rows() );
2334 const size_t N( (*rhs).columns() );
2342 for( ; i<M && j<N; ++i, ++j )
2344 if( !
isOne( (*rhs)(i,j) ) )
2370template<
typename MT
2375inline bool tryDivAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2376 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
2378 return tryMultAssign( lhs, *rhs,
row,
column );
2401template<
typename MT
2406inline bool tryDivAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
2431template<
typename MT
2435inline bool tryShiftAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2436 const Vector<VT,false>& rhs,
size_t row,
size_t column )
2470template<
typename MT
2474inline bool tryShiftAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2475 const Vector<VT,true>& rhs,
size_t row,
size_t column )
2510template<
typename MT
2515inline bool tryShiftAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
2528 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
2557template<
typename MT
2562inline bool tryShiftAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
2575 if( (*rhs).nonZeros() != (*rhs).size() )
2577 for(
const auto& element : *rhs ) {
2605template<
typename MT1
2610inline bool tryShiftAssign(
const UniUpperMatrix<MT1,SO1,DF>& lhs,
2611 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2622 const size_t M( (*rhs).rows() );
2623 const size_t N( (*rhs).columns() );
2631 for( ; i<M && j<N; ++i, ++j )
2660template<
typename MT
2664inline bool tryBitandAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2665 const Vector<VT,false>& rhs,
size_t row,
size_t column )
2677 ( ElementType_t<MT>(1) & (*rhs)[
column-
row] );
2700template<
typename MT
2704inline bool tryBitandAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2705 const Vector<VT,true>& rhs,
size_t row,
size_t column )
2717 ( ElementType_t<MT>(1) & (*rhs)[
row-
column] );
2740template<
typename MT
2745inline bool tryBitandAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
2758 for(
size_t i=0UL; i<(*rhs).size(); ++i ) {
2759 if( !( ElementType_t<MT>(1) & (*rhs)[i] ) )
2787template<
typename MT
2792inline bool tryBitandAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
2805 if( (*rhs).nonZeros() != (*rhs).size() )
2807 for(
const auto& element : *rhs ) {
2808 if( !( ElementType_t<MT>(1) & element.value() ) )
2836template<
typename MT1
2841inline bool tryBitandAssign(
const UniUpperMatrix<MT1,SO1,DF>& lhs,
2842 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2853 const size_t M( (*rhs).rows() );
2854 const size_t N( (*rhs).columns() );
2862 for( ; i<M && j<N; ++i, ++j )
2864 if( !( ElementType_t<MT1>(1) & (*rhs)(i,j) ) )
2891template<
typename MT
2896inline bool tryBitorAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2897 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
2899 return tryAssign( lhs, *rhs,
row,
column );
2922template<
typename MT
2927inline bool tryBitorAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
2953template<
typename MT1
2958inline bool tryBitorAssign(
const UniUpperMatrix<MT1,SO1,DF>& lhs,
2959 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2961 return tryAssign( lhs, *rhs,
row,
column );
2984template<
typename MT
2989inline bool tryBitxorAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2990 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
2992 return tryAddAssign( lhs, *rhs,
row,
column );
3015template<
typename MT
3020inline bool tryBitxorAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
3046template<
typename MT1
3051inline bool tryBitxorAssign(
const UniUpperMatrix<MT1,SO1,DF>& lhs,
3052 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
3054 return tryAddAssign( lhs, *rhs,
row,
column );
3074template<
typename MT
3077inline MT& derestrict( UniUpperMatrix<MT,SO,DF>& m )
3095template<
typename MT,
bool SO,
bool DF >
3096struct Size< UniUpperMatrix<MT,SO,DF>, 0UL >
3097 :
public Size<MT,0UL>
3100template<
typename MT,
bool SO,
bool DF >
3101struct Size< UniUpperMatrix<MT,SO,DF>, 1UL >
3102 :
public Size<MT,1UL>
3118template<
typename MT,
bool SO,
bool DF >
3119struct MaxSize< UniUpperMatrix<MT,SO,DF>, 0UL >
3120 :
public MaxSize<MT,0UL>
3123template<
typename MT,
bool SO,
bool DF >
3124struct MaxSize< UniUpperMatrix<MT,SO,DF>, 1UL >
3125 :
public MaxSize<MT,1UL>
3141template<
typename MT,
bool SO,
bool DF >
3142struct IsSquare< UniUpperMatrix<MT,SO,DF> >
3159template<
typename MT,
bool SO,
bool DF >
3160struct IsUniUpper< UniUpperMatrix<MT,SO,DF> >
3177template<
typename MT,
bool SO,
bool DF >
3178struct IsAdaptor< UniUpperMatrix<MT,SO,DF> >
3195template<
typename MT,
bool SO,
bool DF >
3196struct IsRestricted< UniUpperMatrix<MT,SO,DF> >
3213template<
typename MT,
bool SO >
3214struct HasConstDataAccess< UniUpperMatrix<MT,SO,true> >
3231template<
typename MT,
bool SO,
bool DF >
3232struct IsAligned< UniUpperMatrix<MT,SO,DF> >
3233 :
public IsAligned<MT>
3249template<
typename MT,
bool SO,
bool DF >
3250struct IsContiguous< UniUpperMatrix<MT,SO,DF> >
3251 :
public IsContiguous<MT>
3267template<
typename MT,
bool SO,
bool DF >
3268struct IsPadded< UniUpperMatrix<MT,SO,DF> >
3269 :
public IsPadded<MT>
3285template<
typename MT,
bool SO,
bool DF >
3286struct RemoveAdaptor< UniUpperMatrix<MT,SO,DF> >
3304template<
typename T1,
typename T2 >
3305struct AddTraitEval1< T1, T2
3308 ( ( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> &&
3309 !( IsUniLower_v<T1> && IsStrictlyLower_v<T2> ) ) ||
3310 ( IsStrictlyUpper_v<T1> && IsUniUpper_v<T2> &&
3311 !( IsStrictlyLower_v<T1> && IsUniLower_v<T2> ) ) ) &&
3312 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3314 using Type = UniUpperMatrix< typename AddTraitEval2<T1,T2>::Type >;
3330template<
typename T1,
typename T2 >
3331struct SubTraitEval1< T1, T2
3334 ( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> &&
3335 !( IsUniLower_v<T1> && IsStrictlyLower_v<T2> ) ) &&
3336 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3338 using Type = UniUpperMatrix< typename SubTraitEval2<T1,T2>::Type >;
3354template<
typename T1,
typename T2 >
3355struct SchurTraitEval1< T1, T2
3358 ( IsUniUpper_v<T1> && IsUniUpper_v<T2> ) &&
3359 !( IsDiagonal_v<T1> || IsDiagonal_v<T2> ) &&
3360 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3362 using Type = UniUpperMatrix< typename SchurTraitEval2<T1,T2>::Type >;
3378template<
typename T1,
typename T2 >
3379struct MultTraitEval1< T1, T2
3382 ( IsUniUpper_v<T1> && IsUniUpper_v<T2> ) &&
3383 !( IsIdentity_v<T1> || IsIdentity_v<T2> ) > >
3385 using Type = UniUpperMatrix< typename MultTraitEval2<T1,T2>::Type >;
3401template<
typename T1,
typename T2 >
3402struct KronTraitEval1< T1, T2
3405 ( IsUniUpper_v<T1> && IsUniUpper_v<T2> ) &&
3406 !( IsIdentity_v<T1> && IsIdentity_v<T2> ) &&
3407 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3409 using Type = UniUpperMatrix< typename KronTraitEval2<T1,T2>::Type >;
3425template<
typename T,
typename OP >
3426struct UnaryMapTraitEval1< T, OP
3428 !YieldsIdentity_v<OP,T> > >
3430 using Type = UniUpperMatrix< typename UnaryMapTraitEval2<T,OP>::Type, StorageOrder_v<T> >;
3438template<
typename T1,
typename T2,
typename OP >
3439struct BinaryMapTraitEval1< T1, T2, OP
3441 !YieldsIdentity_v<OP,T1,T2> > >
3443 using Type = UniUpperMatrix< typename BinaryMapTraitEval2<T1,T2,OP>::Type >;
3459template<
typename MT,
bool SO,
bool DF >
3460struct DeclSymTrait< UniUpperMatrix<MT,SO,DF> >
3462 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3478template<
typename MT,
bool SO,
bool DF >
3479struct DeclHermTrait< UniUpperMatrix<MT,SO,DF> >
3481 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3497template<
typename MT,
bool SO,
bool DF >
3498struct DeclLowTrait< UniUpperMatrix<MT,SO,DF> >
3500 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3516template<
typename MT,
bool SO,
bool DF >
3517struct DeclUniLowTrait< UniUpperMatrix<MT,SO,DF> >
3519 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3535template<
typename MT,
bool SO,
bool DF >
3536struct DeclStrLowTrait< UniUpperMatrix<MT,SO,DF> >
3538 using Type = INVALID_TYPE;
3554template<
typename MT,
bool SO,
bool DF >
3555struct DeclUppTrait< UniUpperMatrix<MT,SO,DF> >
3557 using Type = UniUpperMatrix<MT,SO,DF>;
3573template<
typename MT,
bool SO,
bool DF >
3574struct DeclUniUppTrait< UniUpperMatrix<MT,SO,DF> >
3576 using Type = UniUpperMatrix<MT,SO,DF>;
3592template<
typename MT,
bool SO,
bool DF >
3593struct DeclStrUppTrait< UniUpperMatrix<MT,SO,DF> >
3595 using Type = INVALID_TYPE;
3611template<
typename MT,
bool SO,
bool DF >
3612struct DeclDiagTrait< UniUpperMatrix<MT,SO,DF> >
3614 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3630template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
3631struct HighType< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
3633 using Type = UniUpperMatrix< typename HighType<MT1,MT2>::Type >;
3649template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
3650struct LowType< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
3652 using Type = UniUpperMatrix< typename LowType<MT1,MT2>::Type >;
3668template<
typename MT,
size_t I,
size_t N >
3669struct SubmatrixTraitEval1< MT, I, I, N, N
3672 !IsIdentity_v<MT> > >
3674 using Type = UniUpperMatrix< 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 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 YieldsUniUpper type trait.
Header file for the implementation of the base template of the UniUpperMatrix.
UniUpperMatrix specialization for dense matrices.
UniUpperMatrix 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 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
constexpr bool YieldsUniUpper_v
Auxiliary variable template for the YieldsUniUpper type trait.
Definition: YieldsUniUpper.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.