HPM SDK
HPMicro Software Development Kit
DSP Matrix Functions

Functions

static void hpm_dsp_mat_add_f32 (const float32_t *src1, const float32_t *src2, float32_t *dst, uint32_t row, uint32_t col)
 Addition of two floating-potint matrices. More...
 
static void hpm_dsp_mat_add_q15 (const q15_t *src1, const q15_t *src2, q15_t *dst, uint32_t row, uint32_t col)
 Addition of two q15 matrices. More...
 
static void hpm_dsp_mat_add_q31 (const q31_t *src1, const q31_t *src2, q31_t *dst, uint32_t row, uint32_t col)
 Addition of two q31 matrices. More...
 
static int32_t hpm_dsp_mat_inv_f32 (float32_t *src, float32_t *dst, uint32_t size)
 Compute the inverse matrix of the floating-potint matrix. More...
 
static int32_t hpm_dsp_mat_inv_f64 (float64_t *src, float64_t *dst, uint32_t size)
 
static void hpm_dsp_mat_mul_f32 (const float32_t *src1, const float32_t *src2, float32_t *dst, uint32_t row, uint32_t col, uint32_t col2)
 Multiplication of two floating-point matrices. More...
 
static void hpm_dsp_mat_mul_f64 (const float64_t *src1, const float64_t *src2, float64_t *dst, uint32_t row, uint32_t col, uint32_t col2)
 
static void hpm_dsp_cmat_mul_f32 (const float32_t *src1, const float32_t *src2, float32_t *dst, uint32_t row, uint32_t col, uint32_t col2)
 Multiplication of two floating-point complex matrices. More...
 
static void hpm_dsp_mat_mul_q15 (const q15_t *src1, const q15_t *src2, q15_t *dst, uint32_t row, uint32_t col, uint32_t col2)
 Multiplication of two q15 matrices. More...
 
static void hpm_dsp_mat_mul_fast_q15 (const q15_t *src1, const q15_t *src2, q15_t *dst, uint32_t row, uint32_t col, uint32_t col2)
 
static void hpm_dsp_cmat_mul_q15 (const q15_t *src1, const q15_t *src2, q15_t *dst, uint32_t row, uint32_t col, uint32_t col2)
 Multiplication of two q15 complex matrices. More...
 
static void hpm_dsp_mat_mul_q31 (const q31_t *src1, const q31_t *src2, q31_t *dst, uint32_t row, uint32_t col, uint32_t col2)
 Multiplication of two q31 matrices. More...
 
static void hpm_dsp_mat_mul_fast_q31 (const q31_t *src1, const q31_t *src2, q31_t *dst, uint32_t row, uint32_t col, uint32_t col2)
 
static void hpm_dsp_cmat_mul_q31 (const q31_t *src1, const q31_t *src2, q31_t *dst, uint32_t row, uint32_t col, uint32_t col2)
 Multiplication of two q31 complex matrices. More...
 
static void hpm_dsp_mat_mul_q7 (const q7_t *src1, const q7_t *src2, q7_t *dst, uint32_t row, uint32_t col, uint32_t col2)
 Multiplication of two q7 matrices. More...
 
static void hpm_dsp_mat_mul_vxm_q7 (const q7_t *src1, const q7_t *src2, q7_t *dst, uint32_t col, uint32_t col2)
 Multiplication of q7 vetor by matrix. More...
 
static int32_t hpm_dsp_mat_pwr2_cache_f64 (const float64_t *src, float64_t *dst, uint32_t size)
 
static void hpm_dsp_mat_scale_f32 (const float32_t *src, float32_t scale, float32_t *dst, uint32_t row, uint32_t col)
 Multiplt a scale value of floating-potint matrix. More...
 
static void hpm_dsp_mat_scale_q15 (const q15_t *src, q15_t scale_fract, int32_t shift, q15_t *dst, uint32_t row, uint32_t col)
 Multiplt a scale value of q15 matrix. More...
 
static void hpm_dsp_mat_scale_q31 (const q31_t *src, q31_t scale_fract, int32_t shift, q31_t *dst, uint32_t row, uint32_t col)
 Multiplt a scale value of q31 matrix. More...
 
static void hpm_dsp_mat_sub_f64 (const float64_t *src1, const float64_t *src2, float64_t *dst, uint32_t row, uint32_t col)
 Substraction of two double-precision floating-potint matrices. More...
 
