Commit 5f5086fa authored by Christophe Favergeon's avatar Christophe Favergeon
Browse files

Correct issue #172 : singular matrix inversion

parent 03fa0e5c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -155,6 +155,9 @@ arm_status arm_mat_inverse_f16(
    /* Index modifier to navigate through the columns */
    for(column = 0U; column < numCols; column++)
    {
      /* reset flag */
      flag = 0; 
      
      /* Check if the pivot element is zero..
       * If it is zero then interchange the row with non zero row below.
       * If there is no non zero element to replace in the rows below,
+3 −0
Original line number Diff line number Diff line
@@ -188,6 +188,9 @@ arm_status arm_mat_inverse_f32(
    /* Index modifier to navigate through the columns */
    for(column = 0U; column < numCols; column++)
    {
      /* reset flag */
      flag = 0; 
      
      /* Check if the pivot element is zero..
       * If it is zero then interchange the row with non zero row below.
       * If there is no non zero element to replace in the rows below,
+3 −0
Original line number Diff line number Diff line
@@ -153,6 +153,9 @@ arm_status arm_mat_inverse_f64(
    /* Index modifier to navigate through the columns */
    for(column = 0U; column < numCols; column++)
    {
      /* reset flag */
      flag = 0; 
      
      /* Check if the pivot element is zero..
       * If it is zero then interchange the row with non zero row below.
       * If there is no non zero element to replace in the rows below,
+12 −3
Original line number Diff line number Diff line
@@ -806,6 +806,15 @@ def writeUnaryTests(config,format):
    r = np.linalg.inv(ma)
    vals = vals + list(r.reshape(4))
    dims.append(2)

    # Add matrix for testing singular matrix

    ma = np.array([[1., 2.], [2., 4.]])
    inp = inp + list(ma.reshape(4))

    r = np.array([0.,0.5,1.0,-0.5])
    vals = vals + list(r)
    dims.append(2)
    #
    config.writeInputS16(1, dims,"DimsInvert")
    config.writeInput(1, inp,"InputInvert")
@@ -1197,9 +1206,9 @@ def generatePatterns():
    configUnaryq15.setOverwrite(False)
    configUnaryq7.setOverwrite(False)
    
    #writeUnaryTests(configUnaryf64,Tools.F64)
    #writeUnaryTests(configUnaryf32,Tools.F32)
    #writeUnaryTests(configUnaryf16,Tools.F16)
    writeUnaryTests(configUnaryf64,Tools.F64)
    writeUnaryTests(configUnaryf32,Tools.F32)
    writeUnaryTests(configUnaryf16,Tools.F16)
    #writeUnaryTests(configUnaryq31,Tools.Q31)
    #writeUnaryTests(configUnaryq31,Tools.Q31)
    #writeUnaryTests(configUnaryq15,Tools.Q15)
+3 −1
Original line number Diff line number Diff line
H
10
11
// 1
0x0001
// 2
@@ -20,3 +20,5 @@ H
0x0010
// 2
0x0002
// 2
0x0002
Loading