vendor/scs/include/glbopts.h in scs-0.3.1 vs vendor/scs/include/glbopts.h in scs-0.3.2
- old
+ new
@@ -3,32 +3,21 @@
#ifdef __cplusplus
extern "C" {
#endif
+#include "scs.h"
#include <math.h>
#ifndef SCS
-#define SCS(x) scs_##x
+#define SCS(x) _scs_##x
#endif
/* SCS VERSION NUMBER ---------------------------------------------- */
-#define SCS_VERSION \
- ("3.0.0") /* string literals automatically null-terminated */
+/* string literals automatically null-terminated */
+#define SCS_VERSION ("3.1.1")
-/* SCS returns one of the following integers: */
-#define SCS_INFEASIBLE_INACCURATE (-7)
-#define SCS_UNBOUNDED_INACCURATE (-6)
-#define SCS_SIGINT (-5)
-#define SCS_FAILED (-4)
-#define SCS_INDETERMINATE (-3)
-#define SCS_INFEASIBLE (-2) /* primal infeasible, dual unbounded */
-#define SCS_UNBOUNDED (-1) /* primal unbounded, dual infeasible */
-#define SCS_UNFINISHED (0) /* never returned, used as placeholder */
-#define SCS_SOLVED (1)
-#define SCS_SOLVED_INACCURATE (2)
-
/* verbosity level */
#ifndef VERBOSITY
#define VERBOSITY (0)
#endif
@@ -52,92 +41,65 @@
/* redefine printfs and memory allocators as needed */
#ifdef MATLAB_MEX_FILE
#include "mex.h"
#define scs_printf mexPrintf
-#define _scs_free mxFree
-#define _scs_malloc mxMalloc
-#define _scs_calloc mxCalloc
-#define _scs_realloc mxRealloc
+#define scs_free mxFree
+#define scs_malloc mxMalloc
+#define scs_calloc mxCalloc
+#define scs_realloc mxRealloc
#elif defined PYTHON
#include <Python.h>
#define scs_printf(...) \
{ \
PyGILState_STATE gilstate = PyGILState_Ensure(); \
PySys_WriteStdout(__VA_ARGS__); \
PyGILState_Release(gilstate); \
}
-/* only for SuiteSparse */
-#define _scs_printf PySys_WriteStdout
#if PY_MAJOR_VERSION >= 3
-#define _scs_free PyMem_RawFree
-#define _scs_malloc PyMem_RawMalloc
-#define _scs_realloc PyMem_RawRealloc
-#define _scs_calloc PyMem_RawCalloc
+#define scs_free PyMem_RawFree
+#define scs_malloc PyMem_RawMalloc
+#define scs_realloc PyMem_RawRealloc
+#define scs_calloc PyMem_RawCalloc
+/* only for SuiteSparse + python */
+#define _scs_printf PySys_WriteStdout
#else
-#define _scs_free PyMem_Free
-#define _scs_malloc PyMem_Malloc
-#define _scs_realloc PyMem_Realloc
-static inline void *_scs_calloc(size_t count, size_t size) {
+#define scs_free PyMem_Free
+#define scs_malloc PyMem_Malloc
+#define scs_realloc PyMem_Realloc
+static inline void *scs_calloc(size_t count, size_t size) {
void *obj = PyMem_Malloc(count * size);
memset(obj, 0, count * size);
return obj;
}
#endif
#elif defined R_LANG
#include <R_ext/Print.h> /* Rprintf etc */
#include <stdio.h>
#include <stdlib.h>
#define scs_printf Rprintf
-#define _scs_free free
-#define _scs_malloc malloc
-#define _scs_calloc calloc
-#define _scs_realloc realloc
+#define scs_free free
+#define scs_malloc malloc
+#define scs_calloc calloc
+#define scs_realloc realloc
#else
#include <stdio.h>
#include <stdlib.h>
#define scs_printf printf
-#define _scs_free free
-#define _scs_malloc malloc
-#define _scs_calloc calloc
-#define _scs_realloc realloc
+#define scs_free free
+#define scs_malloc malloc
+#define scs_calloc calloc
+#define scs_realloc realloc
#endif
-/* Only required for SuiteSparse compatibility: */
-#ifndef _scs_printf
-#define _scs_printf scs_printf
-#endif
-
-#define scs_free(x) \
- _scs_free(x); \
- x = SCS_NULL
-#define scs_malloc(x) _scs_malloc(x)
-#define scs_calloc(x, y) _scs_calloc(x, y)
-#define scs_realloc(x, y) _scs_realloc(x, y)
-
-#ifdef DLONG
-/*#ifdef _WIN64
-#include <stdint.h>
-typedef int64_t scs_int;
-#else
-typedef long scs_int;
-#endif
-*/
-typedef long long scs_int;
-#else
-typedef int scs_int;
-#endif
-
#ifndef SFLOAT
-typedef double scs_float;
#ifndef NAN
#define NAN ((scs_float)0x7ff8000000000000)
#endif
#ifndef INFINITY
#define INFINITY NAN
#endif
#else
-typedef float scs_float;
#ifndef NAN
#define NAN ((float)0x7fc00000)
#endif
#ifndef INFINITY
#define INFINITY NAN