CSI-DSP  Version 1.0.0
CSI DSP Software Library
Functions
Matrix Addition

Functions

csky_status csky_mat_add_f32 (const csky_matrix_instance_f32 *pSrcA, const csky_matrix_instance_f32 *pSrcB, csky_matrix_instance_f32 *pDst)
 Floating-point matrix addition. More...
 
csky_status csky_mat_add_q15 (const csky_matrix_instance_q15 *pSrcA, const csky_matrix_instance_q15 *pSrcB, csky_matrix_instance_q15 *pDst)
 Q15 matrix addition. More...
 
csky_status csky_mat_add_q31 (const csky_matrix_instance_q31 *pSrcA, const csky_matrix_instance_q31 *pSrcB, csky_matrix_instance_q31 *pDst)
 Q31 matrix addition. More...
 

Description

Adds two matrices.

MatrixAddition.gif
Addition of two 3 x 3 matrices

The functions check to make sure that pSrcA, pSrcB, and pDst have the same number of rows and columns.

Function Documentation

csky_status csky_mat_add_f32 ( const csky_matrix_instance_f32 pSrcA,
const csky_matrix_instance_f32 pSrcB,
csky_matrix_instance_f32 pDst 
)
Parameters
[in]*pSrcApoints to the first input matrix structure
[in]*pSrcBpoints to the second input matrix structure
[out]*pDstpoints to output matrix structure
Returns
The function returns either CSKY_MATH_SIZE_MISMATCH or CSKY_MATH_SUCCESS based on the outcome of size checking.
csky_status csky_mat_add_q15 ( const csky_matrix_instance_q15 pSrcA,
const csky_matrix_instance_q15 pSrcB,
csky_matrix_instance_q15 pDst 
)
Parameters
[in]*pSrcApoints to the first input matrix structure
[in]*pSrcBpoints to the second input matrix structure
[out]*pDstpoints to output matrix structure
Returns
The function returns either CSKY_MATH_SIZE_MISMATCH or CSKY_MATH_SUCCESS based on the outcome of size checking.

Scaling and Overflow Behavior:

The function uses saturating arithmetic. Results outside of the allowable Q15 range [0x8000 0x7FFF] will be saturated.
csky_status csky_mat_add_q31 ( const csky_matrix_instance_q31 pSrcA,
const csky_matrix_instance_q31 pSrcB,
csky_matrix_instance_q31 pDst 
)
Parameters
[in]*pSrcApoints to the first input matrix structure
[in]*pSrcBpoints to the second input matrix structure
[out]*pDstpoints to output matrix structure
Returns
The function returns either CSKY_MATH_SIZE_MISMATCH or CSKY_MATH_SUCCESS based on the outcome of size checking.

Scaling and Overflow Behavior:

The function uses saturating arithmetic. Results outside of the allowable Q31 range [0x80000000 0x7FFFFFFF] will be saturated.