35#ifndef _BLAZE_MATH_VIEWS_ROW_H_
36#define _BLAZE_MATH_VIEWS_ROW_H_
141 using ReturnType = Row_<MT,I>;
142 return ReturnType( *matrix, args... );
190 using ReturnType =
const Row_<const MT,I>;
191 return ReturnType( *matrix, args... );
218 using ReturnType = Row_<MT,I>;
219 return ReturnType( *matrix, args... );
267 using ReturnType = Row_<MT>;
268 return ReturnType( *matrix, index, args... );
316 using ReturnType =
const Row_<const MT>;
317 return ReturnType( *matrix, index, args... );
344 using ReturnType = Row_<MT>;
345 return ReturnType( *matrix, index, args... );
371template<
size_t... CRAs
374inline decltype(
auto)
row(
const MatMatAddExpr<MT>& matrix, RRAs... args )
378 return row<CRAs...>( (*matrix).leftOperand(), args... ) +
379 row<CRAs...>( (*matrix).rightOperand(), args... );
398template<
size_t... CRAs
401inline decltype(
auto)
row(
const MatMatSubExpr<MT>& matrix, RRAs... args )
405 return row<CRAs...>( (*matrix).leftOperand(), args... ) -
406 row<CRAs...>( (*matrix).rightOperand(), args... );
424template<
size_t... CRAs
427inline decltype(
auto)
row(
const SchurExpr<MT>& matrix, RRAs... args )
431 return row<CRAs...>( (*matrix).leftOperand(), args... ) *
432 row<CRAs...>( (*matrix).rightOperand(), args... );
451template<
size_t... CRAs
454inline decltype(
auto)
row(
const MatMatMultExpr<MT>& matrix, RRAs... args )
458 return row<CRAs...>( (*matrix).leftOperand(), args... ) * (*matrix).rightOperand();
477template<
size_t... CRAs
480inline decltype(
auto)
row(
const MatMatKronExpr<MT>& matrix, RRAs... args )
484 const RowData<CRAs...> rd( args... );
487 if( (*matrix).rows() <= rd.row() ) {
492 const size_t rows( (*matrix).rightOperand().rows() );
516inline decltype(
auto)
row(
const VecTVecMultExpr<MT>& matrix, RRAs... args )
521 if( (*matrix).rows() <= I ) {
526 return (*matrix).leftOperand()[I] * (*matrix).rightOperand();
547inline decltype(
auto)
row(
const VecTVecMultExpr<MT>& matrix,
size_t index, RRAs... args )
552 if( (*matrix).rows() <= index ) {
557 return (*matrix).leftOperand()[index] * (*matrix).rightOperand();
576template<
size_t... CRAs
579inline decltype(
auto)
row(
const MatScalarMultExpr<MT>& matrix, RRAs... args )
583 return row<CRAs...>( (*matrix).leftOperand(), args... ) * (*matrix).rightOperand();
602template<
size_t... CRAs
605inline decltype(
auto)
row(
const MatScalarDivExpr<MT>& matrix, RRAs... args )
609 return row<CRAs...>( (*matrix).leftOperand(), args... ) / (*matrix).rightOperand();
628template<
size_t... CRAs
631inline decltype(
auto)
row(
const MatMapExpr<MT>& matrix, RRAs... args )
635 return map( row<CRAs...>( (*matrix).operand(), args... ), (*matrix).operation() );
654template<
size_t... CRAs
657inline decltype(
auto)
row(
const MatMatMapExpr<MT>& matrix, RRAs... args )
661 return map( row<CRAs...>( (*matrix).leftOperand(), args... ),
662 row<CRAs...>( (*matrix).rightOperand(), args... ),
663 (*matrix).operation() );
685inline decltype(
auto)
row(
const VecTVecMapExpr<MT>& matrix, RRAs... args )
690 if( (*matrix).rows() <= I ) {
695 return map( (*matrix).rightOperand(),
696 blaze::bind2nd( (*matrix).operation(), (*matrix).leftOperand()[I] ) );
718inline decltype(
auto)
row(
const VecTVecMapExpr<MT>& matrix,
size_t index, RRAs... args )
723 if( (*matrix).rows() <= index ) {
728 return map( (*matrix).rightOperand(),
729 blaze::bind2nd( (*matrix).operation(), (*matrix).leftOperand()[index] ) );
748template<
size_t... CRAs
751inline decltype(
auto)
row(
const MatEvalExpr<MT>& matrix, RRAs... args )
755 return eval( row<CRAs...>( (*matrix).operand(), args... ) );
774template<
size_t... CRAs
777inline decltype(
auto)
row(
const MatSerialExpr<MT>& matrix, RRAs... args )
781 return serial( row<CRAs...>( (*matrix).operand(), args... ) );
800template<
size_t... CRAs
803inline decltype(
auto)
row(
const MatNoAliasExpr<MT>& matrix, RRAs... args )
807 return noalias( row<CRAs...>( (*matrix).operand(), args... ) );
826template<
size_t... CRAs
829inline decltype(
auto)
row(
const MatNoSIMDExpr<MT>& matrix, RRAs... args )
833 return nosimd( row<CRAs...>( (*matrix).operand(), args... ) );
852template<
size_t... CRAs
855inline decltype(
auto)
row(
const DeclExpr<MT>& matrix, RRAs... args )
859 return row<CRAs...>( (*matrix).operand(), args... );
878template<
size_t... CRAs
881inline decltype(
auto)
row(
const MatTransExpr<MT>& matrix, RRAs... args )
886 return trans( column<CRAs...>( (*matrix).operand(), args... ) );
909template<
size_t... CRAs
913 , EnableIf_t< IsRowMajorMatrix_v<MT> >* =
nullptr >
914inline decltype(
auto)
row(
const VecExpandExpr<MT,CEAs...>& matrix, RRAs... args )
919 const RowData<CRAs...> rd( args... );
920 if( (*matrix).rows() <= rd.row() ) {
944template<
size_t... CRAs
948 , EnableIf_t< !IsRowMajorMatrix_v<MT> >* =
nullptr >
949inline decltype(
auto)
row(
const VecExpandExpr<MT,CEAs...>& matrix, RRAs... args )
953 const RowData<CRAs...> rd( args... );
956 if( (*matrix).rows() <= rd.row() ) {
961 using ET = ElementType_t< MatrixType_t<MT> >;
963 return UniformVector<ET,rowVector>( (*matrix).columns(), (*matrix).operand()[rd.row()] );
982template<
size_t... CRAs1
986inline decltype(
auto)
row(
const MatRepeatExpr<MT,CRAs2...>& matrix, RRAs... args )
990 const RowData<CRAs1...> rd( args... );
993 if( (*matrix).rows() <= rd.row() ) {
999 , rd.row() % (*matrix).operand().rows()
1001 , (*matrix).template repetitions<1UL>() );
1046inline bool isDefault(
const Row<MT,SO,true,SF,CRAs...>&
row )
1050 for(
size_t i=0UL; i<
row.size(); ++i )
1051 if( !isDefault<RF>(
row[i] ) )
return false;
1089inline bool isDefault(
const Row<MT,SO,false,SF,CRAs...>&
row )
1093 for(
const auto& element :
row )
1094 if( !isDefault<RF>( element.value() ) )
return false;
1119template<
typename MT
1124inline bool isIntact(
const Row<MT,SO,DF,SF,CRAs...>&
row )
noexcept
1126 return (
row.row() <
row.operand().rows() &&
1146template<
typename MT1
1154inline bool isSame(
const Row<MT1,SO,DF,SF1,CRAs1...>& a,
1155 const Row<MT2,SO,DF,SF2,CRAs2...>& b )
noexcept
1157 return (
isSame( a.operand(), b.operand() ) && ( a.row() == b.row() ) );
1178template<
typename MT
1184inline bool trySet(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
const ET& value )
1188 return trySet(
row.operand(),
row.row(), index, value );
1210template<
typename MT
1217 trySet(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
size_t size,
const ET& value )
1222 return trySet(
row.operand(),
row.row(), index, 1UL,
size, value );
1243template<
typename MT
1249inline bool tryAdd(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
const ET& value )
1253 return tryAdd(
row.operand(),
row.row(), index, value );
1275template<
typename MT
1282 tryAdd(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
size_t size,
const ET& value )
1287 return tryAdd(
row.operand(),
row.row(), index, 1UL,
size, value );
1308template<
typename MT
1314inline bool trySub(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
const ET& value )
1318 return trySub(
row.operand(),
row.row(), index, value );
1340template<
typename MT
1347 trySub(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
size_t size,
const ET& value )
1352 return trySub(
row.operand(),
row.row(), index, 1UL,
size, value );
1373template<
typename MT
1379inline bool tryMult(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
const ET& value )
1383 return tryMult(
row.operand(),
row.row(), index, value );
1405template<
typename MT
1412 tryMult(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
size_t size,
const ET& value )
1417 return tryMult(
row.operand(),
row.row(), index, 1UL,
size, value );
1438template<
typename MT
1444inline bool tryDiv(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
const ET& value )
1448 return tryDiv(
row.operand(),
row.row(), index, value );
1470template<
typename MT
1477 tryDiv(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
size_t size,
const ET& value )
1482 return tryDiv(
row.operand(),
row.row(), index, 1UL,
size, value );
1503template<
typename MT
1508inline bool tryShift(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
int count )
1512 return tryShift(
row.operand(),
row.row(), index, count );
1534template<
typename MT
1540 tryShift(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
size_t size,
int count )
1545 return tryShift(
row.operand(),
row.row(), index, 1UL,
size, count );
1566template<
typename MT
1572inline bool tryBitand(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
const ET& value )
1576 return tryBitand(
row.operand(),
row.row(), index, value );
1598template<
typename MT
1605 tryBitand(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
size_t size,
const ET& value )
1610 return tryBitand(
row.operand(),
row.row(), index, 1UL,
size, value );
1631template<
typename MT
1637inline bool tryBitor(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
const ET& value )
1641 return tryBitor(
row.operand(),
row.row(), index, value );
1663template<
typename MT
1670 tryBitor(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
size_t size,
const ET& value )
1675 return tryBitor(
row.operand(),
row.row(), index, 1UL,
size, value );
1696template<
typename MT
1702inline bool tryBitxor(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
const ET& value )
1706 return tryBitxor(
row.operand(),
row.row(), index, value );
1728template<
typename MT
1735 tryBitxor(
const Row<MT,SO,DF,SF,CRAs...>&
row,
size_t index,
size_t size,
const ET& value )
1740 return tryBitxor(
row.operand(),
row.row(), index, 1UL,
size, value );
1761template<
typename MT
1767inline bool tryAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1768 const Vector<VT,true>& rhs,
size_t index )
1773 return tryAssign( lhs.operand(), *rhs, lhs.row(), index );
1794template<
typename MT
1800inline bool tryAddAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1801 const Vector<VT,true>& rhs,
size_t index )
1806 return tryAddAssign( lhs.operand(), *rhs, lhs.row(), index );
1827template<
typename MT
1833inline bool trySubAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1834 const Vector<VT,true>& rhs,
size_t index )
1839 return trySubAssign( lhs.operand(), *rhs, lhs.row(), index );
1860template<
typename MT
1866inline bool tryMultAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1867 const Vector<VT,true>& rhs,
size_t index )
1872 return tryMultAssign( lhs.operand(), *rhs, lhs.row(), index );
1893template<
typename MT
1899inline bool tryDivAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1900 const Vector<VT,true>& rhs,
size_t index )
1905 return tryDivAssign( lhs.operand(), *rhs, lhs.row(), index );
1926template<
typename MT
1932inline bool tryShiftAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1933 const Vector<VT,true>& rhs,
size_t index )
1938 return tryShiftAssign( lhs.operand(), *rhs, lhs.row(), index );
1959template<
typename MT
1965inline bool tryBitandAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1966 const Vector<VT,true>& rhs,
size_t index )
1971 return tryBitandAssign( lhs.operand(), *rhs, lhs.row(), index );
1992template<
typename MT
1998inline bool tryBitorAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1999 const Vector<VT,true>& rhs,
size_t index )
2004 return tryBitorAssign( lhs.operand(), *rhs, lhs.row(), index );
2025template<
typename MT
2031inline bool tryBitxorAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
2032 const Vector<VT,true>& rhs,
size_t index )
2037 return tryBitxorAssign( lhs.operand(), *rhs, lhs.row(), index );
2058template<
typename MT
2063inline decltype(
auto) derestrict( Row<MT,SO,DF,SF,I>& r )
2065 return row<I>( derestrict( r.operand() ),
unchecked );
2086template<
typename MT
2091inline decltype(
auto) derestrict( Row<MT,SO,DF,SF,I>&& r )
2093 return row<I>( derestrict( r.operand() ),
unchecked );
2114template<
typename MT
2118inline decltype(
auto) derestrict( Row<MT,SO,DF,SF>& r )
2120 return row( derestrict( r.operand() ), r.row(),
unchecked );
2141template<
typename MT
2145inline decltype(
auto) derestrict( Row<MT,SO,DF,SF>&& r )
2147 return row( derestrict( r.operand() ), r.row(),
unchecked );
2166template<
typename MT
2171inline decltype(
auto) unview( Row<MT,SO,DF,SF,CRAs...>& r )
2192template<
typename MT
2197inline decltype(
auto) unview(
const Row<MT,SO,DF,SF,CRAs...>& r )
2215template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs >
2216struct Size< Row<MT,SO,DF,SF,CRAs...>, 0UL >
2217 :
public Size<MT,1UL>
2233template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs >
2234struct MaxSize< Row<MT,SO,DF,SF,CRAs...>, 0UL >
2235 :
public MaxSize<MT,1UL>
2251template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs >
2252struct IsRestricted< Row<MT,SO,DF,SF,CRAs...> >
2253 :
public IsRestricted<MT>
2269template<
typename MT,
bool SO,
bool SF,
size_t... CRAs >
2270struct HasConstDataAccess< Row<MT,SO,true,SF,CRAs...> >
2271 :
public HasConstDataAccess<MT>
2287template<
typename MT,
bool SO,
bool SF,
size_t... CRAs >
2288struct HasMutableDataAccess< Row<MT,SO,true,SF,CRAs...> >
2289 :
public HasMutableDataAccess<MT>
2305template<
typename MT,
bool SO,
bool SF,
size_t... CRAs >
2306struct IsAligned< Row<MT,SO,true,SF,CRAs...> >
2307 :
public BoolConstant< IsAligned_v<MT> && ( IsRowMajorMatrix_v<MT> || IsSymmetric_v<MT> ) >
2323template<
typename MT,
bool SF,
size_t... CRAs >
2324struct IsContiguous< Row<MT,true,true,SF,CRAs...> >
2325 :
public IsContiguous<MT>
2341template<
typename MT,
bool SO,
bool SF,
size_t... CRAs >
2342struct IsPadded< Row<MT,SO,true,SF,CRAs...> >
2343 :
public BoolConstant< IsPadded_v<MT> && ( IsRowMajorMatrix_v<MT> || IsSymmetric_v<MT> ) >
2359template<
typename MT,
bool DF,
size_t... CRAs >
2360struct IsOpposedView< Row<MT,false,DF,false,CRAs...> >
Header file for run time assertion macros.
Header file for the Bind2nd functor.
Header file for the blaze::checked and blaze::unchecked instances.
Header file for the EnableIf class template.
Header file for the function trace functionality.
Header file for the HasConstDataAccess type trait.
Header file for the HasMutableDataAccess type trait.
Header file for the IntegralConstant class template.
Header file for the IsAligned type trait.
Header file for the IsContiguous type trait.
Header file for the isDefault shim.
Header file for the IsOpposedView type trait.
Header file for the IsPadded type trait.
Header file for the IsRowMajorMatrix type trait.
Header file for the IsSymmetric type trait.
Header file for the MaxSize type trait.
Header file for the relaxation flag enumeration.
Header file for the implementation of the RowData class template.
Base class for matrices.
Definition: Matrix.h:85
Header file for the DeclExpr base class.
Header file for the MatEvalExpr base class.
Header file for the MatMapExpr base class.
Header file for the MatMatAddExpr base class.
Header file for the MatMatKronExpr base class.
Header file for the MatMatMapExpr base class.
Header file for the MatMatMultExpr base class.
Header file for the MatMatSubExpr base class.
Header file for the MatNoAliasExpr base class.
Header file for the MatNoSIMDExpr base class.
Header file for the MatRepeatExpr base class.
Header file for the MatScalarDivExpr base class.
Header file for the MatScalarMultExpr base class.
Header file for the MatSerialExpr base class.
Header file for the MatTransExpr base class.
Header file for the Matrix base class.
Header file for the SchurExpr base class.
Header file for the VecExpandExpr base class.
Header file for the VecTVecMapExpr base class.
Header file for the VecTVecMultExpr base class.
decltype(auto) noalias(const DenseMatrix< MT, SO > &dm)
Forces the non-aliased evaluation of the given dense matrix expression dm.
Definition: DMatNoAliasExpr.h:679
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:790
decltype(auto) repeat(const DenseMatrix< MT, SO > &dm, size_t m, size_t n)
Repeats the given dense matrix.
Definition: DMatRepeatExpr.h:543
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
decltype(auto) map(const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs, OP op)
Elementwise evaluation of the given binary operation on each single element of the dense matrices lhs...
Definition: DMatDMatMapExpr.h:1144
decltype(auto) nosimd(const DenseMatrix< MT, SO > &dm)
Disables the SIMD evaluation of the given dense matrix expression dm.
Definition: DMatNoSIMDExpr.h:717
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:812
decltype(auto) kron(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the Kronecker product of two dense matrices ( ).
Definition: DMatDMatKronExpr.h:957
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:207
bool isDefault(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the given diagonal matrix is in default state.
Definition: DiagonalMatrix.h:169
constexpr Bind2nd< OP, A2 > bind2nd(const OP &op, const A2 &a2)
Binds the given object/value to the 2nd parameter of the given operation.
Definition: Bind2nd.h:155
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition: RelaxationFlag.h:66
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:644
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:1424
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:676
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:137
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
decltype(auto) subvector(Vector< VT, TF > &, RSAs...)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:158
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
BoolConstant< true > TrueType
Type traits base class.
Definition: IntegralConstant.h:132
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition: IntegralConstant.h:110
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition: FunctionTrace.h:94
constexpr bool isChecked(const Ts &... args)
Extracting blaze::Check arguments from a given list of arguments.
Definition: Check.h:225
constexpr Unchecked unchecked
Global Unchecked instance.
Definition: Check.h:146
Header file for the exception macros of the math module.
Header file for the Size type trait.
Header file for basic type definitions.
Header file for the implementation of the Row base template.
Row specialization for dense matrices.
Row specialization for sparse matrices.