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

Data Structures

struct  _Outer< LHS, RHS, DerivedOp >
 Outer product operator for expressions. More...
 
struct  Slice
 Slice. More...
 
struct  Matrix< P, R, C, Allocator >
 Matrix. More...
 
struct  Matrix< P, DYNAMIC, DYNAMIC, Allocator >
 Matrix. More...
 
struct  MatrixView< T, S >
 Matrix. More...
 
struct  MatrixView< T, DYNAMIC >
 Dynamic Matrix View. More...
 
struct  MatrixView< T, CONSTRAINED_DYNAMIC >
 Dynamic Matrix View. More...
 

Functions

template<typename VA , typename VB , typename std::enable_if< vector_idx_pair< VA, VB >(), bool >::type = true>
auto outer (const VA &a, const VB &b)
 Outer product.
 

Description


Data Structure Documentation

◆ arm_cmsis_dsp::_Outer

struct arm_cmsis_dsp::_Outer
template<typename LHS, typename RHS, typename DerivedOp>
struct arm_cmsis_dsp::_Outer< LHS, RHS, DerivedOp >

Outer product operator for expressions.

Template Parameters
LHSLeft hand side datatype
RHSRight hand side datatype
DerivedOpOperator for the Outer operation

vector op vector (including matrix)

Public Types

using Scalar = typename traits< LHS >::Scalar
 Type of vector elements.
 
using Vector = typename traits< LHS >::Vector
 Type of vector in the architecture.
 

Public Member Functions

 _Outer (const LHS &lhs, const RHS &rhs, const _BinaryOperator< Scalar, DerivedOp > &op)
 Create an Outer operator.
 
 _Outer (const _Outer &other)
 Create an Outer operator from another operator of same type.
 
 _Outer (_Outer &&other)
 Move semantic for _Outer operator.
 
template<typename R = RHS, typename L = LHS, typename std::enable_if< IsVector< L >::value &&IsVector< R >::value, bool >::type = true>
vector_length_t length () const
 Length of the matrix (seen as vector) resulting from the outer operator.
 
template<typename R = RHS, typename L = LHS, typename std::enable_if< IsVector< L >::value, bool >::type = true>
vector_length_t rows () const
 Rows of the matrix.
 
template<typename R = RHS, typename L = LHS, typename std::enable_if< IsVector< R >::value, bool >::type = true>
vector_length_t columns () const
 Columns of the matrix.
 
template<typename R = RHS, typename L = LHS, typename std::enable_if< IsVector< L >::value &&IsVector< R >::value, bool >::type = true>
Scalar const operator() (const index_t r, const index_t c) const
 Expression value at given position.
 
template<typename R = RHS, typename L = LHS, typename std::enable_if< IsVector< L >::value &&IsVector< R >::value, bool >::type = true>
Vector const matrix_op (const index_t r, const index_t c) const
 Expression vector value at given position.
 
template<typename R = RHS, typename L = LHS, typename std::enable_if< IsVector< L >::value &&IsVector< R >::value, bool >::type = true>
Vector const matrix_op_tail (const index_t r, const index_t c, const vector_length_t remaining) const
 Expression vector value at given position with tail predication.
 
- Public Member Functions inherited from _Expr< _Outer< LHS, RHS, DerivedOp > >
_Outer< LHS, RHS, DerivedOp > & derived ()
 Derived datatype.
 
_Outer< LHS, RHS, DerivedOp > const & derived () const
 Derived datatype.
 
Scalar const operator[] (const index_t i) const
 Vector indexing in the expression.
 
Scalar const operator() (const index_t r, const index_t c) const
 Matrix indexing.
 
Vector const vector_op (const index_t i) const
 Vector operation at given index.
 
Vector const vector_op_tail (const index_t i, const vector_length_t remaining) const
 Vector operation at index with loop predicate.
 
Vector const matrix_op (const index_t r, const index_t c) const
 Matrix operation at index.
 
Vector const matrix_op_tail (const index_t r, const index_t c, const vector_length_t remaining) const
 Matrix operation at index with tail predication.
 
vector_length_t length () const
 Length of result.
 
vector_length_t rows () const
 Number of rows for result.
 
vector_length_t columns () const
 Number of columns for result.
 

Constructor & Destructor Documentation

◆ _Outer() [1/3]

_Outer ( const LHS &  lhs,
const RHS &  rhs,
const _BinaryOperator< Scalar, DerivedOp > &  op 
)
inline

Create an Outer operator.

Parameters
lhsLeft hand side expression
rhsRight hand side expression
opoperator

◆ _Outer() [2/3]

_Outer ( const _Outer< LHS, RHS, DerivedOp > &  other)
inline

Create an Outer operator from another operator of same type.

Parameters
otherthe other operator

◆ _Outer() [3/3]

_Outer ( _Outer< LHS, RHS, DerivedOp > &&  other)
inline

Move semantic for _Outer operator.

Parameters
otherthe other operator

Member Function Documentation

◆ columns()

vector_length_t columns ( ) const
inline

Columns of the matrix.

Template Parameters
RRight hand side datatype
LLeft hand side datatype
Returns
number of columns

◆ length()

vector_length_t length ( ) const
inline

Length of the matrix (seen as vector) resulting from the outer operator.

Template Parameters
RRight hand side datatype
LLeft hand side datatype
Returns
vector dimension

◆ matrix_op()

Vector const matrix_op ( const index_t  r,
const index_t  c 
) const
inline

Expression vector value at given position.

Template Parameters
RRight hand side datatype
LLeft hand side datatype
Parameters
rrow index
ccolumn index
Returns
expression vector value

Vector + Vector (matrix interpreted as a Vector)

◆ matrix_op_tail()

Vector const matrix_op_tail ( const index_t  r,
const index_t  c,
const vector_length_t  remaining 
) const
inline

Expression vector value at given position with tail predication.

Template Parameters
RRight hand side datatype
LLeft hand side datatype
Parameters
rrow index
ccolumn index
remainingremaining number of samples in loop
Returns
expression vector value

Vector + Vector (matrix interpreted as a Vector)

◆ operator()()

Scalar const operator() ( const index_t  r,
const index_t  c 
) const
inline

Expression value at given position.

Template Parameters
RRight hand side datatype
LLeft hand side datatype
Parameters
rrow index
ccolumn index
Returns
expression value

◆ rows()

vector_length_t rows ( ) const
inline

Rows of the matrix.

Template Parameters
RRight hand side datatype
LLeft hand side datatype
Returns
number of rows

◆ arm_cmsis_dsp::Slice

struct arm_cmsis_dsp::Slice

Public Member Functions

 Slice (const index_t s, const index_t e)
 Create new slice object.
 

Data Fields

const index_t start
 Start index.
 
const index_t stop
 Stop index.
 

Constructor & Destructor Documentation

◆ Slice()

Slice ( const index_t  s,
const index_t  e 
)
inline

Create new slice object.

Parameters
sstart index
estop index

◆ arm_cmsis_dsp::Matrix

struct arm_cmsis_dsp::Matrix
template<typename P, int R = DYNAMIC, int C = DYNAMIC, template< int > typename Allocator = malloc_allocator>
struct arm_cmsis_dsp::Matrix< P, R, C, Allocator >

Matrix.

Template Parameters
PType of the scalar
RNumber of rows
CNumber of columns
AllocatorMemory allocator

Public Types

using VectorType = typename vector_traits< P >::vector
 Type of vectors for a vector architecture and for scalar datatype P.
 
- Public Types inherited from Vector< P, L, Allocator >
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

constexpr vector_length_t rows () const
 Number of rows.
 
constexpr vector_length_t columns () const
 Number of columns.
 
constexpr uint32_t stride () const
 Number of stride.
 
 Matrix ()
 Create matrix.
 
 Matrix (P init_val)
 Create matrix.
 
template<template< int > typename OtherAllocator>
 Matrix (const Matrix< P, R, C, OtherAllocator > &other)
 Create matrix from another matrix using different memory allocator.
 
template<typename Derived , typename std::enable_if< IsVector< Derived >::value, bool >::type = true>
 Matrix (const _Expr< Derived > &other)
 Create matrix from expression.
 
template<typename Derived , typename std::enable_if< must_use_matrix_idx< Derived >(), bool >::type = true>
 Matrix (const _Expr< Derived > &other)
 Create matrix from expression.
 
template<typename Derived , typename std::enable_if< IsVector< Derived >::value, bool >::type = true>
Matrixoperator= (const _Expr< Derived > &other)
 Assign matrix from expression.
 
