CMSIS-DSP  
CMSIS DSP Software Library
 
Loading...
Searching...
No Matches

Data Structures

struct  Vector_Base< P >
 Storage for a vector. More...
 
struct  Vector< P, L, Allocator >
 Vector template for size knonw at build time. More...
 
struct  Vector< P, DYNAMIC, Allocator >
 Vector template for dynamic vector (size known at runtime) More...
 
struct  VectorView< T, stride >
 Vector view. More...
 
struct  VectorView< T, DYNAMIC >
 Vector view with dynamic stride (not known at build time) More...
 

Functions

template<typename LHS , typename RHS , typename std::enable_if<(!is_scalar< LHS >()||!is_scalar< RHS >()) &&SameElementType< LHS, RHS >::value &&same_static_length< LHS, RHS >(), bool >::type = true>
auto operator+ (const LHS &a, const RHS &b)
 Addition operator for expressions.
 
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true>
auto operator+ (const LHS &a)
 
  • operator for expressions

 
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true>
auto expr (const LHS &a)
 Identity operator for expression.
 
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true>
auto copy (const LHS &a)
 Identity operator for expression.
 
template<typename LHS , typename RHS , typename std::enable_if<(!is_scalar< LHS >()||!is_scalar< RHS >()) &&SameElementType< LHS, RHS >::value &&same_static_length< LHS, RHS >(), bool >::type = true>
auto operator- (const LHS &a, const RHS &b)
 Subtraction operator for expressions.
 
template<typename LHS , typename std::enable_if<!is_scalar< LHS >(), bool >::type = true>
auto operator- (const LHS &a)
 
  • operator for expressions

 
template<typename LHS , typename RHS , typename std::enable_if<(!is_scalar< LHS >()||!is_scalar< RHS >()) &&SameElementType< LHS, RHS >::value &&same_static_length< LHS, RHS >(), bool >::type = true>
auto operator* (const LHS &a, const RHS &b)
 Element wise multiplication operator for expressions.
 

Description


Data Structure Documentation

◆ arm_cmsis_dsp::Vector_Base

struct arm_cmsis_dsp::Vector_Base
template<typename P>
struct arm_cmsis_dsp::Vector_Base< P >

Storage for a vector.

Template Parameters
PType of the scalar

Public Types

typedef P element_type
 Type of vector elements.
 
using Vector = typename vector_traits< P >::vector
 Type of vectors for a vector architecture and for scalar datatype P.
 

Public Member Functions

vector_length_t length () const
 Vector dimension.
 
P * ptr () const
 Pointer to storage buffer.
 
P * ptr (const index_t i) const
 Pointer to storage buffer at index i.
 
const P * const_ptr () const
 Pointer to storage buffer.
 
const P * const_ptr (const index_t i) const
 Pointer to storage buffer at index i.
 
P * begin () const
 Iterator begin.
 
P * end () const
 Iterator end.
 
P & operator[] (const index_t i)
 Element at index i.
 
P & operator[] (const index_t i) const
 Element at index i.
 
template<typename T = P, typename std::enable_if< vector_traits< T >::has_vector, bool >::type = true>
void vector_store (const index_t i, const Vector val) const
 Vector store at index i
 
void vector_store_tail (const index_t i, const vector_length_t remaining, const Vector val) const
 Vector store at index i with predicated tail
 
Vector const vector_op_tail (const index_t i, const vector_length_t remaining) const
 Vector operation at index i with predicated tail
 
Vector const vector_op (const index_t i) const
 Vector operation at index i
 

Member Function Documentation

◆ begin()

P * begin ( ) const
inline

Iterator begin.

Returns
Pointer to start of buffer

◆ const_ptr() [1/2]

const P * const_ptr ( ) const
inline

Pointer to storage buffer.

Returns
Pointer to constant storage

◆ const_ptr() [2/2]

const P * const_ptr ( const index_t  i) const
inline

Pointer to storage buffer at index i.

Parameters
iIndex in buffer
Returns
Pointer to constant storage

◆ end()

P * end ( ) const
inline

Iterator end.

Returns
Pointer to first element after end of buffer

◆ length()

vector_length_t length ( ) const
inline

Vector dimension.

Returns
Vector dimension

◆ operator[]() [1/2]

P & operator[] ( const index_t  i)
inline

Element at index i.

Parameters
iindex
Returns
Reference to element

◆ operator[]() [2/2]

P & operator[] ( const index_t  i) const
inline

Element at index i.

Parameters
iindex
Returns
Reference to element

◆ ptr() [1/2]

P * ptr ( ) const
inline

Pointer to storage buffer.

Returns
Pointer to storage

◆ ptr() [2/2]

P * ptr ( const index_t  i) const
inline

Pointer to storage buffer at index i.

Parameters
iIndex in buffer
Returns
Pointer to storage

◆ vector_op()

Vector const vector_op ( const index_t  i) const
inline

Vector operation at index i

Parameters
iindex
Returns
Result of operation

On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function execute an operation at index i. In the case of a vector, this operation is a load

◆ vector_op_tail()

Vector const vector_op_tail ( const index_t  i,
const vector_length_t  remaining 
) const
inline

Vector operation at index i with predicated tail

Parameters
iindex
remainingNumber of remaining samples in the loop
Returns
Result of operation

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function execute an operation at index i with predication. In the case of a vector, this operation is a load

◆ vector_store()

void vector_store ( const index_t  i,
const Vector  val 
) const
inline

Vector store at index i

Template Parameters
Tscalar datatype
Parameters
iindex
valVector value

On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at index i in this vector datatype

◆ vector_store_tail()

void vector_store_tail ( const index_t  i,
const vector_length_t  remaining,
const Vector  val 
) const
inline

Vector store at index i with predicated tail

Parameters
iindex
remainingNumber of remaining samples in the loop
valVector value to write at index i with tail predication

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at index i in this vector datatype with predication

