aboutsummaryrefslogtreecommitdiff
path: root/include/linalg_error.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/linalg_error.hpp')
-rw-r--r--include/linalg_error.hpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linalg_error.hpp b/include/linalg_error.hpp
new file mode 100644
index 0000000..8258899
--- /dev/null
+++ b/include/linalg_error.hpp
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <stdexcept>
+#include <string>
+
+namespace linalg {
+
+class LinAlgError : public std::runtime_error {
+public:
+ using std::runtime_error::runtime_error;
+};
+
+class DimensionMismatchError : public LinAlgError {
+public:
+ explicit DimensionMismatchError(const std::string& message)
+ : LinAlgError(message) {}
+};
+
+} // namespace linalg