feat(quadrature): quadrature system brought over
Ported and dramatically cleaned up the quadrature system. This includes centralizing all field definitions
This commit is contained in:
@@ -1,26 +1,17 @@
|
||||
#include "serif/utils/misc/finite.hpp"
|
||||
#include "serif/utils/error/codes.hpp"
|
||||
#include <limits>
|
||||
|
||||
enum class [[maybe_unused]] TestErrorCode {
|
||||
NotFinite
|
||||
};
|
||||
|
||||
namespace {
|
||||
class test_exception : public std::runtime_error {
|
||||
public:
|
||||
test_exception(TestErrorCode error_code, const std::string& message)
|
||||
: std::runtime_error(message), m_error_code(error_code) {}
|
||||
|
||||
TestErrorCode error_code() const noexcept {
|
||||
return m_error_code;
|
||||
}
|
||||
private:
|
||||
TestErrorCode m_error_code;
|
||||
test_exception(const std::string& message)
|
||||
: std::runtime_error(message) {}
|
||||
};
|
||||
}
|
||||
|
||||
int main() {
|
||||
double a = std::numeric_limits<double>::infinity();
|
||||
|
||||
serif::utils::misc::validate_finite<test_exception>(a, TestErrorCode::NotFinite);
|
||||
serif::utils::misc::validate_finite<test_exception, serif::utils::errors::SERiFErrorCode::NON_FINITE_VALUE_ERROR>(a);
|
||||
}
|
||||
Reference in New Issue
Block a user