◆ arm_cmsis_dsp::Vector

struct arm_cmsis_dsp::Vector
template<typename P, int L = DYNAMIC, template< int > typename Allocator = malloc_allocator>
struct arm_cmsis_dsp::Vector< P, L, Allocator >

Vector template for size knonw at build time.

Template Parameters
PType of the scalar
LVector length in number of elements. Negative if length not known at build time. It is the default value
AllocatorMemory allocator to use. By default it is the macro TMP_ALLOC

Public Types

using element_type = P
 Type of vector elements.
 
- Public Types inherited from Vector_Base< P >
typedef P element_type
 Type of vector elements.
 
using Vector = typename vector_traits< P >::vector
 Type of vectors for a vector architecture and for scalar datatype P.
 

Public Member Functions

 Vector ()
 Construct a new vector.
 
 Vector (P init_val)
 Construct a new vector and initialize it.
 
 Vector (const std::initializer_list< P > &l)
 Construct a new vector and initialize it with a list.
 
template<template< int > typename OtherAllocator>
 Vector (const Vector< P, L, OtherAllocator > &other)
 Create a vector from a vector using a different memory allocator.
 
template<int S>
 Vector (const VectorView< P, S > &other)
 Create a vector from a VectorView.
 
template<typename Derived >
 Vector (const _Expr< Derived > &other)
 Create a vector from an expression.
 
template<typename Derived >
Vectoroperator= (const _Expr< Derived > &other)
 Copy result of an expression to a vector content.
 
template<typename T , typename std::enable_if< is_scalar< T >(), bool >::type = true>
Vectoroperator= (const T other)
 Fill a vector with a constant.
 
template<typename Derived >
Vectoroperator+= (const _Expr< Derived > &other)
 Elementwise add the result of an expression to a vector.
 
Vectoroperator+= (const Vector &other)
 Elementwise add vector to another vector.
 
Vectoroperator+= (const P other)
 Elementwise add a constant to a vector.
 
template<typename Derived >
Vectoroperator-= (const _Expr< Derived > &other)
 Elementwise subtract the result of an expression from a vector.
 
Vectoroperator-= (const Vector &other)
 Elementwise subtract a vector from a vector.
 
Vectoroperator-= (const P other)
 Elementwise subtract a constant from a vector.
 
template<typename Derived >
Vectoroperator*= (const _Expr< Derived > &other)
 Elementwise multiply the result of an expression with a vector.
 
Vectoroperator*= (const Vector &other)
 Elementwise multiply a vector with a vector.
 
Vectoroperator*= (const P other)
 Elementwise multiply a constant with a vector.
 
template<int S = 1>
VectorView< P, S > sub (const index_t start=0, const index_t stop=L)
 Create a vector view.
 
- Public Member Functions inherited from Vector_Base< P >
vector_length_t length () const
 Vector dimension.
 
P * ptr () const
 Pointer to storage buffer.
 
P * ptr (const index_t i) const
 Pointer to storage buffer at index i.
 
const P * const_ptr () const
 Pointer to storage buffer.
 
const P * const_ptr (const index_t i) const
 Pointer to storage buffer at index i.
 
P * begin () const
 Iterator begin.
 
P * end () const
 Iterator end.
 
P & operator[] (const index_t i)
 Element at index i.
 
P & operator[] (const index_t i) const
 Element at index i.
 
template<typename T = P, typename std::enable_if< vector_traits< T >::has_vector, bool >::type = true>
void vector_store (const index_t i, const Vector val) const
 Vector store at index i
 
void vector_store_tail (const index_t i, const vector_length_t remaining, const Vector val) const
 Vector store at index i with predicated tail
 
Vector const vector_op_tail (const index_t i, const vector_length_t remaining) const
 Vector operation at index i with predicated tail
 
Vector const vector_op (const index_t i) const
 Vector operation at index i
 

Static Public Member Functions

static char * allocate ()
 Allocate a buffer for this vector using the memory allocator.
 

Static Public Attributes

static constexpr vector_length_t vector_size = sizeof(P)*L
 Length of the vector when known at build time.
 

Constructor & Destructor Documentation

◆ Vector() [1/6]

Vector ( )
inline

Construct a new vector.

        The length is known at build time.

◆ Vector() [2/6]

Vector ( init_val)
inlineexplicit

Construct a new vector and initialize it.

        The length is known at build time.
Parameters
init_valInitialization value

◆ Vector() [3/6]

Vector ( const std::initializer_list< P > &  l)
inline

Construct a new vector and initialize it with a list.

        A vector can be initialized like an array using {} syntax
        The length is known at build time.
Parameters
lInitialization list

◆ Vector() [4/6]

Vector ( const Vector< P, L, OtherAllocator > &  other)
inlineexplicit

Create a vector from a vector using a different memory allocator.

Parameters
otherOther vector using a different memory allocator

◆ Vector() [5/6]

Vector ( const VectorView< P, S > &  other)
inlineexplicit

Create a vector from a VectorView.

Template Parameters
SThe stride of the vector view known at build time
Parameters
otherThe vector view

◆ Vector() [6/6]

Vector ( const _Expr< Derived > &  other)
inline

Create a vector from an expression.

Template Parameters
DerivedThe type representing the abstract syntax tree
Parameters
otherThe expression

It is the mechanism allowing to evaluate an expression and merge all of the operators the of the expression in the same loop

Member Function Documentation

◆ allocate()

static char * allocate ( )
inlinestatic

Allocate a buffer for this vector using the memory allocator.

Returns
A new memory buffer

◆ operator*=() [1/3]

Vector & operator*= ( const _Expr< Derived > &  other)
inline

Elementwise multiply the result of an expression with a vector.

Template Parameters
DerivedThe type representing the abstract syntax tree of the expression
Parameters
otherThe expression
Returns
A reference to the vector

◆ operator*=() [2/3]

Vector & operator*= ( const P  other)
inline

