35 #ifndef _BLAZE_MATH_VIEWS_SUBMATRIX_H_ 36 #define _BLAZE_MATH_VIEWS_SUBMATRIX_H_ 181 return submatrix<unaligned,I,J,M,N>( ~matrix, args... );
250 return submatrix<unaligned,I,J,M,N>( ~matrix, args... );
281 return submatrix<unaligned,I,J,M,N>( ~matrix, args... );
446 using ReturnType =
const Submatrix_<const MT,AF,I,J,M,N>;
544 template<
typename MT
547 inline decltype(
auto)
552 return submatrix<unaligned>( ~matrix,
row,
column, m, n, args... );
614 template<
typename MT
617 inline decltype(
auto)
622 return submatrix<unaligned>( ~matrix,
row,
column, m, n, args... );
646 template<
typename MT
649 inline decltype(
auto)
654 return submatrix<unaligned>( ~matrix,
row,
column, m, n, args... );
733 inline decltype(
auto)
816 inline decltype(
auto)
821 using ReturnType =
const Submatrix_<const MT,AF>;
851 inline decltype(
auto)
886 inline decltype(
auto)
submatrix( const MatMatAddExpr<MT>& matrix, RSAs... args )
890 return submatrix<AF,CSAs...>( (~matrix).leftOperand(), args... ) +
891 submatrix<AF,CSAs...>( (~matrix).rightOperand(), args... );
913 inline decltype(
auto)
submatrix( const MatMatSubExpr<MT>& matrix, RSAs... args )
917 return submatrix<AF,CSAs...>( (~matrix).leftOperand(), args... ) -
918 submatrix<AF,CSAs...>( (~matrix).rightOperand(), args... );
940 inline decltype(
auto)
submatrix( const SchurExpr<MT>& matrix, RSAs... args )
944 return submatrix<AF,CSAs...>( (~matrix).leftOperand(), args... ) %
945 submatrix<AF,CSAs...>( (~matrix).rightOperand(), args... );
967 inline decltype(
auto)
submatrix( const MatMatMultExpr<MT>& matrix, RSAs... args )
971 using MT1 = RemoveReference_t< LeftOperand_t< MatrixType_t<MT> > >;
972 using MT2 = RemoveReference_t< RightOperand_t< MatrixType_t<MT> > >;
974 const SubmatrixData<CSAs...> sd( args... );
976 BLAZE_DECLTYPE_AUTO( left , (~matrix).leftOperand() );
977 BLAZE_DECLTYPE_AUTO( right, (~matrix).rightOperand() );
979 const size_t begin(
max( ( IsUpper_v<MT1> )
980 ?( ( !AF && IsStrictlyUpper_v<MT1> )
989 const size_t end(
min( ( IsLower_v<MT1> )
990 ?( ( IsStrictlyLower_v<MT1> && sd.rows() > 0UL )
991 ?( sd.row() + sd.rows() - 1UL )
992 :( sd.row() + sd.rows() ) )
1002 return submatrix<AF>( left, sd.row(),
begin, sd.rows(), diff ) *
1003 submatrix<AF>( right,
begin, sd.column(), diff, sd.columns() );
1026 ,
typename... RSAs >
1027 inline decltype(
auto)
submatrix( const VecTVecMultExpr<MT>& matrix, RSAs... args )
1031 return subvector<AF,I,M>( (~matrix).leftOperand(), args... ) *
1032 subvector<AF,J,N>( (~matrix).rightOperand(), args... );
1055 ,
typename... RSAs >
1056 inline decltype(
auto)
1057 submatrix( const VecTVecMultExpr<MT>& matrix,
size_t row,
size_t column,
size_t m,
size_t n, RSAs... args )
1061 return subvector<AF>( (~matrix).leftOperand(),
row, m, args... ) *
1062 subvector<AF>( (~matrix).rightOperand(),
column, n, args... );
1083 ,
typename... RSAs >
1084 inline decltype(
auto)
submatrix( const MatScalarMultExpr<MT>& matrix, RSAs... args )
1088 return submatrix<AF,CSAs...>( (~matrix).leftOperand(), args... ) * (~matrix).rightOperand();
1109 ,
typename... RSAs >
1110 inline decltype(
auto)
submatrix( const MatScalarDivExpr<MT>& matrix, RSAs... args )
1114 return submatrix<AF,CSAs...>( (~matrix).leftOperand(), args... ) / (~matrix).rightOperand();
1135 ,
typename... RSAs >
1136 inline decltype(
auto)
submatrix( const MatMapExpr<MT>& matrix, RSAs... args )
1140 return map( submatrix<AF,CSAs...>( (~matrix).operand(), args... ), (~matrix).operation() );
1161 ,
typename... RSAs >
1162 inline decltype(
auto)
submatrix( const MatMatMapExpr<MT>& matrix, RSAs... args )
1166 return map( submatrix<AF,CSAs...>( (~matrix).leftOperand(), args... ),
1167 submatrix<AF,CSAs...>( (~matrix).rightOperand(), args... ),
1168 (~matrix).operation() );
1189 ,
typename... RSAs >
1190 inline decltype(
auto)
submatrix( const MatEvalExpr<MT>& matrix, RSAs... args )
1194 return eval( submatrix<AF,CSAs...>( (~matrix).operand(), args... ) );
1215 ,
typename... RSAs >
1216 inline decltype(
auto)
submatrix( const MatSerialExpr<MT>& matrix, RSAs... args )
1220 return serial( submatrix<AF,CSAs...>( (~matrix).operand(), args... ) );
1241 ,
typename... RSAs >
1242 inline decltype(
auto)
submatrix( const DeclExpr<MT>& matrix, RSAs... args )
1246 return submatrix<AF,CSAs...>( (~matrix).operand(), args... );
1270 ,
typename... RSAs >
1271 inline decltype(
auto)
submatrix( const MatTransExpr<MT>& matrix, RSAs... args )
1275 return trans( submatrix<AF,J,I,N,M>( (~matrix).operand(), args... ) );
1299 ,
typename... RSAs >
1300 inline decltype(
auto)
1301 submatrix( const MatTransExpr<MT>& matrix,
size_t row,
size_t column,
size_t m,
size_t n, RSAs... args )
1305 return trans( submatrix<AF>( (~matrix).operand(),
column,
row, n, m, args... ) );
1330 ,
typename... RSAs >
1331 inline decltype(
auto)
submatrix( const VecExpandExpr<MT,CEAs...>& matrix, RSAs... args )
1337 constexpr
bool TF( TransposeFlag_v<VT> );
1339 constexpr
size_t index ( TF ? J : I );
1340 constexpr
size_t size ( TF ? N : M );
1341 constexpr
size_t expansion( TF ? M : N );
1343 return expand<expansion>( subvector<index,size>( (~matrix).operand(), args... ) );
1368 ,
typename... RSAs >
1369 inline decltype(
auto)
1370 submatrix( const VecExpandExpr<MT,CEAs...>& matrix,
1371 size_t row,
size_t column,
size_t m,
size_t n, RSAs... args )
1377 constexpr
bool TF( TransposeFlag_v<VT> );
1379 const size_t index ( TF ?
column :
row );
1380 const size_t size ( TF ? n : m );
1381 const size_t expansion( TF ? m : n );
1413 ,
typename... RSAs >
1414 inline decltype(
auto)
submatrix( Submatrix<MT,AF2,SO,DF,I2,J2,M2,N2>& sm, RSAs... args )
1421 return submatrix<AF1,I1+I2,J1+J2,M1,N1>( sm.operand(), args... );
1452 ,
typename... RSAs >
1453 inline decltype(
auto)
submatrix( const Submatrix<MT,AF2,SO,DF,I2,J2,M2,N2>& sm, RSAs... args )
1460 return submatrix<AF1,I1+I2,J1+J2,M1,N1>( sm.operand(), args... );
1491 ,
typename... RSAs >
1492 inline decltype(
auto)
submatrix( Submatrix<MT,AF2,SO,DF,I2,J2,M2,N2>&& sm, RSAs... args )
1499 return submatrix<AF1,I1+I2,J1+J2,M1,N1>( sm.operand(), args... );
1526 ,
typename... RSAs >
1527 inline decltype(
auto)
submatrix( Submatrix<MT,AF2,SO,DF>& sm, RSAs... args )
1534 if( ( I + M > sm.rows() ) || ( J + N > sm.columns() ) ) {
1543 return submatrix<AF1>( sm.operand(), sm.row() + I, sm.column() + J, M, N, args... );
1571 ,
typename... RSAs >
1572 inline decltype(
auto)
submatrix( const Submatrix<MT,AF2,SO,DF>& sm, RSAs... args )
1579 if( ( I + M > sm.rows() ) || ( J + N > sm.columns() ) ) {
1588 return submatrix<AF1>( sm.operand(), sm.row() + I, sm.column() + J, M, N, args... );
1616 ,
typename... RSAs >
1617 inline decltype(
auto)
submatrix( Submatrix<MT,AF2,SO,DF>&& sm, RSAs... args )
1624 if( ( I + M > sm.rows() ) || ( J + N > sm.columns() ) ) {
1633 return submatrix<AF1>( sm.operand(), sm.row() + I, sm.column() + J, M, N, args... );
1661 ,
typename... RSAs >
1662 inline decltype(
auto)
1664 size_t m,
size_t n, RSAs... args )
1671 if( (
row + m > sm.rows() ) || (
column + n > sm.columns() ) ) {
1680 return submatrix<AF1>( sm.operand(), sm.row() +
row, sm.column() +
column, m, n, args... );
1709 ,
typename... RSAs >
1710 inline decltype(
auto)
1712 size_t m,
size_t n, RSAs... args )
1719 if( (
row + m > sm.rows() ) || (
column + n > sm.columns() ) ) {
1728 return submatrix<AF1>( sm.operand(), sm.row() +
row, sm.column() +
column, m, n, args... );
1757 ,
typename... RSAs >
1758 inline decltype(
auto)
1760 size_t m,
size_t n, RSAs... args )
1767 if( (
row + m > sm.rows() ) || (
column + n > sm.columns() ) ) {
1776 return submatrix<AF1>( sm.operand(), sm.row() +
row, sm.column() +
column, m, n, args... );
1805 ,
typename... RSAs >
1806 inline decltype(
auto)
subvector( const MatVecMultExpr<VT>& vector, RSAs... args )
1810 using MT = RemoveReference_t< LeftOperand_t< VectorType_t<VT> > >;
1812 const SubvectorData<CSAs...> sd( args... );
1814 BLAZE_DECLTYPE_AUTO( left , (~vector).leftOperand() );
1815 BLAZE_DECLTYPE_AUTO( right, (~vector).rightOperand() );
1817 const size_t column( ( IsUpper_v<MT> )
1818 ?( ( !AF && IsStrictlyUpper_v<MT> )?( sd.offset() + 1UL ):( sd.offset() ) )
1820 const size_t n( ( IsLower_v<MT> )
1821 ?( ( IsUpper_v<MT> )?( sd.size() )
1822 :( ( IsStrictlyLower_v<MT> && sd.size() > 0UL )
1823 ?( sd.offset() + sd.size() - 1UL )
1824 :( sd.offset() + sd.size() ) ) )
1825 :( ( IsUpper_v<MT> )?( left.columns() -
column )
1826 :( left.columns() ) ) );
1828 return submatrix<AF>( left, sd.offset(),
column, sd.size(), n ) * subvector<AF>( right,
column, n );
1849 ,
typename... RSAs >
1850 inline decltype(
auto)
subvector( const TVecMatMultExpr<VT>& vector, RSAs... args )
1854 using MT = RemoveReference_t< RightOperand_t< VectorType_t<VT> > >;
1856 const SubvectorData<CSAs...> sd( args... );
1858 BLAZE_DECLTYPE_AUTO( left , (~vector).leftOperand() );
1859 BLAZE_DECLTYPE_AUTO( right, (~vector).rightOperand() );
1861 const size_t row( ( IsLower_v<MT> )
1862 ?( ( !AF && IsStrictlyLower_v<MT> )?( sd.offset() + 1UL ):( sd.offset() ) )
1864 const size_t m( ( IsUpper_v<MT> )
1865 ?( ( IsLower_v<MT> )?( sd.size() )
1866 :( ( IsStrictlyUpper_v<MT> && sd.size() > 0UL )
1867 ?( sd.offset() + sd.size() - 1UL )
1868 :( sd.offset() + sd.size() ) ) )
1869 :( ( IsLower_v<MT> )?( right.rows() -
row )
1870 :( right.rows() ) ) );
1872 return subvector<AF>( left,
row, m ) * submatrix<AF>( right,
row, sd.offset(), m, sd.size() );
1893 ,
typename... RSAs >
1894 inline decltype(
auto)
subvector( const MatReduceExpr<VT,
columnwise>& vector, RSAs... args )
1898 const SubvectorData<CSAs...> sd( args... );
1899 const size_t M( (~vector).operand().
rows() );
1901 decltype(
auto) sm(
submatrix<AF>( (~vector).operand(), 0UL, sd.offset(), M, sd.
size() ) );
1923 , typename... RSAs >
1924 inline decltype(auto)
subvector( const MatReduceExpr<VT,
rowwise>& vector, RSAs... args )
1928 const SubvectorData<CSAs...> sd( args... );
1929 const size_t N( (~vector).operand().
columns() );
1931 decltype(
auto) sm(
submatrix<AF>( (~vector).operand(), sd.offset(), 0UL, sd.
size(), N ) );
1966 , typename... RRAs >
1967 inline decltype(auto)
row( Submatrix<MT,AF,SO,DF,I2,J,M,N>& sm, RRAs... args )
1973 return subvector<J,N>( row<I1+I2>( sm.operand(), args... ),
unchecked );
2000 ,
typename... RRAs >
2001 inline decltype(
auto)
row( const Submatrix<MT,AF,SO,DF,I2,J,M,N>& sm, RRAs... args )
2007 return subvector<J,N>( row<I1+I2>( sm.operand(), args... ),
unchecked );
2034 ,
typename... RRAs >
2035 inline decltype(
auto)
row( Submatrix<MT,AF,SO,DF,I2,J,M,N>&& sm, RRAs... args )
2041 return subvector<J,N>( row<I1+I2>( sm.operand(), args... ),
unchecked );
2060 template<
typename MT
2068 ,
typename... RRAs >
2069 inline decltype(
auto)
row( Submatrix<MT,AF,SO,DF,I,J,M,N>& sm,
size_t index, RRAs... args )
2076 if( ( index >= M ) ) {
2084 return subvector<J,N>(
row( sm.operand(), I+index, args... ),
unchecked );
2104 template<
typename MT
2112 ,
typename... RRAs >
2113 inline decltype(
auto)
row( const Submatrix<MT,AF,SO,DF,I,J,M,N>& sm,
size_t index, RRAs... args )
2120 if( ( index >= M ) ) {
2128 return subvector<J,N>(
row( sm.operand(), I+index, args... ),
unchecked );
2148 template<
typename MT
2156 ,
typename... RRAs >
2157 inline decltype(
auto)
row( Submatrix<MT,AF,SO,DF,I,J,M,N>&& sm,
size_t index, RRAs... args )
2164 if( ( index >= M ) ) {
2172 return subvector<J,N>(
row( sm.operand(), I+index, args... ),
unchecked );
2190 template<
size_t... CRAs
2195 ,
typename... RRAs >
2196 inline decltype(
auto)
row( Submatrix<MT,AF,SO,DF>& sm, RRAs... args )
2200 const RowData<CRAs...> rd( args... );
2205 if( ( rd.row() >= sm.rows() ) ) {
2213 const size_t index( rd.row() + sm.row() );
2234 template<
size_t... CRAs
2239 ,
typename... RRAs >
2240 inline decltype(
auto)
row( const Submatrix<MT,AF,SO,DF>& sm, RRAs... args )
2244 const RowData<CRAs...> rd( args... );
2249 if( ( rd.row() >= sm.rows() ) ) {
2257 const size_t index( rd.row() + sm.row() );
2278 template<
size_t... CRAs
2283 ,
typename... RRAs >
2284 inline decltype(
auto)
row( Submatrix<MT,AF,SO,DF>&& sm, RRAs... args )
2288 const RowData<CRAs...> rd( args... );
2293 if( ( rd.row() >= sm.rows() ) ) {
2301 const size_t index( rd.row() + sm.row() );
2338 ,
typename... RRAs >
2339 inline decltype(
auto)
rows( Submatrix<MT,AF,SO,DF,I2,J,M,N>& sm, RRAs... args )
2343 return submatrix<0UL,J,
sizeof...(Is)+1UL,N>(
2372 ,
typename... RRAs >
2373 inline decltype(
auto)
rows( const Submatrix<MT,AF,SO,DF,I2,J,M,N>& sm, RRAs... args )
2377 return submatrix<0UL,J,
sizeof...(Is)+1UL,N>(
2406 ,
typename... RRAs >
2407 inline decltype(
auto)
rows( Submatrix<MT,AF,SO,DF,I2,J,M,N>&& sm, RRAs... args )
2411 return submatrix<0UL,J,
sizeof...(Is)+1UL,N>(
2436 ,
typename... RRAs >
2437 inline decltype(
auto)
rows( Submatrix<MT,AF,SO,DF>& sm, RRAs... args )
2444 static constexpr
size_t indices[] = { I1, Is... };
2445 for(
size_t i=0UL; i<
sizeof...(Is)+1UL; ++i ) {
2446 if( sm.rows() <= indices[i] ) {
2452 return submatrix(
rows( sm.operand(), { I1+sm.row(), Is+sm.row()... }, args... ),
2453 0UL, sm.column(),
sizeof...(Is)+1UL, sm.columns(),
unchecked );
2478 ,
typename... RRAs >
2479 inline decltype(
auto)
rows( const Submatrix<MT,AF,SO,DF>& sm, RRAs... args )
2486 static constexpr
size_t indices[] = { I1, Is... };
2487 for(
size_t i=0UL; i<
sizeof...(Is)+1UL; ++i ) {
2488 if( sm.rows() <= indices[i] ) {
2494 return submatrix(
rows( sm.operand(), { I1+sm.row(), Is+sm.row()... }, args... ),
2495 0UL, sm.column(),
sizeof...(Is)+1UL, sm.columns(),
unchecked );
2520 ,
typename... RRAs >
2521 inline decltype(
auto)
rows( Submatrix<MT,AF,SO,DF>&& sm, RRAs... args )
2528 static constexpr
size_t indices[] = { I1, Is... };
2529 for(
size_t i=0UL; i<
sizeof...(Is)+1UL; ++i ) {
2530 if( sm.rows() <= indices[i] ) {
2536 return submatrix(
rows( sm.operand(), { I1+sm.row(), Is+sm.row()... }, args... ),
2537 0UL, sm.column(),
sizeof...(Is)+1UL, sm.columns(),
unchecked );
2557 template<
typename MT
2563 ,
typename... RRAs >
2564 inline decltype(
auto)
2565 rows( Submatrix<MT,AF,SO,DF,CSAs...>& sm, const T* indices,
size_t n, RRAs... args )
2572 for(
size_t i=0UL; i<n; ++i ) {
2573 if( sm.rows() <= indices[i] ) {
2579 SmallArray<size_t,128UL> newIndices( indices, indices+n );
2580 std::for_each( newIndices.begin(), newIndices.end(),
2581 [
row=sm.row()](
size_t& index ){ index +=
row; } );
2583 return submatrix(
rows( sm.operand(), newIndices.data(), n, args... ),
2584 0UL, sm.column(), n, sm.columns(),
unchecked );
2605 template<
typename MT
2611 ,
typename... RRAs >
2612 inline decltype(
auto)
2613 rows( const Submatrix<MT,AF,SO,DF,CSAs...>& sm, const T* indices,
size_t n, RRAs... args )
2620 for(
size_t i=0UL; i<n; ++i ) {
2621 if( sm.rows() <= indices[i] ) {
2627 SmallArray<size_t,128UL> newIndices( indices, indices+n );
2628 std::for_each( newIndices.begin(), newIndices.end(),
2629 [
row=sm.row()](
size_t& index ){ index +=
row; } );
2631 return submatrix(
rows( sm.operand(), newIndices.data(), n, args... ),
2632 0UL, sm.column(), n, sm.columns(),
unchecked );
2653 template<
typename MT
2659 ,
typename... RRAs >
2660 inline decltype(
auto)
2661 rows( Submatrix<MT,AF,SO,DF,CSAs...>&& sm, const T* indices,
size_t n, RRAs... args )
2668 for(
size_t i=0UL; i<n; ++i ) {
2669 if( sm.rows() <= indices[i] ) {
2675 SmallArray<size_t,128UL> newIndices( indices, indices+n );
2676 std::for_each( newIndices.begin(), newIndices.end(),
2677 [
row=sm.row()](
size_t& index ){ index +=
row; } );
2679 return submatrix(
rows( sm.operand(), newIndices.data(), n, args... ),
2680 0UL, sm.column(), n, sm.columns(),
unchecked );
2714 ,
typename... RCAs >
2715 inline decltype(
auto)
column( Submatrix<MT,AF,SO,DF,I2,J,M,N>& sm, RCAs... args )
2721 return subvector<I2,M>( column<I1+J>( sm.operand(), args... ),
unchecked );
2748 ,
typename... RCAs >
2749 inline decltype(
auto)
column( const Submatrix<MT,AF,SO,DF,I2,J,M,N>& sm, RCAs... args )
2755 return subvector<I2,M>( column<I1+J>( sm.operand(), args... ),
unchecked );
2782 ,
typename... RCAs >
2783 inline decltype(
auto)
column( Submatrix<MT,AF,SO,DF,I2,J,M,N>&& sm, RCAs... args )
2789 return subvector<I2,M>( column<I1+J>( sm.operand(), args... ),
unchecked );
2808 template<
typename MT
2816 ,
typename... RCAs >
2817 inline decltype(
auto)
column( Submatrix<MT,AF,SO,DF,I,J,M,N>& sm,
size_t index, RCAs... args )
2824 if( ( index >= N ) ) {
2832 return subvector<I,M>(
column( sm.operand(), J+index, args... ),
unchecked );
2852 template<
typename MT
2860 ,
typename... RCAs >
2861 inline decltype(
auto)
column( const Submatrix<MT,AF,SO,DF,I,J,M,N>& sm,
size_t index, RCAs... args )
2868 if( ( index >= N ) ) {
2876 return subvector<I,M>(
column( sm.operand(), J+index, args... ),
unchecked );
2896 template<
typename MT
2904 ,
typename... RCAs >
2905 inline decltype(
auto)
column( Submatrix<MT,AF,SO,DF,I,J,M,N>&& sm,
size_t index, RCAs... args )
2912 if( ( index >= N ) ) {
2920 return subvector<I,M>(
column( sm.operand(), J+index, args... ),
unchecked );
2938 template<
size_t... CCAs
2943 ,
typename... RCAs >
2944 inline decltype(
auto)
column( Submatrix<MT,AF,SO,DF>& sm, RCAs... args )
2948 const ColumnData<CCAs...> cd( args... );
2953 if( ( cd.column() >= sm.columns() ) ) {
2961 const size_t index( cd.column() + sm.column() );
2982 template<
size_t... CCAs
2987 ,
typename... RCAs >
2988 inline decltype(
auto)
column( const Submatrix<MT,AF,SO,DF>& sm, RCAs... args )
2992 const ColumnData<CCAs...> cd( args... );
2997 if( ( cd.column() >= sm.columns() ) ) {
3005 const size_t index( cd.column() + sm.column() );
3026 template<
size_t... CCAs
3031 ,
typename... RCAs >
3032 inline decltype(
auto)
column( Submatrix<MT,AF,SO,DF>&& sm, RCAs... args )
3036 const ColumnData<CCAs...> cd( args... );
3041 if( ( cd.column() >= sm.columns() ) ) {
3049 const size_t index( cd.column() + sm.column() );
3086 ,
typename... RCAs >
3087 inline decltype(
auto)
columns( Submatrix<MT,AF,SO,DF,I2,J,M,N>& sm, RCAs... args )
3091 return submatrix<I2,0UL,M,
sizeof...(Is)+1UL>(
3120 ,
typename... RCAs >
3121 inline decltype(
auto)
columns( const Submatrix<MT,AF,SO,DF,I2,J,M,N>& sm, RCAs... args )
3125 return submatrix<I2,0UL,M,
sizeof...(Is)+1UL>(
3154 ,
typename... RCAs >
3155 inline decltype(
auto)
columns( Submatrix<MT,AF,SO,DF,I2,J,M,N>&& sm, RCAs... args )
3159 return submatrix<I2,0UL,M,
sizeof...(Is)+1UL>(
3184 ,
typename... RCAs >
3185 inline decltype(
auto)
columns( Submatrix<MT,AF,SO,DF>& sm, RCAs... args )
3192 static constexpr
size_t indices[] = { I1, Is... };
3193 for(
size_t j=0UL; j<
sizeof...(Is)+1UL; ++j ) {
3194 if( sm.columns() <= indices[j] ) {
3200 return submatrix(
columns( sm.operand(), { I1+sm.column(), Is+sm.column()... }, args... ),
3201 sm.row(), 0UL, sm.rows(),
sizeof...(Is)+1UL,
unchecked );
3226 ,
typename... RCAs >
3227 inline decltype(
auto)
columns( const Submatrix<MT,AF,SO,DF>& sm, RCAs... args )
3234 static constexpr
size_t indices[] = { I1, Is... };
3235 for(
size_t j=0UL; j<
sizeof...(Is)+1UL; ++j ) {
3236 if( sm.columns() <= indices[j] ) {
3242 return submatrix(
columns( sm.operand(), { I1+sm.column(), Is+sm.column()... }, args... ),
3243 sm.row(), 0UL, sm.rows(),
sizeof...(Is)+1UL,
unchecked );
3268 ,
typename... RCAs >
3269 inline decltype(
auto)
columns( Submatrix<MT,AF,SO,DF>&& sm, RCAs... args )
3276 static constexpr
size_t indices[] = { I1, Is... };
3277 for(
size_t j=0UL; j<
sizeof...(Is)+1UL; ++j ) {
3278 if( sm.columns() <= indices[j] ) {
3284 return submatrix(
columns( sm.operand(), { I1+sm.column(), Is+sm.column()... }, args... ),
3285 sm.row(), 0UL, sm.rows(),
sizeof...(Is)+1UL,
unchecked );
3305 template<
typename MT
3311 ,
typename... RCAs >
3312 inline decltype(
auto)
3313 columns( Submatrix<MT,AF,SO,DF,CSAs...>& sm, const T* indices,
size_t n, RCAs... args )
3320 for(
size_t j=0UL; j<n; ++j ) {
3321 if( sm.columns() <= indices[j] ) {
3327 SmallArray<size_t,128UL> newIndices( indices, indices+n );
3328 std::for_each( newIndices.begin(), newIndices.end(),
3329 [
column=sm.column()](
size_t& index ){ index +=
column; } );
3332 sm.row(), 0UL, sm.rows(), n,
unchecked );
3353 template<
typename MT
3359 ,
typename... RCAs >
3360 inline decltype(
auto)
3361 columns( const Submatrix<MT,AF,SO,DF,CSAs...>& sm, const T* indices,
size_t n, RCAs... args )
3368 for(
size_t j=0UL; j<n; ++j ) {
3369 if( sm.columns() <= indices[j] ) {
3375 SmallArray<size_t,128UL> newIndices( indices, indices+n );
3376 std::for_each( newIndices.begin(), newIndices.end(),
3377 [
column=sm.column()](
size_t& index ){ index +=
column; } );
3380 sm.row(), 0UL, sm.rows(), n,
unchecked );
3401 template<
typename MT
3407 ,
typename... RCAs >
3408 inline decltype(
auto)
3409 columns( Submatrix<MT,AF,SO,DF,CSAs...>&& sm, const T* indices,
size_t n, RCAs... args )
3416 for(
size_t j=0UL; j<n; ++j ) {
3417 if( sm.columns() <= indices[j] ) {
3423 SmallArray<size_t,128UL> newIndices( indices, indices+n );
3424 std::for_each( newIndices.begin(), newIndices.end(),
3425 [
column=sm.column()](
size_t& index ){ index +=
column; } );
3428 sm.row(), 0UL, sm.rows(), n,
unchecked );
3450 template<
typename MT
3455 inline void reset( Submatrix<MT,AF,SO,DF,CSAs...>& sm )
3471 template<
typename MT
3476 inline void reset( Submatrix<MT,AF,SO,DF,CSAs...>&& sm )
3498 template<
typename MT
3503 inline void reset( Submatrix<MT,AF,SO,DF,CSAs...>& sm,
size_t i )
3521 template<
typename MT
3526 inline void clear( Submatrix<MT,AF,SO,DF,CSAs...>& sm )
3544 template<
typename MT
3549 inline void clear( Submatrix<MT,AF,SO,DF,CSAs...>&& sm )
3588 inline bool isDefault(
const Submatrix<MT,AF,SO,true,CSAs...>& sm )
3593 for(
size_t i=0UL; i<(~sm).
rows(); ++i )
3594 for(
size_t j=0UL; j<(~sm).
columns(); ++j )
3595 if( !isDefault<RF>( (~sm)(i,j) ) )
3599 for(
size_t j=0UL; j<(~sm).
columns(); ++j )
3600 for(
size_t i=0UL; i<(~sm).
rows(); ++i )
3601 if( !isDefault<RF>( (~sm)(i,j) ) )
3642 inline bool isDefault(
const Submatrix<MT,AF,SO,false,CSAs...>& sm )
3646 const size_t iend( ( SO ==
rowMajor)?( sm.rows() ):( sm.columns() ) );
3648 for(
size_t i=0UL; i<iend; ++i ) {
3649 for(
auto element=sm.cbegin(i); element!=sm.cend(i); ++element )
3650 if( !isDefault<RF>( element->value() ) )
return false;
3678 template<
typename MT
3683 inline bool isIntact(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm ) noexcept
3685 return ( sm.row() + sm.rows() <= sm.operand().rows() &&
3686 sm.column() + sm.columns() <= sm.operand().columns() &&
3714 template<
typename MT
3719 inline bool isSymmetric(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm )
3723 if( IsSymmetric_v<MT> && sm.row() == sm.column() && sm.rows() == sm.columns() )
3725 else return isSymmetric( static_cast<const BaseType&>( sm ) );
3752 template<
typename MT
3757 inline bool isHermitian(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm )
3761 if( IsHermitian_v<MT> && sm.row() == sm.column() && sm.rows() == sm.columns() )
3763 else return isHermitian( static_cast<const BaseType&>( sm ) );
3800 template<
typename MT
3805 inline bool isLower(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm )
3809 if( IsLower_v<MT> && sm.row() == sm.column() && sm.rows() == sm.columns() )
3811 else return isLower( static_cast<const BaseType&>( sm ) );
3847 template<
typename MT
3852 inline bool isUniLower(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm )
3856 if( IsUniLower_v<MT> && sm.row() == sm.column() && sm.rows() == sm.columns() )
3858 else return isUniLower( static_cast<const BaseType&>( sm ) );
3894 template<
typename MT
3899 inline bool isStrictlyLower(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm )
3903 if( IsStrictlyLower_v<MT> && sm.row() == sm.column() && sm.rows() == sm.columns() )
3942 template<
typename MT
3947 inline bool isUpper(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm )
3951 if( IsUpper_v<MT> && sm.row() == sm.column() && sm.rows() == sm.columns() )
3953 else return isUpper( static_cast<const BaseType&>( sm ) );
3989 template<
typename MT
3994 inline bool isUniUpper(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm )
3998 if( IsUniUpper_v<MT> && sm.row() == sm.column() && sm.rows() == sm.columns() )
4000 else return isUniUpper( static_cast<const BaseType&>( sm ) );
4036 template<
typename MT
4041 inline bool isStrictlyUpper(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm )
4045 if( IsStrictlyUpper_v<MT> && sm.row() == sm.column() && sm.rows() == sm.columns() )
4066 template<
typename MT
4071 inline bool isSame(
const Submatrix<MT,AF,SO,DF,CSAs...>& a,
const Matrix<MT,SO>& b ) noexcept
4073 return (
isSame( a.operand(), ~b ) &&
4074 ( a.rows() == (~b).
rows() ) &&
4075 ( a.columns() == (~b).
columns() ) );
4094 template<
typename MT
4099 inline bool isSame(
const Matrix<MT,SO>& a,
const Submatrix<MT,AF,SO,DF,CSAs...>& b ) noexcept
4101 return (
isSame( ~a, b.operand() ) &&
4102 ( (~a).rows() == b.rows() ) &&
4103 ( (~a).columns() == b.columns() ) );
4122 template<
typename MT1
4132 inline bool isSame(
const Submatrix<MT1,AF1,SO1,DF1,CSAs1...>& a,
4133 const Submatrix<MT2,AF2,SO2,DF2,CSAs2...>& b ) noexcept
4135 return (
isSame( a.operand(), b.operand() ) &&
4136 ( a.row() == b.row() ) && ( a.column() == b.column() ) &&
4137 ( a.rows() == b.rows() ) && ( a.columns() == b.columns() ) );
4187 inline auto invert( Submatrix<MT,AF,SO,true,CSAs...>& sm )
4188 -> DisableIf_t< HasMutableDataAccess_v<MT> >
4190 using RT =
ResultType_t< Submatrix<MT,AF,SO,
true,CSAs...> >;
4219 template<
typename MT
4225 inline bool trySet(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm,
size_t i,
size_t j,
const ET& value )
4230 return trySet( sm.operand(), sm.row()+i, sm.column()+j, value );
4252 template<
typename MT
4258 inline bool tryAdd(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm,
size_t i,
size_t j,
const ET& value )
4263 return tryAdd( sm.operand(), sm.row()+i, sm.column()+j, value );
4285 template<
typename MT
4291 inline bool trySub(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm,
size_t i,
size_t j,
const ET& value )
4296 return trySub( sm.operand(), sm.row()+i, sm.column()+j, value );
4318 template<
typename MT
4324 inline bool tryMult(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm,
size_t i,
size_t j,
const ET& value )
4329 return tryMult( sm.operand(), sm.row()+i, sm.column()+j, value );
4353 template<
typename MT
4360 tryMult(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
4369 return tryMult( sm.operand(), sm.row()+
row, sm.column(), m, n, value );
4391 template<
typename MT
4397 inline bool tryDiv(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm,
size_t i,
size_t j,
const ET& value )
4402 return tryDiv( sm.operand(), sm.row()+i, sm.column()+j, value );
4426 template<
typename MT
4433 tryDiv(
const Submatrix<MT,AF,SO,DF,CSAs...>& sm,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
4442 return tryDiv( sm.operand(), sm.row()+
row, sm.column(), m, n, value );
4464 template<
typename MT
4471 inline bool tryAssign(
const Submatrix<MT,AF,SO,DF,CSAs...>& lhs,
4472 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
4479 return tryAssign( lhs.operand(), ~rhs, lhs.row() +
row, lhs.column() +
column );
4502 template<
typename MT
4509 inline bool tryAssign(
const Submatrix<MT,AF,SO,DF,CSAs...>& lhs,
4510 const Vector<VT,TF>& rhs, ptrdiff_t
band,
size_t row,
size_t column )
4517 return tryAssign( lhs.operand(), ~rhs,
band + ptrdiff_t( lhs.column() - lhs.row() ),
4518 lhs.row() +
row, lhs.column() +
column );
4540 template<
typename MT1
4547 inline bool tryAssign(
const Submatrix<MT1,AF,SO1,DF,CSAs...>& lhs,
4548 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
4555 return tryAssign( lhs.operand(), ~rhs, lhs.row() +
row, lhs.column() +
column );
4577 template<
typename MT
4584 inline bool tryAddAssign(
const Submatrix<MT,AF,SO,DF,CSAs...>& lhs,
4585 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
4592 return tryAddAssign( lhs.operand(), ~rhs, lhs.row() +
row, lhs.column() +
column );
4616 template<
typename MT
4623 inline bool tryAddAssign(
const Submatrix<MT,AF,SO,DF,CSAs...>& lhs,
4624 const Vector<VT,TF>& rhs, ptrdiff_t
band,
size_t row,
size_t column )
4631 return tryAddAssign( lhs.operand(), ~rhs,
band + ptrdiff_t( lhs.column() - lhs.row() ),
4632 lhs.row() +
row, lhs.column() +
column );
4654 template<
typename MT1
4661 inline bool tryAddAssign(
const Submatrix<MT1,AF,SO1,DF,CSAs...>& lhs,
4662 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
4669 return tryAddAssign( lhs.operand(), ~rhs, lhs.row() +
row, lhs.column() +
column );
4691 template<
typename MT
4698 inline bool trySubAssign(
const Submatrix<MT,AF,SO,DF,CSAs...>& lhs,
4699 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
4706 return trySubAssign( lhs.operand(), ~rhs, lhs.row() +
row, lhs.column() +
column );
4730 template<
typename MT
4737 inline bool trySubAssign(
const Submatrix<MT,AF,SO,DF,CSAs...>& lhs,
4738 const Vector<VT,TF>& rhs, ptrdiff_t
band,
size_t row,
size_t column )
4745 return trySubAssign( lhs.operand(), ~rhs,
band + ptrdiff_t( lhs.column() - lhs.row() ),
4746 lhs.row() +
row, lhs.column() +
column );
4768 template<
typename MT1
4775 inline bool trySubAssign(
const Submatrix<MT1,AF,SO1,DF,CSAs...>& lhs,
4776 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
4783 return trySubAssign( lhs.operand(), ~rhs, lhs.row() +
row, lhs.column() +
column );
4805 template<
typename MT
4812 inline bool tryMultAssign(
const Submatrix<MT,AF,SO,DF,CSAs...>& lhs,
4813 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
4820 return tryMultAssign( lhs.operand(), ~rhs, lhs.row() +
row, lhs.column() +
column );
4844 template<
typename MT
4851 inline bool tryMultAssign(
const Submatrix<MT,AF,SO,DF,CSAs...>& lhs,
4852 const Vector<VT,TF>& rhs, ptrdiff_t
band,
size_t row,
size_t column )
4859 return tryMultAssign( lhs.operand(), ~rhs,
band + ptrdiff_t( lhs.column() - lhs.row() ),
4860 lhs.row() +
row, lhs.column() +
column );
4882 template<
typename MT1
4889 inline bool trySchurAssign(
const Submatrix<MT1,AF,SO1,DF,CSAs...>& lhs,
4890 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
4897 return trySchurAssign( lhs.operand(), ~rhs, lhs.row() +
row, lhs.column() +
column );
4919 template<
typename MT
4926 inline bool tryDivAssign(
const Submatrix<MT,AF,SO,DF,CSAs...>& lhs,
4927 const Vector<VT,TF>& rhs,
size_t row,
size_t column )
4934 return tryDivAssign( lhs.operand(), ~rhs, lhs.row() +
row, lhs.column() +
column );
4958 template<
typename MT
4965 inline bool tryDivAssign(
const Submatrix<MT,AF,SO,DF,CSAs...>& lhs,
4966 const Vector<VT,TF>& rhs, ptrdiff_t
band,
size_t row,
size_t column )
4973 return tryDivAssign( lhs.operand(), ~rhs,
band + ptrdiff_t( lhs.column() - lhs.row() ),
4974 lhs.row() +
row, lhs.column() +
column );
4995 template<
typename MT
5003 inline decltype(
auto) derestrict( Submatrix<MT,AF,SO,DF,I,J,M,N>& dm )
5005 return submatrix<AF,I,J,M,N>( derestrict( dm.operand() ),
unchecked );
5026 template<
typename MT
5034 inline decltype(
auto) derestrict( Submatrix<MT,AF,SO,DF,I,J,M,N>&& dm )
5036 return submatrix<AF,I,J,M,N>( derestrict( dm.operand() ),
unchecked );
5057 template<
typename MT
5061 inline decltype(
auto) derestrict( Submatrix<MT,AF,SO,DF>& dm )
5063 return submatrix<AF>( derestrict( dm.operand() ), dm.row(), dm.column(), dm.rows(), dm.columns(),
unchecked );
5084 template<
typename MT
5088 inline decltype(
auto) derestrict( Submatrix<MT,AF,SO,DF>&& dm )
5090 return submatrix<AF>( derestrict( dm.operand() ), dm.row(), dm.column(), dm.rows(), dm.columns(),
unchecked );
5106 template<
typename MT, AlignmentFlag AF,
bool SO,
bool DF,
size_t I,
size_t J,
size_t M,
size_t N >
5107 struct Size< Submatrix<MT,AF,SO,DF,I,J,M,N>, 0UL >
5111 template<
typename MT, AlignmentFlag AF,
bool SO,
bool DF,
size_t I,
size_t J,
size_t M,
size_t N >
5112 struct Size< Submatrix<MT,AF,SO,DF,I,J,M,N>, 1UL >
5129 template<
typename MT, AlignmentFlag AF,
bool SO,
bool DF,
size_t I,
size_t J,
size_t M,
size_t N >
5130 struct MaxSize< Submatrix<MT,AF,SO,DF,I,J,M,N>, 0UL >
5134 template<
typename MT, AlignmentFlag AF,
bool SO,
bool DF,
size_t I,
size_t J,
size_t M,
size_t N >
5135 struct MaxSize< Submatrix<MT,AF,SO,DF,I,J,M,N>, 1UL >
5152 template<
typename MT,
AlignmentFlag AF,
bool SO,
bool DF,
size_t... CSAs >
5153 struct IsRestricted< Submatrix<MT,AF,SO,DF,CSAs...> >
5154 :
public IsRestricted<MT>
5170 template<
typename MT,
AlignmentFlag AF,
bool SO,
size_t... CSAs >
5171 struct HasConstDataAccess< Submatrix<MT,AF,SO,true,CSAs...> >
5172 :
public HasConstDataAccess<MT>
5188 template<
typename MT,
AlignmentFlag AF,
bool SO,
size_t... CSAs >
5189 struct HasMutableDataAccess< Submatrix<MT,AF,SO,true,CSAs...> >
5190 :
public HasMutableDataAccess<MT>
5206 template<
typename MT,
bool SO,
size_t... CSAs >
5207 struct IsAligned< Submatrix<MT,
aligned,SO,true,CSAs...> >
5224 template<
typename MT,
AlignmentFlag AF,
bool SO,
size_t... CSAs >
5225 struct IsContiguous< Submatrix<MT,AF,SO,true,CSAs...> >
5226 :
public IsContiguous<MT>
5242 template<
typename MT, AlignmentFlag AF,
bool SO,
bool DF,
size_t I,
size_t J,
size_t M,
size_t N >
5243 struct IsSymmetric< Submatrix<MT,AF,SO,DF,I,J,M,N> >
5244 :
public BoolConstant< ( IsSymmetric_v<MT> && I == J && M == N ) >
5260 template<
typename MT, AlignmentFlag AF,
bool SO,
bool DF,
size_t I,
size_t J,
size_t M,
size_t N >
5261 struct IsHermitian< Submatrix<MT,AF,SO,DF,I,J,M,N> >
5262 :
public BoolConstant< ( IsHermitian_v<MT> && I == J && M == N ) >
5278 template<
typename MT, AlignmentFlag AF,
bool SO,
bool DF,
size_t I,
size_t J,
size_t M,
size_t N >
5279 struct IsLower< Submatrix<MT,AF,SO,DF,I,J,M,N> >
5280 :
public BoolConstant< ( IsLower_v<MT> && I == J && M == N ) ||
5281 ( IsStrictlyLower_v<MT> && I == J+1UL && M == N ) >
5297 template<
typename MT, AlignmentFlag AF,
bool SO,
bool DF,
size_t I,
size_t J,
size_t M,
size_t N >
5298 struct IsUniLower< Submatrix<MT,AF,SO,DF,I,J,M,N> >
5299 :
public BoolConstant< ( IsUniLower_v<MT> && I == J && M == N ) >
5315 template<
typename MT, AlignmentFlag AF,
bool SO,
bool DF,
size_t I,
size_t J,
size_t M,
size_t N >
5316 struct IsStrictlyLower< Submatrix<MT,AF,SO,DF,I,J,M,N> >
5317 :
public BoolConstant< ( IsLower_v<MT> && I < J && M == N ) ||
5318 ( IsStrictlyLower_v<MT> && I == J && M == N ) >
5334 template< typename MT, AlignmentFlag AF, bool SO, bool DF, size_t I, size_t J, size_t M, size_t N >
5335 struct IsUpper< Submatrix<MT,AF,SO,DF,I,J,M,N> >
5336 : public BoolConstant< ( IsUpper_v<MT> && I == J && M == N ) ||
5337 ( IsStrictlyUpper_v<MT> && I+1UL == J && M == N ) >
5353 template< typename MT, AlignmentFlag AF, bool SO, bool DF, size_t I, size_t J, size_t M, size_t N >
5354 struct IsUniUpper< Submatrix<MT,AF,SO,DF,I,J,M,N> >
5355 : public BoolConstant< ( IsUniUpper_v<MT> && I == J && M == N ) >
5371 template< typename MT, AlignmentFlag AF, bool SO, bool DF, size_t I, size_t J, size_t M, size_t N >
5372 struct IsStrictlyUpper< Submatrix<MT,AF,SO,DF,I,J,M,N> >
5373 : public BoolConstant< ( IsUpper_v<MT> && I > J && M == N ) ||
5374 ( IsStrictlyUpper_v<MT> && I == J && M == N ) >
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:329
AlignmentFlag
Alignment flag for (un-)aligned vectors and matrices.Via these flags it is possible to specify subvec...
Definition: AlignmentFlag.h:62
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
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 blaze::checked and blaze::unchecked instances.
bool isLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a lower triangular matrix.
Definition: DenseMatrix.h:1004
bool isUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper triangular matrix.
Definition: DenseMatrix.h:1271
bool isStrictlyLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly lower triangular matrix.
Definition: DenseMatrix.h:1179
Header file for the implementation of the RowData class template.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the alignment flag values.
Header file for the UNUSED_PARAMETER function template.
Header file for the IsUniUpper type trait.
#define BLAZE_CONSTRAINT_MUST_HAVE_MUTABLE_DATA_ACCESS(T)
Constraint on the data type.In case the given data type T does not provide low-level data access to m...
Definition: MutableDataAccess.h:61
bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b) noexcept
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:992
Header file for basic type definitions.
Header file for the MatReduceExpr base class.
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.The ResultType_t alias declaration provides ...
Definition: Aliases.h:390
Header file for the serial shim.
Header file for the MatTransExpr base class.
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:591
bool isUniLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a lower unitriangular matrix.
Definition: DenseMatrix.h:1092
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
Header file for the MatEvalExpr base class.
typename RemoveReference< T >::Type RemoveReference_t
Auxiliary alias declaration for the RemoveReference type trait.The RemoveReference_t alias declaratio...
Definition: RemoveReference.h:95
Header file for the MatMatMultExpr base class.
constexpr bool IsUpper_v
Auxiliary variable template for the IsUpper type trait.The IsUpper_v variable template provides a con...
Definition: IsUpper.h:174
Header file for the decltype(auto) workaround.
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
#define BLAZE_STATIC_ASSERT_MSG(expr, msg)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:123
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
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
constexpr bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:775
Submatrix specialization for dense matrices.
Header file for the MatMapExpr base class.
Header file for the implementation of the Subvector view.
decltype(auto) reduce(const DenseMatrix< MT, SO > &dm, OP op)
Performs a custom reduction operation on the given dense matrix.
Definition: DMatReduceExpr.h:2016
Headerfile for the generic max algorithm.
Header file for the DisableIf class template.
Header file for the SmallArray implementation.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric 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
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
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:1147
Header file for the implementation of the Submatrix base template.
Header file for the MatMatSubExpr base class.
constexpr bool Contains_v
Auxiliary variable template for the Contains type trait.The Contains_v variable template provides a c...
Definition: Contains.h:139
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
Header file for the TransposeFlag type trait.
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:786
constexpr bool IsStrictlyLower_v
Auxiliary variable template for the IsStrictlyLower type trait.The IsStrictlyLower_v variable templat...
Definition: IsStrictlyLower.h:172
Submatrix specialization for sparse matrices.
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1179
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
Constraint on the data type.
Constraint on the data type.
Header file for the MatSerialExpr base class.
Header file for the VecTVecMultExpr base class.
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:360
Header file for the IsStrictlyLower type trait.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:611
decltype(auto) band(Matrix< MT, SO > &matrix, RBAs... args)
Creating a view on a specific band of the given matrix.
Definition: Band.h:135
Flag for aligned vectors and matrices.
Definition: AlignmentFlag.h:65
Header file for the HasConstDataAccess type trait.
IntegralConstant< ptrdiff_t, N > PtrdiffT
Compile time integral constant wrapper for ptrdiff_t.The PtrdiffT class template represents an integr...
Definition: PtrdiffT.h:72
Header file for the DeclExpr base class.
Header file for the Matrix base class.
Header file for the PtrdiffT class template.
constexpr size_t columnwise
Reduction flag for column-wise reduction operations.
Definition: ReductionFlag.h:90
bool isStrictlyUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly upper triangular matrix.
Definition: DenseMatrix.h:1446
decltype(subsequence< Is... >(shift< Offset >(make_index_sequence< N >()))) make_shifted_index_subsequence
Auxiliary alias declaration for the setup of shifted index subsequences.The make_shifted_index_subseq...
Definition: IntegerSequence.h:243
Header file for the MatScalarMultExpr base class.
Header file for run time assertion macros.
Header file for the Unique class template.
Header file for the IsContiguous type trait.
Check< false > Unchecked
Type of the blaze::unchecked instance.blaze::Unchecked is the type of the blaze::unchecked instance...
Definition: Check.h:96
Header file for the SchurExpr base class.
decltype(auto) expand(const DenseVector< VT, TF > &dv, size_t expansion)
Expansion of the given dense vector.
Definition: DVecExpandExpr.h:739
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
constexpr bool IsStrictlyUpper_v
Auxiliary variable template for the IsStrictlyUpper type trait.The IsStrictlyUpper_v variable templat...
Definition: IsStrictlyUpper.h:172
constexpr bool IsLower_v
Auxiliary variable template for the IsLower type trait.The IsLower_v variable template provides a con...
Definition: IsLower.h:174
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
bool isHermitian(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is Hermitian.
Definition: DenseMatrix.h:617
Header file for the isDefault shim.
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:109
typename T::VectorType VectorType_t
Alias declaration for nested VectorType type definitions.The VectorType_t alias declaration provides ...
Definition: Aliases.h:510
Header file for the TVecMatMultExpr base class.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:808
Header file for the HasMutableDataAccess type trait.
bool isSymmetric(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is symmetric.
Definition: DenseMatrix.h:539
#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
Header file for the MatMatAddExpr base class.
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:101
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 RemoveReference type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:765
Header file for the VecExpandExpr base class.
typename T::BaseType BaseType_t
Alias declaration for nested BaseType type definitions.The BaseType_t alias declaration provides a co...
Definition: Aliases.h:70
constexpr size_t rowwise
Reduction flag for row-wise reduction operations.
Definition: ReductionFlag.h:70
Header file for the MatMatMapExpr base class.
Header file for the IntegralConstant class template.
bool isUniUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper unitriangular matrix.
Definition: DenseMatrix.h:1359
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
Header file for the IsUpper type trait.
Header file for the implementation of the ColumnData class template.
Header file for the MatScalarDivExpr base class.
Header file for the MatVecMultExpr base class.
Header file for the IsHermitian 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, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the reduction flags.
Header file for the TrueType type/value trait base class.
Header file for the function trace functionality.
decltype(auto) map(const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs, OP op)
Evaluates the given binary operation on each single element of the dense matrices lhs and rhs...
Definition: DMatDMatMapExpr.h:1110