refactor: extract math solver boundary

This commit is contained in:
NINI
2026-05-05 01:16:26 +09:00
parent fd93bc35b0
commit 34e7d1638f
12 changed files with 353 additions and 189 deletions
+30
View File
@@ -0,0 +1,30 @@
#pragma once
#include "fesa/Core/Types.hpp"
#include <algorithm>
#include <vector>
namespace fesa {
struct SparsePatternEntry {
EquationId row = 0;
EquationId col = 0;
};
struct SparsePattern {
EquationId equation_count = 0;
std::vector<SparsePatternEntry> entries;
SparseIndex nonzeroCount() const {
return static_cast<SparseIndex>(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