Elementwise multiply a constant with a vector.

Template Parameters
DerivedConstant datatype
Parameters
otherThe constant
Returns
A reference to the vector

◆ operator*=() [3/3]

Vector & operator*= ( const Vector< P, L, Allocator > &  other)
inline

Elementwise multiply a vector with a vector.

Parameters
otherThe othr vector
Returns
A reference to the vector

◆ operator+=() [1/3]

Vector & operator+= ( const _Expr< Derived > &  other)
inline

Elementwise add the result of an expression to a vector.

Template Parameters
DerivedThe type representing the abstract syntax tree of the expression
Parameters
otherThe expression
Returns
A reference to the vector

◆ operator+=() [2/3]

Vector & operator+= ( const P  other)
inline

Elementwise add a constant to a vector.

Template Parameters
PThe constant datatype
Parameters
otherThe expression
Returns
A reference to the vector

◆ operator+=() [3/3]

Vector & operator+= ( const Vector< P, L, Allocator > &  other)
inline

Elementwise add vector to another vector.

Parameters
otherThe vector
Returns
A reference to the vector

◆ operator-=() [1/3]

Vector & operator-= ( const _Expr< Derived > &  other)
inline

Elementwise subtract the result of an expression from a vector.

Template Parameters
DerivedThe type representing the abstract syntax tree of the expression
Parameters
otherThe expression
Returns
A reference to the vector

◆ operator-=() [2/3]

Vector & operator-= ( const P  other)
inline

Elementwise subtract a constant from a vector.

Template Parameters
PDatatype of the constant
Parameters
otherThe constant
Returns
A reference to the vector

◆ operator-=() [3/3]

Vector & operator-= ( const Vector< P, L, Allocator > &  other)
inline

Elementwise subtract a vector from a vector.

Parameters
otherThe other vector
Returns
A reference to the vector

◆ operator=() [1/2]

Vector & operator= ( const _Expr< Derived > &  other)
inline

Copy result of an expression to a vector content.

Template Parameters
DerivedThe type representing the abstract syntax tree
Parameters
otherThe expression
Returns
A reference to the vector

It is the mechanism allowing to evaluate an expression and merge all of the operators the of the expression in the same loop

◆ operator=() [2/2]

Vector & operator= ( const T  other)
inline

Fill a vector with a constant.

Template Parameters
TThe constant datatype
Parameters
otherThe const
Returns
A reference to the vector

◆ sub()

VectorView< P, S > sub ( const index_t  start = 0,
const index_t  stop = L 
)
inline

Create a vector view.

Template Parameters
SStride known at build time
Parameters
startStart index for the vector view
stopStop index for the vector view (first element after the vector view) Default is length of the vector if known at build time.
Returns
A reference to the vector view

◆ arm_cmsis_dsp::Vector< P, DYNAMIC, Allocator >

struct arm_cmsis_dsp::Vector< P, DYNAMIC, Allocator >
template<typename P, template< int > typename Allocator>
struct arm_cmsis_dsp::Vector< P, DYNAMIC, Allocator >

Vector template for dynamic vector (size known at runtime)

Template Parameters
PType of the scalar
AllocatorMemory allocator to use. By default it is the macro TMP_ALLOC

Public Member Functions

 Vector (vector_length_t length, P init_val)
 Create a new vector.
 
 Vector (vector_length_t length)
 Create a new vector.
 
 Vector (const std::initializer_list< P > &l)
 Create a new vector.
 
template<int K, template< int > typename OtherAllocator>
 Vector (const Vector< P, K, OtherAllocator > &other)
 Create a new vector from a vector using a different memory allocator.
 
 Vector (const Vector &other)
 Create a new vector from a vector of same type.
 
template<int S>
 Vector (const VectorView< P, S > &other)
 Create a new vector from a vector view.
 
template<typename Derived >
 Vector (const _Expr< Derived > &other)
 Create a new vector from an expressipn.
 
template<typename Derived >
Vectoroperator= (const _Expr< Derived > &other)
 Fill a vector with an expression.
 
template<typename T , typename std::enable_if< is_scalar< T >(), bool >::type = true>
Vectoroperator= (const T other)
 Fill a vector with a scalar.
 
template<typename Derived >
Vectoroperator+= (const _Expr< Derived > &other)
 Elementwise add an expression to a vector.
 
Vectoroperator+= (const Vector &other)
 Elementwise add a vector to a vector.
 
Vectoroperator+= (const P other)
 Elementwise add a scalar to a vector.
 
template<typename Derived >
Vectoroperator-= (const _Expr< Derived > &other)
 Elementwise subtract an expression to a vector.
 
Vectoroperator-= (const Vector &other)
 Elementwise subtract a vector to a vector.
 
Vectoroperator-= (const P other)
 Elementwise subtract a scalar to a vector.
 
template<typename Derived >
Vectoroperator*= (const _Expr< Derived > &other)
 Elementwise multiply an expression with a vector.
 
Vectoroperator*= (const Vector &other)
 Elementwise multiply a vector with a vector.
 
Vectoroperator*= (const P other)
 Elementwise multiply a scalar with a vector.
 
template<int S = 1>
VectorView< P, S > sub (const index_t start=0, const index_t stop=-1)
 Create a vector view.
 
- Public Member Functions inherited from Vector_Base< P >
vector_length_t length () const
 Vector dimension.
 
P * ptr () const
 Pointer to storage buffer.
 
P * ptr (const index_t i) const
 Pointer to storage buffer at index i.
 
const P * const_ptr () const
 Pointer to storage buffer.
 
const P * const_ptr (const index_t i) const
 Pointer to storage buffer at index i.
 
P * begin () const
 Iterator begin.
 
P * end () const
 Iterator end.
 
P & operator[] (const index_t i)
 Element at index i.
 
P & operator[] (const index_t i) const
 Element at index i.
 
