From 0f17f188fb6338e8a2ec675e982ad50d87e534c6 Mon Sep 17 00:00:00 2001 From: Julian Litz <91479202+julianlitz@users.noreply.github.com> Date: Mon, 20 Apr 2026 18:53:55 +0200 Subject: [PATCH 1/2] Update csr_lu_solver.h --- include/LinearAlgebra/Solvers/csr_lu_solver.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/include/LinearAlgebra/Solvers/csr_lu_solver.h b/include/LinearAlgebra/Solvers/csr_lu_solver.h index 89a1e59a..53ab0cfa 100644 --- a/include/LinearAlgebra/Solvers/csr_lu_solver.h +++ b/include/LinearAlgebra/Solvers/csr_lu_solver.h @@ -60,7 +60,6 @@ class SparseLUSolver * @param b Right-hand side vector (modified in place to contain the solution). */ void solveInPlace(Vector b) const; - void solveInPlace(T* b) const; private: // LU decomposition data structures @@ -130,16 +129,6 @@ SparseLUSolver::SparseLUSolver(const SparseMatrixCSR& A, T tolerance_abs, */ template void SparseLUSolver::solveInPlace(Vector b) const -{ - solveInPlace(b.data()); -} - -/** - * Solves Ax = b for raw pointer - * @param b - Right-hand side vector (overwritten with solution) - */ -template -void SparseLUSolver::solveInPlace(T* b) const { assert(factorized_); const int n = perm.size(); From a97ba31b0e6544a274d564f30847d918ed3bf969 Mon Sep 17 00:00:00 2001 From: Julian Litz <91479202+julianlitz@users.noreply.github.com> Date: Mon, 20 Apr 2026 18:56:02 +0200 Subject: [PATCH 2/2] Update csr_lu_solver.h --- include/LinearAlgebra/Solvers/csr_lu_solver.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/LinearAlgebra/Solvers/csr_lu_solver.h b/include/LinearAlgebra/Solvers/csr_lu_solver.h index 53ab0cfa..5f32507a 100644 --- a/include/LinearAlgebra/Solvers/csr_lu_solver.h +++ b/include/LinearAlgebra/Solvers/csr_lu_solver.h @@ -59,7 +59,7 @@ class SparseLUSolver * * @param b Right-hand side vector (modified in place to contain the solution). */ - void solveInPlace(Vector b) const; + void solveInPlace(Vector& b) const; private: // LU decomposition data structures @@ -75,7 +75,7 @@ class SparseLUSolver // Core methods void factorize(const SparseMatrixCSR& A); - void solveInPlacePermuted(T* b) const; + void solveInPlacePermuted(Vector& b) const; // Reordering and permutation utilities std::vector computeRCM(const SparseMatrixCSR& A) const; @@ -128,7 +128,7 @@ SparseLUSolver::SparseLUSolver(const SparseMatrixCSR& A, T tolerance_abs, * @param b - Right-hand side vector (overwritten with solution) */ template -void SparseLUSolver::solveInPlace(Vector b) const +void SparseLUSolver::solveInPlace(Vector& b) const { assert(factorized_); const int n = perm.size(); @@ -142,7 +142,7 @@ void SparseLUSolver::solveInPlace(Vector b) const } // Solve permuted system - solveInPlacePermuted(b_perm.data()); + solveInPlacePermuted(b_perm); // Unpermute solution: x = P^T * x_perm for (int i = 0; i < n; i++) { @@ -155,7 +155,7 @@ void SparseLUSolver::solveInPlace(Vector b) const * @param b - Permuted right-hand side vector (overwritten with solution) */ template -void SparseLUSolver::solveInPlacePermuted(T* b) const +void SparseLUSolver::solveInPlacePermuted(Vector& b) const { const int n = L_row_ptr.size() - 1;