| version 1.34, 2007/03/14 10:30:54 |
version 1.43, 2016/08/23 02:24:19 |
|
|
| /* -*- mode: C -*- */ |
/* -*- mode: C -*- */ |
| /* $OpenXM: OpenXM/src/ox_toolkit/ox_toolkit.h,v 1.33 2005/10/12 04:03:37 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/ox_toolkit/ox_toolkit.h,v 1.42 2016/07/14 08:16:19 ohara Exp $ */ |
| |
|
| #ifndef _OX_TOOLKIT_H_ |
#ifndef _OX_TOOLKIT_H_ |
| |
|
| #define _OX_TOOLKIT_H_ |
#define _OX_TOOLKIT_H_ |
| |
|
| #ifdef __cplusplus |
|
| extern "C" { |
|
| #endif |
|
| |
|
| #include <stdio.h> |
#include <stdio.h> |
| #include <gmp.h> |
#include <gmp.h> |
| |
#include <mpfr.h> |
| #include <ox/cmotag.h> |
#include <ox/cmotag.h> |
| #include <ox/oxMessageTag.h> |
#include <ox/oxMessageTag.h> |
| #include <ox/smCommand.h> |
#include <ox/smCommand.h> |
| #include <gc/gc.h> |
#include <gc/gc.h> |
| |
|
| |
#if defined(_MSC_VER) |
| |
#include <malloc.h> |
| |
#else |
| |
#include <sys/select.h> |
| |
#endif |
| |
|
| #define MALLOC(x) GC_MALLOC((x)) |
#define MALLOC(x) GC_MALLOC((x)) |
| #define MALLOC_ATOMIC(x) GC_MALLOC_ATOMIC((x)) |
#define MALLOC_ATOMIC(x) GC_MALLOC_ATOMIC((x)) |
| #define ALLOCA(x) alloca((x)) |
#define ALLOCA(x) alloca((x)) |
| /* #define FREE(x) free((x)) */ |
/* #define FREE(x) free((x)) */ |
| #define FREE(x) |
#define FREE(x) |
| |
|
| |
#ifdef __cplusplus |
| |
extern "C" { |
| |
#endif |
| |
|
| #if !defined(__GNUC__) && !defined(__inline__) |
#if !defined(__GNUC__) && !defined(__inline__) |
| #define __inline__ |
#define __inline__ |
| #endif |
#endif |
|
|
| typedef struct mathcap { |
typedef struct mathcap { |
| table *cmotbl; |
table *cmotbl; |
| table *smtbl; |
table *smtbl; |
| |
char **opts; |
| } mathcap; |
} mathcap; |
| |
|
| /* OpenXM File Descripter */ |
/* OpenXM File Descripter */ |
| Line 54 typedef struct OXFILE{ |
|
| Line 62 typedef struct OXFILE{ |
|
| double (*receive_double)(struct OXFILE *oxfp); |
double (*receive_double)(struct OXFILE *oxfp); |
| } OXFILE; |
} OXFILE; |
| |
|
| |
#if 0 |
| |
#define OX_FD_SETSIZE FD_SETSIZE |
| |
#else |
| |
#define OX_FD_SETSIZE 32 |
| |
#endif |
| |
|
| |
typedef struct { |
| |
int count; |
| |
fd_set fdset; |
| |
OXFILE *p[OX_FD_SETSIZE]; |
| |
} OXFILE_set; |
| |
|
| typedef struct cmo { |
typedef struct cmo { |
| int tag; |
int tag; |
| } cmo; |
} cmo; |
| Line 120 typedef struct { |
|
| Line 140 typedef struct { |
|
| |
|
| typedef struct { |
typedef struct { |
| int tag; |
int tag; |
| |
mpfr_t mpfr; |
| |
} cmo_bf; |
| |
|
| |
typedef struct { |
| |
int tag; |
| |
cmo *re,*im; |
| |
} cmo_complex; |
| |
|
| |
typedef struct { |
| |
int tag; |
| double d; /* machine dependent */ |
double d; /* machine dependent */ |
| } cmo_double; |
} cmo_double; |
| |
|
| Line 192 cmo_zz* new_cmo_zz_set_string(char* s); |
|
| Line 222 cmo_zz* new_cmo_zz_set_string(char* s); |
|
| cmo_qq* new_cmo_qq(); |
cmo_qq* new_cmo_qq(); |
| cmo_qq* new_cmo_qq_set_mpq(mpq_ptr q); |
cmo_qq* new_cmo_qq_set_mpq(mpq_ptr q); |
| cmo_qq* new_cmo_qq_set_mpz(mpz_ptr num, mpz_ptr den); |
cmo_qq* new_cmo_qq_set_mpz(mpz_ptr num, mpz_ptr den); |
| |
cmo_bf* new_cmo_bf(); |
| |
cmo_bf* new_cmo_bf_set_mpfr(mpfr_ptr q); |
| |
cmo_complex* new_cmo_complex(); |
| |
cmo_complex* new_cmo_complex_set_re_im(cmo *re,cmo *im); |
| cmo_zero* new_cmo_zero(); |
cmo_zero* new_cmo_zero(); |
| cmo_double* new_cmo_double(double d); |
cmo_double* new_cmo_double(double d); |
| cmo_distributed_polynomial* new_cmo_distributed_polynomial(); |
cmo_distributed_polynomial* new_cmo_distributed_polynomial(); |
| Line 252 cmo_list* list_append_monomial(cmo_list* , cm |
|
| Line 286 cmo_list* list_append_monomial(cmo_list* , cm |
|
| cmo_list* list_appendl(cmo_list*, ...); |
cmo_list* list_appendl(cmo_list*, ...); |
| int list_length(cmo_list* ); |
int list_length(cmo_list* ); |
| cmo* list_nth(cmo_list* , int n); |
cmo* list_nth(cmo_list* , int n); |
| |
cmo* list_first_cmo(cmo_list *); |
| |
|
| int cmolen_cmo(cmo* m); |
int cmolen_cmo(cmo* m); |
| void dump_buffer_init(char *s); |
void dump_buffer_init(char *s); |
| Line 262 void dump_ox_data(ox_data* m); |
|
| Line 297 void dump_ox_data(ox_data* m); |
|
| void print_cmo(cmo* c); |
void print_cmo(cmo* c); |
| void resize_mpz(mpz_ptr mpz, int size); |
void resize_mpz(mpz_ptr mpz, int size); |
| |
|
| |
int cmo_to_int(cmo *n); |
| |
|
| typedef cmo *(*hook_t)(OXFILE *, cmo *); |
typedef cmo *(*hook_t)(OXFILE *, cmo *); |
| |
|
| int add_hook_before_send_cmo(hook_t func); |
int add_hook_before_send_cmo(hook_t func); |
| Line 282 char* get_symbol_by_tag(int tag); |
|
| Line 319 char* get_symbol_by_tag(int tag); |
|
| /* for mathcap database */ |
/* for mathcap database */ |
| mathcap *new_mathcap(); |
mathcap *new_mathcap(); |
| void mathcap_init(int ver, char *vstr, char *sysname, int cmos[], int sms[]); |
void mathcap_init(int ver, char *vstr, char *sysname, int cmos[], int sms[]); |
| |
void mathcap_init2(int ver, char *vstr, char *sysname, int cmos[], int sms[], char *options[]); |
| cmo_mathcap* mathcap_get(mathcap *); |
cmo_mathcap* mathcap_get(mathcap *); |
| mathcap *mathcap_update(mathcap *, cmo_mathcap *mc); |
mathcap *mathcap_update(mathcap *, cmo_mathcap *mc); |
| int mathcap_allowQ_cmo(mathcap *, cmo *ob); |
int mathcap_allowQ_cmo(mathcap *, cmo *ob); |