7 rng = np.random.default_rng()
9 A = rng.random((rows, cols))
12 householder_qr = eigenpy.HouseholderQR()
13 householder_qr = eigenpy.HouseholderQR(rows, cols)
14 householder_qr = eigenpy.HouseholderQR(A)
16 householder_qr_eye = eigenpy.HouseholderQR(np.eye(rows, rows))
17 X = rng.random((rows, 20))
18 assert householder_qr_eye.absDeterminant() == 1.0
19 assert householder_qr_eye.logAbsDeterminant() == 0.0
21 Y = householder_qr_eye.solve(X)
25 fullpiv_householder_qr = eigenpy.FullPivHouseholderQR()
26 fullpiv_householder_qr = eigenpy.FullPivHouseholderQR(rows, cols)
27 fullpiv_householder_qr = eigenpy.FullPivHouseholderQR(A)
29 fullpiv_householder_qr = eigenpy.FullPivHouseholderQR(np.eye(rows, rows))
30 X = rng.random((rows, 20))
31 assert fullpiv_householder_qr.absDeterminant() == 1.0
32 assert fullpiv_householder_qr.logAbsDeterminant() == 0.0
34 Y = fullpiv_householder_qr.solve(X)
36 assert fullpiv_householder_qr.rank() == rows
38 fullpiv_householder_qr.setThreshold(1e-8)
39 assert fullpiv_householder_qr.threshold() == 1e-8
43 colpiv_householder_qr = eigenpy.ColPivHouseholderQR()
44 colpiv_householder_qr = eigenpy.ColPivHouseholderQR(rows, cols)
45 colpiv_householder_qr = eigenpy.ColPivHouseholderQR(A)
47 colpiv_householder_qr = eigenpy.ColPivHouseholderQR(np.eye(rows, rows))
48 X = rng.random((rows, 20))
49 assert colpiv_householder_qr.absDeterminant() == 1.0
50 assert colpiv_householder_qr.logAbsDeterminant() == 0.0
52 Y = colpiv_householder_qr.solve(X)
54 assert colpiv_householder_qr.rank() == rows
56 colpiv_householder_qr.setThreshold(1e-8)
57 assert colpiv_householder_qr.threshold() == 1e-8
61 cod = eigenpy.CompleteOrthogonalDecomposition()
62 cod = eigenpy.CompleteOrthogonalDecomposition(rows, cols)
63 cod = eigenpy.CompleteOrthogonalDecomposition(A)
65 cod = eigenpy.CompleteOrthogonalDecomposition(np.eye(rows, rows))
66 X = rng.random((rows, 20))
67 assert cod.absDeterminant() == 1.0
68 assert cod.logAbsDeterminant() == 0.0
72 assert cod.rank() == rows
74 cod.setThreshold(1e-8)
75 assert cod.threshold() == 1e-8