template<typename Derived , typename std::enable_if< must_use_matrix_idx< Derived >(), bool >::type = true>
Matrixoperator= (const _Expr< Derived > &other)
 Assign matrix from expression.
 
MatrixView< P, C > sub (const index_t rs, const index_t cs)
 Create a matrix view.
 
const MatrixView< P, C > sub (const index_t rs, const index_t cs) const
 Create a constant matrix view.
 
MatrixView< P, C > sub (const Slice &rs, const index_t cs)
 Create a matrix view.
 
const MatrixView< P, C > sub (const Slice &rs, const index_t cs) const
 Create a constant matrix view.
 
MatrixView< P, C > sub (const index_t rs, const Slice &cs)
 Create a matrix view.
 
const MatrixView< P, C > sub (const index_t rs, const Slice &cs) const
 Create a constant matrix view.
 
MatrixView< P, C > sub (const Slice &rs, const Slice &cs)
 Create a matrix view.
 
const MatrixView< P, C > sub (const Slice &rs, const Slice &cs) const
 Create a constant matrix view.
 
MatrixView< P, C > sub (const index_t rs, const index_t re, const index_t cs, const index_t ce)
 Create a matrix view.
 
const MatrixView< P, C > sub (const index_t rs, const index_t re, const index_t cs, const index_t ce) const
 Create a constant matrix view.
 
P & operator() (const index_t r, const index_t c)
 Access matrix element at given position.
 
P & operator() (const index_t r, const index_t c) const
 Access matrix element at given position.
 
template<int S = 1>
VectorView< P, S > row (const index_t i, const index_t start=0, const index_t stop=C)
 Create a row view vector with stride.
 
template<int S = 1>
const VectorView< P, S > row (const index_t i, const index_t start=0, const index_t stop=C) const
 Create a constant row view vector with stride.
 
template<int CS = 1, int S = C>
VectorView< P, CS *S > col (const index_t i, const index_t start=0, const index_t stop=R)
 Create a column view vector with stride.
 
template<int CS = 1, int S = C>
const VectorView< P, CS *S > col (const index_t i, const index_t start=0, const index_t stop=R) const
 Create a constant column view vector with stride.
 
template<int RA = R, int CA = C, typename VA , typename std::enable_if< IsVector< VA >::value &&(RA==CA) &&(RA >0) &&SameElementType< VA, P >::value, bool >::type = true>
void fill_diagonal (const VA &a)
 Fill diagonal of a matrix with a vector.
 
Matrix< P, R, C, Allocator > create () const
 Create a matrix of same type.
 
Matrix< P, C, R, Allocator > transpose () const
 Create the transposed matrix.
 
void matrix_store (const index_t row, const index_t col, const VectorType val) const
 Vector store at a given row,column position
 
void matrix_store_tail (const index_t row, const index_t col, const vector_length_t remaining, const VectorType val) const
 Vector store at a given row,column position with predicated tail
 
VectorType const matrix_op_tail (const index_t row, const index_t col, const vector_length_t remaining) const
 Vector operation at a given row,column position with predicated tail
 
VectorType const matrix_op (const index_t row, const index_t col) const
 Vector operation at a given row,column position
 
- Public Member Functions inherited from Vector< P, L, Allocator >
 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

template<int RA = R, int CA = C, typename VA , typename std::enable_if< IsVector< VA >::value &&(RA==CA) &&(RA >0) &&SameElementType< VA, P >::value, bool >::type = true>
static Matrix< P, RA, CA, Allocator > diagonal (const VA &a)
 Create a diagonal matrix.
 
template<int RA = R, int CA = C, typename std::enable_if<(RA==CA) &&(RA >0), bool >::type = true>
static Matrix< P, RA, CA, Allocator > identity ()
 Create an identity matrix.
 
- Static Public Member Functions inherited from Vector< P, L, Allocator >
static char * allocate ()
 Allocate a buffer for this vector using the memory allocator.
 

Additional Inherited Members

- Static Public Attributes inherited from Vector< P, L, Allocator >
static constexpr vector_length_t vector_size = sizeof(P)*L
 Length of the vector when known at build time.
 

Constructor & Destructor Documentation

◆ Matrix() [1/4]

Matrix ( init_val)
inlineexplicit

Create matrix.

Parameters
init_valInitialization value

◆ Matrix() [2/4]

Matrix ( const Matrix< P, R, C, OtherAllocator > &  other)
inlineexplicit

Create matrix from another matrix using different memory allocator.

Template Parameters
OtherAllocatorother memory allocator
Parameters
otherOther matrix

◆ Matrix() [3/4]

Matrix ( const _Expr< Derived > &  other)
inline

Create matrix from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherOther matrix

Only applies when the expression does not contain any MatrixView since matrix view may have a stride and cannot be used as vectors.

◆ Matrix() [4/4]

Matrix ( const _Expr< Derived > &  other)
inline

Create matrix from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherOther matrix

Applies when contain a matrix view that has a stride and thus force a 2D evaluation loop.

Member Function Documentation

◆ col() [1/2]

VectorView< P, CS *S > col ( const index_t  i,
const index_t  start = 0,
const index_t  stop = R 
)
inline

Create a column view vector with stride.

Template Parameters
Sstride
Parameters
icolumn index
startStart index in row
stopStop index in row Default is number of rows
Returns
column view vector

◆ col() [2/2]

const VectorView< P, CS *S > col ( const index_t  i,
const index_t  start = 0,
const index_t  stop = R 
) const
inline

Create a constant column view vector with stride.

Template Parameters
Sstride
Parameters
icolumn index
startStart index in row
stopStop index in row Default is number of rows
Returns
column view vector

◆ columns()

constexpr vector_length_t columns ( ) const
inlineconstexpr

Number of columns.

Returns
Number of columns

◆ create()

Matrix< P, R, C, Allocator > create ( ) const
inline

Create a matrix of same type.

Returns
a matrix

◆ diagonal()

static Matrix< P, RA, CA, Allocator > diagonal ( const VA &  a)
inlinestatic

Create a diagonal matrix.

Template Parameters
RANumber of rows
CANumber of columns
VAVector datatype
Parameters
aVector for initializing the diagonal
Returns
a matrix

Only exists when RA == CA and the size is known at built time

◆ fill_diagonal()

void fill_diagonal ( const VA &  a)
inline

Fill diagonal of a matrix with a vector.

Template Parameters
RANumber of rows
CANumber of columns
VAVector datatype
Parameters
aVector for initializing the diagonal

Only exists when RA == CA and the size is known at built time

◆ identity()

static Matrix< P, RA, CA, Allocator > identity ( )
inlinestatic

Create an identity matrix.

Template Parameters
RANumber of rows
CANumber of columns
Returns
a matrix

Only exists when RA == CA and the size is known at built time

◆ matrix_op()

VectorType const matrix_op ( const index_t  row,
const index_t  col 
) const
inline

Vector operation at a given row,column position

Parameters
rowrow index
colcolumn index
Returns
the vector result of the operation

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype

◆ matrix_op_tail()

VectorType const matrix_op_tail ( const index_t  row,
const index_t  col,
const vector_length_t  remaining 
) const
inline

Vector operation at a given row,column position with predicated tail

Parameters
rowrow index
colcolumn index
remainingNumber of remaining samples in the loop
Returns
the vector result of the operation

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype with predication

◆ matrix_store()

void matrix_store ( const index_t  row,
const index_t  col,
const VectorType  val 
) const
inline

Vector store at a given row,column position

Parameters
rowrow index
colcolumn index
valVector value

On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at row,column in this matrix.

◆ matrix_store_tail()

void matrix_store_tail ( const index_t  row,
const index_t  col,
const vector_length_t  remaining,
const VectorType  val 
) const
inline

Vector store at a given row,column position with predicated tail

Parameters
rowrow index
colcolumn index
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 row,column index in this matrix datatype with predication

◆ operator()() [1/2]

P & operator() ( const index_t  r,
const index_t  c 
)
inline

Access matrix element at given position.

Parameters
rRow index
cColumn index
Returns
reference to element

◆ operator()() [2/2]

P & operator() ( const index_t  r,
const index_t  c 
) const
inline

Access matrix element at given position.

Parameters
rRow index
cColumn index
Returns
reference to element

◆ operator=() [1/2]

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

Assign matrix from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherOther matrix
Returns
the matrix

Applies when expression does not contain matrix view

◆ operator=() [2/2]

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

Assign matrix from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherOther matrix
Returns
the matrix

Applies when contain a matrix view that has a stride and thus force a 2D evaluation loop.

◆ row() [1/2]

