#pragma once #include "fesa/Core/Types.hpp" #include #include namespace fesa { struct SparsePatternEntry { EquationId row = 0; EquationId col = 0; }; struct SparsePattern { EquationId equation_count = 0; std::vector entries; SparseIndex nonzeroCount() const { return static_cast(entries.size()); } bool contains(EquationId row, EquationId col) const { return std::any_of(entries.begin(), entries.end(), [&](const SparsePatternEntry& entry) { return entry.row == row && entry.col == col; }); } }; } // namespace fesa