template<typename T = P, typename std::enable_if< vector_traits< T >::has_vector, bool >::type = true>
void vector_store (const index_t i, const Vector val) const
 Vector store at index i
 
void vector_store_tail (const index_t i, const vector_length_t remaining, const Vector val) const
 Vector store at index i with predicated tail
 
Vector const vector_op_tail (const index_t i, const vector_length_t remaining) const
 Vector operation at index i with predicated tail
 
Vector const vector_op (const index_t i) const
 Vector operation at index i
 

Static Public Member Functions

static char * allocate (vector_length_t length)
 Allocate a buffer for this vector using the memory allocator.
 

Additional Inherited Members

- Public Types inherited from Vector_Base< P >
typedef P element_type
 Type of vector elements.
 
using Vector = typename vector_traits< P >::vector
 Type of vectors for a vector architecture and for scalar datatype P.
 

Constructor & Destructor Documentation

◆ Vector() [1/7]

Vector ( vector_length_t  length,
init_val 
)
inlineexplicit

Create a new vector.

Parameters
lengthVector dimension
init_valInitialization value

◆ Vector() [2/7]

Vector ( vector_length_t  length)
inlineexplicit

Create a new vector.

Parameters
lengthVector dimension

◆ Vector() [3/7]

Vector ( const std::initializer_list< P > &  l)
inlineexplicit

Create a new vector.

Parameters
lInitializer list A vector can be initialized like an array using {} syntax

◆ Vector() [4/7]

Vector ( const Vector< P, K, OtherAllocator > &  other)
inlineexplicit

Create a new vector from a vector using a different memory allocator.

Template Parameters
KDimension of other vector (statically known or dynamic)
Parameters
otherThe vector to copy

◆ Vector() [5/7]

Vector ( const Vector< P, DYNAMIC, Allocator > &  other)
inline

Create a new vector from a vector of same type.

Parameters
otherThe vector to copy

◆ Vector() [6/7]

Vector ( const VectorView< P, S > &  other)
inlineexplicit

Create a new vector from a vector view.

Template Parameters
SStride of vector view known at build time
Parameters
otherThe vector to copy

◆ Vector() [7/7]

Vector ( const _Expr< Derived > &  other)
inline

Create a new vector from an expressipn.

Template Parameters
DerivedType representing the abstract syntax tree of the expression
Parameters
otherThe expression to evaluate

Member Function Documentation

◆ allocate()

static char * allocate ( vector_length_t  length)
inlinestatic

Allocate a buffer for this vector using the memory allocator.

Parameters
lengthVector dimension
Returns
A new memory buffer

◆ operator*=() [1/3]

Vector & operator*= ( const _Expr< Derived > &  other)
inline

Elementwise multiply an expression with a vector.

Template Parameters
DerivedType representing the abstract syntax tree of the expression
Parameters
otherThe expression to evaluate
Returns
A reference to the vector

◆ operator*=() [2/3]

Vector & operator*= ( const P  other)
inline

Elementwise multiply a scalar with a vector.

Template Parameters
PScalar datatype
Parameters
otherThe scalar
Returns
A reference to the vector

◆ operator*=() [3/3]

Vector & operator*= ( const Vector< P, DYNAMIC, Allocator > &  other)
inline

Elementwise multiply a vector with a vector.

Parameters
otherThe vector to add
Returns
A reference to the vector

◆ operator+=() [1/3]

Vector & operator+= ( const _Expr< Derived > &  other)
inline

Elementwise add an expression to a vector.

Template Parameters
DerivedType representing the abstract syntax tree of the expression
Parameters
otherThe expression to evaluate
Returns
A reference to the vector

◆ operator+=() [2/3]

Vector & operator+= ( const P  other)
inline

Elementwise add a scalar to a vector.

Template Parameters
PScalar datatype
Parameters
otherThe scalar
Returns
A reference to the vector

◆ operator+=() [3/3]

Vector & operator+= ( const Vector< P, DYNAMIC, Allocator > &  other)
inline

Elementwise add a vector to a vector.

Parameters
otherThe vector to add
Returns
A reference to the vector

◆ operator-=() [1/3]

Vector & operator-= ( const _Expr< Derived > &  other)
inline

Elementwise subtract an expression to a vector.

Template Parameters
DerivedType representing the abstract syntax tree of the expression
Parameters
otherThe expression to evaluate
Returns
A reference to the vector

◆ operator-=() [2/3]

Vector & operator-= ( const P  other)
inline

Elementwise subtract a scalar to a vector.

Template Parameters
PScalar datatype
Parameters
otherThe scalar
Returns
A reference to the vector

◆ operator-=() [3/3]

Vector & operator-= ( const Vector< P, DYNAMIC, Allocator > &  other)
inline

Elementwise subtract a vector to a vector.

Parameters
otherThe vector to add
Returns
A reference to the vector

◆ operator=() [1/2]

Vector & operator= ( const _Expr< Derived > &  other)
inline

Fill a vector with an expression.

Template Parameters
DerivedType representing the abstract syntax tree of the expression
Parameters
otherThe expression to evaluate
Returns
A reference to the vector

◆ operator=() [2/2]

Vector & operator= ( const T  other)
inline

Fill a vector with a scalar.

Template Parameters
TScalar datatype
Parameters
otherThe scalar
Returns
A reference to the vector

◆ sub()

VectorView< P, S > sub ( const index_t  start = 0,
const index_t  stop = -1 
)
inline

Create a vector view.

Template Parameters
Sstride
Parameters
startStart index of view
stopStop index of view (first index after end of view) By default it is the length of the vector.
Returns
The vector view

◆ arm_cmsis_dsp::VectorView

struct arm_cmsis_dsp::VectorView
template<typename T, int stride = 1>
struct arm_cmsis_dsp::VectorView< T, stride >

Vector view.

Template Parameters
TType of the scalar
SStride known at build time (default 1)

Public Types