VectorView< P, S > row ( const index_t  i,
const index_t  start = 0,
const index_t  stop = C 
)
inline

Create a row view vector with stride.

Template Parameters
Sstride
Parameters
irow index
startStart index in row
stopStop index in row Default is number of columns
Returns
row view vector

◆ row() [2/2]

const VectorView< P, S > row ( const index_t  i,
const index_t  start = 0,
const index_t  stop = C 
) const
inline

Create a constant row view vector with stride.

Template Parameters
Sstride
Parameters
irow index
startStart index in row
stopStop index in row Default is number of columns
Returns
row view vector

◆ rows()

constexpr vector_length_t rows ( ) const
inlineconstexpr

Number of rows.

Returns
Number of rows

◆ stride()

constexpr uint32_t stride ( ) const
inlineconstexpr

Number of stride.

Returns
Number of stride

◆ sub() [1/10]

MatrixView< P, C > sub ( const index_t  rs,
const index_t  cs 
)
inline

Create a matrix view.

Parameters
rsstart row
csstart column
Returns
matrix view

◆ sub() [2/10]

const MatrixView< P, C > sub ( const index_t  rs,
const index_t  cs 
) const
inline

Create a constant matrix view.

Parameters
rsstart row
csstart column
Returns
matrix view

◆ sub() [3/10]

MatrixView< P, C > sub ( const index_t  rs,
const index_t  re,
const index_t  cs,
const index_t  ce 
)
inline

Create a matrix view.

Parameters
rsRow start
reRow end
csColumn start
ceColumn end
Returns
matrix view

◆ sub() [4/10]

const MatrixView< P, C > sub ( const index_t  rs,
const index_t  re,
const index_t  cs,
const index_t  ce 
) const
inline

Create a constant matrix view.

Parameters
rsRow start
reRow end
csColumn start
ceColumn end
Returns
matrix view

◆ sub() [5/10]

MatrixView< P, C > sub ( const index_t  rs,
const Slice cs 
)
inline

Create a matrix view.

Parameters
rsRow start index
csColumn slice
Returns
matrix view

◆ sub() [6/10]

const MatrixView< P, C > sub ( const index_t  rs,
const Slice cs 
) const
inline

Create a constant matrix view.

Parameters
rsRow start index
csColumn slice
Returns
matrix view

◆ sub() [7/10]

MatrixView< P, C > sub ( const Slice rs,
const index_t  cs 
)
inline

Create a matrix view.

Parameters
rsRow slice (start and end row)
csstart column
Returns
matrix view

◆ sub() [8/10]

const MatrixView< P, C > sub ( const Slice rs,
const index_t  cs 
) const
inline

Create a constant matrix view.

Parameters
rsRow slice (start and end row)
csstart column
Returns
matrix view

◆ sub() [9/10]

MatrixView< P, C > sub ( const Slice rs,
const Slice cs 
)
inline

Create a matrix view.

Parameters
rsRow slice
csColumn slice
Returns
matrix view

◆ sub() [10/10]

const MatrixView< P, C > sub ( const Slice rs,
const Slice cs 
) const
inline

Create a constant matrix view.

Parameters
rsRow slice
csColumn slice
Returns
matrix view

◆ transpose()

Matrix< P, C, R, Allocator > transpose ( ) const
inline

Create the transposed matrix.

Returns
a matrix

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

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

Matrix.

Template Parameters
PType of the scalar
AllocatorMemory allocator

Public Types

using VectorType = typename vector_traits< P >::vector
 Type of vectors for a vector architecture and for scalar datatype P.
 
- 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_length_t rows () const
 Number of rows.
 
vector_length_t columns () const
 Number of columns.
 
uint32_t stride () const
 Number of stride.
 
 Matrix (vector_length_t r, vector_length_t c)
 Create matrix.
 
 Matrix (vector_length_t r, vector_length_t c, P init_val)
 Create matrix.
 
P & operator() (const index_t r, const index_t c)
 Access matrix element at given position.
 
P & operator() (const index_t r, const index_t c) const
 Access matrix element at given position.
 
template<int RK, int CK, template< int > typename OtherAllocator>
 Matrix (const Matrix< P, RK, CK, OtherAllocator > &other)
 Create matrix from another matrix using different memory allocator.
 
template<typename Derived , typename std::enable_if< IsVector< Derived >::value, bool >::type = true>
 Matrix (const _Expr< Derived > &other)
 Create matrix from expression.
 
template<typename Derived , typename std::enable_if< must_use_matrix_idx< Derived >(), bool >::type = true>
 Matrix (const _Expr< Derived > &other)
 Create matrix from expression.
 
template<typename Derived , typename std::enable_if< IsVector< Derived >::value, bool >::type = true>
Matrixoperator= (const _Expr< Derived > &other)
 Assign matrix from expression.
 
template<typename Derived , typename std::enable_if< must_use_matrix_idx< Derived >(), bool >::type = true>
Matrixoperator= (const _Expr< Derived > &other)
 Assign matrix from expression.
 
template<typename VA , typename std::enable_if< IsVector< VA >::value &&SameElementType< VA, P >::value, bool >::type = true>
void fill_diagonal (const VA &a)
 Fill diagonal of a matrix with a vector.
 
Matrix< P, DYNAMIC, DYNAMIC, Allocator > create () const
 Create a matrix of same type.
 
Matrix< P, DYNAMIC, DYNAMIC, Allocator > transpose () const
 Create the transposed matrix.
 
VectorView< P, 1 > row (const index_t i, const index_t start=0)
 Create a row view with stride 1.
 
VectorView< P, 1 > row (const index_t i, const index_t start, const index_t stop)
 Create a row view with stride 1.
 
const VectorView< P, 1 > row (const index_t i, const index_t start=0) const
 Create a constant row view with stride 1.
 
const VectorView< P, 1 > row (const index_t i, const index_t start, const index_t stop) const
 Create a constant row view with stride 1.
 
template<int CS = 1>
VectorView< P, DYNAMICcol (const index_t i, const index_t start=0)
 Create a column view vector.
 
template<int CS = 1>
VectorView< P, DYNAMICcol (const index_t i, const index_t start, const index_t stop)
 Create a column view vector.
 
template<int CS = 1>
const VectorView< P, DYNAMICcol (const index_t i, const index_t start=0) const
 Create a constant column view vector.
 
template<int CS = 1>
const VectorView< P, DYNAMICcol (const index_t i, const index_t start, const index_t stop) const
 Create a constant column view vector.
 
void matrix_store (const index_t row, const index_t col, const VectorType val) const
 Vector store at a given row,column position
 
void matrix_store_tail (const index_t row, const index_t col, const vector_length_t remaining, const VectorType val) const
 Vector store at a given row,column position with predicated tail
 
VectorType const matrix_op_tail (const index_t row, const index_t col, const vector_length_t remaining) const
 Vector operation at a given row,column position with predicated tail
 
VectorType const matrix_op (const index_t row, const index_t col) const
 Vector operation at a given row,column position
 
MatrixView< P, DYNAMICsub (const index_t rs, const index_t cs)
 Create a matrix view.
 
const MatrixView< P, DYNAMICsub (const index_t rs, const index_t cs) const
 Create a constant matrix view.
 
MatrixView< P, DYNAMICsub (const Slice &rs, const index_t cs)
 Create a matrix view.
 
const MatrixView< P, DYNAMICsub (const Slice &rs, const index_t cs) const
 Create a constant matrix view.
 
MatrixView< P, DYNAMICsub (const index_t rs, const Slice &cs)
 Create a matrix view.
 
const MatrixView< P, DYNAMICsub (const index_t rs, const Slice &cs) const
 Create a constant matrix view.
 
MatrixView< P, DYNAMICsub (const Slice &rs, const Slice &cs)
 Create a matrix view.
 
const MatrixView< P, DYNAMICsub (const Slice &rs, const Slice &cs) const
 Create a constant matrix view.
 
MatrixView< P, DYNAMICsub (const index_t rs, const index_t re, const index_t cs, const index_t ce)
 Create a matrix view.
 
const MatrixView< P, DYNAMICsub (const index_t rs, const index_t re, const index_t cs, const index_t ce) const
 Create a constant matrix view.
 
- Public Member Functions inherited from Vector< P, DYNAMIC, Allocator >
 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

template<typename VA , typename std::enable_if< IsVector< VA >::value &&SameElementType< VA, P >::value, bool >::type = true>
static Matrix< P, DYNAMIC, DYNAMIC, Allocator > diagonal (const VA &a)
 Create a diagonal matrix.
 
static Matrix< P, DYNAMIC, DYNAMIC, Allocator > identity (const vector_length_t l)
 Create an identity matrix.
 
