Skip to content

Commit 4cb6ee1

Browse files
authored
Fixing complex cone bug (#318)
* first simple attempt * second try * third minor attempt * minor change * cmake build * does it work without the macro? * does it work without the macro? * removed unnecessary macro * adding test for complex PSD * added test * ran formatter
1 parent 1890d46 commit 4cb6ee1

File tree

6 files changed

+222
-98
lines changed

6 files changed

+222
-98
lines changed

cmake/scs_types.h.in

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
/*
22
* GENERATED BY CMAKE
33
*/
4-
54
/*
65
* Public header including definitions of primitive types used in SCS.
76
* Make sure this file and `scs.h` are somewhere appropriate and then use
87
* `#include "scs.h"` to access the SCS public API.
98
*/
10-
119
#ifndef SCS_TYPES_H_GUARD
1210
#define SCS_TYPES_H_GUARD
1311

1412
#ifdef __cplusplus
1513
extern "C" {
1614
#endif
1715

18-
#include <complex.h>
19-
20-
typedef @SCS_INT_TYPE@ scs_int;
21-
typedef @SCS_FLOAT_TYPE@ scs_float;
22-
typedef @SCS_FLOAT_TYPE@ _Complex scs_complex_float;
16+
typedef @SCS_INT_TYPE@ scs_int;
17+
typedef @SCS_FLOAT_TYPE@ scs_float;
18+
typedef @SCS_FLOAT_TYPE@ scs_complex_float[2]; /* [real, imaginary] */
2319

2420
#ifdef __cplusplus
2521
}

include/scs_types.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
extern "C" {
1212
#endif
1313

14-
#include <complex.h>
15-
1614
#ifdef DLONG
1715
/*#ifdef _WIN64
1816
#include <stdint.h>
@@ -28,10 +26,10 @@ typedef int scs_int;
2826

2927
#ifndef SFLOAT
3028
typedef double scs_float;
31-
typedef double _Complex scs_complex_float;
29+
typedef double scs_complex_float[2]; // [real, imaginary]
3230
#else
3331
typedef float scs_float;
34-
typedef float _Complex scs_complex_float;
32+
typedef float scs_complex_float[2]; // [real, imaginary]
3533
#endif
3634

3735
#ifdef __cplusplus

0 commit comments

Comments
 (0)