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
405 return row<CRAs...>( (*matrix).leftOperand(), args... ) -
406 row<CRAs...>( (*matrix).rightOperand(), args... );
424template<
size_t... CRAs
431 return row<CRAs...>( (*matrix).leftOperand(), args... ) *
432 row<CRAs...>( (*matrix).rightOperand(), args... );
451template<
size_t... CRAs
458 return row<CRAs...>( (*matrix).leftOperand(), args... ) * (*matrix).rightOperand();
477template<
size_t... CRAs
484 const RowData<CRAs...> rd( args... );
487 if( (*matrix).rows() <= rd.row() ) {
492 const size_t rows( (*matrix).rightOperand().rows() );
521 if( (*matrix).rows() <= I ) {
526 return (*matrix).leftOperand()[I] * (*matrix).rightOperand();
552 if( (*matrix).rows() <= index ) {
557 return (*matrix).leftOperand()[index] * (*matrix).rightOperand();
576template<
size_t... CRAs
583 return row<CRAs...>( (*matrix).leftOperand(), args... ) * (*matrix).rightOperand();
602template<
size_t... CRAs
609 return row<CRAs...>( (*matrix).leftOperand(), args... ) / (*matrix).rightOperand();
628template<
size_t... CRAs
635 return map(
row<CRAs...>( (*matrix).operand(), args... ), (*matrix).operation() );
654template<
size_t... CRAs
663 (*matrix).operation() );
690 if( (*matrix).rows() <= I ) {
695 return map( (*matrix).rightOperand(),
696 blaze::bind2nd( (*matrix).operation(), (*matrix).leftOperand()[I] ) );
723 if( (*matrix).rows() <= index ) {
728 return map( (*matrix).rightOperand(),
729 blaze::bind2nd( (*matrix).operation(), (*matrix).leftOperand()[index] ) );
748template<
size_t... CRAs
774template<
size_t... CRAs
800template<
size_t... CRAs
826template<
size_t... CRAs
852template<
size_t... CRAs
859 return row<CRAs...>( (*matrix).operand(), args... );
878template<
size_t... CRAs
909template<
size_t... CRAs
919 const RowData<CRAs...> rd( args... );
920 if( (*matrix).rows() <= rd.row() ) {
944template<
size_t... CRAs
953 const RowData<CRAs...> rd( args... );
956 if( (*matrix).rows() <= rd.row() ) {
982template<
size_t... CRAs1
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 )
1089inline bool isDefault(
const Row<MT,SO,false,SF,CRAs...>&
row )
1093 for(
const auto& element :
row )
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,
1773 return tryAssign( lhs.operand(), *rhs, lhs.row(), index );
1794template<
typename MT
1800inline bool tryAddAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1806 return tryAddAssign( lhs.operand(), *rhs, lhs.row(), index );
1827template<
typename MT
1833inline bool trySubAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1839 return trySubAssign( lhs.operand(), *rhs, lhs.row(), index );
1860template<
typename MT
1866inline bool tryMultAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1872 return tryMultAssign( lhs.operand(), *rhs, lhs.row(), index );
1893template<
typename MT
1899inline bool tryDivAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1905 return tryDivAssign( lhs.operand(), *rhs, lhs.row(), index );
1926template<
typename MT
1932inline bool tryShiftAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1938 return tryShiftAssign( lhs.operand(), *rhs, lhs.row(), index );
1959template<
typename MT
1965inline bool tryBitandAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1971 return tryBitandAssign( lhs.operand(), *rhs, lhs.row(), index );
1992template<
typename MT
1998inline bool tryBitorAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
2004 return tryBitorAssign( lhs.operand(), *rhs, lhs.row(), index );
2025template<
typename MT
2031inline bool tryBitxorAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
2037 return tryBitxorAssign( lhs.operand(), *rhs, lhs.row(), index );
2058template<
typename MT
2063inline decltype(
auto) derestrict( Row<MT,SO,DF,SF,I>& r )
2086template<
typename MT
2091inline decltype(
auto) derestrict( Row<MT,SO,DF,SF,I>&& r )
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 >
2251template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs >
2269template<
typename MT,
bool SO,
bool SF,
size_t... CRAs >
2287template<
typename MT,
bool SO,
bool SF,
size_t... CRAs >
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 >
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 >
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition Aliases.h:190
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
Auxiliary class template for the data members of the Row class.
Definition RowData.h:65
Base class for N-dimensional vectors.
Definition Vector.h:82
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) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition Column.h:137
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
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:138
BoolConstant< true > TrueType
Type traits base class.
Definition IntegralConstant.h:132
#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
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition IntegralConstant.h:110
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.
Base class for all matrix for-each expression templates.
Definition DeclExpr.h:68
Compile time check for low-level access to constant data.
Definition HasConstDataAccess.h:76
Compile time check for low-level access to mutable data.
Definition HasMutableDataAccess.h:76
Compile time check for the alignment of data types.
Definition IsAligned.h:88
Compile time check for the memory layout of data types.
Definition IsContiguous.h:87
Compile time check for resizable data types.
Definition IsOpposedView.h:82
Compile time check for data types with padding.
Definition IsPadded.h:77
Compile time check for data types with restricted data access.
Definition IsRestricted.h:83
Base class for all matrix evaluation expression templates.
Definition MatEvalExpr.h:69
Base class for all unary matrix map expression templates.
Definition MatMapExpr.h:68
Base class for all matrix/matrix Kronecker expression templates.
Definition MatMatKronExpr.h:69
Base class for all binary matrix map expression templates.
Definition MatMatMapExpr.h:68
Base class for all matrix/matrix multiplication expression templates.
Definition MatMatMultExpr.h:71
Base class for all matrix/matrix subtraction expression templates.
Definition MatMatSubExpr.h:69
Base class for all matrix no-alias expression templates.
Definition MatNoAliasExpr.h:68
Base class for all matrix no-SIMD expression templates.
Definition MatNoSIMDExpr.h:95
Base class for all matrix repeat expression templates.
Definition MatRepeatExpr.h:69
Base class for all matrix/scalar division expression templates.
Definition MatScalarDivExpr.h:75
Base class for all matrix/scalar multiplication expression templates.
Definition MatScalarMultExpr.h:77
Base class for all matrix serial evaluation expression templates.
Definition MatSerialExpr.h:69
Base class for all matrix transposition expression templates.
Definition MatTransExpr.h:69
Compile time evaluation of the maximum size of vectors and matrices.
Definition MaxSize.h:118
Base class for all Schur product expression templates.
Definition SchurExpr.h:68
Compile time evaluation of the size of vectors and matrices.
Definition Size.h:119
Base class for all vector expansion expression templates.
Definition VecExpandExpr.h:69
Base class for all outer map expression templates.
Definition VecTVecMapExpr.h:68
Base class for all outer product expression templates.
Definition VecTVecMultExpr.h:69
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.