- Static Public Member Functions inherited from Vector< P, DYNAMIC, Allocator >
static char * allocate (vector_length_t length)
 Allocate a buffer for this vector using the memory allocator.
 

Constructor & Destructor Documentation

◆ Matrix() [1/5]

Matrix ( vector_length_t  r,
vector_length_t  c 
)
inlineexplicit

Create matrix.

Parameters
rnumber of rows
cnumber of columns

◆ Matrix() [2/5]

Matrix ( vector_length_t  r,
vector_length_t  c,
init_val 
)
inlineexplicit

Create matrix.

Parameters
rnumber of rows
cnumber of columns
init_valInitialization value

◆ Matrix() [3/5]

Matrix ( const Matrix< P, RK, CK, OtherAllocator > &  other)
inlineexplicit

Create matrix from another matrix using different memory allocator.

Template Parameters
RKNumber of rows
CKNumber of columns
OtherAllocatorother memory allocator
Parameters
otherOther matrix

◆ Matrix() [4/5]

Matrix ( const _Expr< Derived > &  other)
inline

Create matrix from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherOther matrix

Only applies when the expression does not contain any MatrixView since matrix view may have a stride and cannot be used as vectors.

◆ Matrix() [5/5]

Matrix ( const _Expr< Derived > &  other)
inline

Create matrix from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherOther matrix

Applies when contain a matrix view that has a stride and thus force a 2D evaluation loop.

Member Function Documentation

◆ col() [1/4]

VectorView< P, DYNAMIC > col ( const index_t  i,
const index_t  start,
const index_t  stop 
)
inline

Create a column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
stopStop index in column
Returns
column view vector

◆ col() [2/4]

const VectorView< P, DYNAMIC > col ( const index_t  i,
const index_t  start,
const index_t  stop 
) const
inline

Create a constant column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
stopStop index in column
Returns
column view vector

◆ col() [3/4]

VectorView< P, DYNAMIC > col ( const index_t  i,
const index_t  start = 0 
)
inline

Create a column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
Returns
column view vector

◆ col() [4/4]

const VectorView< P, DYNAMIC > col ( const index_t  i,
const index_t  start = 0 
) const
inline

Create a constant column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
Returns
column view vector

◆ columns()

vector_length_t columns ( ) const
inline

Number of columns.

Returns
Number of columns

◆ create()

Matrix< P, DYNAMIC, DYNAMIC, Allocator > create ( ) const
inline

Create a matrix of same type.

Returns
a matrix

◆ diagonal()

static Matrix< P, DYNAMIC, DYNAMIC, Allocator > diagonal ( const VA &  a)
inlinestatic

Create a diagonal matrix.

Template Parameters
VAVector datatype
Parameters
aVector for initializing the diagonal
Returns
a matrix

◆ fill_diagonal()

void fill_diagonal ( const VA &  a)
inline

Fill diagonal of a matrix with a vector.

Template Parameters
VAVector datatype
Parameters
aVector for initializing the diagonal

◆ identity()

static Matrix< P, DYNAMIC, DYNAMIC, Allocator > identity ( const vector_length_t  l)
inlinestatic

Create an identity matrix.

Parameters
lMatrix dimension (l x l)
Returns
a matrix

◆ matrix_op()

VectorType const matrix_op ( const index_t  row,
const index_t  col 
) const
inline

Vector operation at a given row,column position

Parameters
rowrow index
colcolumn index
Returns
the vector result of the operation

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype

◆ matrix_op_tail()

VectorType const matrix_op_tail ( const index_t  row,
const index_t  col,
const vector_length_t  remaining 
) const
inline

Vector operation at a given row,column position with predicated tail

Parameters
rowrow index
colcolumn index
remainingNumber of remaining samples in the loop
Returns
the vector result of the operation

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype with predication

◆ matrix_store()

void matrix_store ( const index_t  row,
const index_t  col,
const VectorType  val 
) const
inline

Vector store at a given row,column position

Parameters
rowrow index
colcolumn index
valVector value

On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at row,column in this matrix.

◆ matrix_store_tail()

void matrix_store_tail ( const index_t  row,
const index_t  col,
const vector_length_t  remaining,
const VectorType  val 
) const
inline

Vector store at a given row,column position with predicated tail

Parameters
rowrow index
colcolumn index
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 row,column index in this matrix datatype with predication

◆ operator()() [1/2]

P & operator() ( const index_t  r,
const index_t  c 
)
inline

Access matrix element at given position.

Parameters
rRow index
cColumn index
Returns
reference to element

◆ operator()() [2/2]

P & operator() ( const index_t  r,
const index_t  c 
) const
inline

Access matrix element at given position.

Parameters
rRow index
cColumn index
Returns
reference to element

◆ operator=() [1/2]

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

Assign matrix from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherOther matrix
Returns
the matrix

Applies when expression does not contain matrix view

◆ operator=() [2/2]

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

Assign matrix from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherOther matrix
Returns
the matrix

Applies when contain a matrix view that has a stride and thus force a 2D evaluation loop.

◆ row() [1/4]

VectorView< P, 1 > row ( const index_t  i,
const index_t  start,
const index_t  stop 
)
inline

Create a row view with stride 1.

Parameters
irow index
startStart index in row
stopStop index in row
Returns
row view vector

◆ row() [2/4]

const VectorView< P, 1 > row ( const index_t  i,
const index_t  start,
const index_t  stop 
) const
inline

Create a constant row view with stride 1.

Parameters
irow index
startStart index in row
stopStop index in row
Returns
row view vector

◆ row() [3/4]

VectorView< P, 1 > row ( const index_t  i,
const index_t  start = 0 
)
inline

Create a row view with stride 1.

Parameters
irow index
startStart index in row
Returns
row view vector

◆ row() [4/4]

const VectorView< P, 1 > row ( const index_t  i,
const index_t  start = 0 
) const
inline

Create a constant row view with stride 1.

Parameters
irow index
startStart index in row
Returns
row view vector

◆ rows()

vector_length_t rows ( ) const
inline

Number of rows.

Returns
Number of rows

◆ stride()

uint32_t stride ( ) const
inline

Number of stride.

Returns
Number of stride

◆ sub() [1/10]

MatrixView< P, DYNAMIC > sub ( const index_t  rs,
const index_t  cs 
)
inline

Create a matrix view.

Parameters
rsstart row
csstart column
Returns
matrix view

◆ sub() [2/10]

const MatrixView< P, DYNAMIC > sub ( const index_t  rs,
const index_t  cs 
) const
inline

Create a constant matrix view.

Parameters
rsstart row
csstart column
Returns
matrix view

◆ sub() [3/10]

MatrixView< P, DYNAMIC > sub ( const index_t  rs,
const index_t  re,
const index_t  cs,
const index_t  ce 
)
inline

Create a matrix view.

Parameters
rsRow start
reRow end
csColumn start
ceColumn end
Returns
matrix view

◆ sub() [4/10]

const MatrixView< P, DYNAMIC > sub ( const index_t  rs,
const index_t  re,
const index_t  cs,
const index_t  ce 
) const
inline

Create a constant matrix view.

Parameters
rsRow start
reRow end
csColumn start
ceColumn end
Returns
matrix view

◆ sub() [5/10]

MatrixView< P, DYNAMIC > sub ( const index_t  rs,
const Slice cs 
)
inline

Create a matrix view.

Parameters
rsRow start index
csColumn slice
Returns
matrix view

◆ sub() [6/10]

const MatrixView< P, DYNAMIC > sub ( const index_t  rs,
const Slice cs 
) const
inline

Create a constant matrix view.

Parameters
rsRow start index
csColumn slice
Returns
matrix view

◆ sub() [7/10]

MatrixView< P, DYNAMIC > sub ( const Slice rs,
const index_t  cs 
)
inline

Create a matrix view.

Parameters
rsRow slice (start and end row)
csstart column
Returns
matrix view

◆ sub() [8/10]

const MatrixView< P, DYNAMIC > sub ( const Slice rs,
const index_t  cs 
) const
inline

Create a constant matrix view.

Parameters
rsRow slice (start and end row)
csstart column
Returns
matrix view

◆ sub() [9/10]

MatrixView< P, DYNAMIC > sub ( const Slice rs,
const Slice cs 
)
inline

Create a matrix view.

Parameters
rsRow slice
csColumn slice
Returns
matrix view

◆ sub() [10/10]

const MatrixView< P, DYNAMIC > sub ( const Slice rs,
const Slice cs 
) const
inline

Create a constant matrix view.

