summaryrefslogtreecommitdiff
path: root/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/MatrixFunctions/mat_trans.c
diff options
context:
space:
mode:
authorjoshua <joshua@joshuayun.com>2023-12-30 23:54:31 -0500
committerjoshua <joshua@joshuayun.com>2023-12-30 23:54:31 -0500
commit86608c6770cf08c138a2bdab5855072f64be09ef (patch)
tree494a61b3ef37e76f9235a0d10f5c93d97290a35f /Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/MatrixFunctions/mat_trans.c
downloadsdr-software-master.tar.gz
initial commitHEADmaster
Diffstat (limited to 'Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/MatrixFunctions/mat_trans.c')
-rw-r--r--Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/MatrixFunctions/mat_trans.c77
1 files changed, 77 insertions, 0 deletions
diff --git a/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/MatrixFunctions/mat_trans.c b/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/MatrixFunctions/mat_trans.c
new file mode 100644
index 0000000..8cb9a8d
--- /dev/null
+++ b/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/MatrixFunctions/mat_trans.c
@@ -0,0 +1,77 @@
+#include "ref.h"
+
+arm_status ref_mat_trans_f64(
+ const arm_matrix_instance_f64 * pSrc,
+ arm_matrix_instance_f64 * pDst)
+{
+ uint64_t r,c;
+ uint64_t numR = pSrc->numRows;
+ uint64_t numC = pSrc->numCols;
+
+ for(r=0;r<numR;r++)
+ {
+ for(c=0;c<numC;c++)
+ {
+ pDst->pData[c*numR + r] = pSrc->pData[r*numC + c];
+ }
+ }
+
+ return ARM_MATH_SUCCESS;
+}
+
+arm_status ref_mat_trans_f32(
+ const arm_matrix_instance_f32 * pSrc,
+ arm_matrix_instance_f32 * pDst)
+{
+ uint32_t r,c;
+ uint32_t numR = pSrc->numRows;
+ uint32_t numC = pSrc->numCols;
+
+ for(r=0;r<numR;r++)
+ {
+ for(c=0;c<numC;c++)
+ {
+ pDst->pData[c*numR + r] = pSrc->pData[r*numC + c];
+ }
+ }
+
+ return ARM_MATH_SUCCESS;
+}
+
+arm_status ref_mat_trans_q31(
+ const arm_matrix_instance_q31 * pSrc,
+ arm_matrix_instance_q31 * pDst)
+{
+ uint32_t r,c;
+ uint32_t numR = pSrc->numRows;
+ uint32_t numC = pSrc->numCols;
+
+ for(r=0;r<numR;r++)
+ {
+ for(c=0;c<numC;c++)
+ {
+ pDst->pData[c*numR + r] = pSrc->pData[r*numC + c];
+ }
+ }
+
+ return ARM_MATH_SUCCESS;
+}
+
+arm_status ref_mat_trans_q15(
+ const arm_matrix_instance_q15 * pSrc,
+ arm_matrix_instance_q15 * pDst)
+{
+ uint32_t r,c;
+ uint32_t numR = pSrc->numRows;
+ uint32_t numC = pSrc->numCols;
+
+ for(r=0;r<numR;r++)
+ {
+ for(c=0;c<numC;c++)
+ {
+ pDst->pData[c*numR + r] = pSrc->pData[r*numC + c];
+ }
+ }
+
+ return ARM_MATH_SUCCESS;
+}