#pragma once

#include <span>
#include <vector>

#include <fesa/assembly/symmetric_csr.hpp>
#include <fesa/core/diagnostic.hpp>

namespace fesa {

struct LinearSolveResult final {
    std::vector<double> solution;
    double relative_residual{};
    std::vector<Diagnostic> diagnostics;
};

class LinearSolver {
public:
    virtual ~LinearSolver() = default;

    [[nodiscard]] virtual LinearSolveResult solve(
        const SymmetricCsr& matrix,
        std::span<const double> rhs) = 0;
};

}  // namespace fesa
