35 #ifndef _BLAZE_MATH_VIEWS_SUBVECTOR_H_
36 #define _BLAZE_MATH_VIEWS_SUBVECTOR_H_
132 template<
typename VT
134 inline typename SubvectorExprTrait<VT,unaligned>::Type
139 return subvector<unaligned>( ~vector, index,
size );
200 template<
typename VT
202 inline typename SubvectorExprTrait<const VT,unaligned>::Type
207 return subvector<unaligned>( ~vector, index,
size );
288 inline typename DisableIf< Or< IsComputation<VT>, IsTransExpr<VT> >
289 ,
typename SubvectorExprTrait<VT,AF>::Type >::Type
376 inline typename DisableIf< Or< IsComputation<VT>, IsTransExpr<VT> >
377 ,
typename SubvectorExprTrait<const VT,AF>::Type >::Type
412 inline typename EnableIf< IsVecVecAddExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
413 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
417 return subvector<AF>( (~vector).leftOperand() , index,
size ) +
418 subvector<AF>( (~vector).rightOperand(), index,
size );
440 inline typename EnableIf< IsVecVecSubExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
441 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
445 return subvector<AF>( (~vector).leftOperand() , index,
size ) -
446 subvector<AF>( (~vector).rightOperand(), index,
size );
468 inline typename EnableIf< IsVecVecMultExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
469 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
473 return subvector<AF>( (~vector).leftOperand() , index,
size ) *
474 subvector<AF>( (~vector).rightOperand(), index,
size );
496 inline typename EnableIf< IsCrossExpr<VT>,
typename SubvectorExprTrait<VT,unaligned>::Type >::Type
497 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
501 typedef typename SubvectorExprTrait<VT,unaligned>::Type
ReturnType;
524 inline typename EnableIf< IsMatVecMultExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
525 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
529 typename VT::LeftOperand left ( (~vector).leftOperand() );
530 typename VT::RightOperand right( (~vector).rightOperand() );
532 return submatrix<AF>( left, index, 0UL,
size, left.columns() ) * right;
554 inline typename EnableIf< IsTVecMatMultExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
555 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
559 typename VT::LeftOperand left ( (~vector).leftOperand() );
560 typename VT::RightOperand right( (~vector).rightOperand() );
562 return left * submatrix<AF>( right, 0UL, index, right.rows(),
size );
584 inline typename EnableIf< IsVecScalarMultExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
585 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
589 return subvector<AF>( (~vector).leftOperand(), index,
size ) * (~vector).rightOperand();
611 inline typename EnableIf< IsVecScalarDivExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
612 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
616 return subvector<AF>( (~vector).leftOperand(), index,
size ) / (~vector).rightOperand();
638 inline typename EnableIf< IsVecAbsExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
639 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
643 return abs( subvector<AF>( (~vector).operand(), index, size ) );
665 inline typename EnableIf< IsVecEvalExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
666 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
670 return eval( subvector<AF>( (~vector).operand(), index, size ) );
692 inline typename EnableIf< IsVecSerialExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
693 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
697 return serial( subvector<AF>( (~vector).operand(), index, size ) );
719 inline typename EnableIf< IsVecTransExpr<VT>,
typename SubvectorExprTrait<VT,AF>::Type >::Type
720 subvector(
const Vector<VT,TF>& vector,
size_t index,
size_t size )
724 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.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
Header file for the IsCrossExpr type trait class.
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:909
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:695
Header file for the IsMatVecMultExpr type trait class.
Header file for the IsVecSerialExpr 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 serial shim.
Header file for the IsVecTransExpr type trait class.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2477
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:135
const DMatEvalExpr< MT, SO > eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:677
Header file for the IsVecScalarMultExpr 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:932
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.