static void hpm_dsp_mat_sub_f32 (const float32_t *src1, const float32_t *src2, float32_t *dst, uint32_t row, uint32_t col)
 Substraction of two floating-potint matrices. More...
 
static void hpm_dsp_mat_sub_q15 (const q15_t *src1, const q15_t *src2, q15_t *dst, uint32_t row, uint32_t col)
 Substraction of two q15 matrices. More...
 
static void hpm_dsp_mat_sub_q31 (const q31_t *src1, const q31_t *src2, q31_t *dst, uint32_t row, uint32_t col)
 Substraction of two q31 matrices. More...
 
static void hpm_dsp_mat_trans_f64 (const float64_t *src, float64_t *dst, uint32_t row, uint32_t col)
 Transpose the double-precision floating-potint matrices. More...
 
static void hpm_dsp_mat_trans_f32 (const float32_t *src, float32_t *dst, uint32_t row, uint32_t col)
 Transpose the floating-potint matricex. More...
 
static void hpm_dsp_mat_trans_q15 (const q15_t *src, q15_t *dst, uint32_t row, uint32_t col)
 Transpose the q15 matricex. More...
 
static void hpm_dsp_mat_trans_q31 (const q31_t *src, q31_t *dst, uint32_t row, uint32_t col)
 Transpose the q31 matricex. More...
 
static void hpm_dsp_mat_trans_u8 (const uint8_t *src, uint8_t *dst, uint32_t row, uint32_t col)
 Transpose the u8 matricex. More...
 
static void hpm_dsp_mat_trans_q7 (const q7_t *src, q7_t *dst, uint32_t row, uint32_t col)
 Transpose the q7 matrices. More...
 
static void hpm_dsp_mat_oprod_q31 (const q31_t *src1, const q31_t *src2, q31_t *dst, uint32_t size1, uint32_t size2)
 Outer production of two q31 matrices. More...
 
static void hpm_dsp_mat_mul_mxv_f32 (const float32_t *src1, const float32_t *src2, float32_t *dst, uint32_t row, uint32_t col)
 Matrix multiply vector for f32 formats. More...
 
static void hpm_dsp_mat_mul_mxv_q15 (const q15_t *src1, const q15_t *src2, q15_t *dst, uint32_t row, uint32_t col)
 Matrix multiply vector for q15 formats. More...
 
static void hpm_dsp_mat_mul_mxv_q31 (const q31_t *src1, const q31_t *src2, q31_t *dst, uint32_t row, uint32_t col)
 Matrix multiply vector for q31 formats. More...
 
static void hpm_dsp_mat_mul_mxv_q7 (const q7_t *src1, const q7_t *src2, q7_t *dst, uint32_t row, uint32_t col)
 Matrix multiply vector for q7 formats. More...
 

Detailed Description

This set of functions provides basic matrix math operations. The funciotn specifies the size of the matrix and then points to an array. For example, the function definition for the floating-point is shown below:

    void riscv_dsp_funcname_f32(const float32_t *src1,
                            const float32_t *src2,
                                  float32_t *dst,
                                  uint32_t row,
                                  uint32_t col,
                                  uint32_t row2,
                                  uint32_t col2)

where it can be transform to the two matrix. For the matrix 1 is a row * col matrix and the matrix 2 is a rol2 * col2 and the output matrix woild be different since the math operation. There are similar definitions for Q15 and Q31 data types.

Function Documentation

◆ hpm_dsp_cmat_mul_f32()

