31 lines
962 B
C++
31 lines
962 B
C++
#ifndef FESA_SOLVERS_LINEAR_LINEAR_SOLVER_H_
|
|
#define FESA_SOLVERS_LINEAR_LINEAR_SOLVER_H_
|
|
|
|
#include "fesa/core/status.h"
|
|
|
|
namespace fesa {
|
|
|
|
class SparseMatrix;
|
|
class Vector;
|
|
|
|
/// @brief Separates reusable factorization from RHS substitution.
|
|
class LinearSolver {
|
|
public:
|
|
/// @brief Destroys a backend-neutral linear solver.
|
|
virtual ~LinearSolver() = default;
|
|
|
|
/// @brief Factorizes a validated free-equation matrix for reuse.
|
|
/// @return Success or a structured solver failure.
|
|
virtual Status Factorize(const SparseMatrix& matrix) = 0;
|
|
|
|
/// @brief Substitutes one right-hand side using retained factorization.
|
|
/// @param rhs Immutable right-hand side in free-equation order.
|
|
/// @param solution Updated only after successful finite substitution.
|
|
/// @return Success or a structured solver failure.
|
|
virtual Status Solve(const Vector& rhs, Vector& solution) const = 0;
|
|
};
|
|
|
|
} // namespace fesa
|
|
|
|
#endif // FESA_SOLVERS_LINEAR_LINEAR_SOLVER_H_
|