Parameters
rsRow slice
csColumn slice
Returns
matrix view

◆ transpose()

Matrix< P, DYNAMIC, DYNAMIC, Allocator > transpose ( ) const
inline

Create the transposed matrix.

Returns
a matrix

◆ arm_cmsis_dsp::MatrixView

struct arm_cmsis_dsp::MatrixView
template<typename T, int S = 1>
struct arm_cmsis_dsp::MatrixView< T, S >

Matrix.

Template Parameters
TType of the scalar
SStride

Public Types

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

Public Member Functions

vector_length_t rows () const
 Number of rows.
 
vector_length_t columns () const
 Number of columns.
 
constexpr uint32_t stride () const
 Number of stride.
 
 MatrixView (T *v, const vector_length_t rows, const vector_length_t cols)
 Create matrix view on a buffer (buffer not owned by the view)
 
 MatrixView (const Vector_Base< T > &v, const vector_length_t rows, const vector_length_t cols)
 Create matrix view on vector (vector not owned by the view)
 
T & operator() (const index_t r, const index_t c)
 Access matrix view element at given position.
 
T const operator() (const index_t r, const index_t c) const
 Access matrix view element at given position.
 
template<typename Derived >
MatrixViewoperator= (const _Expr< Derived > &other)
 Assign matrix from expression.
 
MatrixViewoperator= (const T val)
 Assign matrix view from constant.
 
template<typename Derived >
MatrixViewoperator+= (const _Expr< Derived > &other)
 Add matrix from expression.
 
MatrixViewoperator+= (const MatrixView &other)
 Add matrix from matrix view.
 
MatrixViewoperator+= (const T other)
 Add constant to matrix view.
 
template<typename Derived >
MatrixViewoperator-= (const _Expr< Derived > &other)
 Subtract matrix from expression.
 
MatrixViewoperator-= (const MatrixView &other)
 Subtract matrix view.
 
MatrixViewoperator-= (const T other)
 Subtract constant.
 
template<typename Derived >
MatrixViewoperator*= (const _Expr< Derived > &other)
 Elementwise multiply matrix view with expression.
 
MatrixViewoperator*= (const MatrixView &other)
 Elementwise multiply matrix view with matrix view.
 
MatrixViewoperator*= (const T other)
 Elementwise multiply matrix view constant.
 
VectorView< T, 1 > row (const index_t i, const index_t start=0)
 Create a row view with stride 1.
 
VectorView< T, 1 > row (const index_t i, const index_t start, const index_t stop)
 Create a row view with stride 1.
 
const VectorView< T, 1 > row (const index_t i, const index_t start=0) const
 Create a constant row view with stride 1.
 
const VectorView< T, 1 > row (const index_t i, const index_t start, const index_t stop) const
 Create a constant row view with stride 1.
 
template<int CS = 1>
VectorView< T, CS *S > col (const index_t i, const index_t start=0)
 Create a column view vector.
 
template<int CS = 1>
VectorView< T, CS *S > col (const index_t i, const index_t start, const index_t stop)
 Create a column view vector.
 
template<int CS = 1>
const VectorView< T, CS *S > col (const index_t i, const index_t start=0) const
 Create a constant column view vector.
 
template<int CS = 1>
const VectorView< T, CS *S > col (const index_t i, const index_t start, const index_t stop) const
 Create a constant column view vector.
 
void matrix_store (const index_t row, const index_t col, const VectorType val) const
 Vector store at a given row,column position
 
void matrix_store_tail (const index_t row, const index_t col, const vector_length_t remaining, const VectorType val) const
 Vector store at a given row,column position with predicated tail
 
VectorType const matrix_op_tail (const index_t row, const index_t col, const vector_length_t remaining) const
 Vector operation at a given row,column position with predicated tail
 
VectorType const matrix_op (const index_t row, const index_t col) const
 Vector operation at a given row,column position
 
template<typename VA , typename std::enable_if< IsVector< VA >::value &&SameElementType< VA, T >::value, bool >::type = true>
void fill_diagonal (const VA &a)
 Fill diagonal of a matrix with a vector.
 
Matrix< T, DYNAMIC, DYNAMIC, malloc_allocatortranspose () const
 Create the transposed matrix.
 
Matrix< T, DYNAMIC, DYNAMIC, malloc_allocatorcreate () const
 Create a matrix of same type.
 
T * ptr () const
 Pointer to storage buffer.
 
const T * const_ptr () const
 Constant pointer to storage buffer.
 

Constructor & Destructor Documentation

◆ MatrixView() [1/2]

MatrixView ( T *  v,
const vector_length_t  rows,
const vector_length_t  cols 
)
inlineexplicit

Create matrix view on a buffer (buffer not owned by the view)

Parameters
vbuffer
rowsnumber of rows
colsnumber of columns

◆ MatrixView() [2/2]

MatrixView ( const Vector_Base< T > &  v,
const vector_length_t  rows,
const vector_length_t  cols 
)
inlineexplicit

Create matrix view on vector (vector not owned by the view)

Parameters
vvector
rowsnumber of rows
colsnumber of columns

Member Function Documentation

◆ col() [1/4]

VectorView< T, CS *S > col ( const index_t  i,
const index_t  start,
const index_t  stop 
)
inline

Create a column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
stopStop index in column
Returns
column view vector

◆ col() [2/4]

const VectorView< T, CS *S > col ( const index_t  i,
const index_t  start,
const index_t  stop 
) const
inline

Create a constant column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
stopStop index in column
Returns
column view vector

◆ col() [3/4]

VectorView< T, CS *S > col ( const index_t  i,
const index_t  start = 0 
)
inline

Create a column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
Returns
column view vector

◆ col() [4/4]

const VectorView< T, CS *S > col ( const index_t  i,
const index_t  start = 0 
) const
inline

Create a constant column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
Returns
column view vector

◆ columns()

vector_length_t columns ( ) const
inline

Number of columns.

Returns
Number of columns

◆ const_ptr()

const T * const_ptr ( ) const
inline

Constant pointer to storage buffer.

Returns
Pointer to storage

◆ create()

Matrix< T, DYNAMIC, DYNAMIC, malloc_allocator > create ( ) const
inline

Create a matrix of same type.

Returns
a matrix

◆ fill_diagonal()

void fill_diagonal ( const VA &  a)
inline

Fill diagonal of a matrix with a vector.

Template Parameters
VAVector datatype
Parameters
aVector for initializing the diagonal

◆ matrix_op()

VectorType const matrix_op ( const index_t  row,
const index_t  col 
) const
inline

Vector operation at a given row,column position

Parameters
rowrow index
colcolumn index
Returns
the vector result of the operation

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype

◆ matrix_op_tail()

VectorType const matrix_op_tail ( const index_t  row,
const index_t  col,
const vector_length_t  remaining 
) const
inline

Vector operation at a given row,column position with predicated tail

Parameters
rowrow index
colcolumn index
remainingNumber of remaining samples in the loop
Returns
the vector result of the operation

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype with predication

◆ matrix_store()

void matrix_store ( const index_t  row,
const index_t  col,
const VectorType  val 
) const
inline

Vector store at a given row,column position

Parameters
rowrow index
colcolumn index
valVector value

On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at row,column in this matrix.

◆ matrix_store_tail()

void matrix_store_tail ( const index_t  row,
const index_t  col,
const vector_length_t  remaining,
const VectorType  val 
) const
inline

Vector store at a given row,column position with predicated tail

Parameters
rowrow index
colcolumn index
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 row,column index in this matrix datatype with predication

◆ operator()() [1/2]

T & operator() ( const index_t  r,
const index_t  c 
)
inline

Access matrix view element at given position.

Parameters
rRow index
cColumn index
Returns
reference to element

◆ operator()() [2/2]

T const operator() ( const index_t  r,
const index_t  c 
) const
inline

Access matrix view element at given position.

Parameters
rRow index
cColumn index
Returns
reference to element

◆ operator*=() [1/3]

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

Elementwise multiply matrix view with expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherexpression
Returns
the matrix

◆ operator*=() [2/3]

MatrixView & operator*= ( const MatrixView< T, S > &  other)
inline

Elementwise multiply matrix view with matrix view.

Parameters
otherOther matrix
Returns
the matrix

◆ operator*=() [3/3]

MatrixView & operator*= ( const T  other)
inline

Elementwise multiply matrix view constant.

Parameters
otherconstant
Returns
the matrix

◆ operator+=() [1/3]

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

Add matrix from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherExpression
Returns
the matrix

◆ operator+=() [2/3]

MatrixView & operator+= ( const MatrixView< T, S > &  other)
inline