using Vector = typename vector_traits< T >::vector
 Type of vectors for a vector architecture and for scalar datatype P.
 

Public Member Functions

 VectorView (T *v, const vector_length_t start, const vector_length_t stop)
 Create a vector view on a buffer.
 
 VectorView (const Vector_Base< T > &v)
 Create a vector on a vector.
 
 VectorView (const Vector_Base< T > &v, const index_t start, const index_t stop)
 Create a vector view on vector.
 
vector_length_t length () const
 Vector view dimension.
 
T * ptr () const
 Pointer to view storage.
 
T * ptr (const index_t i) const
 Pointer to view storage at index i.
 
const T * const_ptr () const
 Pointer to view constant storage.
 
const T * const_ptr (const index_t i) const
 Pointer to view constant storage at index i.
 
T & operator[] (const index_t i)
 Element at index i.
 
T & operator[] (const index_t i) const
 Element at index i.
 
void vector_store (const index_t i, const Vector val)
 Vector store at index i
 
void vector_store_tail (const index_t i, const vector_length_t remaining, const Vector val)
 Vector store at index i with predicated tail
 
Vector const vector_op_tail (const index_t i, const vector_length_t remaining) const
 Vector operation at index i with predicated tail
 
Vector const vector_op (const index_t i) const
 Vector operation at index i
 
 VectorView (const VectorView &other)
 Create a vector view from another view.
 
 VectorView (VectorView &&other)
 Move a vector view to another view.
 
template<typename Derived >
VectorViewoperator= (const _Expr< Derived > &other)
 Assign an expression to a vector view.
 
VectorViewoperator= (const T val)
 Assign a scalar to a vector view.
 
template<typename Derived >
VectorViewoperator+= (const _Expr< Derived > &other)
 Elementwise add an expression to a vector view.
 
VectorViewoperator+= (const VectorView &other)
 Elementwise add a vector view to a vector view.
 
VectorViewoperator+= (const T other)
 Elementwise add a scalar to a vector view.
 
template<typename Derived >
VectorViewoperator-= (const _Expr< Derived > &other)
 Elementwise subtract an expression to a vector view.
 
VectorViewoperator-= (const VectorView &other)
 Elementwise subtract a vector view to a vector view.
 
VectorViewoperator-= (const T other)
 Elementwise subtract a scalar to a vector view.
 
template<typename Derived >
VectorViewoperator*= (const _Expr< Derived > &other)
 Elementwise multiply an expression to a vector view.
 
VectorViewoperator*= (const VectorView &other)
 Elementwise multiply a vector view to a vector view.
 
VectorViewoperator*= (const T other)
 Elementwise multiply a scalar to a vector view.
 
template<int S = 1>
VectorView< T, S *stride > sub (const index_t start=0, const index_t stop=-1)
 Create a sub vector (a view of a view)
 
template<int S = 1>
const VectorView< T, S *stride > sub (const index_t start=0, const index_t stop=-1) const
 Create a constant sub vector (a view of a view)
 

Static Public Member Functions

static constexpr vector_length_t compute_length (const index_t start, const index_t stop)
 Compute the number of elements in the vector view.
 

Constructor & Destructor Documentation

◆ VectorView() [1/5]

VectorView ( T *  v,
const vector_length_t  start,
const vector_length_t  stop 
)
inlineexplicit

Create a vector view on a buffer.

Parameters
vBuffer of samples (not owned by the view)
startStart index of the view
stopStop index of the view (first elemnt after the view)

◆ VectorView() [2/5]

VectorView ( const Vector_Base< T > &  v)
inlineexplicit

Create a vector on a vector.

Parameters
vVector storage (not owned by the view)

◆ VectorView() [3/5]

VectorView ( const Vector_Base< T > &  v,
const index_t  start,
const index_t  stop 
)
inlineexplicit

Create a vector view on vector.

Parameters
vVector storage (not owned by the view)
startStart index of the view
stopStop index of the view (first elemnt after the view)

◆ VectorView() [4/5]

VectorView ( const VectorView< T, stride > &  other)
inline

Create a vector view from another view.

Parameters
otherthe other vector view

The new vector view will point to the same storage as the other vector view. No copy of element is occuring. To copy vector view content, the expr and copy operators are needed.

◆ VectorView() [5/5]

VectorView ( VectorView< T, stride > &&  other)
inline

Move a vector view to another view.

Parameters
otherthe other vector view

The new vector view will point to the same storage as the other vector view. No copy of element is occuring.

The other vector view is no more valid (points to null storage)

Member Function Documentation

◆ compute_length()

static constexpr vector_length_t compute_length ( const index_t  start,
const index_t  stop 
)
inlinestaticconstexpr

Compute the number of elements in the vector view.

Parameters
startVector view start index
stopVector view stop index (first elemnt after the view)
Returns
Vector dimension

◆ const_ptr() [1/2]

const T * const_ptr ( ) const
inline

Pointer to view constant storage.

Returns
Pointer to start of constant storage

◆ const_ptr() [2/2]

const T * const_ptr ( const index_t  i) const
inline

Pointer to view constant storage at index i.

Parameters
iIndex
Returns
Pointer to constant storage at index i

The stride is used to compute this pointer. The index is scaled by the stride.

◆ length()

vector_length_t length ( ) const
inline

Vector view dimension.

Returns
Number of elements

◆ operator*=() [1/3]

VectorView & operator*= ( const _Expr< Derived > &  other)
inline

Elementwise multiply an expression to a vector view.

Template Parameters
Derivedthe datatype representing the abstract syntax tree of the view
Parameters
otherthe expression
Returns
the vector view

◆ operator*=() [2/3]

VectorView & operator*= ( const T  other)
inline

Elementwise multiply a scalar to a vector view.

Parameters
otherthe scalar
Returns
the vector view

◆ operator*=() [3/3]

VectorView & operator*= ( const VectorView< T, stride > &  other)
inline

Elementwise multiply a vector view to a vector view.

