35 #ifndef _BLAZE_MATH_VIEWS_SUBVECTOR_H_ 36 #define _BLAZE_MATH_VIEWS_SUBVECTOR_H_ 144 template<
typename VT
150 return subvector<unaligned>( ~vector, index,
size );
211 template<
typename VT
217 return subvector<unaligned>( ~vector, index,
size );
237 template<
typename VT
243 return subvector<unaligned>( ~vector, index,
size );
469 return subvector<AF>( (~vector).leftOperand() , index,
size ) +
470 subvector<AF>( (~vector).rightOperand(), index,
size );
495 return subvector<AF>( (~vector).leftOperand() , index,
size ) -
496 subvector<AF>( (~vector).rightOperand(), index,
size );
521 return subvector<AF>( (~vector).leftOperand() , index,
size ) *
522 subvector<AF>( (~vector).rightOperand(), index,
size );
547 return subvector<AF>( (~vector).leftOperand() , index,
size ) /
548 subvector<AF>( (~vector).rightOperand(), index,
size );
598 return subvector<AF>( (~vector).leftOperand(), index,
size ) * (~vector).rightOperand();
623 return subvector<AF>( (~vector).leftOperand(), index,
size ) / (~vector).rightOperand();
648 return map( subvector<AF>( (~vector).operand(), index, size ), (~vector).operation() );
673 return map( subvector<AF>( (~vector).leftOperand() , index, size ),
674 subvector<AF>( (~vector).rightOperand(), index, size ),
675 (~vector).operation() );
700 return eval( subvector<AF>( (~vector).operand(), index, size ) );
725 return serial( subvector<AF>( (~vector).operand(), index, size ) );
750 return trans( subvector<AF>( (~vector).operand(), index, size ) );
778 if( index + size > sv.size() ) {
799 template<
typename VT,
bool AF,
bool TF,
bool DF >
802 template<
typename VT,
bool AF,
bool TF,
bool DF >
805 template<
typename VT,
bool AF,
bool TF,
bool DF >
808 template<
typename VT,
bool AF,
bool TF,
bool DF >
811 template<
bool RF,
typename VT,
bool AF,
bool TF,
bool DF >
814 template<
typename VT,
bool AF,
bool TF,
bool DF >
817 template<
typename VT,
bool AF,
bool TF,
bool DF >
820 template<
typename VT,
bool AF,
bool TF,
bool DF >
823 template<
typename VT,
bool AF,
bool TF,
bool DF >
836 template<
typename VT
854 template<
typename VT
872 template<
typename VT
890 template<
typename VT
936 for(
size_t i=0UL; i<sv.size(); ++i )
937 if( !isDefault<RF>( sv[i] ) )
return false;
974 if( !isDefault<RF>( element->value() ) )
return false;
998 template<
typename VT
1004 return ( sv.offset() + sv.size() <= sv.operand().size() &&
1022 template<
typename VT
1028 return (
isSame( a.operand(), ~b ) && ( a.size() == (~b).
size() ) );
1045 template<
typename VT
1051 return (
isSame( ~a, b.operand() ) && ( (~a).size() == b.size() ) );
1068 template<
typename VT
1074 return (
isSame( a.operand(), b.operand() ) &&
1075 ( a.offset() == b.offset() ) &&
1076 ( a.size() == b.size() ) );
1096 template<
typename VT1
1106 return tryAssign( lhs.operand(), ~rhs, lhs.offset() + index );
1127 template<
typename VT1
1137 return tryAddAssign( lhs.operand(), ~rhs, lhs.offset() + index );
1158 template<
typename VT1
1168 return trySubAssign( lhs.operand(), ~rhs, lhs.offset() + index );
1189 template<
typename VT1
1199 return tryMultAssign( lhs.operand(), ~rhs, lhs.offset() + index );
1220 template<
typename VT1
1230 return tryDivAssign( lhs.operand(), ~rhs, lhs.offset() + index );
1251 template<
typename VT
1257 return subvector( derestrict( sv.operand() ), sv.offset(), sv.size() );
1278 template<
typename VT
1284 return subvector( derestrict( sv.operand() ), sv.offset(), sv.size() );
1300 template<
typename VT,
bool AF,
bool TF,
bool DF >
1318 template<
typename VT,
bool AF,
bool TF >
1336 template<
typename VT,
bool AF,
bool TF >
1338 :
public BoolConstant< HasMutableDataAccess<VT>::value >
1354 template<
typename VT,
bool TF >
1355 struct IsAligned< Subvector<VT,aligned,TF,true> >
1372 template<
typename VT,
bool AF,
bool TF,
bool DF,
typename T >
1373 struct AddTrait< Subvector<VT,AF,TF,DF>, T >
1378 template<
typename T,
typename VT,
bool AF,
bool TF,
bool DF >
1379 struct AddTrait< T, Subvector<VT,AF,TF,DF> >
1397 template<
typename VT,
bool AF,
bool TF,
bool DF,
typename T >
1398 struct SubTrait< Subvector<VT,AF,TF,DF>, T >
1403 template<
typename T,
typename VT,
bool AF,
bool TF,
bool DF >
1404 struct SubTrait< T, Subvector<VT,AF,TF,DF> >
1422 template<
typename VT,
bool AF,
bool TF,
bool DF,
typename T >
1423 struct MultTrait< Subvector<VT,AF,TF,DF>, T >
1428 template<
typename T,
typename VT,
bool AF,
bool TF,
bool DF >
1429 struct MultTrait< T, Subvector<VT,AF,TF,DF> >
1447 template<
typename VT,
bool AF,
bool TF,
bool DF,
typename T >
1448 struct DivTrait< Subvector<VT,AF,TF,DF>, T >
1453 template<
typename T,
typename VT,
bool AF,
bool TF,
bool DF >
1454 struct DivTrait< T, Subvector<VT,AF,TF,DF> >
1472 template<
typename VT,
bool AF,
bool TF,
bool DF,
typename T >
1473 struct CrossTrait< Subvector<VT,AF,TF,DF>, T >
1478 template<
typename T,
typename VT,
bool AF,
bool TF,
bool DF >
1479 struct CrossTrait< T, Subvector<VT,AF,TF,DF> >
#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.
View on a specific subvector of a dense or sparse vector.The Subvector class template represents a vi...
Definition: BaseTemplate.h:434
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
Base class for all vector transposition expression templates.The VecTransExpr class serves as a tag f...
Definition: VecTransExpr.h:66
Header file for the alignment flag values.
Header file for the VecVecDivExpr base class.
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:786
Header file for basic type definitions.
Base class for all vector evaluation expression templates.The VecEvalExpr class serves as a tag for a...
Definition: VecEvalExpr.h:66
Subvector< VT, AF > subvector(Vector< VT, TF > &vector, size_t index, size_t size)
Creating a view on a specific subvector of the given vector.
Definition: Subvector.h:322
Header file for the serial shim.
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
Subvector specialization for sparse vectors.
Base class for all cross product expression templates.The CrossExpr class serves as a tag for all exp...
Definition: CrossExpr.h:66
Header file for the VecMapExpr base class.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:560
Base class for all vector serial evaluation expression templates.The VecSerialExpr class serves as a ...
Definition: VecSerialExpr.h:67
Header file for the VecScalarDivExpr base class.
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:250
Base class for all vector/scalar division expression templates.The VecScalarDivExpr class serves as a...
Definition: VecScalarDivExpr.h:66
Header file for the VecEvalExpr base class.
Header file for the VecScalarMultExpr base class.
Header file for the VecVecMapExpr base class.
Base template for the CrossTrait class.
Definition: CrossTrait.h:116
Compile time check for data types with restricted data access.This type trait tests whether the given...
Definition: IsRestricted.h:82
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
Subvector specialization for dense vectors.
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the VecVecAddExpr base class.
Header file for the implementation of the Subvector base template.
Base class for all vector/vector division expression templates.The VecVecDivExpr class serves as a ta...
Definition: VecVecDivExpr.h:66
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
Header file for the subvector trait.
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:797
Base class for all unary vector map expression templates.The VecMapExpr class serves as a tag for all...
Definition: VecMapExpr.h:66
Header file for the exception macros of the math module.
Header file for the VecVecMultExpr base class.
typename CrossTrait< T1, T2 >::Type CrossTrait_
Auxiliary alias declaration for the CrossTrait class template.The CrossTrait_ alias declaration provi...
Definition: CrossTrait.h:159
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:264
Header file for the VecVecSubExpr base class.
Base class for all vector/vector addition expression templates.The VecVecAddExpr class serves as a ta...
Definition: VecVecAddExpr.h:66
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:580
typename DivTrait< T1, T2 >::Type DivTrait_
Auxiliary alias declaration for the DivTrait class template.The DivTrait_ alias declaration provides ...
Definition: DivTrait.h:250
Header file for the CrossExpr base class.
Header file for the HasConstDataAccess type trait.
Base class for all vector/scalar multiplication expression templates.The VecScalarMultExpr class serv...
Definition: VecScalarMultExpr.h:67
Header file for the VecSerialExpr base class.
Header file for the VecTransExpr base class.
Base template for the AddTrait class.
Definition: AddTrait.h:139
Base template for the MultTrait class.
Definition: MultTrait.h:139
Header file for the addition trait.
Header file for the cross product trait.
Header file for the division 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.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:819
Header file for the HasMutableDataAccess type trait.
Header file for the RemoveReference type trait.
Base template for the DivTrait class.
Definition: DivTrait.h:139
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:790
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:177
typename SubTrait< T1, T2 >::Type SubTrait_
Auxiliary alias declaration for the SubTrait class template.The SubTrait_ alias declaration provides ...
Definition: SubTrait.h:250
Header file for the IntegralConstant class template.
Base class for all binary vector map expression templates.The VecVecMapExpr class serves as a tag for...
Definition: VecVecMapExpr.h:66
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:252
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:600
Base template for the SubTrait class.
Definition: SubTrait.h:139
Base class for all vector/vector subtraction expression templates.The VecVecSubExpr class serves as a...
Definition: VecVecSubExpr.h:66
Header file for the Vector CRTP base class.
Base class for all vector/vector multiplication expression templates.The VecVecMultExpr class serves ...
Definition: VecVecMultExpr.h:66
typename AddTrait< T1, T2 >::Type AddTrait_
Auxiliary alias declaration for the AddTrait class template.The AddTrait_ alias declaration provides ...
Definition: AddTrait.h:250
#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.
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:1133