Add matrix from matrix view.

Parameters
otherOther matrix
Returns
the matrix

◆ operator+=() [3/3]

MatrixView & operator+= ( const T  other)
inline

Add constant to matrix view.

Parameters
otherThe constant
Returns
the matrix

◆ operator-=() [1/3]

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

Subtract matrix from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherexpression
Returns
the matrix

◆ operator-=() [2/3]

MatrixView & operator-= ( const MatrixView< T, S > &  other)
inline

Subtract matrix view.

Parameters
otherOther matrix view
Returns
the matrix

◆ operator-=() [3/3]

MatrixView & operator-= ( const T  other)
inline

Subtract constant.

Parameters
otherOther matrix
Returns
the matrix

◆ operator=() [1/2]

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

Assign matrix from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherExpression
Returns
the matrix

◆ operator=() [2/2]

MatrixView & operator= ( const T  val)
inline

Assign matrix view from constant.

Parameters
valThe constant
Returns
the matrix

◆ ptr()

T * ptr ( ) const
inline

Pointer to storage buffer.

Returns
Pointer to storage

◆ row() [1/4]

VectorView< T, 1 > row ( const index_t  i,
const index_t  start,
const index_t  stop 
)
inline

Create a row view with stride 1.

Parameters
irow index
startStart index in row
stopStop index in row
Returns
row view vector

◆ row() [2/4]

const VectorView< T, 1 > row ( const index_t  i,
const index_t  start,
const index_t  stop 
) const
inline

Create a constant row view with stride 1.

Parameters
irow index
startStart index in row
stopStop index in row
Returns
row view vector

◆ row() [3/4]

VectorView< T, 1 > row ( const index_t  i,
const index_t  start = 0 
)
inline

Create a row view with stride 1.

Parameters
irow index
startStart index in row
Returns
row view vector

◆ row() [4/4]

const VectorView< T, 1 > row ( const index_t  i,
const index_t  start = 0 
) const
inline

Create a constant row view with stride 1.

Parameters
irow index
startStart index in row
Returns
row view vector

◆ rows()

vector_length_t rows ( ) const
inline

Number of rows.

Returns
Number of rows

◆ stride()

constexpr uint32_t stride ( ) const
inlineconstexpr

Number of stride.

Returns
Number of stride

◆ transpose()

Matrix< T, DYNAMIC, DYNAMIC, malloc_allocator > transpose ( ) const
inline

Create the transposed matrix.

Returns
a matrix

◆ arm_cmsis_dsp::MatrixView< T, DYNAMIC >

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

Dynamic Matrix View.

Template Parameters
TType of the scalar

This template is used for dynamic matrix (stride not known at build time) and when we do not know if stride == number of columns. When stride is different from number of columns, the matrix cannot be seen as a vector.

Public Types

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

Public Member Functions

vector_length_t rows () const
 Number of rows.
 
vector_length_t columns () const
 Number of columns.
 
uint32_t stride () const
 Number of stride.
 
 MatrixView (T *v, const vector_length_t rows, const vector_length_t cols, const uint32_t stride)
 Create matrix view on a buffer (buffer not owned by the view)
 
 MatrixView (const Vector_Base< T > &v, const vector_length_t rows, const vector_length_t cols, const uint32_t stride)
 Create matrix view on vector (vector not owned by the view)
 
T & operator() (const index_t r, const index_t c)
 Access matrix view element at given position.
 
T const operator() (const index_t r, const index_t c) const
 Access matrix view element at given position.
 
template<typename Derived >
MatrixViewoperator= (const _Expr< Derived > &other)
 Assign matrix view from expression.
 
MatrixViewoperator= (const T val)
 Assign matrix view from constant.
 
template<typename Derived >
MatrixViewoperator+= (const _Expr< Derived > &other)
 Add matrix from expression.
 
MatrixViewoperator+= (const MatrixView &other)
 Add matrix from matrix view.
 
MatrixViewoperator+= (const T other)
 Add constant to matrix view.
 
template<typename Derived >
MatrixViewoperator-= (const _Expr< Derived > &other)
 Subtract matrix from expression.
 
MatrixViewoperator-= (const MatrixView &other)
 Subtract matrix view.
 
MatrixViewoperator-= (const T other)
 Subtract constant.
 
template<typename Derived >
MatrixViewoperator*= (const _Expr< Derived > &other)
 Elementwise multiply matrix view with expression.
 
MatrixViewoperator*= (const MatrixView &other)
 Elementwise multiply matrix view with matrix view.
 
MatrixViewoperator*= (const T other)
 Elementwise multiply matrix view constant.
 
VectorView< T, 1 > row (const index_t i, const index_t start=0)
 Create a row view with stride 1.
 
VectorView< T, 1 > row (const index_t i, const index_t start, const index_t stop)
 Create a row view with stride 1.
 
const VectorView< T, 1 > row (const index_t i, const index_t start=0) const
 Create a constant row view with stride 1.
 
const VectorView< T, 1 > row (const index_t i, const index_t start, const index_t stop) const
 Create a constant row view with stride 1.
 
template<int CS = 1>
VectorView< T, DYNAMICcol (const index_t i, const index_t start=0)
 Create a column view vector.
 
template<int CS = 1>
VectorView< T, DYNAMICcol (const index_t i, const index_t start, const index_t stop)
 Create a column view vector.
 
template<int CS = 1>
const VectorView< T, DYNAMICcol (const index_t i, const index_t start=0) const
 Create a constant column view vector.
 
template<int CS = 1>
const VectorView< T, DYNAMICcol (const index_t i, const index_t start, const index_t stop) const
 Create a constant column view vector.
 
void matrix_store (const index_t row, const index_t col, const VectorType val) const
 Vector store at a given row,column position
 
void matrix_store_tail (const index_t row, const index_t col, const vector_length_t remaining, const VectorType val) const
 Vector store at a given row,column position with predicated tail
 
VectorType const matrix_op_tail (const index_t row, const index_t col, const vector_length_t remaining) const
 Vector operation at a given row,column position with predicated tail
 
VectorType const matrix_op (const index_t row, const index_t col) const
 Vector operation at a given row,column position
 
template<typename VA , typename std::enable_if< IsVector< VA >::value &&SameElementType< VA, T >::value, bool >::type = true>
void fill_diagonal (const VA &a)
 Fill diagonal of a matrix with a vector.
 
Matrix< T, DYNAMIC, DYNAMIC, malloc_allocatortranspose () const
 Create the transposed matrix.
 
Matrix< T, DYNAMIC, DYNAMIC, malloc_allocatorcreate () const
 Create a matrix of same type.
 
T * ptr () const
 Pointer to storage buffer.
 
const T * const_ptr () const
 Constant pointer to storage buffer.
 

Constructor & Destructor Documentation

◆ MatrixView() [1/2]

MatrixView ( T *  v,
const vector_length_t  rows,
const vector_length_t  cols,
const uint32_t  stride 
)
inlineexplicit

Create matrix view on a buffer (buffer not owned by the view)

Parameters
vbuffer
rowsnumber of rows
colsnumber of columns
stridestride

◆ MatrixView() [2/2]

MatrixView ( const Vector_Base< T > &  v,
const vector_length_t  rows,
const vector_length_t  cols,
const uint32_t  stride 
)
inlineexplicit

Create matrix view on vector (vector not owned by the view)

Parameters
vvector
rowsnumber of rows
colsnumber of columns
stridestride

Member Function Documentation

◆ col() [1/4]

VectorView< T, DYNAMIC > col ( const index_t  i,
const index_t  start,
const index_t  stop 
)
inline

Create a column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
stopStop index in column
Returns
column view vector

◆ col() [2/4]

const VectorView< T, DYNAMIC > col ( const index_t  i,
const index_t  start,
const index_t  stop 
) const
inline

Create a constant column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
stopStop index in column
Returns
column view vector

◆ col() [3/4]

VectorView< T, DYNAMIC > col ( const index_t  i,
const index_t  start = 0 
)
inline

Create a column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
Returns
column view vector

◆ col() [4/4]

const VectorView< T, DYNAMIC > col ( const index_t  i,
const index_t  start = 0 
) const
inline

Create a constant column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
Returns
column view vector

◆ columns()

vector_length_t columns ( ) const
inline

Number of columns.

Returns
Number of columns

◆ const_ptr()

const T * const_ptr ( ) const
inline

Constant pointer to storage buffer.

Returns
Pointer to storage

◆ create()

Matrix< T, DYNAMIC, DYNAMIC, malloc_allocator > create ( ) const
inline

Create a matrix of same type.

