blob: edca6f44d66001f2935dfa4a3a0c4cd190a02e2c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#include <convex.h>
#include <wstp.h>
extern int WSMain(int, char **);
void convexminorant(double *, int);
:Begin:
:Function: convexminorant
:Pattern: GetConvexMinorant[ list:{___Real} ]
:Arguments: { list }
:ArgumentTypes: { Real64List }
:ReturnType: Manual
:End:
:Evaluate: GetConvexMinorant[ sequence___Float]:= GetConvexMinorant[ {sequence} ]
void convexminorant(double * Gammas, int len) {
int i;
for (i = 0; i < len; i++) {
if (Gammas[i] <= 0) {
break;
}
}
double *m = get_convex_minorant(i, Gammas);
WSPutReal64List(stdlink, m, i);
free(m);
}
int main(int argc, char **argv) {
return WSMain(argc, argv);
}
|