Skip to content
Snippets Groups Projects
Unverified Commit 3c818e1c authored by Justin Carpentier's avatar Justin Carpentier
Browse files

test/decompositions: test ColPivHouseholderQR

parent 4f349297
No related branches found
No related tags found
No related merge requests found
Pipeline #41209 passed with warnings
......@@ -38,3 +38,21 @@ assert fullpiv_householder_qr.rank() == rows
fullpiv_householder_qr.setThreshold(1e-8)
assert fullpiv_householder_qr.threshold() == 1e-8
assert eigenpy.is_approx(np.eye(rows, rows), fullpiv_householder_qr.inverse())
# Test ColPivHouseholderQR decomposition
colpiv_householder_qr = eigenpy.ColPivHouseholderQR()
colpiv_householder_qr = eigenpy.ColPivHouseholderQR(rows, cols)
colpiv_householder_qr = eigenpy.ColPivHouseholderQR(A)
colpiv_householder_qr = eigenpy.ColPivHouseholderQR(np.eye(rows, rows))
X = rng.random((rows, 20))
assert colpiv_householder_qr.absDeterminant() == 1.0
assert colpiv_householder_qr.logAbsDeterminant() == 0.0
Y = colpiv_householder_qr.solve(X)
assert (X == Y).all()
assert colpiv_householder_qr.rank() == rows
colpiv_householder_qr.setThreshold(1e-8)
assert colpiv_householder_qr.threshold() == 1e-8
assert eigenpy.is_approx(np.eye(rows, rows), colpiv_householder_qr.inverse())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment