Squashed 'third_party/osqp/' content from commit 33454b3e23
Change-Id: I056df0582ca06664e86554c341a94c47ab932001
git-subtree-dir: third_party/osqp
git-subtree-split: 33454b3e236f1f44193bfbbb6b8c8e71f8f04e9a
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/src/error.c b/src/error.c
new file mode 100644
index 0000000..e0c069e
--- /dev/null
+++ b/src/error.c
@@ -0,0 +1,21 @@
+#include "error.h"
+
+const char *OSQP_ERROR_MESSAGE[] = {
+ "Problem data validation.",
+ "Solver settings validation.",
+ "Linear system solver not available.\nTried to obtain it from shared library.",
+ "Linear system solver initialization.",
+ "KKT matrix factorization.\nThe problem seems to be non-convex.",
+ "Memory allocation.",
+ "Solver workspace not initialized.",
+};
+
+
+c_int _osqp_error(enum osqp_error_type error_code,
+ const char * function_name) {
+# ifdef PRINTING
+ c_print("ERROR in %s: %s\n", function_name, OSQP_ERROR_MESSAGE[error_code-1]);
+# endif
+ return (c_int)error_code;
+}
+