Returns
a matrix

◆ fill_diagonal()

void fill_diagonal ( const VA &  a)
inline

Fill diagonal of a matrix with a vector.

Template Parameters
VAVector datatype
Parameters
aVector for initializing the diagonal

◆ matrix_op()

VectorType const matrix_op ( const index_t  row,
const index_t  col 
) const
inline

Vector operation at a given row,column position

Parameters
rowrow index
colcolumn index
Returns
the vector result of the operation

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype

◆ matrix_op_tail()

VectorType const matrix_op_tail ( const index_t  row,
const index_t  col,
const vector_length_t  remaining 
) const
inline

Vector operation at a given row,column position with predicated tail

Parameters
rowrow index
colcolumn index
remainingNumber of remaining samples in the loop
Returns
the vector result of the operation

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype with predication

◆ matrix_store()

void matrix_store ( const index_t  row,
const index_t  col,
const VectorType  val 
) const
inline

Vector store at a given row,column position

Parameters
rowrow index
colcolumn index
valVector value

On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at row,column in this matrix.

◆ matrix_store_tail()

void matrix_store_tail ( const index_t  row,
const index_t  col,
const vector_length_t  remaining,
const VectorType  val 
) const
inline

Vector store at a given row,column position with predicated tail

Parameters
rowrow index
colcolumn index
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 row,column index in this matrix datatype with predication

◆ operator()() [1/2]

T & operator() ( const index_t  r,
const index_t  c 
)
inline

Access matrix view element at given position.

Parameters
rRow index
cColumn index
Returns
reference to element

◆ operator()() [2/2]

T const operator() ( const index_t  r,
const index_t  c 
) const
inline

Access matrix view element at given position.

Parameters
rRow index
cColumn index
Returns
reference to element

◆ operator*=() [1/3]

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

Elementwise multiply matrix view with expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherexpression
Returns
the matrix

◆ operator*=() [2/3]

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

Elementwise multiply matrix view with matrix view.

Parameters
otherOther matrix
Returns
the matrix

◆ operator*=() [3/3]

MatrixView & operator*= ( const T  other)
inline

Elementwise multiply matrix view constant.

Parameters
otherconstant
Returns
the matrix

◆ operator+=() [1/3]

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

Add matrix from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherExpression
Returns
the matrix

◆ operator+=() [2/3]

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

Add matrix from matrix view.

Parameters
otherOther matrix
Returns
the matrix

◆ operator+=() [3/3]

MatrixView & operator+= ( const T  other)
inline

Add constant to matrix view.

Parameters
otherThe constant
Returns
the matrix

◆ operator-=() [1/3]

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

Subtract matrix from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherexpression
Returns
the matrix

◆ operator-=() [2/3]

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

Subtract matrix view.

Parameters
otherOther matrix view
Returns
the matrix

◆ operator-=() [3/3]

MatrixView & operator-= ( const T  other)
inline

Subtract constant.

Parameters
otherOther matrix
Returns
the matrix

◆ operator=() [1/2]

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

Assign matrix view from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherExpression
Returns
the matrix

◆ operator=() [2/2]

MatrixView & operator= ( const T  val)
inline

Assign matrix view from constant.

Parameters
valThe constant
Returns
the matrix

◆ ptr()

T * ptr ( ) const
inline

Pointer to storage buffer.

Returns
Pointer to storage

◆ row() [1/4]

VectorView< T, 1 > row ( const index_t  i,
const index_t  start,
const index_t  stop 
)
inline

Create a row view with stride 1.

Parameters
irow index
startStart index in row
stopStop index in row
Returns
row view vector

◆ row() [2/4]

const VectorView< T, 1 > row ( const index_t  i,
const index_t  start,
const index_t  stop 
) const
inline

Create a constant row view with stride 1.

Parameters
irow index
startStart index in row
stopStop index in row
Returns
row view vector

◆ row() [3/4]

VectorView< T, 1 > row ( const index_t  i,
const index_t  start = 0 
)
inline

Create a row view with stride 1.

Parameters
irow index
startStart index in row
Returns
row view vector

◆ row() [4/4]

const VectorView< T, 1 > row ( const index_t  i,
const index_t  start = 0 
) const
inline

Create a constant row view with stride 1.

Parameters
irow index
startStart index in row
Returns
row view vector

◆ rows()

vector_length_t rows ( ) const
inline

Number of rows.

Returns
Number of rows

◆ stride()

uint32_t stride ( ) const
inline

Number of stride.

Returns
Number of stride

◆ transpose()

Matrix< T, DYNAMIC, DYNAMIC, malloc_allocator > transpose ( ) const
inline

Create the transposed matrix.

Returns
a matrix

◆ arm_cmsis_dsp::MatrixView< T, CONSTRAINED_DYNAMIC >

struct arm_cmsis_dsp::MatrixView< T, CONSTRAINED_DYNAMIC >
template<typename T>
struct arm_cmsis_dsp::MatrixView< T, CONSTRAINED_DYNAMIC >

Dynamic Matrix View.

Template Parameters
TType of the scalar

This template is used for dynamic matrix (stride not known at build time) and when we do know that stride == number of columns. When stride is equal to the number of columns, the matrix can be seen as a vector and it enables to use the vector eval loop in the operator fusion mechanism.

Those matrix views are created by expression when a reference to a matrix is used in the expression tree (to avoid copying the matrix). In this case, we do know that the matrix view is the full matrix and thus stride == number of columns

Public Types

using VectorType = typename vector_traits< T >::vector
 Type of vectors for a vector architecture and for scalar datatype P.
 
- Public Types inherited from VectorView< T, 1 >
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 rows () const
 Number of rows.
 
vector_length_t columns () const
 Number of columns.
 
uint32_t stride () const
 Number of stride.
 
 MatrixView (T *v, const vector_length_t rows, const vector_length_t cols)
 Create matrix view on a buffer (buffer not owned by the view)
 
 MatrixView (const Vector_Base< T > &v, const vector_length_t rows, const vector_length_t cols)
 Create matrix view on vector (vector not owned by the view)
 
T & operator() (const index_t r, const index_t c)
 Access matrix view element at given position.
 
T const operator() (const index_t r, const index_t c) const
 Access matrix view element at given position.
 
template<typename Derived >
MatrixViewoperator= (const _Expr< Derived > &other)
 Assign matrix view from expression.
 
MatrixViewoperator= (const T val)
 Assign matrix view from constant.
 
template<typename Derived >
MatrixViewoperator+= (const _Expr< Derived > &other)
 Add matrix from expression.
 
MatrixViewoperator+= (const MatrixView &other)
 Add matrix from matrix view.
 
MatrixViewoperator+= (const T other)
 Add constant to matrix view.
 
template<typename Derived >
MatrixViewoperator-= (const _Expr< Derived > &other)
 Subtract matrix from expression.
 
MatrixViewoperator-= (const MatrixView &other)
 Subtract matrix view.
 
MatrixViewoperator-= (const T other)
 Subtract constant.
 
template<typename Derived >
MatrixViewoperator*= (const _Expr< Derived > &other)
 Elementwise multiply matrix view with expression.
 
MatrixViewoperator*= (const MatrixView &other)
 Elementwise multiply matrix view with matrix view.
 
MatrixViewoperator*= (const T other)
 Elementwise multiply matrix view constant.
 
VectorView< T, 1 > row (const index_t i, const index_t start=0)
 Create a row view with stride 1.
 
VectorView< T, 1 > row (const index_t i, const index_t start, const index_t stop)
 Create a row view with stride 1.
 
const VectorView< T, 1 > row (const index_t i, const index_t start=0) const
 Create a constant row view with stride 1.
 
const VectorView< T, 1 > row (const index_t i, const index_t start, const index_t stop) const
 Create a constant row view with stride 1.
 
template<int CS = 1>
VectorView< T, DYNAMICcol (const index_t i, const index_t start=0)
 Create a column view vector.
 
template<int CS = 1>
VectorView< T, DYNAMICcol (const index_t i, const index_t start, const index_t stop)
 Create a column view vector.
 
template<int CS = 1>
const VectorView< T, DYNAMICcol (const index_t i, const index_t start=0) const
 Create a constant column view vector.
 
template<int CS = 1>
const VectorView< T, DYNAMICcol (const index_t i, const index_t start, const index_t stop) const
 Create a constant column view vector.
 
void matrix_store (const index_t row, const index_t col, const VectorType val) const
 Vector store at a given row,column position
 
void matrix_store_tail (const index_t row, const index_t col, const vector_length_t remaining, const VectorType val) const
 Vector store at a given row,column position with predicated tail
 
