35 #ifndef _BLAZE_MATH_VIEWS_ROW_H_ 36 #define _BLAZE_MATH_VIEWS_ROW_H_ 131 inline decltype(
auto)
row(
Matrix<MT,SO>& matrix, RRAs... args )
180 inline decltype(
auto)
row( const
Matrix<MT,SO>& matrix, RRAs... args )
208 inline decltype(
auto)
row(
Matrix<MT,SO>&& matrix, RRAs... args )
254 template<
typename MT
257 inline decltype(
auto)
row(
Matrix<MT,SO>& matrix,
size_t index, RRAs... args )
303 template<
typename MT
306 inline decltype(
auto)
row( const
Matrix<MT,SO>& matrix,
size_t index, RRAs... args )
331 template<
typename MT
334 inline decltype(
auto)
row(
Matrix<MT,SO>&& matrix,
size_t index, RRAs... args )
364 template<
size_t... CRAs
371 return row<CRAs...>( (~matrix).leftOperand(), args... ) +
372 row<CRAs...>( (~matrix).rightOperand(), args... );
390 template<
size_t... CRAs
397 return row<CRAs...>( (~matrix).leftOperand(), args... ) -
398 row<CRAs...>( (~matrix).rightOperand(), args... );
415 template<
size_t... CRAs
422 return row<CRAs...>( (~matrix).leftOperand(), args... ) *
423 row<CRAs...>( (~matrix).rightOperand(), args... );
441 template<
size_t... CRAs
448 return row<CRAs...>( (~matrix).leftOperand(), args... ) * (~matrix).rightOperand();
476 if( (~matrix).
rows() <= I ) {
481 return (~matrix).leftOperand()[I] * (~matrix).rightOperand();
500 template<
typename MT
509 if( (~matrix).
rows() <= index ) {
514 return (~matrix).leftOperand()[index] * (~matrix).rightOperand();
532 template<
size_t... CRAs
539 return row<CRAs...>( (~matrix).leftOperand(), args... ) * (~matrix).rightOperand();
557 template<
size_t... CRAs
564 return row<CRAs...>( (~matrix).leftOperand(), args... ) / (~matrix).rightOperand();
582 template<
size_t... CRAs
589 return map( row<CRAs...>( (~matrix).operand(), args... ), (~matrix).operation() );
607 template<
size_t... CRAs
614 return map( row<CRAs...>( (~matrix).leftOperand(), args... ),
615 row<CRAs...>( (~matrix).rightOperand(), args... ),
616 (~matrix).operation() );
634 template<
size_t... CRAs
641 return eval( row<CRAs...>( (~matrix).operand(), args... ) );
659 template<
size_t... CRAs
666 return serial( row<CRAs...>( (~matrix).operand(), args... ) );
684 template<
size_t... CRAs
691 return row<CRAs...>( (~matrix).operand(), args... );
709 template<
size_t... CRAs
716 return trans( column<CRAs...>( (~matrix).operand(), args... ) );
738 template<
typename MT
743 inline void reset( Row<MT,SO,DF,SF,CRAs...>&
row )
759 template<
typename MT
764 inline void reset( Row<MT,SO,DF,SF,CRAs...>&& row )
782 template<
typename MT
787 inline void clear( Row<MT,SO,DF,SF,CRAs...>& row )
805 template<
typename MT
810 inline void clear( Row<MT,SO,DF,SF,CRAs...>&& row )
849 inline bool isDefault(
const Row<MT,SO,true,SF,CRAs...>& row )
853 for(
size_t i=0UL; i<row.size(); ++i )
854 if( !isDefault<RF>( row[i] ) )
return false;
892 inline bool isDefault(
const Row<MT,SO,false,SF,CRAs...>& row )
896 for(
const auto& element : row )
897 if( !isDefault<RF>( element.value() ) )
return false;
922 template<
typename MT
927 inline bool isIntact(
const Row<MT,SO,DF,SF,CRAs...>& row ) noexcept
929 return ( row.row() < row.operand().rows() &&
949 template<
typename MT1
957 inline bool isSame(
const Row<MT1,SO,DF,SF1,CRAs1...>& a,
958 const Row<MT2,SO,DF,SF2,CRAs2...>& b ) noexcept
960 return (
isSame( a.operand(), b.operand() ) && ( a.row() == b.row() ) );
981 template<
typename MT
987 inline bool trySet(
const Row<MT,SO,DF,SF,CRAs...>& row,
size_t index,
const ET& value )
991 return trySet( row.operand(), row.row(), index, value );
1012 template<
typename MT
1018 inline bool tryAdd(
const Row<MT,SO,DF,SF,CRAs...>& row,
size_t index,
const ET& value )
1022 return tryAdd( row.operand(), row.row(), index, value );
1043 template<
typename MT
1049 inline bool trySub(
const Row<MT,SO,DF,SF,CRAs...>& row,
size_t index,
const ET& value )
1053 return trySub( row.operand(), row.row(), index, value );
1074 template<
typename MT
1080 inline bool tryMult(
const Row<MT,SO,DF,SF,CRAs...>& row,
size_t index,
const ET& value )
1084 return tryMult( row.operand(), row.row(), index, value );
1106 template<
typename MT
1113 tryMult(
const Row<MT,SO,DF,SF,CRAs...>& row,
size_t index,
size_t size,
const ET& value )
1118 return tryMult( row.operand(), row.row(), index, 1UL,
size, value );
1139 template<
typename MT
1145 inline bool tryDiv(
const Row<MT,SO,DF,SF,CRAs...>& row,
size_t index,
const ET& value )
1149 return tryDiv( row.operand(), row.row(), index, value );
1171 template<
typename MT
1178 tryDiv(
const Row<MT,SO,DF,SF,CRAs...>& row,
size_t index,
size_t size,
const ET& value )
1183 return tryDiv( row.operand(), row.row(), index, 1UL,
size, value );
1204 template<
typename MT
1210 inline bool tryAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1216 return tryAssign( lhs.operand(), ~rhs, lhs.row(), index );
1237 template<
typename MT
1243 inline bool tryAddAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1249 return tryAddAssign( lhs.operand(), ~rhs, lhs.row(), index );
1270 template<
typename MT
1276 inline bool trySubAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1282 return trySubAssign( lhs.operand(), ~rhs, lhs.row(), index );
1303 template<
typename MT
1309 inline bool tryMultAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1315 return tryMultAssign( lhs.operand(), ~rhs, lhs.row(), index );
1336 template<
typename MT
1342 inline bool tryDivAssign(
const Row<MT,SO,DF,SF,CRAs...>& lhs,
1348 return tryDivAssign( lhs.operand(), ~rhs, lhs.row(), index );
1369 template<
typename MT
1374 inline decltype(
auto) derestrict( Row<MT,SO,DF,SF,I>& r )
1376 return row<I>( derestrict( r.operand() ),
unchecked );
1397 template<
typename MT
1402 inline decltype(
auto) derestrict( Row<MT,SO,DF,SF,I>&& r )
1404 return row<I>( derestrict( r.operand() ),
unchecked );
1425 template<
typename MT
1429 inline decltype(
auto) derestrict( Row<MT,SO,DF,SF>& r )
1431 return row( derestrict( r.operand() ), r.row(),
unchecked );
1452 template<
typename MT
1456 inline decltype(
auto) derestrict( Row<MT,SO,DF,SF>&& r )
1458 return row( derestrict( r.operand() ), r.row(),
unchecked );
1474 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs >
1475 struct Size< Row<MT,SO,DF,SF,CRAs...>, 0UL >
1476 :
public Size<MT,1UL>
1492 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs >
1510 template<
typename MT,
bool SO,
bool SF,
size_t... CRAs >
1528 template<
typename MT,
bool SO,
bool SF,
size_t... CRAs >
1546 template<
typename MT,
bool SO,
bool SF,
size_t... CRAs >
1547 struct IsAligned< Row<MT,SO,true,SF,CRAs...> >
1548 :
public And< IsAligned<MT>, Or< IsRowMajorMatrix<MT>, IsSymmetric<MT> > >
1564 template<
typename MT,
bool SF,
size_t... CRAs >
1582 template<
typename MT,
bool SO,
bool SF,
size_t... CRAs >
1583 struct IsPadded< Row<MT,SO,true,SF,CRAs...> >
1584 :
public And< IsPadded<MT>, Or< IsRowMajorMatrix<MT>, IsSymmetric<MT> > >
1600 template<
typename MT,
bool DF,
size_t... CRAs >
1618 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs,
size_t... CSAs >
1637 template<
typename MT,
bool SO,
bool DF,
bool SF,
size_t... CRAs,
size_t... CEAs >
#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 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
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 UNUSED_PARAMETER function template.
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
Header file for the row trait.
Base class for all matrix/scalar division expression templates.The MatScalarDivExpr class serves as a...
Definition: MatScalarDivExpr.h:66
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Header file for the MatTransExpr base class.
Compile time check for resizable data types.This type trait tests whether the given data type is an o...
Definition: IsOpposedView.h:81
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
Row specialization for dense matrices.
constexpr Unchecked unchecked
Global Unchecked instance.The blaze::unchecked instance is an optional token for the creation of view...
Definition: Check.h:138
Base class for all matrix/scalar multiplication expression templates.The MatScalarMultExpr class serv...
Definition: MatScalarMultExpr.h:67
Header file for the And class template.
Header file for the MatEvalExpr base class.
Header file for the MatMatMultExpr base class.
typename ElementsTrait< VT, CEAs... >::Type ElementsTrait_
Auxiliary alias declaration for the ElementsTrait type trait.The ElementsTrait_ alias declaration pro...
Definition: ElementsTrait.h:144
Row specialization for sparse matrices.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
Header file for the elements trait.
Compile time check for data types with restricted data access.This type trait tests whether the given...
Definition: IsRestricted.h:82
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:109
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
Header file for the MatMapExpr base class.
Compile time check for the memory layout of data types.This type trait tests whether the given data t...
Definition: IsContiguous.h:86
Header file for the implementation of the Row base template.
Header file for the IsSymmetric type trait.
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
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
Header file for the Or class template.
Header file for the subvector trait.
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.
Base class for all unary matrix map expression templates.The MatMapExpr class serves as a tag for all...
Definition: MatMapExpr.h:66
Implementation of a type list.The TypeList class template represents a list of data types of arbitrar...
Definition: TypeList.h:119
Header file for the IsOpposedView type trait.
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:794
Header file for the exception macros of the math module.
Base template for the ElementsTrait class.
Definition: ElementsTrait.h:108
Header file for the MatSerialExpr base class.
Header file for the VecTVecMultExpr base class.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
typename SubvectorTrait< VT, CSAs... >::Type SubvectorTrait_
Auxiliary alias declaration for the SubvectorTrait type trait.The SubvectorTrait_ alias declaration p...
Definition: SubvectorTrait.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 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 IsContiguous type 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
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
Header file for the isDefault shim.
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:101
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.
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
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
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
Header file for the IsRowMajorMatrix type trait.
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.
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
Compile time logical 'and' evaluation.The And alias declaration performs at compile time a logical 'a...
Definition: And.h:76
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 Size type trait.
#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 TrueType type/value trait base class.
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