35 #ifndef _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_H_ 36 #define _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_H_ 113 template<
typename MT,
bool SO,
bool DF >
114 void reset( UniUpperMatrix<MT,SO,DF>& m );
116 template<
typename MT,
bool SO,
bool DF >
117 void reset( UniUpperMatrix<MT,SO,DF>& m,
size_t i );
119 template<
typename MT,
bool SO,
bool DF >
120 void clear( UniUpperMatrix<MT,SO,DF>& m );
122 template<
bool RF,
typename MT,
bool SO,
bool DF >
123 bool isDefault(
const UniUpperMatrix<MT,SO,DF>& m );
125 template<
typename MT,
bool SO,
bool DF >
126 bool isIntact(
const UniUpperMatrix<MT,SO,DF>& m );
128 template<
typename MT,
bool SO,
bool DF >
129 void swap( UniUpperMatrix<MT,SO,DF>& a, UniUpperMatrix<MT,SO,DF>& b ) noexcept;
141 template<
typename MT
164 template<
typename MT
181 template<
typename MT
205 inline bool isDefault_backend(
const UniUpperMatrix<MT,SO,DF>& m,
TrueType )
207 return ( m.rows() == 0UL );
227 inline bool isDefault_backend(
const UniUpperMatrix<MT,SO,DF>& m,
FalseType )
229 return isIdentity<RF>( m );
294 template<
typename MT
312 template<
typename MT
348 inline void invert( UniUpperMatrix<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 UniUpperMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
390 DenseMatrix<MT3,SO1>& U, Matrix<MT4,SO2>& P )
404 using ET2 = ElementType_t<MT2>;
405 using ET4 = ElementType_t<MT4>;
407 const size_t n( (~A).
rows() );
409 decltype(
auto) L2( derestrict( ~L ) );
419 for(
size_t i=0UL; i<n; ++i ) {
444 template<
typename MT
448 inline bool trySet(
const UniUpperMatrix<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 UniUpperMatrix<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 UniUpperMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
556 template<
typename MT
561 tryAdd(
const UniUpperMatrix<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 UniUpperMatrix<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 UniUpperMatrix<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 UniUpperMatrix<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 UniUpperMatrix<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 UniUpperMatrix<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 UniUpperMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
795 template<
typename MT
798 inline bool tryShift(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
int count )
829 template<
typename MT
833 tryShift(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
int count )
842 return ( m == 0UL ) ||
868 template<
typename MT
872 inline bool tryBitand(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
879 return ( i != j ) || ( ElementType_t<MT>(1) & value );
903 template<
typename MT
908 tryBitand(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
917 return ( m == 0UL ) ||
921 ( ElementType_t<MT>(1) & value );
943 template<
typename MT
947 inline bool tryBitor(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
949 return trySet( mat, i, j, value );
973 template<
typename MT
978 tryBitor(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
980 return trySet( mat,
row,
column, m, n, value );
1002 template<
typename MT
1006 inline bool tryBitxor(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t i,
size_t j,
const ET& value )
1008 return tryAdd( mat, i, j, value );
1032 template<
typename MT
1037 tryBitxor(
const UniUpperMatrix<MT,SO,DF>& mat,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
1039 return tryAdd( mat,
row,
column, m, n, value );
1061 template<
typename MT
1065 inline bool tryAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
1066 const DenseVector<VT,false>& rhs,
size_t row,
size_t column )
1079 const bool containsDiagonal(
column >=
row );
1080 const size_t ibegin( ( !containsDiagonal )?( 0UL ):(
column -
row + 1UL ) );
1085 for(
size_t i=ibegin; i<(~rhs).
size(); ++i ) {
1112 template<
typename MT
1116 inline bool tryAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
1117 const DenseVector<VT,true>& rhs,
size_t row,
size_t column )
1130 const bool containsDiagonal(
row <
column + (~rhs).
size() );
1133 for(
size_t i=0UL; i<iend; ++i ) {
1138 if( containsDiagonal && !
isOne( (~rhs)[iend] ) )
1165 template<
typename MT
1170 inline bool tryAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
1183 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
1184 if( !
isOne( (~rhs)[i] ) )
1188 else if(
band < 0L ) {
1189 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
1217 template<
typename MT
1221 inline bool tryAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
1222 const SparseVector<VT,false>& rhs,
size_t row,
size_t column )
1235 const bool containsDiagonal(
column >=
row );
1236 const size_t index( ( containsDiagonal )?(
column -
row ):( 0UL ) );
1237 const auto last( (~rhs).
end() );
1238 auto element( (~rhs).lowerBound( index ) );
1240 if( containsDiagonal ) {
1241 if( element == last || element->index() != index || !
isOne( element->value() ) )
1246 for( ; element!=last; ++element ) {
1273 template<
typename MT
1277 inline bool tryAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
1278 const SparseVector<VT,true>& rhs,
size_t row,
size_t column )
1291 const bool containsDiagonal(
row <
column + (~rhs).
size() );
1293 const auto last( (~rhs).lowerBound( index ) );
1295 if( containsDiagonal ) {
1296 if( last == (~rhs).
end() || last->index() != index || !
isOne( last->value() ) )
1300 for(
auto element=(~rhs).begin(); element!=last; ++element ) {
1329 template<
typename MT
1334 inline bool tryAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
1349 for(
const auto& element : ~rhs ) {
1350 if( !
isOne( element.value() ) )
1354 else if(
band < 0L ) {
1355 for(
const auto& element : ~rhs ) {
1383 template<
typename MT1
1387 inline bool tryAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
1388 const DenseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1399 const size_t M( (~rhs).
rows() );
1400 const size_t N( (~rhs).
columns() );
1407 for(
size_t i=ibegin; i<M; ++i )
1411 for(
size_t j=0UL; j<jend; ++j ) {
1416 const bool containsDiagonal(
row + i <
column + N );
1418 if( containsDiagonal && !
isOne( (~rhs)(i,jend) ) )
1444 template<
typename MT1
1448 inline bool tryAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
1449 const DenseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
1460 const size_t M( (~rhs).
rows() );
1461 const size_t N( (~rhs).
columns() );
1468 for(
size_t j=0UL; j<jend; ++j )
1470 const bool containsDiagonal(
column + j >=
row );
1475 const size_t ibegin( ( containsDiagonal )?(
column + j -
row + 1UL ):( 0UL ) );
1477 for(
size_t i=ibegin; i<M; ++i ) {
1505 template<
typename MT1
1509 inline bool tryAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
1510 const SparseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1521 const size_t M( (~rhs).
rows() );
1522 const size_t N( (~rhs).
columns() );
1529 for(
size_t i=ibegin; i<M; ++i )
1531 const bool containsDiagonal(
row + i <
column + N );
1534 const auto last( (~rhs).lowerBound( i,
min( index, N ) ) );
1536 if( containsDiagonal ) {
1537 if( last == (~rhs).
end(i) || ( last->index() != index ) || !
isOne( last->value() ) )
1541 for(
auto element=(~rhs).begin(i); element!=last; ++element ) {
1569 template<
typename MT1
1573 inline bool tryAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
1574 const SparseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
1585 const size_t M( (~rhs).
rows() );
1586 const size_t N( (~rhs).
columns() );
1593 for(
size_t j=0UL; j<jend; ++j )
1595 const bool containsDiagonal(
column + j >=
row );
1596 const size_t index( ( containsDiagonal )?(
column + j -
row ):( 0UL ) );
1598 const auto last( (~rhs).
end(j) );
1599 auto element( (~rhs).lowerBound( index, j ) );
1601 if( containsDiagonal ) {
1602 if( element == last || ( element->index() != index ) || !
isOne( element->value() ) )
1607 for( ; element!=last; ++element ) {
1636 template<
typename MT
1640 inline bool tryAddAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
1641 const DenseVector<VT,false>& rhs,
size_t row,
size_t column )
1653 for(
size_t i=ibegin; i<(~rhs).
size(); ++i ) {
1681 template<
typename MT
1685 inline bool tryAddAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
1686 const DenseVector<VT,true>& rhs,
size_t row,
size_t column )
1701 for(
size_t i=0UL; i<iend; ++i ) {
1729 template<
typename MT
1734 inline bool tryAddAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
1747 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
1776 template<
typename MT
1780 inline bool tryAddAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
1781 const SparseVector<VT,false>& rhs,
size_t row,
size_t column )
1791 const auto last( (~rhs).
end() );
1794 for( ; element!=last; ++element ) {
1822 template<
typename MT
1826 inline bool tryAddAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
1827 const SparseVector<VT,true>& rhs,
size_t row,
size_t column )
1840 const auto last( (~rhs).lowerBound(
row -
column + 1UL ) );
1842 for(
auto element=(~rhs).
begin(); element!=last; ++element ) {
1870 template<
typename MT
1875 inline bool tryAddAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
1888 for(
const auto& element : ~rhs ) {
1917 template<
typename MT1
1921 inline bool tryAddAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
1922 const DenseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
1933 const size_t M( (~rhs).
rows() );
1934 const size_t N( (~rhs).
columns() );
1941 for(
size_t i=ibegin; i<M; ++i )
1945 for(
size_t j=0UL; j<jend; ++j ) {
1974 template<
typename MT1
1978 inline bool tryAddAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
1979 const DenseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
1990 const size_t M( (~rhs).
rows() );
1991 const size_t N( (~rhs).
columns() );
1998 for(
size_t j=0UL; j<jend; ++j )
2000 const bool containsDiagonal(
column + j >=
row );
2001 const size_t ibegin( ( containsDiagonal )?(
column + j -
row ):( 0UL ) );
2003 for(
size_t i=ibegin; i<M; ++i ) {
2032 template<
typename MT1
2036 inline bool tryAddAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
2037 const SparseMatrix<MT2,false>& rhs,
size_t row,
size_t column )
2048 const size_t M( (~rhs).
rows() );
2049 const size_t N( (~rhs).
columns() );
2056 for(
size_t i=ibegin; i<M; ++i )
2058 const size_t index(
row + i -
column + 1UL );
2059 const auto last( (~rhs).lowerBound( i,
min( index, N ) ) );
2061 for(
auto element=(~rhs).
begin(i); element!=last; ++element ) {
2090 template<
typename MT1
2094 inline bool tryAddAssign(
const UniUpperMatrix<MT1,SO,DF>& lhs,
2095 const SparseMatrix<MT2,true>& rhs,
size_t row,
size_t column )
2106 const size_t M( (~rhs).
rows() );
2107 const size_t N( (~rhs).
columns() );
2114 for(
size_t j=0UL; j<jend; ++j )
2116 const bool containsDiagonal(
column + j >=
row );
2117 const size_t index( ( containsDiagonal )?(
column + j -
row ):( 0UL ) );
2119 const auto last( (~rhs).
end(j) );
2120 auto element( (~rhs).lowerBound( index, j ) );
2122 for( ; element!=last; ++element ) {
2151 template<
typename MT
2156 inline bool trySubAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2157 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
2159 return tryAddAssign( lhs, ~rhs,
row,
column );
2183 template<
typename MT
2188 inline bool trySubAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
2214 template<
typename MT1
2219 inline bool trySubAssign(
const UniUpperMatrix<MT1,SO1,DF>& lhs,
2220 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2222 return tryAddAssign( lhs, ~rhs,
row,
column );
2245 template<
typename MT
2249 inline bool tryMultAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2250 const Vector<VT,false>& rhs,
size_t row,
size_t column )
2285 template<
typename MT
2289 inline bool tryMultAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2290 const Vector<VT,true>& rhs,
size_t row,
size_t column )
2325 template<
typename MT
2330 inline bool tryMultAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
2343 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
2344 if( !
isOne( (~rhs)[i] ) )
2372 template<
typename MT
2377 inline bool tryMultAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
2392 for(
const auto& element : ~rhs ) {
2393 if( !
isOne( element.value() ) )
2421 template<
typename MT1
2426 inline bool trySchurAssign(
const UniUpperMatrix<MT1,SO1,DF>& lhs,
2427 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2438 const size_t M( (~rhs).
rows() );
2439 const size_t N( (~rhs).
columns() );
2447 for( ; i<M && j<N; ++i, ++j )
2449 if( !
isOne( (~rhs)(i,j) ) )
2475 template<
typename MT
2480 inline bool tryDivAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2481 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
2483 return tryMultAssign( lhs, ~rhs,
row,
column );
2506 template<
typename MT
2511 inline bool tryDivAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
2536 template<
typename MT
2540 inline bool tryShiftAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2541 const Vector<VT,false>& rhs,
size_t row,
size_t column )
2575 template<
typename MT
2579 inline bool tryShiftAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2580 const Vector<VT,true>& rhs,
size_t row,
size_t column )
2615 template<
typename MT
2620 inline bool tryShiftAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
2633 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
2662 template<
typename MT
2667 inline bool tryShiftAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
2682 for(
const auto& element : ~rhs ) {
2710 template<
typename MT1
2715 inline bool tryShiftAssign(
const UniUpperMatrix<MT1,SO1,DF>& lhs,
2716 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2727 const size_t M( (~rhs).
rows() );
2728 const size_t N( (~rhs).
columns() );
2736 for( ; i<M && j<N; ++i, ++j )
2765 template<
typename MT
2769 inline bool tryBitandAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2770 const Vector<VT,false>& rhs,
size_t row,
size_t column )
2782 ( ElementType_t<MT>(1) & (~rhs)[
column-
row] );
2805 template<
typename MT
2809 inline bool tryBitandAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
2810 const Vector<VT,true>& rhs,
size_t row,
size_t column )
2822 ( ElementType_t<MT>(1) & (~rhs)[
row-
column] );
2845 template<
typename MT
2850 inline bool tryBitandAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const DenseVector<VT,TF>& rhs,
2863 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
2864 if( !( ElementType_t<MT>(1) & (~rhs)[i] ) )
2892 template<
typename MT
2897 inline bool tryBitandAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const SparseVector<VT,TF>& rhs,
2912 for(
const auto& element : ~rhs ) {
2913 if( !( ElementType_t<MT>(1) & element.value() ) )
2941 template<
typename MT1
2946 inline bool tryBitandAssign(
const UniUpperMatrix<MT1,SO1,DF>& lhs,
2947 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
2958 const size_t M( (~rhs).
rows() );
2959 const size_t N( (~rhs).
columns() );
2967 for( ; i<M && j<N; ++i, ++j )
2969 if( !( ElementType_t<MT1>(1) & (~rhs)(i,j) ) )
2996 template<
typename MT
3001 inline bool tryBitorAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
3002 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
3004 return tryAssign( lhs, ~rhs,
row,
column );
3027 template<
typename MT
3032 inline bool tryBitorAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
3058 template<
typename MT1
3063 inline bool tryBitorAssign(
const UniUpperMatrix<MT1,SO1,DF>& lhs,
3064 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
3066 return tryAssign( lhs, ~rhs,
row,
column );
3089 template<
typename MT
3094 inline bool tryBitxorAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
3095 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
3097 return tryAddAssign( lhs, ~rhs,
row,
column );
3120 template<
typename MT
3125 inline bool tryBitxorAssign(
const UniUpperMatrix<MT,SO,DF>& lhs,
const Vector<VT,TF>& rhs,
3151 template<
typename MT1
3156 inline bool tryBitxorAssign(
const UniUpperMatrix<MT1,SO1,DF>& lhs,
3157 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
3159 return tryAddAssign( lhs, ~rhs,
row,
column );
3179 template<
typename MT
3182 inline MT& derestrict( UniUpperMatrix<MT,SO,DF>& m )
3200 template<
typename MT,
bool SO,
bool DF >
3201 struct Size< UniUpperMatrix<MT,SO,DF>, 0UL >
3202 :
public Size<MT,0UL>
3205 template<
typename MT,
bool SO,
bool DF >
3206 struct Size< UniUpperMatrix<MT,SO,DF>, 1UL >
3207 :
public Size<MT,1UL>
3223 template<
typename MT,
bool SO,
bool DF >
3224 struct MaxSize< UniUpperMatrix<MT,SO,DF>, 0UL >
3225 :
public MaxSize<MT,0UL>
3228 template<
typename MT,
bool SO,
bool DF >
3229 struct MaxSize< UniUpperMatrix<MT,SO,DF>, 1UL >
3230 :
public MaxSize<MT,1UL>
3246 template<
typename MT,
bool SO,
bool DF >
3247 struct IsSquare< UniUpperMatrix<MT,SO,DF> >
3264 template<
typename MT,
bool SO,
bool DF >
3265 struct IsUniUpper< UniUpperMatrix<MT,SO,DF> >
3282 template<
typename MT,
bool SO,
bool DF >
3283 struct IsAdaptor< UniUpperMatrix<MT,SO,DF> >
3300 template<
typename MT,
bool SO,
bool DF >
3301 struct IsRestricted< UniUpperMatrix<MT,SO,DF> >
3318 template<
typename MT,
bool SO >
3319 struct HasConstDataAccess< UniUpperMatrix<MT,SO,true> >
3336 template<
typename MT,
bool SO,
bool DF >
3337 struct IsAligned< UniUpperMatrix<MT,SO,DF> >
3338 :
public IsAligned<MT>
3354 template<
typename MT,
bool SO,
bool DF >
3355 struct IsContiguous< UniUpperMatrix<MT,SO,DF> >
3356 :
public IsContiguous<MT>
3372 template<
typename MT,
bool SO,
bool DF >
3373 struct IsPadded< UniUpperMatrix<MT,SO,DF> >
3374 :
public IsPadded<MT>
3390 template<
typename MT,
bool SO,
bool DF >
3391 struct IsResizable< UniUpperMatrix<MT,SO,DF> >
3392 :
public IsResizable<MT>
3408 template<
typename MT,
bool SO,
bool DF >
3409 struct IsShrinkable< UniUpperMatrix<MT,SO,DF> >
3410 :
public IsShrinkable<MT>
3426 template<
typename MT,
bool SO,
bool DF >
3427 struct RemoveAdaptor< UniUpperMatrix<MT,SO,DF> >
3445 template<
typename T1,
typename T2 >
3446 struct AddTraitEval1< T1, T2
3449 ( ( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> &&
3450 !( IsUniLower_v<T1> && IsStrictlyLower_v<T2> ) ) ||
3451 ( IsStrictlyUpper_v<T1> && IsUniUpper_v<T2> &&
3452 !( IsStrictlyLower_v<T1> && IsUniLower_v<T2> ) ) ) &&
3453 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3455 using Type = UniUpperMatrix< typename AddTraitEval2<T1,T2>::Type >;
3471 template<
typename T1,
typename T2 >
3472 struct SubTraitEval1< T1, T2
3475 ( IsUniUpper_v<T1> && IsStrictlyUpper_v<T2> &&
3476 !( IsUniLower_v<T1> && IsStrictlyLower_v<T2> ) ) &&
3477 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3479 using Type = UniUpperMatrix< typename SubTraitEval2<T1,T2>::Type >;
3495 template<
typename T1,
typename T2 >
3496 struct SchurTraitEval1< T1, T2
3499 ( IsUniUpper_v<T1> && IsUniUpper_v<T2> ) &&
3500 !( IsDiagonal_v<T1> || IsDiagonal_v<T2> ) &&
3501 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3503 using Type = UniUpperMatrix< typename SchurTraitEval2<T1,T2>::Type >;
3519 template<
typename T1,
typename T2 >
3520 struct MultTraitEval1< T1, T2
3523 ( IsUniUpper_v<T1> && IsUniUpper_v<T2> ) &&
3524 !( IsIdentity_v<T1> || IsIdentity_v<T2> ) > >
3526 using Type = UniUpperMatrix< typename MultTraitEval2<T1,T2>::Type >;
3542 template<
typename T1,
typename T2 >
3543 struct KronTraitEval1< T1, T2
3546 ( IsUniUpper_v<T1> && IsUniUpper_v<T2> ) &&
3547 !( IsIdentity_v<T1> && IsIdentity_v<T2> ) &&
3548 !( IsZero_v<T1> || IsZero_v<T2> ) > >
3550 using Type = UniUpperMatrix< typename KronTraitEval2<T1,T2>::Type >;
3566 template<
typename T,
typename OP >
3567 struct UnaryMapTraitEval1< T, OP
3569 !YieldsIdentity_v<OP,T> > >
3571 using Type = UniUpperMatrix< typename UnaryMapTraitEval2<T,OP>::Type, StorageOrder_v<T> >;
3579 template<
typename T1,
typename T2,
typename OP >
3580 struct BinaryMapTraitEval1< T1, T2, OP
3582 !YieldsIdentity_v<OP,T1,T2> > >
3584 using Type = UniUpperMatrix< typename BinaryMapTraitEval2<T1,T2,OP>::Type >;
3600 template<
typename MT,
bool SO,
bool DF >
3601 struct DeclSymTrait< UniUpperMatrix<MT,SO,DF> >
3603 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3619 template<
typename MT,
bool SO,
bool DF >
3620 struct DeclHermTrait< UniUpperMatrix<MT,SO,DF> >
3622 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3638 template<
typename MT,
bool SO,
bool DF >
3639 struct DeclLowTrait< UniUpperMatrix<MT,SO,DF> >
3641 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3657 template<
typename MT,
bool SO,
bool DF >
3658 struct DeclUppTrait< UniUpperMatrix<MT,SO,DF> >
3660 using Type = UniUpperMatrix<MT,SO,DF>;
3676 template<
typename MT,
bool SO,
bool DF >
3677 struct DeclDiagTrait< UniUpperMatrix<MT,SO,DF> >
3679 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
3695 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
3696 struct HighType< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
3698 using Type = UniUpperMatrix< typename HighType<MT1,MT2>::Type >;
3714 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
3715 struct LowType< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
3717 using Type = UniUpperMatrix< typename LowType<MT1,MT2>::Type >;
3733 template<
typename MT,
size_t I,
size_t N >
3734 struct SubmatrixTraitEval1< MT, I, I, N, N
3736 !IsIdentity_v<MT> > >
3738 using Type = UniUpperMatrix< 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 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.
UniUpperMatrix specialization for sparse matrices.
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.
constexpr bool IsUniUpper_v
Auxiliary variable template for the IsUniUpper type trait.The IsUniUpper_v variable template provides...
Definition: IsUniUpper.h:173
#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.
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.
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.
constexpr bool YieldsUniUpper_v
Auxiliary variable template for the YieldsUniUpper type trait.The YieldsUniUpper_v variable template ...
Definition: YieldsUniUpper.h:124
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 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
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.
Matrix adapter for upper unitriangular matrices.
Definition: BaseTemplate.h:576
#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
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
UniUpperMatrix specialization for dense matrices.
Header file for the StorageOrder type trait.
Header file for the IntegralConstant class template.
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 YieldsUniUpper type trait.
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 implementation of the base template of the UniUpperMatrix.
Header file for the HighType type trait.