35 #ifndef _BLAZE_MATH_VIEWS_COLUMNS_H_ 36 #define _BLAZE_MATH_VIEWS_COLUMNS_H_ 276 template<
typename MT
280 inline decltype(
auto)
columns(
Matrix<MT,SO>& matrix, const T* indices,
size_t n, RCAs... args )
285 return ReturnType( ~matrix, indices, n, args... );
330 template<
typename MT
334 inline decltype(
auto)
columns( const
Matrix<MT,SO>& matrix, const T* indices,
size_t n, RCAs... args )
339 return ReturnType( ~matrix, indices, n, args... );
359 template<
typename MT
363 inline decltype(
auto)
columns(
Matrix<MT,SO>&& matrix, const T* indices,
size_t n, RCAs... args )
368 return ReturnType( ~matrix, indices, n, args... );
410 template<
typename MT
414 , EnableIf_t< !IsPointer_v<P> >* =
nullptr >
415 inline decltype(
auto)
columns(
Matrix<MT,SO>& matrix, P p,
size_t n, RCAs... args )
464 template<
typename MT
468 , EnableIf_t< !IsPointer_v<P> >* =
nullptr >
469 inline decltype(
auto)
columns( const
Matrix<MT,SO>& matrix, P p,
size_t n, RCAs... args )
473 using ReturnType =
const Columns_<const MT,P>;
494 template<
typename MT
498 , EnableIf_t< !IsPointer_v<P> >* =
nullptr >
499 inline decltype(
auto)
columns(
Matrix<MT,SO>&& matrix, P p,
size_t n, RCAs... args )
546 template<
typename MT
555 return columns<Is...>( std::forward<MT>( matrix ), args... );
596 template<
typename MT
603 return columns( std::forward<MT>( matrix ), indices.begin(), indices.size(), args... );
646 template<
typename MT
650 inline decltype(
auto)
columns( MT&& matrix, const
std::array<T,N>& indices, RCAs... args )
654 return columns( std::forward<MT>( matrix ), indices.data(), N, args... );
697 template<
typename MT
700 inline decltype(
auto)
columns( MT&& matrix, const
std::vector<T>& indices, RCAs... args )
704 return columns( std::forward<MT>( matrix ), indices.data(), indices.size(), args... );
748 template<
typename MT
752 inline decltype(
auto)
columns( MT&& matrix, const SmallArray<T,N>& indices, RCAs... args )
756 return columns( std::forward<MT>( matrix ), indices.data(), indices.size(), args... );
782 template<
typename... CCAs
785 ,
EnableIf_t< (
sizeof...( CCAs ) +
sizeof...( RCAs ) > 0UL ) >* =
nullptr >
786 inline decltype(
auto)
columns( const MatMatAddExpr<MT>& matrix, RCAs... args )
790 return columns<CCAs...>( (~matrix).leftOperand(), args... ) +
791 columns<CCAs...>( (~matrix).rightOperand(), args... );
809 template<
typename... CCAs
812 ,
EnableIf_t< (
sizeof...( CCAs ) +
sizeof...( RCAs ) > 0UL ) >* =
nullptr >
813 inline decltype(
auto)
columns( const MatMatSubExpr<MT>& matrix, RCAs... args )
817 return columns<CCAs...>( (~matrix).leftOperand(), args... ) -
818 columns<CCAs...>( (~matrix).rightOperand(), args... );
836 template<
typename... CCAs
839 ,
EnableIf_t< (
sizeof...( CCAs ) +
sizeof...( RCAs ) > 0UL ) >* =
nullptr >
840 inline decltype(
auto)
columns( const SchurExpr<MT>& matrix, RCAs... args )
844 return columns<CCAs...>( (~matrix).leftOperand(), args... ) %
845 columns<CCAs...>( (~matrix).rightOperand(), args... );
863 template<
typename... CCAs
866 ,
EnableIf_t< (
sizeof...( CCAs ) +
sizeof...( RCAs ) > 0UL ) >* =
nullptr >
867 inline decltype(
auto)
columns( const MatMatMultExpr<MT>& matrix, RCAs... args )
871 return (~matrix).leftOperand() *
columns<CCAs...>( (~matrix).rightOperand(), args... );
889 template<
typename... CCAs
892 ,
EnableIf_t< (
sizeof...( CCAs ) +
sizeof...( RCAs ) > 0UL ) >* =
nullptr >
893 inline decltype(
auto)
columns( const VecTVecMultExpr<MT>& matrix, RCAs... args )
897 return (~matrix).leftOperand() *
elements<CCAs...>( (~matrix).rightOperand(), args... );
915 template<
typename... CCAs
918 ,
EnableIf_t< (
sizeof...( CCAs ) +
sizeof...( RCAs ) > 0UL ) >* =
nullptr >
919 inline decltype(
auto)
columns( const MatScalarMultExpr<MT>& matrix, RCAs... args )
923 return columns<CCAs...>( (~matrix).leftOperand(), args... ) * (~matrix).rightOperand();
941 template<
typename... CCAs
944 ,
EnableIf_t< (
sizeof...( CCAs ) +
sizeof...( RCAs ) > 0UL ) >* =
nullptr >
945 inline decltype(
auto)
columns( const MatScalarDivExpr<MT>& matrix, RCAs... args )
949 return columns<CCAs...>( (~matrix).leftOperand(), args... ) / (~matrix).rightOperand();
967 template<
typename... CCAs
970 ,
EnableIf_t< (
sizeof...( CCAs ) +
sizeof...( RCAs ) > 0UL ) >* =
nullptr >
971 inline decltype(
auto)
columns( const MatMapExpr<MT>& matrix, RCAs... args )
975 return map( columns<CCAs...>( (~matrix).operand(), args... ), (~matrix).operation() );
993 template<
typename... CCAs
996 ,
EnableIf_t< (
sizeof...( CCAs ) +
sizeof...( RCAs ) > 0UL ) >* =
nullptr >
997 inline decltype(
auto)
columns( const MatMatMapExpr<MT>& matrix, RCAs... args )
1001 return map( columns<CCAs...>( (~matrix).leftOperand(), args... ),
1002 columns<CCAs...>( (~matrix).rightOperand(), args... ),
1003 (~matrix).operation() );
1021 template<
typename... CCAs
1024 ,
EnableIf_t< (
sizeof...( CCAs ) +
sizeof...( RCAs ) > 0UL ) >* =
nullptr >
1025 inline decltype(
auto)
columns( const MatEvalExpr<MT>& matrix, RCAs... args )
1029 return eval( columns<CCAs...>( (~matrix).operand(), args... ) );
1047 template<
typename... CCAs
1050 ,
EnableIf_t< (
sizeof...( CCAs ) +
sizeof...( RCAs ) > 0UL ) >* =
nullptr >
1051 inline decltype(
auto)
columns( const MatSerialExpr<MT>& matrix, RCAs... args )
1055 return serial( columns<CCAs...>( (~matrix).operand(), args... ) );
1073 template<
typename... CCAs
1076 ,
EnableIf_t< (
sizeof...( CCAs ) +
sizeof...( RCAs ) > 0UL ) >* =
nullptr >
1077 inline decltype(
auto)
columns( const DeclExpr<MT>& matrix, RCAs... args )
1081 return columns<CCAs...>( (~matrix).operand(), args... );
1099 template<
typename... CCAs
1102 ,
EnableIf_t< (
sizeof...( CCAs ) +
sizeof...( RCAs ) > 0UL ) >* =
nullptr >
1103 inline decltype(
auto)
columns( const MatTransExpr<MT>& matrix, RCAs... args )
1107 return trans( rows<CCAs...>( (~matrix).operand(), args... ) );
1126 template<
typename... CCAs
1131 IsColumnMajorMatrix_v<MT> >* =
nullptr >
1132 inline decltype(
auto)
columns( const VecExpandExpr<MT,CEAs...>& matrix, RCAs... args )
1138 return expand<
sizeof...( CCAs ) >( (~matrix).operand() );
1157 template<
typename... CCAs
1161 ,
EnableIf_t< (
sizeof...( CCAs ) == 0UL ) &&
1162 IsColumnMajorMatrix_v<MT> >* =
nullptr >
1163 inline decltype(
auto)
columns( const VecExpandExpr<MT,CEAs...>& matrix, RCAs... args )
1167 const ColumnsData<CCAs...> cd( args... );
1169 return expand( (~matrix).operand(), cd.columns() );
1187 template<
typename... CCAs
1191 ,
EnableIf_t< (
sizeof...( CCAs ) +
sizeof...( RCAs ) > 0UL ) &&
1192 !IsColumnMajorMatrix_v<MT> >* =
nullptr >
1193 inline decltype(
auto)
columns( const VecExpandExpr<MT,CEAs...>& matrix, RCAs... args )
1197 return expand<CEAs...>(
elements<CCAs...>( (~matrix).operand(), args... ), (~matrix).expansion() );
1224 ,
typename... RCAs >
1225 inline decltype(
auto)
columns( Columns<MT,SO,DF,SF,index_sequence<I2,Is2...>,CCAs...>& c, RCAs... args )
1229 static constexpr
size_t indices[] = { I2, Is2... };
1230 return columns< indices[I1], indices[Is1]... >( c.operand(), args... );
1257 ,
typename... RCAs >
1258 inline decltype(
auto)
columns( const Columns<MT,SO,DF,SF,index_sequence<I2,Is2...>,CCAs...>& c, RCAs... args )
1262 static constexpr
size_t indices[] = { I2, Is2... };
1263 return columns< indices[I1], indices[Is1]... >( c.operand(), args... );
1290 ,
typename... RCAs >
1291 inline decltype(
auto)
columns( Columns<MT,SO,DF,SF,index_sequence<I2,Is2...>,CCAs...>&& c, RCAs... args )
1295 static constexpr
size_t indices[] = { I2, Is2... };
1296 return columns< indices[I1], indices[Is1]... >( c.operand(), args... );
1322 ,
typename... RCAs >
1323 inline decltype(
auto)
columns( Columns<MT,SO,DF,SF,CCAs...>& c, RCAs... args )
1330 static constexpr
size_t indices[] = { I, Is... };
1331 for(
size_t i=0UL; i<
sizeof...(Is)+1UL; ++i ) {
1332 if( c.columns() <= indices[i] ) {
1338 return columns( c.operand(), { c.idx(I), c.idx(Is)... }, args... );
1364 ,
typename... RCAs >
1365 inline decltype(
auto)
columns( const Columns<MT,SO,DF,SF,CCAs...>& c, RCAs... args )
1372 static constexpr
size_t indices[] = { I, Is... };
1373 for(
size_t i=0UL; i<
sizeof...(Is)+1UL; ++i ) {
1374 if( c.columns() <= indices[i] ) {
1380 return columns( c.operand(), { c.idx(I), c.idx(Is)... }, args... );
1406 ,
typename... RCAs >
1407 inline decltype(
auto)
columns( Columns<MT,SO,DF,SF,CCAs...>&& c, RCAs... args )
1414 static constexpr
size_t indices[] = { I, Is... };
1415 for(
size_t i=0UL; i<
sizeof...(Is)+1UL; ++i ) {
1416 if( c.columns() <= indices[i] ) {
1422 return columns( c.operand(), { c.idx(I), c.idx(Is)... }, args... );
1443 template<
typename MT
1449 ,
typename... RCAs >
1450 inline decltype(
auto)
columns( Columns<MT,SO,DF,SF,CCAs...>& c, const T* indices,
size_t n, RCAs... args )
1457 for(
size_t i=0UL; i<n; ++i ) {
1458 if( c.columns() <= size_t( indices[i] ) ) {
1464 SmallArray<size_t,128UL> newIndices;
1465 newIndices.reserve( n );
1467 for(
size_t i=0UL; i<n; ++i ) {
1468 newIndices.pushBack( c.idx( indices[i] ) );
1471 return columns( c.operand(), newIndices.data(), newIndices.size(), args... );
1492 template<
typename MT
1498 ,
typename... RCAs >
1499 inline decltype(
auto)
columns( const Columns<MT,SO,DF,SF,CCAs...>& c, const T* indices,
size_t n, RCAs... args )
1506 for(
size_t i=0UL; i<n; ++i ) {
1507 if( c.columns() <= size_t( indices[i] ) ) {
1513 SmallArray<size_t,128UL> newIndices;
1514 newIndices.reserve( n );
1516 for(
size_t i=0UL; i<n; ++i ) {
1517 newIndices.pushBack( c.idx( indices[i] ) );
1520 return columns( c.operand(), newIndices.data(), newIndices.size(), args... );
1541 template<
typename MT
1547 ,
typename... RCAs >
1548 inline decltype(
auto)
columns( Columns<MT,SO,DF,SF,CCAs...>&& c, const T* indices,
size_t n, RCAs... args )
1555 for(
size_t i=0UL; i<n; ++i ) {
1556 if( c.columns() <= size_t( indices[i] ) ) {
1562 SmallArray<size_t,128UL> newIndices;
1563 newIndices.reserve( n );
1565 for(
size_t i=0UL; i<n; ++i ) {
1566 newIndices.pushBack( c.idx( indices[i] ) );
1569 return columns( c.operand(), newIndices.data(), newIndices.size(), args... );
1590 template<
typename MT
1596 ,
typename... RCAs >
1597 inline decltype(
auto)
columns( Columns<MT,SO,DF,SF,CCAs...>& c, P p,
size_t n, RCAs... args )
1604 for(
size_t i=0UL; i<n; ++i ) {
1605 if( c.columns() <= size_t( p(i) ) ) {
1611 SmallArray<size_t,128UL> newIndices;
1612 newIndices.reserve( n );
1614 for(
size_t i=0UL; i<n; ++i ) {
1615 newIndices.pushBack( c.idx( p(i) ) );
1618 return columns( c.operand(), newIndices.data(), newIndices.size(), args... );
1639 template<
typename MT
1645 ,
typename... RCAs >
1646 inline decltype(
auto)
columns( const Columns<MT,SO,DF,SF,CCAs...>& c, P p,
size_t n, RCAs... args )
1653 for(
size_t i=0UL; i<n; ++i ) {
1654 if( c.columns() <= size_t( p(i) ) ) {
1660 SmallArray<size_t,128UL> newIndices;
1661 newIndices.reserve( n );
1663 for(
size_t i=0UL; i<n; ++i ) {
1664 newIndices.pushBack( c.idx( p(i) ) );
1667 return columns( c.operand(), newIndices.data(), newIndices.size(), args... );
1688 template<
typename MT
1694 ,
typename... RCAs >
1695 inline decltype(
auto)
columns( Columns<MT,SO,DF,SF,CCAs...>&& c, P p,
size_t n, RCAs... args )
1702 for(
size_t i=0UL; i<n; ++i ) {
1703 if( c.columns() <= size_t( p(i) ) ) {
1709 SmallArray<size_t,128UL> newIndices;
1710 newIndices.reserve( n );
1712 for(
size_t i=0UL; i<n; ++i ) {
1713 newIndices.pushBack( c.idx( p(i) ) );
1716 return columns( c.operand(), newIndices.data(), newIndices.size(), args... );
1742 template<
size_t... CEAs
1744 ,
typename... REAs >
1745 inline decltype(
auto)
elements( const TVecMatMultExpr<VT>& vector, REAs... args )
1749 return (~vector).leftOperand() *
columns<CEAs...>( (~vector).rightOperand(), args... );
1768 template<
size_t... CEAs
1770 ,
typename... REAs >
1771 inline decltype(
auto)
elements( const MatReduceExpr<VT,
columnwise>& vector, REAs... args )
1775 return reduce<columnwise>(
columns<CEAs...>( (~vector).operand(), args... ), (~vector).operation() );
1800 template<
size_t... CRAs
1808 ,
typename... RRAs >
1809 inline decltype(
auto)
row( Columns<MT,SO,DF,SF,index_sequence<I,Is...>,CCAs...>&
columns, RRAs... args )
1831 template<
size_t... CRAs
1839 ,
typename... RRAs >
1840 inline decltype(
auto)
row( const Columns<MT,SO,DF,SF,index_sequence<I,Is...>,CCAs...>&
columns, RRAs... args )
1862 template<
size_t... CRAs
1870 ,
typename... RRAs >
1871 inline decltype(
auto)
row( Columns<MT,SO,DF,SF,index_sequence<I,Is...>,CCAs...>&&
columns, RRAs... args )
1892 template<
size_t... CRAs
1898 ,
typename... RRAs >
1899 inline decltype(
auto)
row( Columns<MT,SO,DF,SF,CCAs...>&
columns, RRAs... args )
1921 template<
size_t... CRAs
1927 ,
typename... RRAs >
1928 inline decltype(
auto)
row( const Columns<MT,SO,DF,SF,CCAs...>&
columns, RRAs... args )
1950 template<
size_t... CRAs
1956 ,
typename... RRAs >
1957 inline decltype(
auto)
row( Columns<MT,SO,DF,SF,CCAs...>&&
columns, RRAs... args )
1995 ,
typename... RCAs >
1996 inline decltype(
auto)
column( Columns<MT,SO,DF,SF,index_sequence<I2,Is...>,CCAs...>&
columns, RCAs... args )
2000 static constexpr
size_t indices[] = { I2, Is... };
2001 return column<indices[I1]>(
columns.operand(), args... );
2027 ,
typename... RCAs >
2028 inline decltype(
auto)
column( const Columns<MT,SO,DF,SF,index_sequence<I2,Is...>,CCAs...>&
columns, RCAs... args )
2032 static constexpr
size_t indices[] = { I2, Is... };
2033 return column<indices[I1]>(
columns.operand(), args... );
2059 ,
typename... RCAs >
2060 inline decltype(
auto)
column( Columns<MT,SO,DF,SF,index_sequence<I2,Is...>,CCAs...>&&
columns, RCAs... args )
2064 static constexpr
size_t indices[] = { I2, Is... };
2065 return column<indices[I1]>(
columns.operand(), args... );
2084 template<
size_t... CCAs1
2090 ,
typename... RCAs >
2091 inline decltype(
auto)
column( Columns<MT,SO,DF,SF,CCAs2...>&
columns, RCAs... args )
2095 const ColumnData<CCAs1...> cd( args... );
2100 if(
columns.columns() <= cd.column() ) {
2124 template<
size_t... CCAs1
2130 ,
typename... RCAs >
2131 inline decltype(
auto)
column( const Columns<MT,SO,DF,SF,CCAs2...>&
columns, RCAs... args )
2135 const ColumnData<CCAs1...> cd( args... );
2140 if(
columns.columns() <= cd.column() ) {
2164 template<
size_t... CCAs1
2170 ,
typename... RCAs >
2171 inline decltype(
auto)
column( Columns<MT,SO,DF,SF,CCAs2...>&&
columns, RCAs... args )
2175 const ColumnData<CCAs1...> cd( args... );
2180 if(
columns.columns() <= cd.column() ) {
2207 template<
typename MT
2211 ,
typename... CCAs >
2212 inline void reset( Columns<MT,SO,DF,SF,CCAs...>&
columns )
2228 template<
typename MT
2232 ,
typename... CCAs >
2233 inline void reset( Columns<MT,SO,DF,SF,CCAs...>&&
columns )
2253 template<
typename MT
2257 ,
typename... CCAs >
2258 inline void reset( Columns<MT,SO,DF,SF,CCAs...>&
columns,
size_t i )
2276 template<
typename MT
2280 ,
typename... CCAs >
2281 inline void clear( Columns<MT,SO,DF,SF,CCAs...>&
columns )
2299 template<
typename MT
2303 ,
typename... CCAs >
2304 inline void clear( Columns<MT,SO,DF,SF,CCAs...>&&
columns )
2342 ,
typename... CCAs >
2348 for(
size_t i=0UL; i<
columns.rows(); ++i )
2349 for(
size_t j=0UL; j<
columns.columns(); ++j )
2350 if( !isDefault<RF>(
columns(i,j) ) )
2354 for(
size_t j=0UL; j<
columns.columns(); ++j )
2355 for(
size_t i=0UL; i<
columns.rows(); ++i )
2356 if( !isDefault<RF>(
columns(i,j) ) )
2396 ,
typename... CCAs >
2401 for(
size_t j=0UL; j<
columns.columns(); ++j ) {
2402 for(
auto element=
columns.cbegin(j); element!=
columns.cend(j); ++element )
2403 if( !isDefault<RF>( element->value() ) )
return false;
2430 template<
typename MT
2434 ,
typename... CCAs >
2435 inline bool isIntact(
const Columns<MT,SO,DF,SF,CCAs...>&
columns ) noexcept
2458 template<
typename MT
2464 inline bool isSame(
const Columns<MT,SO1,DF,SF,CCAs...>& a,
const Matrix<MT,SO2>& b ) noexcept
2466 if( !
isSame( a.operand(), ~b ) || ( a.rows() != (~b).
rows() ) || ( a.columns() != (~b).
columns() ) )
2469 for(
size_t j=0UL; j<a.columns(); ++j ) {
2493 template<
typename MT
2499 inline bool isSame(
const Matrix<MT,SO1>& a,
const Columns<MT,SO2,DF,SF,CCAs...>& b ) noexcept
2520 template<
typename MT
2528 inline bool isSame(
const Columns<MT,SO1,DF,SF,CCAs...>& a,
const Submatrix<MT,AF,SO2,DF,CSAs...>& b ) noexcept
2530 if( !
isSame( a.operand(), b.operand() ) || ( a.rows() != (~b).
rows() ) || ( a.columns() != (~b).
columns() ) )
2533 for(
size_t j=0UL; j<a.columns(); ++j ) {
2534 if( a.idx(j) != b.column()+j )
2557 template<
typename MT
2564 ,
typename... CCAs >
2565 inline bool isSame(
const Submatrix<MT,AF,SO1,DF,CSAs...>& a,
const Columns<MT,SO2,DF,SF,CCAs...>& b ) noexcept
2586 template<
typename MT
2591 ,
typename... CCAs2 >
2592 inline bool isSame(
const Columns<MT,SO,DF,SF,CCAs1...>& a,
2593 const Columns<MT,SO,DF,SF,CCAs2...>& b ) noexcept
2595 if( !
isSame( a.operand(), b.operand() ) || a.rows() != b.rows() || a.columns() != b.columns() )
2598 for(
size_t i=0UL; i<a.columns(); ++i ) {
2599 if( a.idx(i) != b.idx(i) )
2652 ,
typename... CCAs >
2653 inline auto invert( Columns<MT,SO,true,SF,CCAs...>& c )
2654 -> DisableIf_t< HasMutableDataAccess_v<MT> >
2656 using RT =
ResultType_t< Columns<MT,SO,
true,SF,CCAs...> >;
2685 template<
typename MT
2691 inline bool trySet(
const Columns<MT,SO,DF,SF,CCAs...>& c,
size_t i,
size_t j,
const ET& value )
2696 return trySet( c.operand(), c.idx(i), j, value );
2718 template<
typename MT
2724 inline bool tryAdd(
const Columns<MT,SO,DF,SF,CCAs...>& c,
size_t i,
size_t j,
const ET& value )
2729 return tryAdd( c.operand(), c.idx(i), j, value );
2751 template<
typename MT
2757 inline bool trySub(
const Columns<MT,SO,DF,SF,CCAs...>& c,
size_t i,
size_t j,
const ET& value )
2762 return trySub( c.operand(), c.idx(i), j, value );
2784 template<
typename MT
2790 inline bool tryMult(
const Columns<MT,SO,DF,SF,CCAs...>& c,
size_t i,
size_t j,
const ET& value )
2795 return tryMult( c.operand(), c.idx(i), j, value );
2819 template<
typename MT
2826 tryMult(
const Columns<MT,SO,DF,SF,CCAs...>& c,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
2833 const size_t jend(
column + n );
2835 for(
size_t j=
column; j<jend; ++j ) {
2836 if( !tryMult( c.operand(),
row, c.idx(j), m, n, value ) )
2862 template<
typename MT
2868 inline bool tryDiv(
const Columns<MT,SO,DF,SF,CCAs...>& c,
size_t i,
size_t j,
const ET& value )
2873 return tryDiv( c.operand(), c.idx(i), j, value );
2897 template<
typename MT
2904 tryDiv(
const Columns<MT,SO,DF,SF,CCAs...>& c,
size_t row,
size_t column,
size_t m,
size_t n,
const ET& value )
2911 const size_t jend(
column + n );
2913 for(
size_t j=
column; j<jend; ++j ) {
2914 if( !tryDiv( c.operand(),
row, c.idx(j), m, n, value ) )
2940 template<
typename MT
2946 inline bool tryAssign(
const Columns<MT,SO,DF,SF,CCAs...>& lhs,
2947 const Vector<VT,false>& rhs,
size_t row,
size_t column )
2953 return tryAssign( lhs.operand(), ~rhs,
row, lhs.idx(
column ) );
2975 template<
typename MT
2981 inline bool tryAssign(
const Columns<MT,SO,DF,SF,CCAs...>& lhs,
2982 const Vector<VT,true>& rhs,
size_t row,
size_t column )
2988 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
2989 if( !trySet( lhs.operand(),
row, lhs.idx(
column+i ), (~rhs)[i] ) )
3017 template<
typename MT
3024 inline bool tryAssign(
const Columns<MT,SO,DF,SF,CCAs...>& lhs,
3025 const Vector<VT,TF>& rhs, ptrdiff_t
band,
size_t row,
size_t column )
3034 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
3035 if( !trySet( lhs.operand(),
row+i, lhs.idx(
column+i ), (~rhs)[i] ) )
3061 template<
typename MT1
3068 inline bool tryAssign(
const Columns<MT1,SO1,DF,SF,CCAs...>& lhs,
3069 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
3076 for(
size_t j=0UL; j<(~rhs).
columns(); ++j ) {
3104 template<
typename MT
3110 inline bool tryAddAssign(
const Columns<MT,SO,DF,SF,CCAs...>& lhs,
3111 const Vector<VT,false>& rhs,
size_t row,
size_t column )
3117 return tryAddAssign( lhs.operand(), ~rhs,
row, lhs.idx(
column ) );
3140 template<
typename MT
3146 inline bool tryAddAssign(
const Columns<MT,SO,DF,SF,CCAs...>& lhs,
3147 const Vector<VT,true>& rhs,
size_t row,
size_t column )
3153 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
3154 if( !tryAdd( lhs.operand(),
row, lhs.idx(
column+i ), (~rhs)[i] ) )
3182 template<
typename MT
3189 inline bool tryAddAssign(
const Columns<MT,SO,DF,SF,CCAs...>& lhs,
3190 const Vector<VT,TF>& rhs, ptrdiff_t
band,
size_t row,
size_t column )
3199 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
3200 if( !tryAdd( lhs.operand(),
row+i, lhs.idx(
column+i ), (~rhs)[i] ) )
3226 template<
typename MT1
3233 inline bool tryAddAssign(
const Columns<MT1,SO1,DF,SF,CCAs...>& lhs,
3234 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
3241 for(
size_t j=0UL; j<(~rhs).
columns(); ++j ) {
3269 template<
typename MT
3275 inline bool trySubAssign(
const Columns<MT,SO,DF,SF,CCAs...>& lhs,
3276 const Vector<VT,false>& rhs,
size_t row,
size_t column )
3282 return trySubAssign( lhs.operand(), ~rhs,
row, lhs.idx(
column ) );
3305 template<
typename MT
3311 inline bool trySubAssign(
const Columns<MT,SO,DF,SF,CCAs...>& lhs,
3312 const Vector<VT,true>& rhs,
size_t row,
size_t column )
3318 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
3319 if( !trySub( lhs.operand(),
row, lhs.idx(
column+i ), (~rhs)[i] ) )
3347 template<
typename MT
3354 inline bool trySubAssign(
const Columns<MT,SO,DF,SF,CCAs...>& lhs,
3355 const Vector<VT,TF>& rhs, ptrdiff_t
band,
size_t row,
size_t column )
3364 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
3365 if( !trySub( lhs.operand(),
row+i, lhs.idx(
column+i ), (~rhs)[i] ) )
3392 template<
typename MT1
3399 inline bool trySubAssign(
const Columns<MT1,SO1,DF,SF,CCAs...>& lhs,
3400 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
3407 for(
size_t j=0UL; j<(~rhs).
columns(); ++j ) {
3435 template<
typename MT
3441 inline bool tryMultAssign(
const Columns<MT,SO,DF,SF,CCAs...>& lhs,
3442 const Vector<VT,false>& rhs,
size_t row,
size_t column )
3448 return tryMultAssign( lhs.operand(), ~rhs,
row, lhs.idx(
column ) );
3471 template<
typename MT
3477 inline bool tryMultAssign(
const Columns<MT,SO,DF,SF,CCAs...>& lhs,
3478 const Vector<VT,true>& rhs,
size_t row,
size_t column )
3484 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
3485 if( !tryMult( lhs.operand(),
row, lhs.idx(
column+i ), (~rhs)[i] ) )
3513 template<
typename MT
3520 inline bool tryMultAssign(
const Columns<MT,SO,DF,SF,CCAs...>& lhs,
3521 const Vector<VT,TF>& rhs, ptrdiff_t
band,
size_t row,
size_t column )
3530 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
3531 if( !tryMult( lhs.operand(),
row+i, lhs.idx(
column+i ), (~rhs)[i] ) )
3558 template<
typename MT1
3565 inline bool trySchurAssign(
const Columns<MT1,SO1,DF,SF,CCAs...>& lhs,
3566 const Matrix<MT2,SO2>& rhs,
size_t row,
size_t column )
3573 for(
size_t j=0UL; j<(~rhs).
columns(); ++j ) {
3601 template<
typename MT
3607 inline bool tryDivAssign(
const Columns<MT,SO,DF,SF,CCAs...>& lhs,
3608 const Vector<VT,false>& rhs,
size_t row,
size_t column )
3614 return tryDivAssign( lhs.operand(), ~rhs,
row, lhs.idx(
column ) );
3637 template<
typename MT
3643 inline bool tryDivAssign(
const Columns<MT,SO,DF,SF,CCAs...>& lhs,
3644 const Vector<VT,true>& rhs,
size_t row,
size_t column )
3650 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
3651 if( !tryDiv( lhs.operand(),
row, lhs.idx(
column+i ), (~rhs)[i] ) )
3679 template<
typename MT
3686 inline bool tryDivAssign(
const Columns<MT,SO,DF,SF,CCAs...>& lhs,
3687 const Vector<VT,TF>& rhs, ptrdiff_t
band,
size_t row,
size_t column )
3696 for(
size_t i=0UL; i<(~rhs).
size(); ++i ) {
3697 if( !tryDiv( lhs.operand(),
row+i, lhs.idx(
column+i ), (~rhs)[i] ) )
3722 template<
typename MT
3726 ,
typename... CCAs >
3727 inline decltype(
auto) derestrict( Columns<MT,SO,DF,SF,CCAs...>& c )
3750 template<
typename MT
3754 ,
typename... CCAs >
3755 inline decltype(
auto) derestrict( Columns<MT,SO,DF,SF,CCAs...>&& c )
3773 template<
typename MT,
bool SO,
bool DF,
bool SF,
typename... CCAs >
3774 struct Size< Columns<MT,SO,DF,SF,CCAs...>, 0UL >
3775 :
public Size<MT,0UL>
3778 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t I,
size_t... Is,
typename... CCAs >
3779 struct Size< Columns<MT,SO,DF,SF,index_sequence<I,Is...>,CCAs...>, 1UL >
3780 :
public PtrdiffT<1UL+sizeof...(Is)>
3796 template<
typename MT,
bool SO,
bool DF,
bool SF,
typename... CCAs >
3797 struct MaxSize< Columns<MT,SO,DF,SF,CCAs...>, 0UL >
3798 :
public MaxSize<MT,0UL>
3801 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t I,
size_t... Is,
typename... CCAs >
3802 struct MaxSize< Columns<MT,SO,DF,SF,index_sequence<I,Is...>,CCAs...>, 1UL >
3803 :
public PtrdiffT<1UL+sizeof...(Is)>
3819 template<
typename MT,
bool SO,
bool DF,
bool SF,
typename... CCAs >
3820 struct IsRestricted< Columns<MT,SO,DF,SF,CCAs...> >
3821 :
public IsRestricted<MT>
3837 template<
typename MT,
bool SO,
bool SF,
typename... CCAs >
3838 struct HasConstDataAccess< Columns<MT,SO,true,SF,CCAs...> >
3839 :
public HasConstDataAccess<MT>
3855 template<
typename MT,
bool SO,
bool SF,
typename... CCAs >
3856 struct HasMutableDataAccess< Columns<MT,SO,true,SF,CCAs...> >
3857 :
public HasMutableDataAccess<MT>
3873 template<
typename MT,
bool SO,
bool SF,
typename... CCAs >
3874 struct IsAligned< Columns<MT,SO,true,SF,CCAs...> >
3875 :
public IsAligned<MT>
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
Header file for the blaze::checked and blaze::unchecked instances.
Header file for the implementation of the Columns base template.
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
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.
Columns specialization for sparse matrices.
Header file for the dense matrix inversion flags.
Header file for the IsColumnMajorMatrix type trait.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
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.
Header file for the MatMatMultExpr base class.
Header file for the extended initializer_list functionality.
Index sequence type of the Blaze library.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the MaxSize 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
Header file for the matrix storage order types.
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:775
Header file for the MatMapExpr base class.
Header file for the DisableIf class template.
Header file for the SmallArray implementation.
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
Columns specialization for dense matrices.
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 IsAligned type trait.
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:786
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:135
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.
Header file for the EnableIf class template.
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
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
Header file for all forward declarations for views.
Header file for the MatScalarMultExpr base class.
Header file for run time assertion macros.
Header file for the Unique class template.
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
Header file for the IsPointer type trait.
#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
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
Header file for the TVecMatMultExpr base class.
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:808
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.
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
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.
Header file for the MatMatMapExpr base class.
Initializer list type of the Blaze library.
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 implementation of the ColumnData class template.
Header file for the MatScalarDivExpr base class.
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 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