Parameters
otherthe vector view to add
Returns
the vector view

◆ operator+=() [1/3]

VectorView & operator+= ( const _Expr< Derived > &  other)
inline

Elementwise add an expression to a vector view.

Template Parameters
Derivedthe datatype representing the abstract syntax tree of the view
Parameters
otherthe expression
Returns
the vector view

◆ operator+=() [2/3]

VectorView & operator+= ( const T  other)
inline

Elementwise add a scalar to a vector view.

Parameters
otherthe scalar
Returns
the vector view

◆ operator+=() [3/3]

VectorView & operator+= ( const VectorView< T, stride > &  other)
inline

Elementwise add a vector view to a vector view.

Parameters
otherthe vector view to add
Returns
the vector view

◆ operator-=() [1/3]

VectorView & operator-= ( const _Expr< Derived > &  other)
inline

Elementwise subtract an expression to a vector view.

Template Parameters
Derivedthe datatype representing the abstract syntax tree of the view
Parameters
otherthe expression
Returns
the vector view

◆ operator-=() [2/3]

VectorView & operator-= ( const T  other)
inline

Elementwise subtract a scalar to a vector view.

Parameters
otherthe scalar
Returns
the vector view

◆ operator-=() [3/3]

VectorView & operator-= ( const VectorView< T, stride > &  other)
inline

Elementwise subtract a vector view to a vector view.

Parameters
otherthe vector view to add
Returns
the vector view

◆ operator=() [1/2]

VectorView & operator= ( const _Expr< Derived > &  other)
inline

Assign an expression to a vector view.

Template Parameters
Derivedthe datatype representing the abstract syntax tree of the view
Parameters
otherthe expression
Returns
the vector view

Evaluate an expression an assign its result to the vector view

◆ operator=() [2/2]

VectorView & operator= ( const T  val)
inline

Assign a scalar to a vector view.

Parameters
valthe scalar
Returns
the vector view

◆ operator[]() [1/2]

T & operator[] ( const index_t  i)
inline

Element at index i.

Parameters
iIndex
Returns
Reference to element

The stride is used to compute this reference. The index is scaled by the stride.

◆ operator[]() [2/2]

T & operator[] ( const index_t  i) const
inline

Element at index i.

Parameters
iIndex
Returns
Reference to element

The stride is used to compute this reference. The index is scaled by the stride.

◆ ptr() [1/2]

T * ptr ( ) const
inline

Pointer to view storage.

Returns
Pointer to start of storage

◆ ptr() [2/2]

T * ptr ( const index_t  i) const
inline

Pointer to view storage at index i.

Parameters
iIndex
Returns
Pointer to storage at index i

The stride is used to compute this pointer. The index is scaled by the stride.

◆ sub() [1/2]

VectorView< T, S *stride > sub ( const index_t  start = 0,
const index_t  stop = -1 
)
inline

Create a sub vector (a view of a view)

Template Parameters
Sstride known at build time
Parameters
startStart index
stopStop index (first element after the view) By default it is the vector view length
Returns
the vector view

◆ sub() [2/2]

const VectorView< T, S *stride > sub ( const index_t  start = 0,
const index_t  stop = -1 
) const
inline

Create a constant sub vector (a view of a view)

Template Parameters
Sstride known at build time
Parameters
startStart index
stopStop index (first element after the view) By default it is the vector view length
Returns
the vector view

◆ vector_op()

Vector const vector_op ( const index_t  i) const
inline

Vector operation at index i

Parameters
iindex
Returns
Result of operation

On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function execute an operation at index i. In the case of a vector, this operation is a load

◆ vector_op_tail()

Vector const vector_op_tail ( const index_t  i,
const vector_length_t  remaining 
) const
inline

Vector operation at index i with predicated tail

Parameters
iindex
remainingNumber of remaining samples in the loop
Returns
Result of operation

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function execute an operation at index i with predication. In the case of a vector, this operation is a load

◆ vector_store()

void vector_store ( const index_t  i,
const Vector  val 
)
inline

Vector store at index i

Parameters
iindex
valVector value

On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at index i in this vector datatype

◆ vector_store_tail()

void vector_store_tail ( const index_t  i,
const vector_length_t  remaining,
const Vector  val 
)
inline

Vector store at index i with predicated tail

Parameters
iindex
remainingNumber of remaining samples in the loop
valVector value to write at index i with tail predication

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at index i in this vector datatype with predication

◆ arm_cmsis_dsp::VectorView< T, DYNAMIC >

struct arm_cmsis_dsp::VectorView< T, DYNAMIC >
template<typename T>
struct arm_cmsis_dsp::VectorView< T, DYNAMIC >

Vector view with dynamic stride (not known at build time)

Template Parameters
TType of the scalar

Public Types

using Vector = typename vector_traits< T >::vector
 Type of vectors for a vector architecture and for scalar datatype P.
 

Public Member Functions

vector_length_t compute_length (const index_t start, const index_t stop, const index_t stride) const
 Compute the number of elements in the vector view.
 
 VectorView (T *v, const index_t start, const index_t stop, const index_t stride)
 Create a vector view on a buffer.
 
 VectorView (const Vector_Base< T > &v, const index_t stride)
 Create a vector view on a vector.
 
 VectorView (const Vector_Base< T > &v, const index_t start, const index_t stop, const index_t stride)
 Create a vector view on a vector.
 
vector_length_t length () const
 Vector view dimension.
 
T * ptr () const
 Pointer to view storage.
 
T * ptr (const index_t i) const
 Pointer to view storage at index i.
 
const T * const_ptr () const
 Pointer to view constant storage.
 
const T * const_ptr (const index_t i) const
 Pointer to view constant storage at index i.
 
T & operator[] (index_t i)
 Element at index i.
 
T & operator[] (index_t i) const
 Element at index i.
 
void vector_store (index_t i, Vector val)
 Vector store at index i
 
