35 #ifndef _BLAZE_MATH_VIEWS_ROWS_H_ 36 #define _BLAZE_MATH_VIEWS_ROWS_H_ 146 inline decltype(
auto)
rows(
Matrix<MT,SO>& matrix, RRAs... args )
196 inline decltype(
auto)
rows( const
Matrix<MT,SO>& matrix, RRAs... args )
200 using ReturnType =
const Rows_<
const MT,I,Is...>;
225 inline decltype(
auto)
rows(
Matrix<MT,SO>&& matrix, RRAs... args )
274 template<
typename MT
278 inline decltype(
auto)
rows(
Matrix<MT,SO>& matrix, const T* indices,
size_t n, RRAs... args )
283 return ReturnType( ~matrix, indices, n, args... );
328 template<
typename MT
332 inline decltype(
auto)
rows( const
Matrix<MT,SO>& matrix, const T* indices,
size_t n, RRAs... args )
337 return ReturnType( ~matrix, indices, n, args... );
357 template<
typename MT
361 inline decltype(
auto)
rows(
Matrix<MT,SO>&& matrix, const T* indices,
size_t n, RRAs... args )
366 return ReturnType( ~matrix, indices, n, args... );
387 template<
typename MT
396 return rows<Is...>( std::forward<MT>( matrix ), args... );
418 template<
typename MT
425 return rows( std::forward<MT>( matrix ), indices.begin(), indices.size(), args... );
447 template<
typename MT
451 inline decltype(
auto)
rows( MT&& matrix,
const std::array<T,N>& indices, RRAs... args )
455 return rows( std::forward<MT>( matrix ), indices.data(), N, args... );
477 template<
typename MT
480 inline decltype(
auto)
rows( MT&& matrix,
const std::vector<T>& indices, RRAs... args )
484 return rows( std::forward<MT>( matrix ), indices.data(), indices.size(), args... );
506 template<
typename MT
514 return rows( std::forward<MT>( matrix ), indices.
data(), indices.
size(), args... );
540 template<
size_t... CRAs
543 ,
typename =
EnableIfTrue_< (
sizeof...( CRAs ) +
sizeof...( RRAs ) > 0UL ) > >
548 return rows<CRAs...>( (~matrix).leftOperand(), args... ) +
549 rows<CRAs...>( (~matrix).rightOperand(), args... );
567 template<
size_t... CRAs
570 ,
typename =
EnableIfTrue_< (
sizeof...( CRAs ) +
sizeof...( RRAs ) > 0UL ) > >
575 return rows<CRAs...>( (~matrix).leftOperand(), args... ) -
576 rows<CRAs...>( (~matrix).rightOperand(), args... );
594 template<
size_t... CRAs
597 ,
typename =
EnableIfTrue_< (
sizeof...( CRAs ) +
sizeof...( RRAs ) > 0UL ) > >
602 return rows<CRAs...>( (~matrix).leftOperand(), args... ) %
603 rows<CRAs...>( (~matrix).rightOperand(), args... );
621 template<
size_t... CRAs
624 ,
typename =
EnableIfTrue_< (
sizeof...( CRAs ) +
sizeof...( RRAs ) > 0UL ) > >
629 return rows<CRAs...>( (~matrix).leftOperand(), args... ) * (~matrix).rightOperand();
647 template<
size_t... CRAs
650 ,
typename =
EnableIfTrue_< (
sizeof...( CRAs ) +
sizeof...( RRAs ) > 0UL ) > >
655 return elements<CRAs...>( (~matrix).leftOperand(), args... ) * (~matrix).rightOperand();
673 template<
size_t... CRAs
676 ,
typename =
EnableIfTrue_< (
sizeof...( CRAs ) +
sizeof...( RRAs ) > 0UL ) > >
681 return rows<CRAs...>( (~matrix).leftOperand(), args... ) * (~matrix).rightOperand();
699 template<
size_t... CRAs
702 ,
typename =
EnableIfTrue_< (
sizeof...( CRAs ) +
sizeof...( RRAs ) > 0UL ) > >
707 return rows<CRAs...>( (~matrix).leftOperand(), args... ) / (~matrix).rightOperand();
725 template<
size_t... CRAs
728 ,
typename =
EnableIfTrue_< (
sizeof...( CRAs ) +
sizeof...( RRAs ) > 0UL ) > >
733 return map( rows<CRAs...>( (~matrix).operand(), args... ), (~matrix).operation() );
751 template<
size_t... CRAs
754 ,
typename =
EnableIfTrue_< (
sizeof...( CRAs ) +
sizeof...( RRAs ) > 0UL ) > >
759 return map( rows<CRAs...>( (~matrix).leftOperand(), args... ),
760 rows<CRAs...>( (~matrix).rightOperand(), args... ),
761 (~matrix).operation() );
779 template<
size_t... CRAs
782 ,
typename =
EnableIfTrue_< (
sizeof...( CRAs ) +
sizeof...( RRAs ) > 0UL ) > >
787 return eval( rows<CRAs...>( (~matrix).operand(), args... ) );
805 template<
size_t... CRAs
808 ,
typename =
EnableIfTrue_< (
sizeof...( CRAs ) +
sizeof...( RRAs ) > 0UL ) > >
813 return serial( rows<CRAs...>( (~matrix).operand(), args... ) );
831 template<
size_t... CRAs
834 ,
typename =
EnableIfTrue_< (
sizeof...( CRAs ) +
sizeof...( RRAs ) > 0UL ) > >
839 return rows<CRAs...>( (~matrix).operand(), args... );
857 template<
size_t... CRAs
860 ,
typename =
EnableIfTrue_< (
sizeof...( CRAs ) +
sizeof...( RRAs ) > 0UL ) > >
865 return trans( columns<CRAs...>( (~matrix).operand(), args... ) );
891 inline decltype(
auto)
rows( Rows<MT,SO,DF,SF,I2,Is2...>& r, RRAs... args )
895 static constexpr
size_t indices[] = { I2, Is2... };
896 return rows< indices[I1], indices[Is1]... >( r.operand(), args... );
923 inline decltype(
auto)
rows(
const Rows<MT,SO,DF,SF,I2,Is2...>& r, RRAs... args )
927 static constexpr
size_t indices[] = { I2, Is2... };
928 return rows< indices[I1], indices[Is1]... >( r.operand(), args... );
955 inline decltype(
auto)
rows( Rows<MT,SO,DF,SF,I2,Is2...>&& r, RRAs... args )
959 static constexpr
size_t indices[] = { I2, Is2... };
960 return rows< indices[I1], indices[Is1]... >( r.operand(), args... );
986 inline decltype(
auto)
rows( Rows<MT,SO,DF,SF,CRAs...>& r, RRAs... args )
993 static constexpr
size_t indices[] = { I, Is... };
994 for(
size_t i=0UL; i<
sizeof...(Is)+1UL; ++i ) {
995 if( r.rows() <= indices[i] ) {
1001 decltype(
auto) indices( r.idces() );
1002 return rows( r.operand(), { indices[I], indices[Is]... }, args... );
1028 ,
typename... RRAs >
1029 inline decltype(
auto)
rows(
const Rows<MT,SO,DF,SF,CRAs...>& r, RRAs... args )
1036 static constexpr
size_t indices[] = { I, Is... };
1037 for(
size_t i=0UL; i<
sizeof...(Is)+1UL; ++i ) {
1038 if( r.rows() <= indices[i] ) {
1044 decltype(
auto) indices( r.idces() );
1045 return rows( r.operand(), { indices[I], indices[Is]... }, args... );
1071 ,
typename... RRAs >
1072 inline decltype(
auto)
rows( Rows<MT,SO,DF,SF,CRAs...>&& r, RRAs... args )
1079 static constexpr
size_t indices[] = { I, Is... };
1080 for(
size_t i=0UL; i<
sizeof...(Is)+1UL; ++i ) {
1081 if( r.rows() <= indices[i] ) {
1087 decltype(
auto) indices( r.idces() );
1088 return rows( r.operand(), { indices[I], indices[Is]... }, args... );
1108 template<
typename MT
1114 ,
typename... RRAs >
1115 inline decltype(
auto)
rows( Rows<MT,SO,DF,SF,CRAs...>& r,
const T* indices,
size_t n, RRAs... args )
1122 for(
size_t i=0UL; i<n; ++i ) {
1123 if( r.rows() <= indices[i] ) {
1129 decltype(
auto) oldIndices( r.idces() );
1133 for(
size_t i=0UL; i<n; ++i ) {
1134 newIndices.pushBack( oldIndices[indices[i]] );
1137 return rows( r.operand(), newIndices.data(), newIndices.size(), args... );
1158 template<
typename MT
1164 ,
typename... RRAs >
1165 inline decltype(
auto)
rows(
const Rows<MT,SO,DF,SF,CRAs...>& r,
const T* indices,
size_t n, RRAs... args )
1172 for(
size_t i=0UL; i<n; ++i ) {
1173 if( r.rows() <= indices[i] ) {
1179 decltype(
auto) oldIndices( r.idces() );
1183 for(
size_t i=0UL; i<n; ++i ) {
1184 newIndices.pushBack( oldIndices[indices[i]] );
1187 return rows( r.operand(), newIndices.data(), newIndices.size(), args... );
1208 template<
typename MT
1214 ,
typename... RRAs >
1215 inline decltype(
auto)
rows( Rows<MT,SO,DF,SF,CRAs...>&& r,
const T* indices,
size_t n, RRAs... args )
1222 for(
size_t i=0UL; i<n; ++i ) {
1223 if( r.rows() <= indices[i] ) {
1229 decltype(
auto) oldIndices( r.idces() );
1233 for(
size_t i=0UL; i<n; ++i ) {
1234 newIndices.pushBack( oldIndices[indices[i]] );
1237 return rows( r.operand(), newIndices.data(), newIndices.size(), args... );
1263 template<
size_t... CEAs
1265 ,
typename... REAs >
1270 return rows<CEAs...>( (~vector).leftOperand(), args... ) * (~vector).rightOperand();
1302 ,
typename... RRAs >
1303 inline decltype(
auto)
row( Rows<MT,SO,DF,SF,I2,Is...>&
rows, RRAs... args )
1307 static constexpr
size_t indices[] = { I2, Is... };
1308 return row<indices[I1]>( rows.operand(), args... );
1333 ,
typename... RRAs >
1334 inline decltype(
auto)
row(
const Rows<MT,SO,DF,SF,I2,Is...>& rows, RRAs... args )
1338 static constexpr
size_t indices[] = { I2, Is... };
1339 return row<indices[I1]>( rows.operand(), args... );
1364 ,
typename... RRAs >
1365 inline decltype(
auto)
row( Rows<MT,SO,DF,SF,I2,Is...>&& rows, RRAs... args )
1369 static constexpr
size_t indices[] = { I2, Is... };
1370 return row<indices[I1]>( rows.operand(), args... );
1388 template<
size_t... CRAs1
1394 ,
typename... RRAs >
1395 inline decltype(
auto)
row( Rows<MT,SO,DF,SF,CRAs2...>& rows, RRAs... args )
1399 const RowData<CRAs1...> rd( args... );
1400 decltype(
auto) indices( rows.idces() );
1405 if( indices.size() <= rd.row() ) {
1410 return row( rows.operand(), indices[rd.row()], args... );
1429 template<
size_t... CRAs1
1435 ,
typename... RRAs >
1436 inline decltype(
auto)
row(
const Rows<MT,SO,DF,SF,CRAs2...>& rows, RRAs... args )
1440 const RowData<CRAs1...> rd( args... );
1441 decltype(
auto) indices( rows.idces() );
1446 if( indices.size() <= rd.row() ) {
1451 return row( rows.operand(), indices[rd.row()], args... );
1470 template<
size_t... CRAs1
1476 ,
typename... RRAs >
1477 inline decltype(
auto)
row( Rows<MT,SO,DF,SF,CRAs2...>&& rows, RRAs... args )
1481 const RowData<CRAs1...> rd( args... );
1482 decltype(
auto) indices( rows.idces() );
1487 if( indices.size() <= rd.row() ) {
1492 return row( rows.operand(), indices[rd.row()], args... );
1517 template<
size_t... CCAs
1524 ,
typename... RCAs >
1525 inline decltype(
auto)
column( Rows<MT,SO,DF,SF,I,Is...>& rows, RCAs... args )
1529 return elements<I,Is...>(
column<CCAs...>( rows.operand(), args... ) );
1547 template<
size_t... CCAs
1554 ,
typename... RCAs >
1555 inline decltype(
auto)
column(
const Rows<MT,SO,DF,SF,I,Is...>& rows, RCAs... args )
1559 return elements<I,Is...>(
column<CCAs...>( rows.operand(), args... ) );
1577 template<
size_t... CCAs
1584 ,
typename... RCAs >
1585 inline decltype(
auto)
column( Rows<MT,SO,DF,SF,I,Is...>&& rows, RCAs... args )
1589 return elements<I,Is...>(
column<CCAs...>( rows.operand(), args... ) );
1606 template<
size_t... CCAs
1611 ,
typename... RCAs >
1612 inline decltype(
auto)
column( Rows<MT,SO,DF,SF>& rows, RCAs... args )
1616 return elements( column<CCAs...>( rows.operand(), args... ), rows.idces() );
1634 template<
size_t... CCAs
1639 ,
typename... RCAs >
1640 inline decltype(
auto)
column(
const Rows<MT,SO,DF,SF>& rows, RCAs... args )
1644 return elements( column<CCAs...>( rows.operand(), args... ), rows.idces() );
1662 template<
size_t... CCAs
1667 ,
typename... RCAs >
1668 inline decltype(
auto)
column( Rows<MT,SO,DF,SF>&& rows, RCAs... args )
1672 return elements( column<CCAs...>( rows.operand(), args... ), rows.idces() );
1694 template<
typename MT
1699 inline void reset( Rows<MT,SO,DF,SF,CRAs...>& rows )
1715 template<
typename MT
1720 inline void reset( Rows<MT,SO,DF,SF,CRAs...>&& rows )
1740 template<
typename MT
1745 inline void reset( Rows<MT,SO,DF,SF,CRAs...>& rows,
size_t i )
1763 template<
typename MT
1768 inline void clear( Rows<MT,SO,DF,SF,CRAs...>& rows )
1786 template<
typename MT
1791 inline void clear( Rows<MT,SO,DF,SF,CRAs...>&& rows )
1830 inline bool isDefault(
const Rows<MT,SO,true,SF,CRAs...>& rows )
1835 for(
size_t i=0UL; i<rows.rows(); ++i )
1836 for(
size_t j=0UL; j<rows.columns(); ++j )
1837 if( !isDefault<RF>(
rows(i,j) ) )
1841 for(
size_t j=0UL; j<rows.columns(); ++j )
1842 for(
size_t i=0UL; i<rows.rows(); ++i )
1843 if( !isDefault<RF>(
rows(i,j) ) )
1884 inline bool isDefault(
const Rows<MT,SO,false,SF,CRAs...>& rows )
1888 for(
size_t i=0UL; i<rows.rows(); ++i ) {
1889 for(
auto element=rows.cbegin(i); element!=rows.cend(i); ++element )
1890 if( !isDefault<RF>( element->value() ) )
return false;
1918 template<
typename MT
1923 inline bool isIntact(
const Rows<MT,SO,DF,SF,CRAs...>& rows ) noexcept
1925 return ( rows.rows() <= rows.operand().rows() &&
1926 rows.columns() == rows.operand().columns() &&
1946 template<
typename MT
1954 if( !
isSame( a.operand(), ~b ) || ( a.rows() != (~b).
rows() ) || ( a.columns() != (~b).
columns() ) )
1957 decltype(
auto) indices( a.idces() );
1958 for(
size_t i=0UL; i<a.rows(); ++i ) {
1959 if( indices[i] != i )
1982 template<
typename MT
2009 template<
typename MT
2017 inline bool isSame(
const Rows<MT,SO1,DF,SF,CRAs...>& a,
const Submatrix<MT,AF,SO2,DF,CSAs...>& b ) noexcept
2019 if( !
isSame( a.operand(), b.operand() ) || ( a.rows() != (~b).
rows() ) || ( a.columns() != (~b).
columns() ) )
2022 decltype(
auto) indices( a.idces() );
2023 for(
size_t i=0UL; i<a.rows(); ++i ) {
2024 if( indices[i] != b.row()+i )
2047 template<
typename MT
2055 inline bool isSame(
const Submatrix<MT,AF,SO1,DF,CSAs...>& a,
const Rows<MT,SO2,DF,SF,CRAs...>& b ) noexcept
2076 template<
typename MT
2082 inline bool isSame(
const Rows<MT,SO,DF,SF,CRAs1...>& a,
2083 const Rows<MT,SO,DF,SF,CRAs2...>& b ) noexcept
2085 if( !
isSame( a.operand(), b.operand() ) || a.rows() != b.rows() || a.columns() != b.columns() )
2088 decltype(
auto) indices1( a.idces() );
2089 decltype(
auto) indices2( b.idces() );
2091 return std::equal( indices1.begin(), indices1.end(), indices2.begin() );
2143 using RT =
ResultType_< Rows<MT,SO,
true,SF,CRAs...> >;
2172 template<
typename MT
2178 inline bool trySet(
const Rows<MT,SO,DF,SF,CRAs...>& r,
size_t i,
size_t j,
const ET& value )
2183 return trySet( r.operand(), r.idx(i), j, value );
2205 template<
typename MT
2211 inline bool tryAdd(
const Rows<MT,SO,DF,SF,CRAs...>& r,
size_t i,
size_t j,
const ET& value )
2216 return tryAdd( r.operand(), r.idx(i), j, value );
2238 template<
typename MT
2244 inline bool trySub(
const Rows<MT,SO,DF,SF,CRAs...>& r,
size_t i,
size_t j,
const ET& value )
2249 return trySub( r.operand(), r.idx(i), j, value );
2271 template<
typename MT
2277 inline bool tryMult(
const Rows<MT,SO,DF,SF,CRAs...>& r,
size_t i,
size_t j,
const ET& value )
2282 return tryMult( r.operand(), r.idx(i), j, value );
2306 template<
typename MT
2313 tryMult(
const Rows<MT,SO,DF,SF,CRAs...>& r,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
2320 const size_t iend( row + m );
2322 for(
size_t i=row; i<iend; ++i ) {
2323 if( !tryMult( r.operand(), r.idx(i),
column, m, n, value ) )
2349 template<
typename MT
2355 inline bool tryDiv(
const Rows<MT,SO,DF,SF,CRAs...>& r,
size_t i,
size_t j,
const ET& value )
2360 return tryDiv( r.operand(), r.idx(i), j, value );
2384 template<
typename MT
2391 tryDiv(
const Rows<MT,SO,DF,SF,CRAs...>& r,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
2398 const size_t iend( row + m );
2400 for(
size_t i=row; i<iend; ++i ) {
2401 if( !tryDiv( r.operand(), r.idx(i),
column, m, n, value ) )
2427 template<
typename MT
2433 inline bool tryAssign(
const Rows<MT,SO,DF,SF,CRAs...>& lhs,
2440 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
2441 if( !trySet( lhs.operand(), lhs.idx( row+i ),
column, (~rhs)[i] ) )
2467 template<
typename MT
2473 inline bool tryAssign(
const Rows<MT,SO,DF,SF,CRAs...>& lhs,
2480 return tryAssign( lhs.operand(), ~rhs, lhs.idx( row ),
column );
2503 template<
typename MT
2510 inline bool tryAssign(
const Rows<MT,SO,DF,SF,CRAs...>& lhs,
2520 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
2521 if( !trySet( lhs.operand(), lhs.idx( row+i ), column+i, (~rhs)[i] ) )
2547 template<
typename MT1
2554 inline bool tryAssign(
const Rows<MT1,SO1,DF,SF,CRAs...>& lhs,
2562 for(
size_t i=0UL; i<(~rhs).
rows(); ++i ) {
2591 template<
typename MT
2597 inline bool tryAddAssign(
const Rows<MT,SO,DF,SF,CRAs...>& lhs,
2604 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
2605 if( !tryAdd( lhs.operand(), lhs.idx( row+i ),
column, (~rhs)[i] ) )
2631 template<
typename MT
2637 inline bool tryAddAssign(
const Rows<MT,SO,DF,SF,CRAs...>& lhs,
2644 return tryAddAssign( lhs.operand(), ~rhs, lhs.idx( row ),
column );
2668 template<
typename MT
2675 inline bool tryAddAssign(
const Rows<MT,SO,DF,SF,CRAs...>& lhs,
2685 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
2686 if( !tryAdd( lhs.operand(), lhs.idx( row+i ), column+i, (~rhs)[i] ) )
2712 template<
typename MT1
2719 inline bool tryAddAssign(
const Rows<MT1,SO1,DF,SF,CRAs...>& lhs,
2727 for(
size_t i=0UL; i<(~rhs).
rows(); ++i ) {
2755 template<
typename MT
2761 inline bool trySubAssign(
const Rows<MT,SO,DF,SF,CRAs...>& lhs,
2768 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
2769 if( !trySub( lhs.operand(), lhs.idx( row+i ),
column, (~rhs)[i] ) )
2796 template<
typename MT
2802 inline bool trySubAssign(
const Rows<MT,SO,DF,SF,CRAs...>& lhs,
2809 return trySubAssign( lhs.operand(), ~rhs, lhs.idx( row ),
column );
2833 template<
typename MT
2840 inline bool trySubAssign(
const Rows<MT,SO,DF,SF,CRAs...>& lhs,
2850 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
2851 if( !trySub( lhs.operand(), lhs.idx( row+i ), column+i, (~rhs)[i] ) )
2877 template<
typename MT1
2884 inline bool trySubAssign(
const Rows<MT1,SO1,DF,SF,CRAs...>& lhs,
2892 for(
size_t i=0UL; i<(~rhs).
rows(); ++i ) {
2921 template<
typename MT
2927 inline bool tryMultAssign(
const Rows<MT,SO,DF,SF,CRAs...>& lhs,
2934 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
2935 if( !tryMult( lhs.operand(), lhs.idx( row+i ),
column, (~rhs)[i] ) )
2962 template<
typename MT
2968 inline bool tryMultAssign(
const Rows<MT,SO,DF,SF,CRAs...>& lhs,
2975 return tryMultAssign( lhs.operand(), ~rhs, lhs.idx( row ),
column );
2999 template<
typename MT
3006 inline bool tryMultAssign(
const Rows<MT,SO,DF,SF,CRAs...>& lhs,
3016 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
3017 if( !tryMult( lhs.operand(), lhs.idx( row+i ), column+i, (~rhs)[i] ) )
3044 template<
typename MT1
3051 inline bool trySchurAssign(
const Rows<MT1,SO1,DF,SF,CRAs...>& lhs,
3059 for(
size_t i=0UL; i<(~rhs).
rows(); ++i ) {
3088 template<
typename MT
3094 inline bool tryDivAssign(
const Rows<MT,SO,DF,SF,CRAs...>& lhs,
3101 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
3102 if( !tryDiv( lhs.operand(), lhs.idx( row+i ),
column, (~rhs)[i] ) )
3128 template<
typename MT
3134 inline bool tryDivAssign(
const Rows<MT,SO,DF,SF,CRAs...>& lhs,
3141 return tryDivAssign( lhs.operand(), ~rhs, lhs.idx( row ),
column );
3165 template<
typename MT
3172 inline bool tryDivAssign(
const Rows<MT,SO,DF,SF,CRAs...>& lhs,
3182 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
3183 if( !tryDiv( lhs.operand(), lhs.idx( row+i ), column+i, (~rhs)[i] ) )
3208 template<
typename MT
3214 inline decltype(
auto) derestrict( Rows<MT,SO,DF,SF,I,Is...>& r )
3216 return rows<I,Is...>( derestrict( r.operand() ),
unchecked );
3237 template<
typename MT
3243 inline decltype(
auto) derestrict( Rows<MT,SO,DF,SF,I,Is...>&& r )
3245 return rows<I,Is...>( derestrict( r.operand() ),
unchecked );
3266 template<
typename MT
3270 inline decltype(
auto) derestrict( Rows<MT,SO,DF,SF>& r )
3272 decltype(
auto) indices( r.idces() );
3273 return rows( derestrict( r.operand() ), indices.data(), indices.size(),
unchecked );
3294 template<
typename MT
3298 inline decltype(
auto) derestrict( Rows<MT,SO,DF,SF>&& r )
3300 decltype(
auto) indices( r.idces() );
3301 return rows( derestrict( r.operand() ), indices.data(), indices.size(),
unchecked );
3317 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t I,
size_t... Is >
3318 struct Size< Rows<MT,SO,DF,SF,I,Is...>, 0UL >
3319 :
public PtrdiffT<1UL+sizeof...(Is)>
3322 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs >
3323 struct Size< Rows<MT,SO,DF,SF,CRAs...>, 1UL >
3324 :
public Size<MT,1UL>
3340 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs >
3358 template<
typename MT,
bool SO,
bool SF,
size_t... CRAs >
3376 template<
typename MT,
bool SO,
bool SF,
size_t... CRAs >
3394 template<
typename MT,
bool SO,
bool SF,
size_t... CRAs >
3395 struct IsAligned< Rows<MT,SO,true,SF,CRAs...> >
3412 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs,
size_t... CSAs >
3431 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs1,
size_t... CRAs2 >
3432 struct RowTrait< Rows<MT,SO,DF,SF,CRAs1...>, CRAs2... >
3450 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs1,
size_t... CRAs2 >
3451 struct RowsTrait< Rows<MT,SO,DF,SF,CRAs1...>, CRAs2... >
3469 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs,
size_t... CCAs >
3470 struct ColumnTrait< Rows<MT,SO,DF,SF,CRAs...>, CCAs... >
3488 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs,
size_t... CCAs >
3489 struct ColumnsTrait< Rows<MT,SO,DF,SF,CRAs...>, CCAs... >
3507 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs,
ptrdiff_t... CBAs >
3508 struct BandTrait< Rows<MT,SO,DF,SF,CRAs...>, CBAs... >
AlignmentFlag
Alignment flag for (un-)aligned vectors and matrices.Via these flags it is possible to specify subvec...
Definition: AlignmentFlag.h:62
Rows specialization for sparse matrices.
#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
Pointer difference type of the Blaze library.
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:131
Header file for the blaze::checked and blaze::unchecked instances.
Base class for all binary matrix map expression templates.The MatMatMapExpr class serves as a tag for...
Definition: MatMatMapExpr.h:66
Header file for the implementation of the RowData class template.
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
Header file for the alignment flag values.
Header file for the UNUSED_PARAMETER function template.
#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
BLAZE_ALWAYS_INLINE 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:949
Header file for basic type definitions.
Base class for all matrix serial evaluation expression templates.The MatSerialExpr class serves as a ...
Definition: MatSerialExpr.h:67
constexpr bool equal(const T1 &a, const T2 &b)
Generic equality check.
Definition: Equal.h:76
Header file for the row trait.
Base template for the SubmatrixTrait class.
Definition: SubmatrixTrait.h:109
Base class for all matrix/scalar division expression templates.The MatScalarDivExpr class serves as a...
Definition: MatScalarDivExpr.h:66
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:108
Header file for the serial shim.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
Header file for the MatTransExpr base class.
Header file for the dense matrix inversion flags.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
Implementation of a dynamic vector with small vector optimization.The SmallVector class template is a...
Definition: SmallVector.h:80
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
Base class for all matrix/scalar multiplication expression templates.The MatScalarMultExpr class serv...
Definition: MatScalarMultExpr.h:67
Header file for the MatEvalExpr base class.
Header file for the MatMatMultExpr base class.
Header file for the extended initializer_list functionality.
Index sequence type of the Blaze library.
typename SubmatrixTrait< MT, CSAs... >::Type SubmatrixTrait_
Auxiliary alias declaration for the SubmatrixTrait type trait.The SubmatrixTrait_ alias declaration p...
Definition: SubmatrixTrait.h:145
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
typename RowTrait< MT, CRAs... >::Type RowTrait_
Auxiliary alias declaration for the RowTrait type trait.The RowTrait_ alias declaration provides a co...
Definition: RowTrait.h:145
Base template for the RowsTrait class.
Definition: RowsTrait.h:109
Header file for the band trait.
Compile time check for data types with restricted data access.This type trait tests whether the given...
Definition: IsRestricted.h:82
Compile time check for low-level access to mutable data.This type trait tests whether the given data ...
Definition: HasMutableDataAccess.h:75
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
Pointer data() noexcept
Low-level data access to the vector elements.
Definition: SmallVector.h:538
Header file for the matrix storage order types.
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:772
Header file for the MatMapExpr base class.
Base template for the RowTrait class.
Definition: RowTrait.h:109
typename ColumnTrait< MT, CCAs... >::Type ColumnTrait_
Auxiliary alias declaration for the ColumnTrait type trait.The ColumnTrait_ alias declaration provide...
Definition: ColumnTrait.h:144
typename ColumnsTrait< MT, CCAs... >::Type ColumnsTrait_
Auxiliary alias declaration for the ColumnsTrait type trait.The ColumnsTrait_ alias declaration provi...
Definition: ColumnsTrait.h:145
Base class for all matrix/matrix subtraction expression templates.The MatMatSubExpr class serves as a...
Definition: MatMatSubExpr.h:67
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
Base class for all matrix/matrix addition expression templates.The MatMatAddExpr class serves as a ta...
Definition: MatMatAddExpr.h:66
Header file for the MatMatSubExpr base class.
Header file for the IsAligned type trait.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:506
Base class for all unary matrix map expression templates.The MatMapExpr class serves as a tag for all...
Definition: MatMapExpr.h:66
Base class for all matrix/vector multiplication expression templates.The MatVecMultExpr class serves ...
Definition: MatVecMultExpr.h:67
Implementation of a type list.The TypeList class template represents a list of data types of arbitrar...
Definition: TypeList.h:119
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:794
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:134
Header file for the exception macros of the math module.
Constraint on the data type.
Constraint on the data type.
Header file for the MatSerialExpr base class.
Header file for the VecTVecMultExpr base class.
typename BandTrait< MT, CBAs... >::Type BandTrait_
Auxiliary alias declaration for the BandTrait type trait.The BandTrait_ alias declaration provides a ...
Definition: BandTrait.h:145
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
decltype(auto) band(Matrix< MT, SO > &matrix, RBAs... args)
Creating a view on a specific band of the given matrix.
Definition: Band.h:134
typename RowsTrait< MT, CRAs... >::Type RowsTrait_
Auxiliary alias declaration for the RowsTrait type trait.The RowsTrait_ alias declaration provides a ...
Definition: RowsTrait.h:145
Header file for the HasConstDataAccess type trait.
Header file for the DeclExpr base class.
Base class for all matrix/matrix multiplication expression templates.The MatMatMultExpr class serves ...
Definition: MatMatMultExpr.h:67
Header file for the Matrix base class.
Header file for all forward declarations for views.
typename EnableIfTrue< Condition, T >::Type EnableIfTrue_
Auxiliary type for the EnableIfTrue class template.The EnableIfTrue_ alias declaration provides a con...
Definition: EnableIf.h:138
Header file for the MatScalarMultExpr base class.
Base class for all Schur product expression templates.The SchurExpr class serves as a tag for all exp...
Definition: SchurExpr.h:66
Header file for run time assertion macros.
Header file for the Unique class template.
Header file for the submatrix trait.
Header file for the columns trait.
Header file for the SchurExpr base class.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:131
Compile time integral constant wrapper for ptrdiff_t.The PtrdiffT class template represents an integr...
Definition: PtrdiffT.h:72
Base class for all matrix evaluation expression templates.The MatEvalExpr class serves as a tag for a...
Definition: MatEvalExpr.h:66
#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
size_t size() const noexcept
Returns the current size/dimension of the small vector.
Definition: SmallVector.h:769
Header file for the column trait.
Header file for the isDefault shim.
void reserve(size_t n)
Setting the minimum capacity of the vector.
Definition: SmallVector.h:895
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:101
Header file for the integer_sequence and index_sequence aliases.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
Base class for all matrix transposition expression templates.The MatTransExpr class serves as a tag f...
Definition: MatTransExpr.h:66
Header file for the HasMutableDataAccess type trait.
#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.
Base class for all outer product expression templates.The VecTVecMultExpr class serves as a tag for a...
Definition: VecTVecMultExpr.h:67
Header file for the rows trait.
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:490
Auxiliary class template for the data members of the Row class.The auxiliary RowData class template r...
Definition: RowData.h:64
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
Base template for the ColumnsTrait class.
Definition: ColumnsTrait.h:109
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:177
Header file for the MatMatMapExpr base class.
Initializer list type of the Blaze library.
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
Rows specialization for dense matrices.
Header file for the SmallVector implementation.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
Header file for the MatScalarDivExpr base class.
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Searching a type list.The Contains class can be used to search the type list for a particular type Ty...
Definition: Contains.h:78
Header file for the MatVecMultExpr base class.
Header file for the implementation of the Rows base template.
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
Base template for the BandTrait class.
Definition: BandTrait.h:109
Header file for the function trace functionality.
Template for the blaze::checked and blaze::unchecked instances.blaze::Check is the template for the b...
Definition: Check.h:56
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:1134