input stringlengths 16 454k | output stringlengths 13 350k | function_name stringlengths 1 100 | repo_name stringlengths 6 43 | category stringclasses 76
values | sample_id stringlengths 22 88 | decompiler stringclasses 1
value | opt_level stringclasses 1
value |
|---|---|---|---|---|---|---|---|
double gretl_one_snormal() {
double v0;
double v2;
double v3;
double v4;
double v5;
double v6;
uint64_t r;
int64_t rabs;
double x;
double xx;
if (initt)
create_ziggurat_tables();
while (1) {
r = randi54();
rabs = r >> 1;
if ((r & 1) != 0)
v0 = (double)-(int)rabs;
else
... | double gretl_one_snormal(void) {
if (initt) {
create_ziggurat_tables();
}
while (1) {
#if HAVE_X86_32
double x;
int si, idx;
uint32_t lo, hi;
int64_t rabs;
uint32_t *p = (uint32_t *)&rabs;
lo = randi32();
idx = lo & 0xFF;
hi = randi32();
si = hi & UMASK;
p[0] = lo;
... | gretl_one_snormal | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_open(const char *pathname, int flags, int mode) {
int v3;
mode_t m;
int fd;
m = 0;
gretl_error_clear();
if ((flags & 0x40) != 0)
m = mode;
fd = open(pathname, (unsigned char)flags, m);
if (*__errno_location()) {
v3 = *__errno_location();
gretl_errmsg_set_from_errno(pathname, v3);
... | int gretl_open(const char *pathname, int flags, int mode) {
mode_t m = 0;
int fd = -1;
gretl_error_clear();
if (flags & O_CREAT) {
m = (mode_t)mode;
}
#ifdef WIN32
fd = g_open(pathname, flags, m);
#else
fd = open(pathname, flags, m);
#endif
if (errno != 0) {
gretl_errmsg_set_from_errno(pathn... | gretl_open | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
GDir *gretl_opendir(const char *name) {
GError *error;
GDir *dir;
unsigned long v4;
v4 = __readfsqword(0x28u);
error = 0;
dir = (GDir *)g_dir_open(name, 0, &error);
if (error) {
gretl_errmsg_set(error->message);
g_error_free(error);
}
return dir;
} | GDir *gretl_opendir(const char *name) {
GError *error = NULL;
GDir *dir;
dir = g_dir_open(name, 0, &error);
if (error != NULL) {
gretl_errmsg_set(error->message);
g_error_free(error);
}
return dir;
} | gretl_opendir | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
const char *gretl_oxl_path() { return paths.oxlpath; } | const char *gretl_oxl_path(void) { return paths.oxlpath; } | gretl_oxl_path | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_panel_ts_plot(int vnum, DATASET *dset, gretlopt opt) {
if ((opt & 0x40000) != 0)
return panel_grid_ts_plot(vnum, dset, opt);
if ((opt & 0x1000) != 0)
return panel_means_ts_plot(vnum, dset,
(gretlopt)(opt & 0xFFFBEFFF | 0x40000));
return panel_overlay_ts_plot(vnum, ... | int gretl_panel_ts_plot(int vnum, DATASET *dset, gretlopt opt) {
if (opt & OPT_S) {
return panel_grid_ts_plot(vnum, dset, opt);
} else if (opt & OPT_M) {
opt &= ~OPT_M;
opt |= OPT_S;
return panel_means_ts_plot(vnum, dset, opt);
} else {
return panel_overlay_ts_plot(vnum, dset, opt);
}
} | gretl_panel_ts_plot | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_path_compose(char *targ, int len, const char *s1, const char *s2) {
size_t v4;
*targ = 0;
v4 = strlen(s1);
if (v4 + strlen(s2) < len) {
strcpy(targ, s1);
strcat(targ, s2);
return 0;
} else {
gretl_errmsg_set("filename is too long");
return 2;
}
} | int gretl_path_compose(char *targ, int len, const char *s1, const char *s2) {
targ[0] = '\0';
if (strlen(s1) + strlen(s2) >= len) {
gretl_errmsg_set("filename is too long");
return E_DATA;
} else {
strcpy(targ, s1);
strcat(targ, s2);
return 0;
}
} | gretl_path_compose | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_path_prepend(char *file, const char *path) {
int v2;
int n;
char temp[520];
unsigned long v6;
v6 = __readfsqword(0x28u);
v2 = strlen(file);
if ((int)(v2 + strlen(path) + 1) > 512)
return 1;
strcpy(temp, path);
n = strlen(temp);
if (temp[n - 1] != 47 && n <= 510)
*(_WORD *)&temp[st... | int gretl_path_prepend(char *file, const char *path) {
int n = strlen(file) + strlen(path) + 1;
char temp[MAXLEN];
if (n > MAXLEN) {
return 1;
}
strcpy(temp, path);
n = strlen(temp);
if (temp[n - 1] != SLASH && n < MAXLEN - 1) {
strcat(temp, SLASHSTR);
}
strcat(temp, file);
strcpy(file, ... | gretl_path_prepend | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
char *gretl_pdf_term_line(char *term_line, PlotType ptype, GptFlags flags) {
int v3;
char font_string[136];
unsigned long v7;
v7 = __readfsqword(0x28u);
if (ptype == PLOT_MULTI_SCATTER)
v3 = 6;
else
v3 = 12;
font_string[0] = 0;
write_other_font_string(font_string, v3);
sprintf(term_line, "set... | static char *gretl_pdf_term_line(char *term_line, PlotType ptype,
GptFlags flags) {
char font_string[128];
int ptsize;
ptsize = (ptype == PLOT_MULTI_SCATTER) ? 6 : 12;
*font_string = '\0';
write_other_font_string(font_string, ptsize);
sprintf(term_line, "set term pdfcairo... | gretl_pdf_term_line | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_plot_append_line(const char *s, const DATASET *dset) {
const char *sa;
int err;
int flag;
char field[264];
unsigned long v7;
v7 = __readfsqword(0x28u);
err = 0;
if (!plot.in_progress)
return 2;
sa = get_plot_field_and_advance(s, field, 0x10u, 0, &err);
if (!strcmp(field, "option")) {
... | int gretl_plot_append_line(const char *s, const DATASET *dset) {
char field[256];
int err = 0;
if (!plot.in_progress) {
return E_DATA;
}
#if PDEBUG
fprintf(stderr, "gretl_plot_append_line: '%s'\n", s);
#endif
s = get_plot_field_and_advance(s, field, 16, 0, &err);
if (!strcmp(field, "option")) {
... | gretl_plot_append_line | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_plot_finalize(const char *s, const DATASET *dset, gretlopt opt) {
int err;
err = execute_plot(dset, opt);
clear_plot();
return err;
} | int gretl_plot_finalize(const char *s, const DATASET *dset, gretlopt opt) {
int err;
#if PDEBUG
fprintf(stderr, "gretl_plot_finalize: '%s'\n", s);
debug_print_option_flags("end plot", opt);
#endif
err = execute_plot(dset, opt);
clear_plot();
return err;
} | gretl_plot_finalize | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_plot_start(const char *param, const DATASET *dset) {
int err;
if (plot.in_progress) {
clear_plot();
err = 2;
} else {
err = check_plot_data_source(param, dset);
}
if (!err) {
plot.in_progress = 1;
set_effective_plot_ci(98);
}
return err;
} | int gretl_plot_start(const char *param, const DATASET *dset) {
int err = 0;
#if PDEBUG
fprintf(stderr, "gretl_plot_start: '%s'\n", param);
#endif
if (plot.in_progress) {
clear_plot();
err = E_DATA;
} else {
err = check_plot_data_source(param, dset);
}
if (!err) {
plot.in_progress = 1;
... | gretl_plot_start | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
const char *gretl_plotfile() { return paths.plotfile; } | const char *gretl_plotfile(void) { return paths.plotfile; } | gretl_plotfile | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_plotfit_matrices(const double *yvar, const double *xvar, FitType fit,
int t1, int t2, gretl_matrix **py,
gretl_matrix **pX) {
char *v8;
double *v9;
double v10;
int v11;
int v12;
double *v13;
int v14;
int n;
int i;
int j;
int ja;
int... | int gretl_plotfit_matrices(const double *yvar, const double *xvar, FitType fit,
int t1, int t2, gretl_matrix **py,
gretl_matrix **pX) {
gretl_matrix *y = NULL;
gretl_matrix *X = NULL;
char *mask = NULL;
double xt;
int T = t2 - t1 + 1;
int n = 0;
int i,... | gretl_plotfit_matrices | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
const double *gretl_plotx(const DATASET *dset, gretlopt opt) {
float v3;
double v4;
double *v5;
double *v6;
double *v7;
double *v8;
int maj;
int min;
int t;
int T;
int new_ptype;
int panvar;
int failed;
int y1;
float rm;
double sd0;
double frac;
double mul;
char datestr[24];
unsi... | const double *gretl_plotx(const DATASET *dset, gretlopt opt) {
static double *x;
static int ptype;
static int Tbak;
static double sd0bak;
double mul, frac;
int t, y1, T = 0;
int maj, min;
int new_ptype = 0;
int panvar = 0;
int failed = 0;
double sd0 = 0;
float rm;
if (dset == NULL) {
fre... | gretl_plotx | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
GHashTable *gretl_plugin_hash_init() {
int i;
GHashTable *ht;
ht = (GHashTable *)g_hash_table_new(&g_str_hash, &g_str_equal);
for (i = 0; plugin_functions[i].name; ++i)
g_hash_table_insert(ht, plugin_functions[i].name,
plugin_functions[i].index);
return ht;
} | static GHashTable *gretl_plugin_hash_init(void) {
GHashTable *ht;
int i;
ht = g_hash_table_new(g_str_hash, g_str_equal);
for (i = 0; plugin_functions[i].name != NULL; i++) {
g_hash_table_insert(ht, (gpointer)plugin_functions[i].name,
GINT_TO_POINTER(plugin_functions[i].index));
}... | gretl_plugin_hash_init | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_plugin_make_zipfile(const char *fname, const char *path) {
int v3;
GError *gerr;
int (*zfunc)(const char *, const char *, GError **);
unsigned long v6;
v6 = __readfsqword(0x28u);
gerr = 0;
zfunc = (int (*)(const char *, const char *, GError **))get_plugin_function(
"gretl_native_make_zipf... | static int gretl_plugin_make_zipfile(const char *fname, const char *path) {
int (*zfunc)(const char *, const char *, GError **);
GError *gerr = NULL;
int err = 0;
zfunc = get_plugin_function("gretl_native_make_zipfile");
if (zfunc == NULL) {
return 1;
}
err = (*zfunc)(fname, path, &gerr);
#if ZDEBUG... | gretl_plugin_make_zipfile | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
const char *gretl_plugin_path() {
const char *epath;
if (!set_2) {
epath = getenv("GRETL_PLUGIN_PATH");
if (epath) {
paths.plugpath[0] = 0;
strncat(paths.plugpath, epath, 0x1FEu);
slash_terminate(paths.plugpath);
}
if (!paths.plugpath[0]) {
strcpy(&paths.plugpath[strlen(path... | const char *gretl_plugin_path(void) {
static int set;
if (!set) {
char *epath = getenv("GRETL_PLUGIN_PATH");
if (epath != NULL) {
*paths.plugpath = '\0';
strncat(paths.plugpath, epath, MAXLEN - 2);
slash_terminate(paths.plugpath);
}
#if defined(LIBDIR) || defined(GRETL_PREFIX)
... | gretl_plugin_path | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_plugin_unzip(const char *fname, const char *path, gchar **zdirname) {
int v4;
GError *gerr;
int (*zfunc)(const char *, const char *, gchar **, GError **);
unsigned long v8;
v8 = __readfsqword(0x28u);
gerr = 0;
zfunc = (int (*)(const char *, const char *, gchar **,
GError **))... | static int gretl_plugin_unzip(const char *fname, const char *path,
gchar **zdirname) {
int (*zfunc)(const char *, const char *, gchar **, GError **);
GError *gerr = NULL;
int err = 0;
zfunc = get_plugin_function("gretl_native_unzip");
if (zfunc == NULL) {
return 1;
}
#if... | gretl_plugin_unzip | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_plugin_zip_datafile(const char *fname, const char *path, int level) {
int v4;
GError *gerr;
int (*zfunc)(const char *, const char *, int, GError **);
unsigned long v8;
v8 = __readfsqword(0x28u);
gerr = 0;
zfunc = (int (*)(const char *, const char *, int,
GError **))get_plugin... | static int gretl_plugin_zip_datafile(const char *fname, const char *path,
int level) {
int (*zfunc)(const char *, const char *, int, GError **);
GError *gerr = NULL;
int err = 0;
zfunc = get_plugin_function("gretl_native_zip_datafile");
if (zfunc == NULL) {
return 1;
... | gretl_plugin_zip_datafile | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
const char *gretl_png_font() { return paths.pngfont; } | const char *gretl_png_font(void) { return paths.pngfont; } | gretl_png_font | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
char *gretl_png_font_string() {
int ptsize;
int nf;
const char *s;
char name[128];
char fstr[264];
unsigned long v6;
v6 = __readfsqword(0x28u);
s = gretl_png_font();
ptsize = 0;
fstr[0] = 0;
nf = split_graph_fontspec(s, name, &ptsize);
if (nf == 2) {
sprintf(fstr, " font \"%s,%d\"", name, p... | char *gretl_png_font_string(void) {
const char *s = gretl_png_font();
char fstr[256];
char name[128];
int nf, ptsize = 0;
fstr[0] = '\0';
nf = split_graph_fontspec(s, name, &ptsize);
if (nf == 2) {
sprintf(fstr, " font \"%s,%d\"", name, ptsize);
} else if (nf == 1) {
sprintf(fstr, " font \"%s\"... | gretl_png_font_string | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
char *gretl_png_term_line(char *term_line, PlotType ptype, GptFlags flags) {
if (ptype == PLOT_GEOMAP)
return real_png_term_line(term_line, PLOT_GEOMAP, flags, 0, 1.0);
else
return real_png_term_line(term_line, ptype, flags, 0, default_png_scale);
} | static char *gretl_png_term_line(char *term_line, PlotType ptype,
GptFlags flags) {
if (ptype == PLOT_GEOMAP) {
return real_png_term_line(term_line, ptype, flags, NULL, 1.0);
} else {
double s = default_png_scale;
return real_png_term_line(term_line, ptype, flags, NULL,... | gretl_png_term_line | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
char *gretl_prepend_homedir(const char *fname, int *err) {
size_t v2;
size_t v3;
char *ret;
const char *homedir;
homedir = getenv("HOME");
ret = 0;
if (homedir) {
v2 = strlen(homedir);
v3 = strlen(fname);
ret = (char *)malloc(v2 + v3);
if (ret) {
strcpy(ret, homedir);
strcat(r... | char *gretl_prepend_homedir(const char *fname, int *err) {
char *homedir = getenv("HOME");
char *ret = NULL;
if (homedir != NULL) {
ret = malloc(strlen(homedir) + strlen(fname));
if (ret == NULL) {
*err = E_ALLOC;
} else {
strcpy(ret, homedir);
strcat(ret, fname + 1);
}
} else... | gretl_prepend_homedir | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_print_alloc(PRN *prn, size_t s) {
int err;
size_t newlen;
char *tmp;
err = 0;
if (!prn || !prn->buf || prn->fixed)
return 2;
if (prn->bufsize - prn->blen <= s) {
newlen = prn->blen + s + 1;
tmp = (char *)realloc(prn->buf, newlen);
if (tmp) {
prn->buf = tmp;
prn->bufsiz... | int gretl_print_alloc(PRN *prn, size_t s) {
size_t rem;
int err = 0;
if (prn == NULL || prn->buf == NULL || prn->fixed) {
return E_DATA;
}
rem = prn->bufsize - prn->blen;
if (rem <= s) {
size_t newlen = prn->blen + s + 1;
char *tmp;
tmp = realloc(prn->buf, newlen);
if (tmp == NULL) {... | gretl_print_alloc | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_print_close_stream(PRN *prn) {
if (prn) {
if (prn->fp) {
fclose(prn->fp);
prn->fp = 0;
free(prn->fname);
prn->fname = 0;
} else if (prn->fz) {
gzclose(prn->fz);
prn->fz = 0;
free(prn->fname);
prn->fname = 0;
}
}
} | void gretl_print_close_stream(PRN *prn) {
if (prn == NULL)
return;
if (prn->fp != NULL) {
fclose(prn->fp);
prn->fp = NULL;
free(prn->fname);
prn->fname = NULL;
} else if (prn->fz != NULL) {
gzclose(prn->fz);
prn->fz = NULL;
free(prn->fname);
prn->fname = NULL;
}
} | gretl_print_close_stream | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_print_destroy(PRN *prn) {
if (prn) {
if (prn->fplist)
prn_destroy_fp_list(prn);
if (prn->fp) {
if (prn->fp == stdout) {
fflush(stdout);
} else if (prn->fp != stderr) {
fclose(prn->fp);
}
} else if (prn->fz) {
gzclose(prn->fz);
}
if (prn->fna... | void gretl_print_destroy(PRN *prn) {
if (prn == NULL) {
return;
}
if (prn->fplist != NULL) {
prn_destroy_fp_list(prn);
}
if (prn->fp != NULL) {
if (prn->fp == stdout) {
fflush(stdout);
} else if (prn->fp != stderr) {
#if PRN_DEBUG
fprintf(stderr, "gretl_print_destroy: prn=%p, clo... | gretl_print_destroy | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_print_detach_stream(PRN *prn) { prn->fp = 0; } | void gretl_print_detach_stream(PRN *prn) { prn->fp = NULL; } | gretl_print_detach_stream | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_print_ensure_vspace(PRN *prn) {
if (prn) {
if (prn->nlcount <= 1u)
pputc(prn, 10);
}
} | void gretl_print_ensure_vspace(PRN *prn) {
if (prn != NULL && prn->nlcount < 2) {
pputc(prn, '\n');
}
} | gretl_print_ensure_vspace | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_print_flush_stream(PRN *prn) {
if (prn) {
if (prn->fp) {
fflush(prn->fp);
} else if (prn->fz) {
gzflush(prn->fz, 2);
}
}
} | void gretl_print_flush_stream(PRN *prn) {
if (prn != NULL) {
if (prn->fp != NULL) {
fflush(prn->fp);
} else if (prn->fz != NULL) {
gzflush(prn->fz, Z_SYNC_FLUSH);
}
}
} | gretl_print_flush_stream | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_print_fullwidth_double(double x, int digits, PRN *prn) {
char decpoint;
int i;
int ia;
int forept;
int tmp;
int tmpa;
char *p;
char numstr[48];
char final[40];
unsigned long v12;
v12 = __readfsqword(0x28u);
decpoint = get_local_decpoint();
if (fabs(x) <= 1.0e-13)
x = 0.0;
spr... | void gretl_print_fullwidth_double(double x, int digits, PRN *prn) {
char numstr[36], final[36];
int totlen = 2 * digits + 5;
int i, tmp, forept = 0;
char decpoint;
char *p;
decpoint = get_local_decpoint();
x = screen_zero(x);
sprintf(numstr, "%#.*G", digits, x);
gretl_fix_exponent(numstr);
p = ... | gretl_print_fullwidth_double | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
const char *gretl_print_get_buffer(PRN *prn) {
if (prn)
return prn->buf;
else
return 0;
} | const char *gretl_print_get_buffer(PRN *prn) {
return (prn != NULL) ? prn->buf : NULL;
} | gretl_print_get_buffer | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
char *gretl_print_get_chunk(PRN *prn) {
char *result;
if (!prn || !prn->buf || prn->savepos < 0 || (int)prn->blen < prn->savepos)
return 0;
result = gretl_strdup(&prn->buf[prn->savepos]);
prn->savepos = -1;
return result;
} | char *gretl_print_get_chunk(PRN *prn) {
int maxpos = prn->blen;
char *ret;
if (prn == NULL || prn->buf == NULL || prn->savepos < 0 ||
prn->savepos > maxpos) {
return NULL;
}
ret = gretl_strdup(prn->buf + prn->savepos);
prn->savepos = -1;
return ret;
} | gretl_print_get_chunk | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
char *gretl_print_get_chunk_at(PRN *prn, int pos) {
if (prn && prn->buf && pos >= 0 && pos <= (int)prn->blen)
return gretl_strdup(&prn->buf[pos]);
else
return 0;
} | char *gretl_print_get_chunk_at(PRN *prn, int pos) {
int maxpos = prn->blen;
char *ret;
if (prn == NULL || prn->buf == NULL || pos < 0 || pos > maxpos) {
return NULL;
}
ret = gretl_strdup(prn->buf + pos);
return ret;
} | gretl_print_get_chunk_at | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_print_get_size(PRN *prn, int *width, int *height) {
int w;
int h;
int lw;
char line[136];
unsigned long v8;
v8 = __readfsqword(0x28u);
w = 0;
h = 0;
if (prn && prn->buf) {
bufgets_init(prn->buf);
while (bufgets(line, 0x80u, prn->buf)) {
lw = g_utf8_strlen(line, -1) - 1;
... | void gretl_print_get_size(PRN *prn, int *width, int *height) {
int w = 0, h = 0;
if (prn != NULL && prn->buf != NULL) {
char line[128];
int lw;
bufgets_init(prn->buf);
while (bufgets(line, sizeof line, prn->buf)) {
lw = g_utf8_strlen(line, -1) - 1;
if (lw > 120) {
w = h = 0;
... | gretl_print_get_size | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
const char *gretl_print_get_tempfile_name(PRN *prn) {
if (prn)
return prn->fname;
else
return 0;
} | const char *gretl_print_get_tempfile_name(PRN *prn) {
if (prn != NULL) {
return prn->fname;
} else {
return NULL;
}
} | gretl_print_get_tempfile_name | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
const char *gretl_print_get_trimmed_buffer(PRN *prn) {
char *v1;
int i;
char *buf;
if (prn)
v1 = prn->buf;
else
v1 = 0;
buf = v1;
if (v1) {
if (*v1 == 10)
buf = v1 + 1;
for (i = strlen(buf) - 1; i > 0 && buf[i] == 10 && buf[i - 1] == 10; --i)
buf[i] = 0;
}
return buf;
} | const char *gretl_print_get_trimmed_buffer(PRN *prn) {
char *buf = (prn != NULL) ? prn->buf : NULL;
if (buf != NULL) {
int i, n;
if (*buf == '\n') {
buf++;
}
n = strlen(buf);
for (i = n - 1; i > 0; i--) {
if (buf[i] == '\n' && buf[i - 1] == '\n') {
buf[i] = '\0';
} el... | gretl_print_get_trimmed_buffer | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_print_has_buffer(PRN *prn) { return prn && prn->buf; } | int gretl_print_has_buffer(PRN *prn) {
return (prn != NULL && prn->buf != NULL);
} | gretl_print_has_buffer | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_print_has_minus(PRN *prn) {
if (prn)
return ((unsigned int)prn->format >> 11) & 1;
else
return 0;
} | int gretl_print_has_minus(PRN *prn) {
if (prn != NULL) {
return (prn->format & GRETL_FORMAT_HAS_MINUS) ? 1 : 0;
} else {
return 0;
}
} | gretl_print_has_minus | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_print_has_tempfile(PRN *prn) {
return prn && prn->fname && prn->fp && strstr(prn->fname, "prntmp.") != 0;
} | int gretl_print_has_tempfile(PRN *prn) {
if (prn != NULL && prn->fname != NULL && prn->fp != NULL) {
return strstr(prn->fname, "prntmp.") != NULL;
} else {
return 0;
}
} | gretl_print_has_tempfile | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
PRN *gretl_print_new(PrnType ptype, int *err) {
if (ptype != GRETL_PRINT_FILE)
return real_gretl_print_new(ptype, 0, 0, 0, -1, err);
fwrite("gretl_print_new: needs a filename\n", 1u, 0x22u, stderr);
return 0;
} | PRN *gretl_print_new(PrnType ptype, int *err) {
if (ptype == GRETL_PRINT_FILE) {
fprintf(stderr, "gretl_print_new: needs a filename\n");
return NULL;
}
#if PRN_DEBUG
fprintf(stderr, "gretl_print_new() called, type = %d\n", ptype);
#endif
return real_gretl_print_new(ptype, NULL, NULL, NULL, -1, err);
} | gretl_print_new | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
PRN *gretl_print_new_with_buffer(char *buf) {
if (buf)
return real_gretl_print_new(GRETL_PRINT_BUFFER, 0, buf, 0, -1, 0);
else
return 0;
} | PRN *gretl_print_new_with_buffer(char *buf) {
if (buf == NULL) {
return NULL;
} else {
return real_gretl_print_new(GRETL_PRINT_BUFFER, NULL, buf, NULL, -1, NULL);
}
} | gretl_print_new_with_buffer | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
PRN *gretl_print_new_with_filename(const char *fname, int *err) {
char *v2;
if (fname)
return real_gretl_print_new(GRETL_PRINT_FILE, fname, 0, 0, -1, err);
v2 = gettext("gretl_prn_new: Must supply a filename\n");
fprintf(stderr, v2);
return 0;
} | PRN *gretl_print_new_with_filename(const char *fname, int *err) {
if (fname == NULL) {
fprintf(stderr, _("gretl_prn_new: Must supply a filename\n"));
return NULL;
}
return real_gretl_print_new(GRETL_PRINT_FILE, fname, NULL, NULL, -1, err);
} | gretl_print_new_with_filename | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
PRN *gretl_print_new_with_gchar_buffer(gchar *buf) {
PRN *prn;
prn = 0;
if (buf) {
prn = real_gretl_print_new(GRETL_PRINT_BUFFER, 0, buf, 0, -1, 0);
if (prn)
prn->gbuf = 1;
}
return prn;
} | PRN *gretl_print_new_with_gchar_buffer(gchar *buf) {
PRN *prn = NULL;
if (buf != NULL) {
prn = real_gretl_print_new(GRETL_PRINT_BUFFER, NULL, buf, NULL, -1, NULL);
if (prn != NULL) {
prn->gbuf = 1;
}
}
return prn;
} | gretl_print_new_with_gchar_buffer | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
PRN *gretl_print_new_with_stream(FILE *fp) {
if (fp)
return real_gretl_print_new(GRETL_PRINT_STREAM, 0, 0, fp, -1, 0);
else
return 0;
} | PRN *gretl_print_new_with_stream(FILE *fp) {
if (fp == NULL) {
return NULL;
} else {
return real_gretl_print_new(GRETL_PRINT_STREAM, NULL, NULL, fp, -1, NULL);
}
} | gretl_print_new_with_stream | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
PRN *gretl_print_new_with_tempfile(int *err) {
return real_gretl_print_new(GRETL_PRINT_TEMPFILE, 0, 0, 0, -1, err);
} | PRN *gretl_print_new_with_tempfile(int *err) {
return real_gretl_print_new(GRETL_PRINT_TEMPFILE, NULL, NULL, NULL, -1, err);
} | gretl_print_new_with_tempfile | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
char *gretl_print_read_tempfile(PRN *prn, int *err) {
char *buf;
size_t pos0;
size_t chk;
if (prn && prn->fp) {
fflush(prn->fp);
pos0 = ftell(prn->fp);
buf = (char *)calloc(pos0 + 1, 1u);
if (buf) {
rewind(prn->fp);
chk = fread(buf, 1u, pos0, prn->fp);
if (chk != pos0) {
... | char *gretl_print_read_tempfile(PRN *prn, int *err) {
size_t chk, bsize;
long pos0;
char *buf = NULL;
if (prn == NULL || prn->fp == NULL) {
fprintf(stderr, "gretl_print_read_tempfile: no temp file to read!\n");
*err = E_DATA;
return NULL;
}
fflush(prn->fp);
pos0 = ftell(prn->fp);
bsize = p... | gretl_print_read_tempfile | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_print_rename_file(PRN *prn, const char *oldpath,
const char *newpath) {
const char *v4;
int err;
if (prn) {
if (prn->fp && !prn_fp_list_active(prn)) {
fclose(prn->fp);
prn->fp = 0;
if (oldpath || !prn->fname)
err = gretl_rename(oldpath, newpath)... | int gretl_print_rename_file(PRN *prn, const char *oldpath,
const char *newpath) {
int err = 0;
if (prn == NULL) {
fprintf(stderr, "gretl_print_rename_file: prn is NULL\n");
return E_DATA;
}
if (prn->fp == NULL || prn_fp_list_active(prn)) {
return E_DATA;
}
#if PRN_DE... | gretl_print_rename_file | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_print_replace_buffer(PRN *prn, char *buf) {
int err;
err = 0;
if (!prn || !prn->buf || !buf)
return 2;
free(prn->buf);
prn->buf = buf;
prn->blen = strlen(buf);
prn->bufsize = prn->blen + 1;
prn->savepos = -1;
return err;
} | int gretl_print_replace_buffer(PRN *prn, char *buf) {
int err = 0;
if (prn == NULL || prn->buf == NULL || buf == NULL) {
err = E_DATA;
} else {
free(prn->buf);
prn->buf = buf;
prn->blen = strlen(buf);
prn->bufsize = prn->blen + 1;
prn->savepos = -1;
}
return err;
} | gretl_print_replace_buffer | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_print_reset_buffer(PRN *prn) {
int err;
err = 0;
if (!prn || !prn->buf)
return 1;
*prn->buf = 0;
prn->blen = 0;
return err;
} | int gretl_print_reset_buffer(PRN *prn) {
int err = 0;
if (prn != NULL && prn->buf != NULL) {
*prn->buf = '\0';
prn->blen = 0;
} else {
err = 1;
}
return err;
} | gretl_print_reset_buffer | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_print_set_delim(PRN *prn, char delim) {
if (prn)
prn->delim = delim;
} | void gretl_print_set_delim(PRN *prn, char delim) {
if (prn != NULL) {
prn->delim = delim;
}
} | gretl_print_set_delim | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_print_set_format(PRN *prn, PrnFormat format) {
PrnFormat formata;
formata = format;
if (prn) {
if (format == GRETL_FORMAT_RTF)
formata = GRETL_FORMAT_DOC | GRETL_FORMAT_RTF;
if (formata == GRETL_FORMAT_CSV)
set_default_csv_delim(prn);
prn->format = formata;
}
} | void gretl_print_set_format(PRN *prn, PrnFormat format) {
if (prn != NULL) {
if (format == GRETL_FORMAT_RTF) {
format = GRETL_FORMAT_RTF | GRETL_FORMAT_DOC;
}
if (format == GRETL_FORMAT_CSV) {
set_default_csv_delim(prn);
}
prn->format = format;
}
} | gretl_print_set_format | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_print_set_has_minus(PRN *prn) {
PrnFormat format;
if (prn) {
format = prn->format;
BYTE1(format) |= 8u;
prn->format = format;
}
} | void gretl_print_set_has_minus(PRN *prn) {
if (prn != NULL) {
prn->format |= GRETL_FORMAT_HAS_MINUS;
}
} | gretl_print_set_has_minus | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_print_set_save_position(PRN *prn) {
if (!prn || !prn->buf)
return 2;
prn->savepos = prn->blen;
return 0;
} | int gretl_print_set_save_position(PRN *prn) {
if (prn == NULL || prn->buf == NULL) {
return E_DATA;
} else {
prn->savepos = prn->blen;
return 0;
}
} | gretl_print_set_save_position | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
char *gretl_print_steal_buffer(PRN *prn) {
char *buf;
buf = 0;
if (prn) {
buf = prn->buf;
prn->buf = 0;
}
return buf;
} | char *gretl_print_steal_buffer(PRN *prn) {
char *buf = NULL;
if (prn != NULL) {
buf = prn->buf;
prn->buf = NULL;
}
return buf;
} | gretl_print_steal_buffer | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_print_tell(PRN *prn) {
long v1;
if (prn && prn->buf)
return prn->blen;
else
LODWORD(v1) = -1;
return v1;
} | int gretl_print_tell(PRN *prn) {
if (prn == NULL || prn->buf == NULL) {
return -1;
} else {
return prn->blen;
}
} | gretl_print_tell | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_print_toggle_doc_flag(PRN *prn) {
if (prn)
prn->format ^= 4u;
} | void gretl_print_toggle_doc_flag(PRN *prn) {
if (prn != NULL) {
prn->format ^= GRETL_FORMAT_DOC;
}
} | gretl_print_toggle_doc_flag | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_print_unset_save_position(PRN *prn) {
if (prn)
prn->savepos = -1;
} | void gretl_print_unset_save_position(PRN *prn) {
if (prn != NULL) {
prn->savepos = -1;
}
} | gretl_print_unset_save_position | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_print_value(double x, PRN *prn) {
gretl_print_fullwidth_double(x, gretl_digits, prn);
} | void gretl_print_value(double x, PRN *prn) {
gretl_print_fullwidth_double(x, gretl_digits, prn);
} | gretl_print_value | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_printxn(double x, int n, PRN *prn) {
int ls;
char s[40];
unsigned long v5;
v5 = __readfsqword(0x28u);
if (fabs(x) <= 1.797693134862316e308)
printxx(x, s, 100);
else
s[0] = 0;
ls = strlen(s);
pputc(prn, 32);
bufspace(n - 3 - ls, prn);
pputs(prn, s);
} | void gretl_printxn(double x, int n, PRN *prn) {
char s[32];
int ls;
if (na(x)) {
*s = '\0';
} else {
printxx(x, s, PRINT);
}
ls = strlen(s);
pputc(prn, ' ');
bufspace(n - 3 - ls, prn);
pputs(prn, s);
} | gretl_printxn | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_prn_newline(PRN *prn) {
if (tex_format(prn)) {
pputs(prn, "\\\\\n");
} else if (rtf_format(prn)) {
pputs(prn, "\\par\n");
} else {
pputc(prn, 10);
}
} | void gretl_prn_newline(PRN *prn) {
if (tex_format(prn)) {
pputs(prn, "\\\\\n");
} else if (rtf_format(prn)) {
pputs(prn, "\\par\n");
} else {
pputc(prn, '\n');
}
} | gretl_prn_newline | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
const char *gretl_python_path() { return paths.pypath; } | const char *gretl_python_path(void) { return paths.pypath; } | gretl_python_path | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_qr_regress(MODEL *pmod, DATASET *dset, gretlopt opt) {
double v3;
int rank;
int warn;
integer k;
int err;
integer T;
gretl_matrix *g;
gretl_matrix *b;
gretl_matrix *y;
gretl_matrix *Q;
gretl_matrix *R;
gretl_matrix *V;
unsigned long v17;
v17 = __readfsqword(0x28u);
y = 0;
Q = ... | int gretl_qr_regress(MODEL *pmod, DATASET *dset, gretlopt opt) {
integer T, k;
gretl_matrix *y = NULL;
gretl_matrix *Q = NULL;
gretl_matrix *R = NULL;
gretl_matrix *g = NULL;
gretl_matrix *b = NULL;
gretl_matrix *V = NULL;
int rank, warn = 0, err = 0;
T = pmod->nobs;
k = pmod->list[0] - 1;
y = g... | gretl_qr_regress | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
gretl_matrix *gretl_quadrule_matrix_new(int n, int method, double a, double b,
int *err) {
gretl_matrix *m;
double *x;
double *w;
if (method > 0 && method <= 3) {
if (n >= 0) {
if (n) {
m = gretl_zero_matrix_new(n, 2);
if (m) {
x = m->... | gretl_matrix *gretl_quadrule_matrix_new(int n, int method, double a, double b,
int *err) {
gretl_matrix *m;
if (method < QUAD_GHERMITE || method >= QUAD_INVALID) {
*err = E_DATA;
return NULL;
}
if (n < 0) {
*err = E_DATA;
return NULL;
} else if (n == 0... | gretl_quadrule_matrix_new | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
double gretl_quantile(int t1, int t2, const double *x, double p, gretlopt opt,
int *err) {
int v7;
int hf;
int hc;
int t;
int n;
int na;
double xmin;
double xmax;
double *a;
double h;
double ret;
unsigned long v21;
v21 = __readfsqword(0x28u);
a = 0;
n = 0;
if (*err... | double gretl_quantile(int t1, int t2, const double *x, double p, gretlopt opt,
int *err) {
double *a = NULL;
double xmin, xmax;
double h, ret;
int hf, hc;
int t, n = 0;
if (*err) {
return NADBL;
}
if (p <= 0 || p >= 1) {
*err = E_DATA;
} else {
n = gretl_minmax(t1... | gretl_quantile | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
double gretl_rand_01() {
uint32_t v0;
if (use_dcmt)
v0 = genrand_mt(dcmt);
else
v0 = sfmt_genrand_uint32(&gretl_sfmt);
return sfmt_to_real2(v0);
} | double gretl_rand_01(void) {
if (use_dcmt) {
return sfmt_to_real2(dcmt_rand32());
} else {
return sfmt_to_real2(sfmt_rand32());
}
} | gretl_rand_01 | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_F(double *a, int t1, int t2, int v1, int v2) {
int t;
int T;
double *b;
T = t2 - t1 + 1;
if (v1 <= 0 || v2 <= 0)
return 17;
b = (double *)malloc(8LL * T);
if (!b)
return 12;
gretl_rand_chisq(a, t1, t2, v1);
gretl_rand_chisq(b, 0, T - 1, v2);
for (t = 0; t < T; ++t)
a[t + ... | int gretl_rand_F(double *a, int t1, int t2, int v1, int v2) {
double *b = NULL;
int T = t2 - t1 + 1;
int s, t;
if (v1 < 1 || v2 < 1) {
return E_INVARG;
}
b = malloc(T * sizeof *b);
if (b == NULL) {
return E_ALLOC;
}
gretl_rand_chisq(a, t1, t2, v1);
gretl_rand_chisq(b, 0, T - 1, v2);
fo... | gretl_rand_F | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_GED(double *a, int t1, int t2, double nu) {
double v5;
double v6;
double v7;
int t;
int err;
double p;
double scale;
if (nu < 0.0)
return 17;
p = 1.0 / nu;
v7 = pow(0.5, 1.0 / nu);
v5 = gammafun(1.0 / nu);
v6 = gammafun(1.0 / nu * 3.0);
scale = sqrt(v5 / v6) * v7;
err = g... | int gretl_rand_GED(double *a, int t1, int t2, double nu) {
int err, t;
double p, scale;
if (nu < 0) {
return E_INVARG;
}
p = 1.0 / nu;
scale = pow(0.5, p) * sqrt(gammafun(p) / gammafun(3.0 * p));
err = gretl_rand_gamma(a, t1, t2, p, 2);
if (!err) {
for (t = t1; t <= t2; t++) {
a[t] = sc... | gretl_rand_GED | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_beta(double *x, int t1, int t2, double s1, double s2) {
double v6;
double v7;
int j;
_BOOL4 swap;
double a;
double b;
double h;
double u0;
double val;
double f;
double d;
double u;
double v;
double s;
double y;
double z;
if (s1 <= 0.0 || s2 <= 0.0)
return 2;
a = s... | int gretl_rand_beta(double *x, int t1, int t2, double s1, double s2) {
double aln4 = 1.3862944;
double a, b, s, u, v, y, z;
double d, f, h, u0, c;
int t, j, swap;
double val;
if (s1 <= 0 || s2 <= 0) {
return E_DATA;
}
a = s1;
b = s2;
swap = b > a;
if (swap) {
f = b;
b = a;
a = f;... | gretl_rand_beta | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_beta_binomial(double *x, int t1, int t2, int n, double s1,
double s2) {
int t;
int err;
double *b;
err = gretl_rand_beta(x, t1, t2, s1, s2);
if (!err) {
b = (double *)malloc(8LL * n);
if (!b)
return 12;
for (t = t1; t <= t2; ++t)
x[t] = gret... | int gretl_rand_beta_binomial(double *x, int t1, int t2, int n, double s1,
double s2) {
int t, err;
err = gretl_rand_beta(x, t1, t2, s1, s2);
if (!err) {
double *b = malloc(n * sizeof *b);
if (b == NULL) {
return E_ALLOC;
} else {
for (t = t1; t <= t2; t++) {... | gretl_rand_beta_binomial | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_binomial(double *a, int t1, int t2, int n, double p) {
int t;
int ta;
int tb;
int i;
double *b;
if (n < 0 || p < 0.0 || p > 1.0)
return 17;
if (n && p != 0.0) {
if (p == 1.0) {
for (ta = t1; ta <= t2; ++ta)
a[ta] = (double)n;
} else {
b = (double *)malloc(8L... | int gretl_rand_binomial(double *a, int t1, int t2, int n, double p) {
int t;
if (n < 0 || p < 0 || p > 1) {
return E_INVARG;
}
if (n == 0 || p == 0.0) {
for (t = t1; t <= t2; t++) {
a[t] = 0.0;
}
} else if (p == 1.0) {
for (t = t1; t <= t2; t++) {
a[t] = n;
}
} else {
d... | gretl_rand_binomial | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
double gretl_rand_binomial_one(int n, double p, double *b) {
int i;
double ret;
if (n < 0 || p < 0.0 || p > 1.0)
return NAN;
if (!n || p == 0.0)
return 0.0;
if (p == 1.0)
return (double)n;
ret = 0.0;
gretl_rand_uniform(b, 0, n - 1);
for (i = 0; i < n; ++i) {
if (p >= b[i])
ret = r... | static double gretl_rand_binomial_one(int n, double p, double *b) {
double ret;
if (n < 0 || p < 0 || p > 1) {
return NADBL;
}
if (n == 0 || p == 0.0) {
ret = 0.0;
} else if (p == 1.0) {
ret = n;
} else {
int i;
ret = 0.0;
gretl_rand_uniform(b, 0, n - 1);
for (i = 0; i < n; i+... | gretl_rand_binomial_one | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_chisq(double *a, int t1, int t2, int v) {
return gretl_rand_gamma(a, t1, t2, (double)v * 0.5, 2.0);
} | int gretl_rand_chisq(double *a, int t1, int t2, int v) {
return gretl_rand_gamma(a, t1, t2, 0.5 * v, 2);
} | gretl_rand_chisq | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_exponential(double *a, int t1, int t2, double mu) {
int err;
double u;
err = 0;
if (mu <= 0.0)
return 2;
while (t1 <= t2) {
do
u = gretl_rand_01();
while (u == 0.0);
a[t1++] = log(u) * COERCE_DOUBLE(*(_QWORD *)&mu ^ 0x8000000000000000LL);
}
return err;
} | int gretl_rand_exponential(double *a, int t1, int t2, double mu) {
int err = 0;
if (mu <= 0) {
err = E_DATA;
} else {
double u;
int t;
for (t = t1; t <= t2; t++) {
u = gretl_rand_01();
while (u == 0.0) {
u = gretl_rand_01();
}
a[t] = -mu * log(u);
}
}
ret... | gretl_rand_exponential | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_rand_free() {
if (dcmt) {
free_mt_struct(dcmt);
dcmt = 0;
}
} | void gretl_rand_free(void) {
if (dcmt != NULL) {
free_mt_struct(dcmt);
dcmt = NULL;
}
} | gretl_rand_free | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_gamma(double *a, int t1, int t2, double shape, double scale) {
double v6;
double v7;
double k;
double dv;
double d;
double c;
double x;
double v;
double u;
k = shape;
if (shape <= 0.0 || scale <= 0.0)
return 2;
if (shape < 1.0)
k = shape + 1.0;
d = k - 0.333333333333333... | int gretl_rand_gamma(double *a, int t1, int t2, double shape, double scale) {
double k = shape;
double d, c, x, v, u, dv;
int t;
if (shape <= 0 || scale <= 0) {
return E_DATA;
}
if (shape < 1) {
k = shape + 1.0;
}
d = k - 1.0 / 3;
c = 1.0 / sqrt(9 * d);
for (t = t1; t <= t2; t++) {
w... | gretl_rand_gamma | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
double gretl_rand_gamma_one(double shape, double scale) {
double v3;
double v4;
double k;
double dv;
double d;
double c;
double x;
double v;
double u;
k = shape;
if (shape <= 0.0 || scale <= 0.0)
return NAN;
if (shape < 1.0)
k = shape + 1.0;
d = k - 0.3333333333333333;
c = 1.0 / sqr... | double gretl_rand_gamma_one(double shape, double scale) {
double k = shape;
double d, c, x, v, u, dv;
if (shape <= 0 || scale <= 0) {
return NADBL;
}
if (shape < 1) {
k = shape + 1.0;
}
d = k - 1.0 / 3;
c = 1.0 / sqrt(9 * d);
while (1) {
x = gretl_one_snormal();
v = pow(1 + c * x, ... | gretl_rand_gamma_one | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_get_dcmt() { return use_dcmt; } | int gretl_rand_get_dcmt(void) { return use_dcmt; } | gretl_rand_get_dcmt | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
unsigned int gretl_rand_get_seed() {
if (use_dcmt)
return dcmt_seed;
else
return sfmt_seed;
} | unsigned int gretl_rand_get_seed(void) {
if (use_dcmt) {
return dcmt_seed;
} else {
return sfmt_seed;
}
} | gretl_rand_get_seed | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_rand_init() {
const char *fseed;
fseed = getenv("GRETL_FORCE_SEED");
if (fseed)
sfmt_seed = atoi(fseed);
else
sfmt_seed = time(0);
sfmt_init_gen_rand(&gretl_sfmt, sfmt_seed);
} | void gretl_rand_init(void) {
char *fseed = getenv("GRETL_FORCE_SEED");
if (fseed != NULL) {
sfmt_seed = atoi(fseed);
} else {
sfmt_seed = time(NULL);
}
sfmt_init_gen_rand(&gretl_sfmt, sfmt_seed);
} | gretl_rand_init | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
unsigned int gretl_rand_int() {
if (use_dcmt)
return genrand_mt(dcmt);
else
return sfmt_genrand_uint32(&gretl_sfmt);
} | unsigned int gretl_rand_int(void) {
if (use_dcmt) {
return dcmt_rand32();
} else {
return sfmt_rand32();
}
} | gretl_rand_int | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
unsigned int gretl_rand_int_max(unsigned int max) {
return mt_int_range(0, max, 0);
} | unsigned int gretl_rand_int_max(unsigned int max) {
return mt_int_range(0, max, 0);
} | gretl_rand_int_max | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_int_minmax(int *a, int n, int min, int max) {
return real_gretl_rand_int_minmax(a, n, min, max, 0);
} | int gretl_rand_int_minmax(int *a, int n, int min, int max) {
return real_gretl_rand_int_minmax(a, n, min, max, 0);
} | gretl_rand_int_minmax | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_laplace(double *a, int t1, int t2, double mu, double b) {
int v6;
double v7;
int t;
double U;
if (b < 0.0)
return 17;
gretl_rand_uniform(a, t1, t2);
for (t = t1; t <= t2; ++t) {
U = 0.5 - a[t];
if (U >= 0.0)
v6 = 1;
else
v6 = -1;
v7 = fabs(U);
a[t] = mu ... | int gretl_rand_laplace(double *a, int t1, int t2, double mu, double b) {
int t, sgn;
double U;
if (b < 0) {
return E_INVARG;
}
gretl_rand_uniform(a, t1, t2);
for (t = t1; t <= t2; t++) {
U = 0.5 - a[t];
sgn = U < 0 ? -1 : 1;
a[t] = mu - b * sgn * log(1 - 2 * fabs(U));
}
return 0;
} | gretl_rand_laplace | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_logistic(double *a, int t1, int t2, double loc, double scale) {
int err;
double u;
err = 0;
if (scale <= 0.0)
return 2;
while (t1 <= t2) {
do
u = gretl_rand_01();
while (u == 0.0);
a[t1++] = log(u / (1.0 - u)) * scale + loc;
}
return err;
} | int gretl_rand_logistic(double *a, int t1, int t2, double loc, double scale) {
int err = 0;
if (scale <= 0) {
err = E_DATA;
} else {
double u;
int t;
for (t = t1; t <= t2; t++) {
u = gretl_rand_01();
while (u == 0.0) {
u = gretl_rand_01();
}
a[t] = loc + scale * l... | gretl_rand_logistic | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_rand_normal(double *a, int t1, int t2) {
while (t1 <= t2)
a[t1++] = gretl_one_snormal();
} | void gretl_rand_normal(double *a, int t1, int t2) {
int t;
for (t = t1; t <= t2; t++) {
a[t] = gretl_one_snormal();
}
} | gretl_rand_normal | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_normal_full(double *a, int t1, int t2, double mean, double sd) {
double sda;
double meana;
int t;
meana = mean;
sda = sd;
if (fabs(mean) <= 1.797693134862316e308 ||
fabs(sd) <= 1.797693134862316e308) {
if (fabs(mean) > 1.797693134862316e308 ||
fabs(sd) > 1.797693134862316e3... | int gretl_rand_normal_full(double *a, int t1, int t2, double mean, double sd) {
int t;
if (na(mean) && na(sd)) {
mean = 0.0;
sd = 1.0;
} else if (na(mean) || na(sd) || sd <= 0.0) {
return E_INVARG;
}
gretl_rand_normal(a, t1, t2);
if (mean != 0.0 || sd != 1.0) {
for (t = t1; t <= t2; t++) ... | gretl_rand_normal_full | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_poisson(double *a, int t1, int t2, const double *m, int vec) {
double v5;
double v6;
while (t1 <= t2) {
if (vec)
v5 = m[t1];
else
v5 = *m;
if (v5 > 0.0)
v6 = genpois(v5);
else
v6 = NAN;
a[t1++] = v6;
}
return 0;
} | int gretl_rand_poisson(double *a, int t1, int t2, const double *m, int vec) {
double mt;
int t;
for (t = t1; t <= t2; t++) {
mt = (vec) ? m[t] : *m;
a[t] = (mt <= 0) ? NADBL : genpois(mt);
}
return 0;
} | gretl_rand_poisson | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_set_dcmt(int s) {
int err;
err = 0;
if (s == use_dcmt)
return 0;
if (s) {
if (dcmt) {
dcmt_seed = time(0);
sgenrand_mt(dcmt_seed, dcmt);
} else {
err = 2;
}
} else {
gretl_rand_init();
}
if (err)
gretl_errmsg_set("dcmt: not available");
else
... | int gretl_rand_set_dcmt(int s) {
int err = 0;
if (s == use_dcmt) {
return 0;
}
if (s) {
if (dcmt == NULL) {
#ifdef HAVE_MPI
err = dcmt_late_start();
#else
err = E_DATA;
#endif
} else {
dcmt_seed = time(NULL);
sgenrand_mt(dcmt_seed, dcmt);
}
} else {
gretl_ran... | gretl_rand_set_dcmt | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_rand_set_seed(unsigned int seed) {
unsigned int v1;
if (seed)
v1 = seed;
else
v1 = time(0);
if (use_dcmt)
gretl_dcmt_set_seed(v1);
else
gretl_sfmt_set_seed(v1);
} | void gretl_rand_set_seed(unsigned int seed) {
seed = (seed == 0) ? time(NULL) : seed;
if (use_dcmt) {
gretl_dcmt_set_seed(seed);
} else {
gretl_sfmt_set_seed(seed);
}
} | gretl_rand_set_seed | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_student(double *a, int t1, int t2, double v) {
int t;
_BYTE T[12];
*(_QWORD *)T = (unsigned int)(t2 - t1 + 1);
if (v <= 0.0)
return 17;
*(_QWORD *)&T[4] = malloc(8LL * *(int *)T);
if (!*(_QWORD *)&T[4])
return 12;
gretl_rand_normal(a, t1, t2);
gretl_rand_gamma(*(double **)&T[4], ... | int gretl_rand_student(double *a, int t1, int t2, double v) {
double *X2 = NULL;
int T = t2 - t1 + 1;
int t;
if (v <= 0) {
return E_INVARG;
}
X2 = malloc(T * sizeof *X2);
if (X2 == NULL) {
return E_ALLOC;
}
gretl_rand_normal(a, t1, t2);
gretl_rand_gamma(X2, 0, T - 1, 0.5 * v, 2);
for (... | gretl_rand_student | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
void gretl_rand_uniform(double *a, int t1, int t2) {
uint32_t v3;
uint32_t v4;
int t;
int ta;
if (use_dcmt) {
for (t = t1; t <= t2; ++t) {
v3 = genrand_mt(dcmt);
a[t] = sfmt_to_real2(v3);
}
} else {
for (ta = t1; ta <= t2; ++ta) {
v4 = sfmt_genrand_uint32(&gretl_sfmt);
a... | void gretl_rand_uniform(double *a, int t1, int t2) {
int t;
if (use_dcmt) {
for (t = t1; t <= t2; t++) {
a[t] = sfmt_to_real2(dcmt_rand32());
}
} else {
for (t = t1; t <= t2; t++) {
a[t] = sfmt_to_real2(sfmt_rand32());
}
}
} | gretl_rand_uniform | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_uniform_int_minmax(double *a, int t1, int t2, int min, int max,
gretlopt opt) {
short opta;
int maxa;
guint32 mina;
int t;
int ta;
int err;
int i;
int offset;
double x;
mina = min;
maxa = max;
opta = opt;
err = 0;
if (max < min)
return 17... | int gretl_rand_uniform_int_minmax(double *a, int t1, int t2, int min, int max,
gretlopt opt) {
int t, err = 0;
if (max < min) {
err = E_INVARG;
} else if (max == min) {
for (t = t1; t <= t2; t++) {
a[t] = min;
}
} else {
int i = 0, offset = 0;
double ... | gretl_rand_uniform_int_minmax | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_uniform_minmax(double *a, int t1, int t2, double min,
double max) {
uint32_t v6;
double maxa;
double mina;
mina = min;
maxa = max;
if (fabs(min) <= 1.797693134862316e308 ||
fabs(max) <= 1.797693134862316e308) {
if (fabs(min) > 1.797693134862316e308 ||
... | int gretl_rand_uniform_minmax(double *a, int t1, int t2, double min,
double max) {
int t;
if (na(min) && na(max)) {
min = 0.0;
max = 1.0;
} else if (na(min) || na(max) || max <= min) {
return E_INVARG;
}
for (t = t1; t <= t2; t++) {
if (use_dcmt) {
a[t] = ... | gretl_rand_uniform_minmax | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
double gretl_rand_uniform_one() {
uint32_t v0;
if (use_dcmt)
v0 = genrand_mt(dcmt);
else
v0 = sfmt_genrand_uint32(&gretl_sfmt);
return sfmt_to_real2(v0);
} | static double gretl_rand_uniform_one(void) {
if (use_dcmt) {
return sfmt_to_real2(dcmt_rand32());
} else {
return sfmt_to_real2(sfmt_rand32());
}
} | gretl_rand_uniform_one | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_rand_weibull(double *a, int t1, int t2, double shape, double scale) {
double v5;
int err;
double u;
err = 0;
if (shape <= 0.0 || scale <= 0.0)
return 2;
while (t1 <= t2) {
do
u = gretl_rand_01();
while (u == 0.0);
v5 = log(u);
a[t1++] = pow(-v5, 1.0 / shape) * scale;
}... | int gretl_rand_weibull(double *a, int t1, int t2, double shape, double scale) {
int err = 0;
if (shape <= 0 || scale <= 0) {
err = E_DATA;
} else {
double u, kinv = 1.0 / shape;
int t;
for (t = t1; t <= t2; t++) {
u = gretl_rand_01();
while (u == 0.0) {
u = gretl_rand_01();
... | gretl_rand_weibull | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
gretl_matrix *gretl_random_matrix_new(int r, int c, int dist) {
gretl_matrix *m;
if (dist != 1 && dist != 3)
return 0;
if (r < 0 || c < 0)
return 0;
if (r && c) {
m = gretl_matrix_alloc(r, c);
if (m) {
if (dist == 3) {
gretl_rand_normal(m->val, 0, c * r - 1);
} else if (dist... | gretl_matrix *gretl_random_matrix_new(int r, int c, int dist) {
gretl_matrix *m = NULL;
if (dist != D_UNIFORM && dist != D_NORMAL) {
return NULL;
} else if (r < 0 || c < 0) {
return NULL;
} else if (r == 0 || c == 0) {
m = gretl_null_matrix_new();
if (m != NULL) {
m->rows = r;
m->co... | gretl_random_matrix_new | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
const char *gretl_rbin_path() { return paths.rbinpath; } | const char *gretl_rbin_path(void) {
#ifdef WIN32
static int checked;
if (!checked) {
R_path_try_registry(REXE, paths.rbinpath);
checked = 1;
}
#endif
#if 0
fprintf(stderr, "gretl_rbin_path: '%s'\n", paths.rbinpath);
#endif
return paths.rbinpath;
} | gretl_rbin_path | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_read_foreign_data(const char *fname, GretlFileType file_type,
DATASET *dset, PRN *prn) {
if (fname && dset && dset->Z)
fwrite("gretl_read_foreign_data: Z must be NULL on entry\n", 1u, 0x31u,
stderr);
if (file_type == GRETL_CSV)
return import_csv(fname, dset, ... | int gretl_read_foreign_data(const char *fname, GretlFileType file_type,
DATASET *dset, PRN *prn) {
int err = 0;
if (fname == NULL || dset == NULL) {
err = E_INVARG;
} else if (dset->Z != NULL) {
fprintf(stderr, "gretl_read_foreign_data: Z must be NULL on entry\n");
err = E... | gretl_read_foreign_data | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_read_gdt(const char *fname, DATASET *dset, gretlopt opt, PRN *prn) {
const char *v5;
int err;
int gdtb;
gchar *zdir;
char xmlfile[4104];
unsigned long v12;
v12 = __readfsqword(0x28u);
gdtb = has_suffix(fname, ".gdtb");
if (gdtb && is_purebin_file(fname))
return read_gbin(fname, dset, op... | int gretl_read_gdt(const char *fname, DATASET *dset, gretlopt opt, PRN *prn) {
int gdtb = has_suffix(fname, ".gdtb");
if (gdtb && is_purebin_file(fname)) {
return read_gbin(fname, dset, opt, prn);
} else if (gdtb) {
gchar *zdir;
int id = -1;
int err;
#ifdef HAVE_MPI
if (gretl_mpi_initialize... | gretl_read_gdt | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
int gretl_read_gdt_subset(const char *fname, DATASET *dset, int *vlist,
gretlopt opt) {
const char *v4;
int err;
int gdtb;
gchar *zdir;
char xmlfile[4104];
unsigned long v12;
v12 = __readfsqword(0x28u);
gdtb = has_suffix(fname, ".gdtb");
err = 0;
if (gdtb && is_purebin_fil... | int gretl_read_gdt_subset(const char *fname, DATASET *dset, int *vlist,
gretlopt opt) {
int gdtb = has_suffix(fname, ".gdtb");
int err = 0;
if (gdtb && is_purebin_file(fname)) {
err = read_gbin_subset(fname, dset, vlist, opt);
} else if (gdtb) {
gchar *zdir;
int err;
... | gretl_read_gdt_subset | gretl-2021d | sci-mathematics | O0/sci-mathematics/gretl-2021d/libgretl-1.0.so.40.0.0 | ida | O0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.