summaryrefslogtreecommitdiff
path: root/Drivers/CMSIS/DSP/DSP_Lib_TestSuite/RefLibs/src/MatrixFunctions/mat_trans.c
blob: 8cb9a8d230c873cb44afaf3a0b5136199aaae292 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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;
}