void vector_store_tail (index_t i, vector_length_t remaining, Vector val)
 Vector store at index i with predicated tail
 
Vector const vector_op_tail (index_t i, vector_length_t remaining) const
 Vector operation at index i with predicated tail
 
Vector const vector_op (index_t i) const
 Vector operation at index i
 
 VectorView (const VectorView &other)
 Create a vector view from another view.
 
 VectorView (VectorView &&other)
 Move a vector view to another view.
 
template<typename Derived >
VectorViewoperator= (const _Expr< Derived > &other)
 Assign an expression to a vector view.
 
VectorViewoperator= (const T val)
 Assign a scalar to a vector view.
 
template<typename Derived >
VectorViewoperator+= (const _Expr< Derived > &other)
 Elementwise add an expression to a vector view.
 
VectorViewoperator+= (const VectorView &other)
 Elementwise add a vector view to a vector view.
 
VectorViewoperator+= (const T other)
 Elementwise add a scalar to a vector view.
 
template<typename Derived >
VectorViewoperator-= (const _Expr< Derived > &other)
 Elementwise subtract an expression to a vector view.
 
VectorViewoperator-= (const VectorView &other)
 Elementwise subtract a vector view to a vector view.
 
VectorViewoperator-= (const T other)
 Elementwise subtract a scalar to a vector view.
 
template<typename Derived >
VectorViewoperator*= (const _Expr< Derived > &other)
 Elementwise multiply an expression to a vector view.
 
VectorViewoperator*= (const VectorView &other)
 Elementwise multiply a vector view to a vector view.
 
VectorViewoperator*= (const T other)
 Elementwise multiply a scalar to a vector view.
 
index_t stride () const
 Stride of the vector view.
 
template<int S = 1>
VectorView< T, DYNAMICsub (const index_t start=0, const index_t stop=-1)
 Create a sub vector (a view of a view)
 
template<int S = 1>
const VectorView< T, DYNAMICsub (const index_t start=0, const index_t stop=-1) const
 Create a constant sub vector (a view of a view)
 

Constructor & Destructor Documentation

◆ VectorView() [1/5]

VectorView ( T *  v,
const index_t  start,
const index_t  stop,
const index_t  stride 
)
inlineexplicit

Create a vector view on a buffer.

Parameters
vBuffer of samples (not owned by the view)
startStart index of the view
stopStop index of the view (first elemnt after the view)
strideStride (only known at runtime)

◆ VectorView() [2/5]

VectorView ( const Vector_Base< T > &  v,
const index_t  stride 
)
inlineexplicit

Create a vector view on a vector.

Parameters
vVector owning the storage (not owned by the view)
strideStride (only known at runtime)

start is 0 stop is defined by the length of the vector

◆ VectorView() [3/5]

VectorView ( const Vector_Base< T > &  v,
const index_t  start,
const index_t  stop,
const index_t  stride 
)
inlineexplicit

Create a vector view on a vector.

Parameters
vVector owning the storage (not owned by the view)
startStart index of the view
stopStop index
strideStride (only known at runtime)

◆ VectorView() [4/5]

VectorView ( const VectorView< T, DYNAMIC > &  other)
inline

Create a vector view from another view.

Parameters
otherthe other vector view

The new vector view will point to the same storage as the other vector view. No copy of element is occuring. To copy vector view content, the expr and copy operators are needed.

◆ VectorView() [5/5]

VectorView ( VectorView< T, DYNAMIC > &&  other)
inline

Move a vector view to another view.

Parameters
otherthe other vector view

The new vector view will point to the same storage as the other vector view. No copy of element is occuring.

The other vector view is no more valid (points to null storage)

Member Function Documentation

◆ compute_length()

vector_length_t compute_length ( const index_t  start,
const index_t  stop,
const index_t  stride 
) const
inline

Compute the number of elements in the vector view.

Parameters
startVector view start index
stopVector view stop index (first elemnt after the view)
strideStride (only known at runtime)
Returns
Vector dimension

◆ const_ptr() [1/2]

const T * const_ptr ( ) const
inline

Pointer to view constant storage.

Returns
Pointer to start of constant storage

◆ const_ptr() [2/2]

const T * const_ptr ( const index_t  i) const
inline

Pointer to view constant storage at index i.

Parameters
iIndex
Returns
Pointer to constant storage at index i

The stride is used to compute this pointer. The index is scaled by the stride.

◆ length()

vector_length_t length ( ) const
inline

Vector view dimension.

Returns
Number of elements

◆ operator*=() [1/3]

VectorView & operator*= ( const _Expr< Derived > &  other)
inline

Elementwise multiply an expression to a vector view.

Template Parameters
Derivedthe datatype representing the abstract syntax tree of the view
Parameters
otherthe expression
Returns
the vector view

◆ operator*=() [2/3]

VectorView & operator*= ( const T  other)
inline

Elementwise multiply a scalar to a vector view.

Parameters
otherthe scalar
Returns
the vector view

◆ operator*=() [3/3]

VectorView & operator*= ( const VectorView< T, DYNAMIC > &  other)
inline

Elementwise multiply a vector view to a vector view.

Parameters
otherthe vector view to add
Returns
the vector view

◆ operator+=() [1/3]

VectorView & operator+= ( const _Expr< Derived > &  other)
inline

Elementwise add an expression to a vector view.

Template Parameters
Derivedthe datatype representing the abstract syntax tree of the view
Parameters
otherthe expression
Returns
the vector view

◆ operator+=() [2/3]

VectorView & operator+= ( const T  other)
inline

Elementwise add a scalar to a vector view.

Parameters
otherthe scalar
Returns
the vector view

◆ operator+=() [3/3]

VectorView & operator+= ( const VectorView< T, DYNAMIC > &  other)
inline

Elementwise add a vector view to a vector view.

Parameters
otherthe vector view to add
Returns
the vector view

◆ operator-=() [1/3]

