Skip to content

LDLT decomposition returns diagonal matrix D non-optimally #119

Open
@yuvpg

Description

@yuvpg

LDL^t decomposition function arm_mat_ldlt_f32 return diagonal matrix D as n×n matrix, but it real application you will probably never need it as a matrix, just n-vector with diagonal values will be sufficient.

For example, when solving system of linear equations with the help of LDLt, in intermediate calculations one should solve equation D.z=y, which is trivial element-by-element vector division z=y/diag(D).

Maybe it is worth considering return D as an vector instead of matrix?

Additionally, the description of permutation vector P in documentation is not complete. It is impossible to understand how to use returned vector pp from documentation. Hopefully in examples there is a piece of python code which describe the intent:

print("LDLT")

def swaprow(m,k,j):
    tmp = np.copy(m[j,:])
    m[j,:] = np.copy(m[k,:])
    m[k,:] = tmp 
    return(m)

# F32 test
status,resl,resd,resperm=dsp.arm_mat_ldlt_f32(a)
n=3
p=np.identity(n)
for k in range(0,n):
    p = swaprow(p,k,resperm[k])

res=resl.dot(resd).dot(resl.T)

permutedSrc=p.dot(a).dot(p.T)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions