|
|
|
|
@ -28,6 +28,7 @@
|
|
|
|
|
|
|
|
|
|
#include "dsp/matrix_functions.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ingroup groupMatrix
|
|
|
|
|
*/
|
|
|
|
|
@ -84,7 +85,7 @@ arm_status arm_mat_inverse_f32(
|
|
|
|
|
float32_t *pTmpA, *pTmpB;
|
|
|
|
|
|
|
|
|
|
float32_t in = 0.0f; /* Temporary input values */
|
|
|
|
|
uint32_t i, rowCnt, flag = 0U, j, loopCnt, k, l; /* loop counters */
|
|
|
|
|
uint32_t i, rowCnt, flag = 0U, j, loopCnt, l; /* loop counters */
|
|
|
|
|
arm_status status; /* status of matrix inverse */
|
|
|
|
|
uint32_t blkCnt;
|
|
|
|
|
|
|
|
|
|
@ -208,10 +209,7 @@ arm_status arm_mat_inverse_f32(
|
|
|
|
|
* Temporary variable to hold the pivot value
|
|
|
|
|
*/
|
|
|
|
|
in = *pInT1;
|
|
|
|
|
/*
|
|
|
|
|
* Destination pointer modifier
|
|
|
|
|
*/
|
|
|
|
|
k = 1U;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Check if the pivot element is zero
|
|
|
|
|
@ -227,7 +225,7 @@ arm_status arm_mat_inverse_f32(
|
|
|
|
|
* Update the input and destination pointers
|
|
|
|
|
*/
|
|
|
|
|
pInT2 = pInT1 + (numCols * i);
|
|
|
|
|
pOutT2 = pOutT1 + (numCols * k);
|
|
|
|
|
pOutT2 = pOutT1 + (numCols * i);
|
|
|
|
|
/*
|
|
|
|
|
* Check if there is a non zero pivot element to
|
|
|
|
|
* * replace in the rows below
|
|
|
|
|
@ -317,10 +315,7 @@ arm_status arm_mat_inverse_f32(
|
|
|
|
|
*/
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
* Update the destination pointer modifier
|
|
|
|
|
*/
|
|
|
|
|
k++;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -699,10 +694,6 @@ arm_status arm_mat_inverse_f32(
|
|
|
|
|
/* Temporary variable to hold the pivot value */
|
|
|
|
|
in = *pInT1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Destination pointer modifier */
|
|
|
|
|
k = 1U;
|
|
|
|
|
|
|
|
|
|
/* Check if the pivot element is zero */
|
|
|
|
|
if (*pInT1 == 0.0f)
|
|
|
|
|
{
|
|
|
|
|
@ -711,7 +702,7 @@ arm_status arm_mat_inverse_f32(
|
|
|
|
|
{
|
|
|
|
|
/* Update the input and destination pointers */
|
|
|
|
|
pInT2 = pInT1 + (numCols * i);
|
|
|
|
|
pOutT2 = pOutT1 + (numCols * k);
|
|
|
|
|
pOutT2 = pOutT1 + (numCols * i);
|
|
|
|
|
|
|
|
|
|
/* Check if there is a non zero pivot element to
|
|
|
|
|
* replace in the rows below */
|
|
|
|
|
@ -753,8 +744,7 @@ arm_status arm_mat_inverse_f32(
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Update the destination pointer modifier */
|
|
|
|
|
k++;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -997,7 +987,7 @@ arm_status arm_mat_inverse_f32(
|
|
|
|
|
#if defined (ARM_MATH_DSP)
|
|
|
|
|
|
|
|
|
|
float32_t Xchg, in = 0.0f, in1; /* Temporary input values */
|
|
|
|
|
uint32_t i, rowCnt, flag = 0U, j, loopCnt, k, l; /* loop counters */
|
|
|
|
|
uint32_t i, rowCnt, flag = 0U, j, loopCnt, k,l; /* loop counters */
|
|
|
|
|
arm_status status; /* status of matrix inverse */
|
|
|
|
|
|
|
|
|
|
#ifdef ARM_MATH_MATRIX_CHECK
|
|
|
|
|
@ -1109,8 +1099,6 @@ arm_status arm_mat_inverse_f32(
|
|
|
|
|
in = *pInT1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Destination pointer modifier */
|
|
|
|
|
k = 1U;
|
|
|
|
|
|
|
|
|
|
/* Check if the pivot element is zero */
|
|
|
|
|
if (*pInT1 == 0.0f)
|
|
|
|
|
@ -1121,7 +1109,7 @@ arm_status arm_mat_inverse_f32(
|
|
|
|
|
{
|
|
|
|
|
/* Update the input and destination pointers */
|
|
|
|
|
pInT2 = pInT1 + (numCols * i);
|
|
|
|
|
pOutT2 = pOutT1 + (numCols * k);
|
|
|
|
|
pOutT2 = pOutT1 + (numCols * i);
|
|
|
|
|
|
|
|
|
|
/* Check if there is a non zero pivot element to
|
|
|
|
|
* replace in the rows below */
|
|
|
|
|
@ -1163,8 +1151,6 @@ arm_status arm_mat_inverse_f32(
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Update the destination pointer modifier */
|
|
|
|
|
k++;
|
|
|
|
|
|
|
|
|
|
/* Decrement loop counter */
|
|
|
|
|
}
|
|
|
|
|
@ -1306,7 +1292,7 @@ arm_status arm_mat_inverse_f32(
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
float32_t Xchg, in = 0.0f; /* Temporary input values */
|
|
|
|
|
uint32_t i, rowCnt, flag = 0U, j, loopCnt, k, l; /* loop counters */
|
|
|
|
|
uint32_t i, rowCnt, flag = 0U, j, loopCnt, l; /* loop counters */
|
|
|
|
|
arm_status status; /* status of matrix inverse */
|
|
|
|
|
|
|
|
|
|
#ifdef ARM_MATH_MATRIX_CHECK
|
|
|
|
|
@ -1417,9 +1403,6 @@ arm_status arm_mat_inverse_f32(
|
|
|
|
|
/* Temporary variable to hold the pivot value */
|
|
|
|
|
in = *pInT1;
|
|
|
|
|
|
|
|
|
|
/* Destination pointer modifier */
|
|
|
|
|
k = 1U;
|
|
|
|
|
|
|
|
|
|
/* Check if the pivot element is zero */
|
|
|
|
|
if (*pInT1 == 0.0f)
|
|
|
|
|
{
|
|
|
|
|
@ -1428,7 +1411,7 @@ arm_status arm_mat_inverse_f32(
|
|
|
|
|
{
|
|
|
|
|
/* Update the input and destination pointers */
|
|
|
|
|
pInT2 = pInT1 + (numCols * i);
|
|
|
|
|
pOutT2 = pOutT1 + (numCols * k);
|
|
|
|
|
pOutT2 = pOutT1 + (numCols * i);
|
|
|
|
|
|
|
|
|
|
/* Check if there is a non zero pivot element to
|
|
|
|
|
* replace in the rows below */
|
|
|
|
|
@ -1457,12 +1440,10 @@ arm_status arm_mat_inverse_f32(
|
|
|
|
|
/* Break after exchange is done */
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Update the destination pointer modifier */
|
|
|
|
|
k++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Update the status if the matrix is singular */
|
|
|
|
|
if ((flag != 1U) && (in == 0.0f))
|
|
|
|
|
{
|
|
|
|
|
|