Skip to content

Commit bf345c3

Browse files
committed
Removed ill coded adjoint and transpose in SparseLU
1 parent 6e9e640 commit bf345c3

File tree

2 files changed

+0
-45
lines changed

2 files changed

+0
-45
lines changed

include/nanoeigenpy/decompositions/sparse/sparse-lu.hpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ void exposeSparseLU(nb::module_ m, const char *name) {
6262
using Scalar = typename MatrixType::Scalar;
6363
using RealScalar = typename MatrixType::RealScalar;
6464
using StorageIndex = typename MatrixType::StorageIndex;
65-
using SparseLUTransposeViewTrue = Eigen::SparseLUTransposeView<true, Solver>;
66-
using SparseLUTransposeViewFalse =
67-
Eigen::SparseLUTransposeView<false, Solver>;
6865
using SCMatrix = typename Solver::SCMatrix;
6966
using MappedSparseMatrix =
7067
typename Eigen::MappedSparseMatrix<Scalar, Eigen::ColMajor, StorageIndex>;
@@ -78,20 +75,6 @@ void exposeSparseLU(nb::module_ m, const char *name) {
7875
exposeMatrixL<SCMatrix>(m);
7976
exposeMatrixU<SCMatrix, MappedSparseMatrix>(m);
8077

81-
nb::class_<SparseLUTransposeViewFalse>(m, "SparseLUTransposeView")
82-
.def(SparseSolverBaseVisitor())
83-
.def("setIsInitialized", &SparseLUTransposeViewFalse::setIsInitialized)
84-
.def("setSparseLU", &SparseLUTransposeViewFalse::setSparseLU)
85-
.def("rows", &SparseLUTransposeViewFalse::rows)
86-
.def("cols", &SparseLUTransposeViewFalse::cols);
87-
88-
nb::class_<SparseLUTransposeViewTrue>(m, "SparseLUAdjointView")
89-
.def(SparseSolverBaseVisitor())
90-
.def("setIsInitialized", &SparseLUTransposeViewTrue::setIsInitialized)
91-
.def("setSparseLU", &SparseLUTransposeViewTrue::setSparseLU)
92-
.def("rows", &SparseLUTransposeViewTrue::rows)
93-
.def("cols", &SparseLUTransposeViewTrue::cols);
94-
9578
nb::class_<Solver>(
9679
m, name,
9780
"Sparse supernodal LU factorization for general matrices.\n\n"
@@ -142,22 +125,6 @@ void exposeSparseLU(nb::module_ m, const char *name) {
142125
"matrix.\n\n"
143126
"The input matrix should be in column-major storage.")
144127

145-
.def(
146-
"transpose",
147-
[](Solver &self) -> SparseLUTransposeViewFalse {
148-
auto view = self.transpose();
149-
return view;
150-
},
151-
"Returns an expression of the transposed of the factored matrix.")
152-
153-
.def(
154-
"adjoint",
155-
[](Solver &self) -> SparseLUTransposeViewTrue {
156-
auto view = self.adjoint();
157-
return view;
158-
},
159-
"Returns an expression of the adjoint of the factored matrix.")
160-
161128
.def(
162129
"matrixL", [](const Solver &self) -> LType { return self.matrixL(); },
163130
"Returns an expression of the matrix L.")

tests/test_sparse_lu.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,3 @@
6161
x_reconstructed[P_cols_indices] = y
6262

6363
assert nanoeigenpy.is_approx(x_reconstructed, x_true, 1e-6)
64-
65-
splu_transpose = splu.transpose()
66-
splu_adjoint = splu.adjoint()
67-
68-
x_true = rng.random(dim)
69-
b_transpose = A.T.dot(x_true)
70-
x_est = splu_transpose.solve(b_transpose)
71-
assert nanoeigenpy.is_approx(x_true, x_est)
72-
73-
x_est_adj = splu_adjoint.solve(b_transpose)
74-
assert nanoeigenpy.is_approx(x_true, x_est_adj)
75-
assert nanoeigenpy.is_approx(x_est, x_est_adj)

0 commit comments

Comments
 (0)