35 #ifndef _BLAZE_MATH_VIEWS_ROW_H_
36 #define _BLAZE_MATH_VIEWS_ROW_H_
123 template<
typename MT
125 inline DisableIf_< Or< IsComputation<MT>, IsTransExpr<MT> >, RowExprTrait_<MT> >
167 template<
typename MT
169 inline const DisableIf_< Or< IsComputation<MT>, IsTransExpr<MT> >, RowExprTrait_<const MT> >
193 template<
typename MT
195 inline DisableIf_< Or< IsComputation<MT>, IsTransExpr<MT> >, RowExprTrait_<MT> >
225 template<
typename MT
227 inline const EnableIf_< IsMatMatAddExpr<MT>, RowExprTrait_<MT> >
228 row(
const Matrix<MT,SO>& matrix,
size_t index )
232 return row( (~matrix).leftOperand(), index ) +
row( (~matrix).rightOperand(), index );
250 template<
typename MT
252 inline const EnableIf_< IsMatMatSubExpr<MT>, RowExprTrait_<MT> >
253 row(
const Matrix<MT,SO>& matrix,
size_t index )
257 return row( (~matrix).leftOperand(), index ) -
row( (~matrix).rightOperand(), index );
275 template<
typename MT
277 inline const EnableIf_< IsMatMatMultExpr<MT>, RowExprTrait_<MT> >
278 row(
const Matrix<MT,SO>& matrix,
size_t index )
282 return row( (~matrix).leftOperand(), index ) * (~matrix).rightOperand();
299 template<
typename MT
301 inline const EnableIf_< IsVecTVecMultExpr<MT>, RowExprTrait_<MT> >
302 row(
const Matrix<MT,SO>& matrix,
size_t index )
306 return (~matrix).leftOperand()[index] * (~matrix).rightOperand();
324 template<
typename MT
326 inline const EnableIf_< IsMatScalarMultExpr<MT>, RowExprTrait_<MT> >
327 row(
const Matrix<MT,SO>& matrix,
size_t index )
331 return row( (~matrix).leftOperand(), index ) * (~matrix).rightOperand();
349 template<
typename MT
351 inline const EnableIf_< IsMatScalarDivExpr<MT>, RowExprTrait_<MT> >
352 row(
const Matrix<MT,SO>& matrix,
size_t index )
356 return row( (~matrix).leftOperand(), index ) / (~matrix).rightOperand();
374 template<
typename MT
376 inline const EnableIf_< IsMatForEachExpr<MT>, RowExprTrait_<MT> >
377 row(
const Matrix<MT,SO>& matrix,
size_t index )
381 return forEach(
row( (~matrix).operand(), index ), (~matrix).operation() );
399 template<
typename MT
401 inline const EnableIf_< IsMatEvalExpr<MT>, RowExprTrait_<MT> >
402 row(
const Matrix<MT,SO>& matrix,
size_t index )
406 return eval(
row( (~matrix).operand(), index ) );
424 template<
typename MT
426 inline const EnableIf_< IsMatSerialExpr<MT>, RowExprTrait_<MT> >
427 row(
const Matrix<MT,SO>& matrix,
size_t index )
431 return serial(
row( (~matrix).operand(), index ) );
449 template<
typename MT
451 inline const EnableIf_< IsMatTransExpr<MT>, RowExprTrait_<MT> >
452 row(
const Matrix<MT,SO>& matrix,
size_t index )
456 return trans(
column( (~matrix).operand(), index ) );
477 template<
typename MT,
bool SO,
bool DF,
bool SF >
478 inline void reset( Row<MT,SO,DF,SF>&
row );
480 template<
typename MT,
bool SO,
bool DF,
bool SF >
481 inline void clear( Row<MT,SO,DF,SF>&
row );
483 template<
typename MT,
bool SO,
bool DF,
bool SF >
486 template<
typename MT,
bool SO,
bool DF,
bool SF >
487 inline bool isIntact(
const Row<MT,SO,DF,SF>&
row ) noexcept;
489 template<
typename MT,
bool SO,
bool DF,
bool SF >
490 inline bool isSame(
const Row<MT,SO,DF,SF>& a,
const Row<MT,SO,DF,SF>& b ) noexcept;
502 template<
typename MT
522 template<
typename MT
551 template<
typename MT
557 for(
size_t i=0UL; i<row.size(); ++i )
583 template<
typename MT
590 const ConstIterator
end( row.end() );
591 for( ConstIterator element=row.begin(); element!=
end; ++element )
592 if( !
isDefault( element->value() ) )
return false;
616 template<
typename MT
622 return ( row.row_ <= row.matrix_.rows() &&
640 template<
typename MT
646 return (
isSame( a.matrix_, b.matrix_ ) && ( a.row_ == b.row_ ) );
666 template<
typename MT
671 inline bool tryAssign(
const Row<MT,SO,DF,SF>& lhs,
const Vector<VT,true>& rhs,
size_t index )
676 return tryAssign( lhs.matrix_, ~rhs, lhs.row_, index );
697 template<
typename MT
702 inline bool tryAddAssign(
const Row<MT,SO,DF,SF>& lhs,
const Vector<VT,true>& rhs,
size_t index )
707 return tryAddAssign( lhs.matrix_, ~rhs, lhs.row_, index );
728 template<
typename MT
733 inline bool trySubAssign(
const Row<MT,SO,DF,SF>& lhs,
const Vector<VT,true>& rhs,
size_t index )
738 return trySubAssign( lhs.matrix_, ~rhs, lhs.row_, index );
759 template<
typename MT
764 inline bool tryMultAssign(
const Row<MT,SO,DF,SF>& lhs,
const Vector<VT,true>& rhs,
size_t index )
769 return tryMultAssign( lhs.matrix_, ~rhs, lhs.row_, index );
790 template<
typename MT
795 inline bool tryDivAssign(
const Row<MT,SO,DF,SF>& lhs,
const Vector<VT,true>& rhs,
size_t index )
800 return tryDivAssign( lhs.matrix_, ~rhs, lhs.row_, index );
821 template<
typename MT
825 inline DerestrictTrait_< Row<MT,SO,DF,SF> > derestrict( Row<MT,SO,DF,SF>& row )
827 typedef DerestrictTrait_< Row<MT,SO,DF,SF> >
ReturnType;
828 return ReturnType( derestrict( row.matrix_ ), row.row_ );
844 template<
typename MT,
bool SO,
bool DF,
bool SF >
845 struct IsRestricted< Row<MT,SO,DF,SF> >
862 template<
typename MT,
bool SO,
bool DF,
bool SF >
863 struct DerestrictTrait< Row<MT,SO,DF,SF> >
865 using Type = Row< RemoveReference_< DerestrictTrait_<MT> > >;
881 template<
typename MT,
bool SO,
bool SF >
882 struct HasConstDataAccess< Row<MT,SO,true,SF> >
899 template<
typename MT,
bool SO,
bool SF >
900 struct HasMutableDataAccess< Row<MT,SO,true,SF> >
901 :
public BoolConstant< HasMutableDataAccess<MT>::value >
917 template<
typename MT,
bool SO,
bool SF >
918 struct IsAligned< Row<MT,SO,true,SF> >
919 :
public BoolConstant< And< IsAligned<MT>, Or< IsRowMajorMatrix<MT>, IsSymmetric<MT> > >::value >
935 template<
typename MT,
bool SO,
bool SF >
936 struct IsPadded< Row<MT,SO,true,SF> >
937 :
public BoolConstant< And< IsPadded<MT>, Or< IsRowMajorMatrix<MT>, IsSymmetric<MT> > >::value >
953 template<
typename MT,
bool DF >
954 struct IsOpposedView< Row<MT,false,DF,false> >
971 template<
typename MT,
bool SO,
bool DF,
bool SF,
typename T >
972 struct AddTrait< Row<MT,SO,DF,SF>, T >
974 using Type = AddTrait_< RowTrait_<MT>, T >;
977 template<
typename T,
typename MT,
bool SO,
bool DF,
bool SF >
978 struct AddTrait< T, Row<MT,SO,DF,SF> >
980 using Type = AddTrait_< T, RowTrait_<MT> >;
996 template<
typename MT,
bool SO,
bool DF,
bool SF,
typename T >
997 struct SubTrait< Row<MT,SO,DF,SF>, T >
999 using Type = SubTrait_< RowTrait_<MT>, T >;
1002 template<
typename T,
typename MT,
bool SO,
bool DF,
bool SF >
1003 struct SubTrait< T, Row<MT,SO,DF,SF> >
1005 using Type = SubTrait_< T, RowTrait_<MT> >;
1021 template<
typename MT,
bool SO,
bool DF,
bool SF,
typename T >
1022 struct MultTrait< Row<MT,SO,DF,SF>, T >
1024 using Type = MultTrait_< RowTrait_<MT>, T >;
1027 template<
typename T,
typename MT,
bool SO,
bool DF,
bool SF >
1028 struct MultTrait< T, Row<MT,SO,DF,SF> >
1030 using Type = MultTrait_< T, RowTrait_<MT> >;
1046 template<
typename MT,
bool SO,
bool DF,
bool SF,
typename T >
1047 struct CrossTrait< Row<MT,SO,DF,SF>, T >
1049 using Type = CrossTrait_< RowTrait_<MT>, T >;
1052 template<
typename T,
typename MT,
bool SO,
bool DF,
bool SF >
1053 struct CrossTrait< T, Row<MT,SO,DF,SF> >
1055 using Type = CrossTrait_< T, RowTrait_<MT> >;
1071 template<
typename MT,
bool SO,
bool DF,
bool SF,
typename T >
1072 struct DivTrait< Row<MT,SO,DF,SF>, T >
1074 using Type = DivTrait_< RowTrait_<MT>, T >;
1077 template<
typename T,
typename MT,
bool SO,
bool DF,
bool SF >
1078 struct DivTrait< T, Row<MT,SO,DF,SF> >
1080 using Type = DivTrait_< T, RowTrait_<MT> >;
1096 template<
typename MT,
bool SO,
bool DF,
bool SF >
1097 struct SubvectorTrait< Row<MT,SO,DF,SF> >
1099 using Type = SubvectorTrait_< ResultType_< Row<MT,SO,DF,SF> > >;
Header file for the subtraction trait.
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:653
Header file for basic type definitions.
Header file for the row trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
Row specialization for dense matrices.
Header file for the And class template.
Header file for the IsTransExpr type trait class.
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:723
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Row specialization for sparse matrices.
Header file for the IsMatMatAddExpr type trait class.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, ColumnExprTrait_< MT > > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:126
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Header file for the IsMatTransExpr type trait class.
Header file for the DisableIf class template.
typename RowExprTrait< MT >::Type RowExprTrait_
Auxiliary alias declaration for the RowExprTrait type trait.The RowExprTrait_ alias declaration provi...
Definition: RowExprTrait.h:134
Header file for the implementation of the Row base template.
Header file for the multiplication trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the IsVecTVecMultExpr type trait class.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
Header file for the Or class template.
Header file for the IsMatMatMultExpr type trait class.
const DMatForEachExpr< MT, OP, SO > forEach(const DenseMatrix< MT, SO > &dm, OP op)
Evaluates the given custom operation on each single element of the dense matrix dm.
Definition: DMatForEachExpr.h:1046
Header file for the IsMatSerialExpr type trait class.
Header file for the IsMatScalarMultExpr type trait class.
Header file for the subvector trait.
Header file for the IsAligned type trait.
Header file for the IsOpposedView type trait.
Header file for the IsMatEvalExpr type trait class.
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:254
Header file for the RowExprTrait class template.
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
Reference to a specific row of a dense or sparse matrix.The Row template represents a reference to a ...
Definition: Forward.h:48
Header file for the HasConstDataAccess type trait.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, RowExprTrait_< MT > > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:126
Header file for the Matrix base class.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2642
Header file for the IsMatScalarDivExpr type trait class.
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division trait.
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:89
Header file for the HasMutableDataAccess type trait.
const DMatEvalExpr< MT, SO > eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:705
Header file for the IsMatMatSubExpr type trait class.
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
Header file for the IsRowMajorMatrix type trait.
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:950
Header file for the IsComputation type trait class.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
Header file for the IntegralConstant class template.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
Header file for the IsMatForEachExpr type trait class.
#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 FunctionTrace class.