35 #ifndef _BLAZE_MATH_VIEWS_SUBVECTOR_H_
36 #define _BLAZE_MATH_VIEWS_SUBVECTOR_H_
130 template<
typename VT
132 inline typename SubvectorExprTrait<VT,unaligned>::Type
137 return subvector<unaligned>( ~vector, index, size );
198 template<
typename VT
200 inline typename SubvectorExprTrait<const VT,unaligned>::Type
205 return subvector<unaligned>( ~vector, index, size );
286 inline typename DisableIf< Or< IsComputation<VT>, IsTransExpr<VT> >
287 ,
typename SubvectorExprTrait<VT,AF>::Type >::Type
374 inline typename DisableIf< Or< IsComputation<VT>, IsTransExpr<VT> >
375 ,
typename SubvectorExprTrait<const VT,AF>::Type >::Type
410 inline typename EnableIf< IsVecVecAddExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
411 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
415 return subvector<AF>( (~vector).leftOperand() , index, size ) +
416 subvector<AF>( (~vector).rightOperand(), index, size );
438 inline typename EnableIf< IsVecVecSubExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
439 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
443 return subvector<AF>( (~vector).leftOperand() , index, size ) -
444 subvector<AF>( (~vector).rightOperand(), index, size );
466 inline typename EnableIf< IsVecVecMultExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
467 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
471 return subvector<AF>( (~vector).leftOperand() , index, size ) *
472 subvector<AF>( (~vector).rightOperand(), index, size );
494 inline typename EnableIf< IsCrossExpr<VT>,
typename SubvectorExprTrait<VT,unaligned>::Type >::Type
495 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
499 typedef typename SubvectorExprTrait<VT,unaligned>::Type
ReturnType;
522 inline typename EnableIf< IsMatVecMultExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
523 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
527 typename VT::LeftOperand left ( (~vector).leftOperand() );
528 typename VT::RightOperand right( (~vector).rightOperand() );
530 return submatrix<AF>( left, index, 0UL, size, left.columns() ) * right;
552 inline typename EnableIf< IsTVecMatMultExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
553 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
557 typename VT::LeftOperand left ( (~vector).leftOperand() );
558 typename VT::RightOperand right( (~vector).rightOperand() );
560 return left * submatrix<AF>( right, 0UL, index, right.rows(), size );
582 inline typename EnableIf< IsVecScalarMultExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
583 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
587 return subvector<AF>( (~vector).leftOperand(), index, size ) * (~vector).rightOperand();
609 inline typename EnableIf< IsVecScalarDivExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
610 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
614 return subvector<AF>( (~vector).leftOperand(), index, size ) / (~vector).rightOperand();
636 inline typename EnableIf< IsVecAbsExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
637 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
641 return abs( subvector<AF>( (~vector).operand(), index, size ) );
663 inline typename EnableIf< IsVecEvalExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
664 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
668 return eval( subvector<AF>( (~vector).operand(), index, size ) );
690 inline typename EnableIf< IsVecTransExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
691 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
695 return trans( subvector<AF>( (~vector).operand(), index, size ) );
Evaluation of the expression type type of a subvector operation.Via this type trait it is possible to...
Definition: SubvectorExprTrait.h:78
Header file for the subvector/submatrix alignment flag values.
Header file for the IsTVecMatMultExpr type trait class.
Header file for the IsVecVecMultExpr type trait class.
Header file for the IsCrossExpr type trait class.
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:751
Header file for the IsVecVecSubExpr type trait class.
const DMatAbsExpr< MT, SO > abs(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the absolute values of each single element of dm.
Definition: DMatAbsExpr.h:764
Header file for the IsTransExpr type trait class.
Header file for the IsMatVecMultExpr type trait class.
Header file for the IsVecEvalExpr type trait class.
Header file for the IsVecVecAddExpr type trait class.
Header file for the DisableIf class template.
Header file for the Or class template.
Header file for the IsVecScalarDivExpr type trait class.
Header file for the IsVecAbsExpr type trait class.
Header file for the EnableIf class template.
Header file for the IsVecTransExpr type trait class.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2383
SubvectorExprTrait< VT, unaligned >::Type 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:133
const DMatEvalExpr< MT, SO > eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:584
Header file for the IsVecScalarMultExpr type trait class.
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 basic type definitions.
Header file for the SubvectorExprTrait class template.
Header file for the Vector CRTP base class.
Header file for the FunctionTrace class.