VectorType const matrix_op_tail (const index_t row, const index_t col, const vector_length_t remaining) const
 Vector operation at a given row,column position with predicated tail
 
VectorType const matrix_op (const index_t row, const index_t col) const
 Vector operation at a given row,column position
 
template<typename VA , typename std::enable_if< IsVector< VA >::value &&SameElementType< VA, T >::value, bool >::type = true>
void fill_diagonal (const VA &a)
 Fill diagonal of a matrix with a vector.
 
Matrix< T, DYNAMIC, DYNAMIC, malloc_allocatortranspose () const
 Create the transposed matrix.
 
Matrix< T, DYNAMIC, DYNAMIC, malloc_allocatorcreate () const
 Create a matrix of same type.
 
- Public Member Functions inherited from VectorView< T, 1 >
 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.
 
 VectorView (const VectorView &other)
 Create a vector view from another view.
 
 VectorView (VectorView &&other)
 Move a vector view to another view.
 
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
 
VectorViewoperator= (const _Expr< Derived > &other)
 Assign an expression to a vector view.
 
VectorViewoperator= (const T val)
 Assign a scalar to a vector view.
 
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.
 
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.
 
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.
 
VectorView< T, S *stride > sub (const index_t start=0, const index_t stop=-1)
 Create a sub vector (a view of a view)
 
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)
 

Additional Inherited Members

- Static Public Member Functions inherited from VectorView< T, 1 >
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

◆ MatrixView() [1/2]

MatrixView ( T *  v,
const vector_length_t  rows,
const vector_length_t  cols 
)
inlineexplicit

Create matrix view on a buffer (buffer not owned by the view)

Parameters
vbuffer
rowsnumber of rows
colsnumber of columns

◆ MatrixView() [2/2]

MatrixView ( const Vector_Base< T > &  v,
const vector_length_t  rows,
const vector_length_t  cols 
)
inlineexplicit

Create matrix view on vector (vector not owned by the view)

Parameters
vvector
rowsnumber of rows
colsnumber of columns

Member Function Documentation

◆ col() [1/4]

VectorView< T, DYNAMIC > col ( const index_t  i,
const index_t  start,
const index_t  stop 
)
inline

Create a column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
stopStop index in column
Returns
column view vector

◆ col() [2/4]

const VectorView< T, DYNAMIC > col ( const index_t  i,
const index_t  start,
const index_t  stop 
) const
inline

Create a constant column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
stopStop index in column
Returns
column view vector

◆ col() [3/4]

VectorView< T, DYNAMIC > col ( const index_t  i,
const index_t  start = 0 
)
inline

Create a column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
Returns
column view vector

◆ col() [4/4]

const VectorView< T, DYNAMIC > col ( const index_t  i,
const index_t  start = 0 
) const
inline

Create a constant column view vector.

Template Parameters
CScolumn stride
Parameters
icolumn index
startStart index in column
Returns
column view vector

◆ columns()

vector_length_t columns ( ) const
inline

Number of columns.

Returns
Number of columns

◆ create()

Matrix< T, DYNAMIC, DYNAMIC, malloc_allocator > create ( ) const
inline

Create a matrix of same type.

Returns
a matrix

◆ fill_diagonal()

void fill_diagonal ( const VA &  a)
inline

Fill diagonal of a matrix with a vector.

Template Parameters
VAVector datatype
Parameters
aVector for initializing the diagonal

◆ matrix_op()

VectorType const matrix_op ( const index_t  row,
const index_t  col 
) const
inline

Vector operation at a given row,column position

Parameters
rowrow index
colcolumn index
Returns
the vector result of the operation

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype

◆ matrix_op_tail()

VectorType const matrix_op_tail ( const index_t  row,
const index_t  col,
const vector_length_t  remaining 
) const
inline

Vector operation at a given row,column position with predicated tail

Parameters
rowrow index
colcolumn index
remainingNumber of remaining samples in the loop
Returns
the vector result of the operation

On an architecture supporting vectors and predicated loops, if the scalar datatype T has a corresponding vector datatype, this function compute an operation at row,column index in this matrix datatype with predication

◆ matrix_store()

void matrix_store ( const index_t  row,
const index_t  col,
const VectorType  val 
) const
inline

Vector store at a given row,column position

Parameters
rowrow index
colcolumn index
valVector value

On an architecture supporting vectors, if the scalar datatype T has a corresponding vector datatype, this function stores a vector value at row,column in this matrix.

◆ matrix_store_tail()

void matrix_store_tail ( const index_t  row,
const index_t  col,
const vector_length_t  remaining,
const VectorType  val 
) const
inline

Vector store at a given row,column position with predicated tail

Parameters
rowrow index
colcolumn index
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 row,column index in this matrix datatype with predication

◆ operator()() [1/2]

T & operator() ( const index_t  r,
const index_t  c 
)
inline

Access matrix view element at given position.

Parameters
rRow index
cColumn index
Returns
reference to element

◆ operator()() [2/2]

T const operator() ( const index_t  r,
const index_t  c 
) const
inline

Access matrix view element at given position.

Parameters
rRow index
cColumn index
Returns
reference to element

◆ operator*=() [1/3]

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

Elementwise multiply matrix view with expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherexpression
Returns
the matrix

◆ operator*=() [2/3]

MatrixView & operator*= ( const MatrixView< T, CONSTRAINED_DYNAMIC > &  other)
inline

Elementwise multiply matrix view with matrix view.

Parameters
otherOther matrix
Returns
the matrix

◆ operator*=() [3/3]

MatrixView & operator*= ( const T  other)
inline

Elementwise multiply matrix view constant.

Parameters
otherconstant
Returns
the matrix

◆ operator+=() [1/3]

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

Add matrix from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherExpression
Returns
the matrix

◆ operator+=() [2/3]

MatrixView & operator+= ( const MatrixView< T, CONSTRAINED_DYNAMIC > &  other)
inline

Add matrix from matrix view.

Parameters
otherOther matrix
Returns
the matrix

◆ operator+=() [3/3]

MatrixView & operator+= ( const T  other)
inline

Add constant to matrix view.

Parameters
otherThe constant
Returns
the matrix

◆ operator-=() [1/3]

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

Subtract matrix from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherexpression
Returns
the matrix

◆ operator-=() [2/3]

MatrixView & operator-= ( const MatrixView< T, CONSTRAINED_DYNAMIC > &  other)
inline

Subtract matrix view.

Parameters
otherOther matrix view
Returns
the matrix

◆ operator-=() [3/3]

MatrixView & operator-= ( const T  other)
inline

Subtract constant.

Parameters
otherOther matrix
Returns
the matrix

◆ operator=() [1/2]

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

Assign matrix view from expression.

Template Parameters
DerivedDatatype representing the abstract syntax tree of the expression
Parameters
otherExpression
Returns
the matrix

◆ operator=() [2/2]

MatrixView & operator= ( const T  val)
inline

Assign matrix view from constant.

Parameters
valThe constant
Returns
the matrix

◆ row() [1/4]

VectorView< T, 1 > row ( const index_t  i,
const index_t  start,
const index_t  stop 
)
inline

Create a row view with stride 1.

Parameters
irow index
startStart index in row
stopStop index in row
Returns
row view vector

◆ row() [2/4]

const VectorView< T, 1 > row ( const index_t  i,
const index_t  start,
const index_t  stop 
) const
inline

Create a constant row view with stride 1.

Parameters
irow index
startStart index in row
stopStop index in row
Returns
row view vector

◆ row() [3/4]

VectorView< T, 1 > row ( const index_t  i,
const index_t  start = 0 
)
inline

Create a row view with stride 1.

Parameters
irow index
startStart index in row
Returns
row view vector

◆ row() [4/4]

const VectorView< T, 1 > row ( const index_t  i,
const index_t  start = 0 
) const
inline

Create a constant row view with stride 1.

Parameters
irow index
startStart index in row
Returns
row view vector

◆ rows()

vector_length_t rows ( ) const
inline

Number of rows.

Returns
Number of rows

◆ stride()

uint32_t stride ( ) const
inline

Number of stride.

Returns
Number of stride

◆ transpose()

Matrix< T, DYNAMIC, DYNAMIC, malloc_allocator > transpose ( ) const
inline

Create the transposed matrix.

Returns
a matrix

Function Documentation

◆ outer()

auto outer ( const VA &  a,
const VB &  b 
)
inline

Outer product.

Template Parameters
VARight hand side datatype
VBLeft hand side datatype
Parameters
aVector a
bVector b
Returns
Outer product of a and b