VectorView & operator-= ( const _Expr< Derived > &  other)
inline

Elementwise subtract an expression to a vector view.

Template Parameters
Derivedthe datatype representing the abstract syntax tree of the view
Parameters
otherthe expression
Returns
the vector view

◆ operator-=() [2/3]

VectorView & operator-= ( const T  other)
inline

Elementwise subtract a scalar to a vector view.

Parameters
otherthe scalar
Returns
the vector view

◆ operator-=() [3/3]

VectorView & operator-= ( const VectorView< T, DYNAMIC > &  other)
inline

Elementwise subtract a vector view to a vector view.

Parameters
otherthe vector view to add
Returns
the vector view

◆ operator=() [1/2]

VectorView & operator= ( const _Expr< Derived > &  other)
inline

Assign an expression to a vector view.

Template Parameters
Derivedthe datatype representing the abstract syntax tree of the view
Parameters
otherthe expression
Returns
the vector view

Evaluate an expression an assign its result to the vector view

◆ operator=() [2/2]

VectorView & operator= ( const T  val)
inline

Assign a scalar to a vector view.

Parameters
valthe scalar
Returns
the vector view

◆ operator[]() [1/2]

T & operator[] ( index_t  i)
inline

Element at index i.

Parameters
iIndex
Returns
Reference to element

The stride is used to compute this reference. The index is scaled by the stride.

◆ operator[]() [2/2]

T & operator[] ( index_t  i) const
inline

Element at index i.

Parameters
iIndex
Returns
Reference to element

The stride is used to compute this reference. The index is scaled by the stride.

◆ ptr() [1/2]

T * ptr ( ) const
inline

Pointer to view storage.

Returns
Pointer to start of storage

◆ ptr() [2/2]

T * ptr ( const index_t  i) const
inline

Pointer to view storage at index i.

Parameters
iIndex
Returns
Pointer to storage at index i

The stride is used to compute this pointer. The index is scaled by the stride.

◆ stride()

index_t stride ( ) const
inline

Stride of the vector view.

Returns
the stride

◆ sub() [1/2]

VectorView< T, DYNAMIC > sub ( const index_t  start = 0,
const index_t  stop = -1 
)
inline

Create a sub vector (a view of a view)

Template Parameters
Sstride known at build time
Parameters
startStart index
stopStop index (first element after the view) By default it is the vector view length
Returns
the vector view

◆ sub() [2/2]

const VectorView< T, DYNAMIC > sub ( const index_t  start = 0,
const index_t  stop = -1 
) const
inline

Create a constant sub vector (a view of a view)

Template Parameters
Sstride known at build time
Parameters
startStart index
stopStop index (first element after the view) By default it is the vector view length
Returns
the vector view

◆ vector_op()

Vector const vector_op ( index_t  i) const
inline

Vector operation at index i

Parameters
iindex
Returns
Result of operation

On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function execute an operation at index i. In the case of a vector, this operation is a load

◆ vector_op_tail()

Vector const vector_op_tail ( index_t  i,
vector_length_t  remaining 
) const
inline

Vector operation at index i with predicated tail

Parameters
iindex
remainingNumber of remaining samples in the loop
Returns
Result of operation

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function execute an operation at index i with predication. In the case of a vector, this operation is a load

◆ vector_store()

void vector_store ( index_t  i,
Vector  val 
)
inline

Vector store at index i

Parameters
iindex
valVector value

On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at index i in this vector datatype

◆ vector_store_tail()

void vector_store_tail ( index_t  i,
vector_length_t  remaining,
Vector  val 
)
inline

Vector store at index i with predicated tail

Parameters
iindex
remainingNumber of remaining samples in the loop
valVector value to write at index i with tail predication

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at index i in this vector datatype with predication

Function Documentation

◆ copy()

auto copy ( const LHS &  a)
inline

Identity operator for expression.

Template Parameters
LHSLeft hand side datatype
Parameters
aLeft hand side expression tree
Returns
Expression representing the identity

Used to consider a vector view as an expression and force the copy of this vector view when assigned to another vector entity.

◆ expr()

auto expr ( const LHS &  a)
inline

Identity operator for expression.

Template Parameters
LHSLeft hand side datatype
Parameters
aLeft hand side expression tree
Returns
Expression representing the identity

Used to consider a vector view as an expression and force the copy of this vector view when assigned to another vector entity.

◆ operator*()

auto operator* ( const LHS &  a,
const RHS &  b 
)
inline

Element wise multiplication operator for expressions.

Template Parameters
LHSLeft hand side datatype
RHSRight hand side datatype
Parameters
aLeft hand side expression tree
bRight hand side expression tree
Returns
Expression representing the *

elementwise vector * vector (including matrix)

◆ operator+() [1/2]

auto operator+ ( const LHS &  a)
inline

  • operator for expressions

Template Parameters
LHSLeft hand side datatype
Parameters
aLeft hand side expression tree
Returns
Expression representing + vector

+vector (including matrix)

◆ operator+() [2/2]

auto operator+ ( const LHS &  a,
const RHS &  b 
)
inline

Addition operator for expressions.

Template Parameters
LHSLeft hand side datatype
RHSRight hand side datatype
Parameters
aLeft hand side expression tree
bRight hand side expression tree
Returns
Expression representing the add

vector + vector (including matrix)

◆ operator-() [1/2]

auto operator- ( const LHS &  a)
inline

  • operator for expressions

Template Parameters
LHSLeft hand side datatype
Parameters
aLeft hand side expression tree
Returns
Expression representing the - vector

-vector (including matrix)

◆ operator-() [2/2]

auto operator- ( const LHS &  a,
const RHS &  b 
)
inline

Subtraction operator for expressions.

Template Parameters
LHSLeft hand side datatype
RHSRight hand side datatype
Parameters
aLeft hand side expression tree
bRight hand side expression tree
Returns
Expression representing the add

vector - vector (including matrix)