static void hpm_dsp_cmat_mul_f32 ( const float32_t *  src1,
const float32_t *  src2,
float32_t *  dst,
uint32_t  row,
uint32_t  col,
uint32_t  col2 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplication of two floating-point complex matrices.

Parameters
[in]*src1points to the first input complex matrix.
[in]*src2points to the second input complex matrix.
[out]*dstpoints to the output complex matrix.
[in]rownumber of the first input matrix rows.
[in]colnumber of the first input matrix columns.
[in]col2number of the second input matrix columns.

◆ hpm_dsp_cmat_mul_q15()

static void hpm_dsp_cmat_mul_q15 ( const q15_t *  src1,
const q15_t *  src2,
q15_t *  dst,
uint32_t  row,
uint32_t  col,
uint32_t  col2 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplication of two q15 complex matrices.

Parameters
[in]*src1points to the first input complex matrix.
[in]*src2points to the second input complex matrix.
[out]*dstpoints to the output complex matrix.
[in]rownumber of the first input matrix rows.
[in]colnumber of the first input matrix columns.
[in]col2number of the second input matrix columns.

Function notes:

The 1.15 format input is multiplied yields a 2.30 format, and then added without saturation to a 64-bit accumulator in 34.30 format. Finally, the added output is truncated to 34.15 format by discarding the lower 15 bits, and then saturated to yield a result in 1.15 format.

◆ hpm_dsp_cmat_mul_q31()

static void hpm_dsp_cmat_mul_q31 ( const q31_t *  src1,
const q31_t *  src2,
q31_t *  dst,
uint32_t  row,
uint32_t  col,
uint32_t  col2 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplication of two q31 complex matrices.

Parameters
[in]*src1points to the first input complex matrix.
[in]*src2points to the second input complex matrix.
[out]*dstpoints to the output complex matrix.
[in]rownumber of the first input matrix rows.
[in]colnumber of the first input matrix columns.
[in]col2number of the second input matrix columns.

Function notes:

The 1.31 format input is multiplied yields a 2.62 format. In order to avoid overflows, the input signal must be scaled down by log2(col) bits, Finally, the 2.62 accumulator is right shifted by 31 bits to yield a 1.31 format value.

◆ hpm_dsp_mat_add_f32()

static void hpm_dsp_mat_add_f32 ( const float32_t *  src1,
const float32_t *  src2,
float32_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Addition of two floating-potint matrices.

Parameters
[in]*src1points to the first input matrix.
[in]*src2points to the second input matrix.
[out]*dstpoints to the output matrix.
[in]rownumber of the matrix rows.
[in]colnumber of the matrix columns.

◆ hpm_dsp_mat_add_q15()

static void hpm_dsp_mat_add_q15 ( const q15_t *  src1,
const q15_t *  src2,
q15_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Addition of two q15 matrices.

Parameters
[in]*src1points to the first input matrix.
[in]*src2points to the second input matrix.
[out]*dstpoints to the output matrix.
[in]rownumber of the matrix rows.
[in]colnumber of the matrix columns.

The output results will be saturated in Q15 range [0x8000 0x7FFF].

◆ hpm_dsp_mat_add_q31()

static void hpm_dsp_mat_add_q31 ( const q31_t *  src1,
const q31_t *  src2,
q31_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Addition of two q31 matrices.

Parameters
[in]*src1points to the first input matrix.
[in]*src2points to the second input matrix.
[out]*dstpoints to the output matrix.
[in]rownumber of the matrix rows.
[in]colnumber of the matrix columns.

Ouput results will be saturated in Q31 range [0x80000000 0x7FFFFFFF].

◆ hpm_dsp_mat_inv_f32()

static int32_t hpm_dsp_mat_inv_f32 ( float32_t *  src,
float32_t *  dst,
uint32_t  size 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Compute the inverse matrix of the floating-potint matrix.

Parameters
[in]*srcpoints to the input matrix.
[out]*dstpoints to the output matrix.
[in]sizenumber of the matrix row or column.
Returns
the inverse process success or not.

◆ hpm_dsp_mat_inv_f64()

static int32_t hpm_dsp_mat_inv_f64 ( float64_t *  src,
float64_t *  dst,
uint32_t  size 
)
inlinestatic

◆ hpm_dsp_mat_mul_f32()

static void hpm_dsp_mat_mul_f32 ( const float32_t *  src1,
const float32_t *  src2,
float32_t *  dst,
uint32_t  row,
uint32_t  col,
uint32_t  col2 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplication of two floating-point matrices.

Parameters
[in]*src1points to the first input matrix.
[in]*src2points to the second input matrix.
[out]*dstpoints to the output matrix.
[in]rownumber of the first input matrix rows.
[in]colnumber of the first input matrix columns.
[in]col2number of the second input matrix columns.

◆ hpm_dsp_mat_mul_f64()

static void hpm_dsp_mat_mul_f64 ( const float64_t *  src1,
const float64_t *  src2,
float64_t *  dst,
uint32_t  row,
uint32_t  col,
uint32_t  col2 
)
inlinestatic

◆ hpm_dsp_mat_mul_fast_q15()

static void hpm_dsp_mat_mul_fast_q15 ( const q15_t *  src1,
const q15_t *  src2,
q15_t *  dst,
uint32_t  row,
uint32_t  col,
uint32_t  col2 
)
inlinestatic

◆ hpm_dsp_mat_mul_fast_q31()

static void hpm_dsp_mat_mul_fast_q31 ( const q31_t *  src1,
const q31_t *  src2,
q31_t *  dst,
uint32_t  row,
uint32_t  col,
uint32_t  col2 
)
inlinestatic

◆ hpm_dsp_mat_mul_mxv_f32()

static void hpm_dsp_mat_mul_mxv_f32 ( const float32_t *  src1,
const float32_t *  src2,
float32_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Matrix multiply vector for f32 formats.

Parameters
[in]src1pointer of the input matrix
[in]src2pointer of the input vector
[out]dstpointer of the output vector
[in]rownumber of rows in the matrix
[in]colnumber of columns in the matrix and the elements size of vector

Example


    #define Arow               2
    #define Acol               3
    float32_t src1[Arow * Acol] = {0.1, -0.1, 0.1, 0.2, -0.2, 0.3};
    float32_t src2[Acol] = {0.2, -0.1, -0.7};
    float32_t dst[Arow];
    hpm_dsp_mat_mul_mxv_f32 (src1, src2, dst, Arow, Acol);

This example also serves as a reference for examples of Q31, Q15 or Q7 functions.
 

◆ hpm_dsp_mat_mul_mxv_q15()

static void hpm_dsp_mat_mul_mxv_q15 ( const q15_t *  src1,
const q15_t *  src2,
q15_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Matrix multiply vector for q15 formats.

Parameters
[in]src1pointer of the input matrix
[in]src2pointer of the input vector
[out]dstpointer of the output vector
[in]rownumber of rows in the matrix
[in]colnumber of columns in the matrix and the elements size of vector

◆ hpm_dsp_mat_mul_mxv_q31()

static void hpm_dsp_mat_mul_mxv_q31 ( const q31_t *  src1,
const q31_t *  src2,
q31_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Matrix multiply vector for q31 formats.

Parameters
[in]src1pointer of the input matrix
[in]src2pointer of the input vector
[out]dstpointer of the output vector
[in]rownumber of rows in the matrix
[in]colnumber of columns in the matrix and the elements size of vector

◆ hpm_dsp_mat_mul_mxv_q7()

static void hpm_dsp_mat_mul_mxv_q7 ( const q7_t *  src1,
const q7_t *  src2,
q7_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Matrix multiply vector for q7 formats.

Parameters
[in]src1pointer of the input matrix
[in]src2pointer of the input vector
[out]dstpointer of the output vector
[in]rownumber of rows in the matrix
[in]colnumber of columns in the matrix and the elements size of vector

◆ hpm_dsp_mat_mul_q15()

static void hpm_dsp_mat_mul_q15 ( const q15_t *  src1,
const q15_t *  src2,
q15_t *  dst,
uint32_t  row,
uint32_t  col,
uint32_t  col2 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplication of two q15 matrices.

Parameters
[in]*src1points to the first input matrix.
[in]*src2points to the second input matrix.
[out]*dstpoints to the output matrix.
[in]rownumber of the first input matrix rows.
[in]colnumber of the first input matrix columns.
[in]col2number of the second input matrix columns.

Function notes:

The 1.15 format input is multiplied yields a 2.30 format, and then added without saturation to a 64-bit accumulator in 34.30 format. Finally, the added output is truncated to 34.15 format by discarding the lower 15 bits, and then saturated to yield a result in 1.15 format.

◆ hpm_dsp_mat_mul_q31()

static void hpm_dsp_mat_mul_q31 ( const q31_t *  src1,
const q31_t *  src2,
q31_t *  dst,
uint32_t  row,
uint32_t  col,
uint32_t  col2 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplication of two q31 matrices.

Parameters
[in]*src1points to the first input matrix.
[in]*src2points to the second input matrix.
[out]*dstpoints to the output matrix.
[in]rownumber of the first input matrix rows.
[in]colnumber of the first input matrix columns.
[in]col2number of the second input matrix columns.

Function notes:

The 1.31 format input is multiplied yields a 2.62 format. In order to avoid overflows, the input signal must be scaled down by log2(col) bits, Finally, the 2.62 accumulator is right shifted by 31 bits to yield a 1.31 format value.

◆ hpm_dsp_mat_mul_q7()

static void hpm_dsp_mat_mul_q7 ( const q7_t *  src1,
const q7_t *  src2,
q7_t *  dst,
uint32_t  row,
uint32_t  col,
uint32_t  col2 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplication of two q7 matrices.

Parameters
[in]*src1points to the first input matrix.
[in]*src2points to the second input matrix.
[out]*dstpoints to the output matrix.
[in]rownumber of the first input matrix rows.
[in]colnumber of the first input matrix columns.
[in]col2number of the second input matrix columns.

Function notes:

The 1.7 format input is multiplied yields a 2.15 format, and then added without saturation to a 32-bit accumulator in 17.15 format. Finally, the added output is truncated to 17.7 format by discarding the lower 7 bits, and then saturated to yield a result in 1.7 format.

◆ hpm_dsp_mat_mul_vxm_q7()

static void hpm_dsp_mat_mul_vxm_q7 ( const q7_t *  src1,
const q7_t *  src2,
q7_t *  dst,
uint32_t  col,
uint32_t  col2 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplication of q7 vetor by matrix.

Parameters
[in]*src1points to the first input vector.
[in]*src2points to the second input matrix.
[out]*dstpoints to the output vector.
[in]colnumber of the first input vector columns.
[in]col2number of the second input matrix columns.

Function notes:

The 1.7 format input is multiplied yields a 2.15 format, and then added without saturation to a 32-bit accumulator in 17.15 format. Finally, the added output is truncated to 17.7 format by discarding the lower 7 bits, and then saturated to yield a result in 1.7 format.

◆ hpm_dsp_mat_oprod_q31()

static void hpm_dsp_mat_oprod_q31 ( const q31_t *  src1,
const q31_t *  src2,
q31_t *  dst,
uint32_t  size1,
uint32_t  size2 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Outer production of two q31 matrices.

Parameters
[in]src1pointer of the first input matrix with a size of size1*1
[in]src2pointer of the second input matrix with a size of 1*size2
[out]dstpointer of the output matrix with a size of size1 * size2
[in]size1number of rows in the first input matrix.
[in]size2number of columns in the second input matrix.

Note:

This function multiplies a one-column matrix with size1 rows, src1[size1, 1], with a one-row matrix with size2 columns, src2[1, size2], and stores the result into a matrix with size1 rows and size2 columns, dst[size1, size2]. It achieves better efficiency for vector-wise matrix multiplication than for regular matrix multiplication.

Example

The following equation shows the outer product of two matrices and its result.


Its code example is as follows:

     #define Arow 3
     #define Bcol 2
     q31_t src1[Arow] = {0x200000, 0x100000, 0x50000};
     q31_t src2[Bcol] = {0x10000, 0x30000};
     q31_t dst[Arow * Bcol];
     hpm_dsp_mat_oprod_q31 (src1, src2, dst, Arow, Bcol);
    

◆ hpm_dsp_mat_pwr2_cache_f64()

static int32_t hpm_dsp_mat_pwr2_cache_f64 ( const float64_t *  src,
float64_t *  dst,
uint32_t  size 
)
inlinestatic

◆ hpm_dsp_mat_scale_f32()

static void hpm_dsp_mat_scale_f32 ( const float32_t *  src,
float32_t  scale,
float32_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplt a scale value of floating-potint matrix.

Parameters
[in]*srcpoints to the input matrix.
[in]scaleis the factor to be multiplied.
[out]*dstpoints to the output matrix.
[in]rownumber of the matrix rows.
[in]colnumber of the matrix columns.

◆ hpm_dsp_mat_scale_q15()

static void hpm_dsp_mat_scale_q15 ( const q15_t *  src,
q15_t  scale_fract,
int32_t  shift,
q15_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplt a scale value of q15 matrix.

Parameters
[in]*srcpoints to the input matrix.
[in]scale_fractfractional multiplication.
[in]shiftarithmetic shift.
[out]*dstpoints to the output matrix.
[in]rownumber of the matrix rows.
[in]colnumber of the matrix columns.

Function notes:

The 1.15 format inputs are multiplied to yield a 2.30 intermediate result and this is shifted with saturation to 1.15 format.

◆ hpm_dsp_mat_scale_q31()

static void hpm_dsp_mat_scale_q31 ( const q31_t *  src,
q31_t  scale_fract,
int32_t  shift,
q31_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Multiplt a scale value of q31 matrix.

Parameters
[in]*srcpoints to the input matrix.
[in]scale_fractfractional multiplication.
[in]shiftarithmetic shift.
[out]*dstpoints to the output matrix.
[in]rownumber of the matrix rows.
[in]colnumber of the matrix columns.

Function notes:

The 1.31 format input are multiplied to yield a 2.62 intermediate result and this is shifted with saturation to 1.31 format.

◆ hpm_dsp_mat_sub_f32()

static void hpm_dsp_mat_sub_f32 ( const float32_t *  src1,
const float32_t *  src2,
float32_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Substraction of two floating-potint matrices.

Parameters
[in]*src1points to the first input matrix.
[in]*src2points to the second input matrix.
[out]*dstpoints to the output matrix.
[in]rownumber of the matrix rows.
[in]colnumber of the matrix columns.

◆ hpm_dsp_mat_sub_f64()

static void hpm_dsp_mat_sub_f64 ( const float64_t *  src1,
const float64_t *  src2,
float64_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Substraction of two double-precision floating-potint matrices.

Parameters
[in]src1pointer of the first input matrix
[in]src2pointer of the second input matrix
[out]dstpointer of the output matrix
[in]rownumber of rows in a matrix
[in]colnumber of columns in a matrix

◆ hpm_dsp_mat_sub_q15()

static void hpm_dsp_mat_sub_q15 ( const q15_t *  src1,
const q15_t *  src2,
q15_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Substraction of two q15 matrices.

Parameters
[in]*src1points to the first input matrix.
[in]*src2points to the second input matrix.
[out]*dstpoints to the output matrix.
[in]rownumber of the matrix rows.
[in]colnumber of the matrix columns.

The output results will be saturated in Q15 range [0x8000 0x7FFF].

◆ hpm_dsp_mat_sub_q31()

static void hpm_dsp_mat_sub_q31 ( const q31_t *  src1,
const q31_t *  src2,
q31_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Substraction of two q31 matrices.

Parameters
[in]*src1points to the first input matrix.
[in]*src2points to the second input matrix.
[out]*dstpoints to the output matrix.
[in]rownumber of the matrix rows.
[in]colnumber of the matrix columns.

Ouput results will be saturated in Q31 range [0x80000000 0x7FFFFFFF].

◆ hpm_dsp_mat_trans_f32()

static void hpm_dsp_mat_trans_f32 ( const float32_t *  src,
float32_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Transpose the floating-potint matricex.

Parameters
[in]*srcpoints to the input matrix.
[out]*dstpoints to the output matrix.
[in]rownumber of the matrix rows.
[in]colnumber of the matrix columns.

◆ hpm_dsp_mat_trans_f64()

static void hpm_dsp_mat_trans_f64 ( const float64_t *  src,
float64_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Transpose the double-precision floating-potint matrices.

Parameters
[in]srcpointer of the input matrix
[out]dstpointer of the output matrix
[in]rownumber of rows in a matrix
[in]colnumber of columns in a matrix

◆ hpm_dsp_mat_trans_q15()

static void hpm_dsp_mat_trans_q15 ( const q15_t *  src,
q15_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Transpose the q15 matricex.

Parameters
[in]*srcpoints to the input matrix.
[out]*dstpoints to the output matrix.
[in]rownumber of the matrix rows.
[in]colnumber of the matrix columns.

◆ hpm_dsp_mat_trans_q31()

static void hpm_dsp_mat_trans_q31 ( const q31_t *  src,
q31_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Transpose the q31 matricex.

Parameters
[in]*srcpoints to the input matrix.
[out]*dstpoints to the output matrix.
[in]rownumber of the matrix rows.
[in]colnumber of the matrix columns.

◆ hpm_dsp_mat_trans_q7()

static void hpm_dsp_mat_trans_q7 ( const q7_t *  src,
q7_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Transpose the q7 matrices.

Parameters
[in]srcpointer of the input matrix
[out]dstpointer of the output matrix
[in]rownumber of rows in a matrix
[in]colnumber of columns in a matrix

◆ hpm_dsp_mat_trans_u8()

static void hpm_dsp_mat_trans_u8 ( const uint8_t *  src,
uint8_t *  dst,
uint32_t  row,
uint32_t  col 
)
inlinestatic

#include <middleware/hpm_math/hpm_math.h>

Transpose the u8 matricex.

Parameters
[in]*srcpoints to the input matrix.
[out]*dstpoints to the output matrix.
[in]rownumber of the matrix rows.
[in]colnumber of the matrix columns.