00001 #ifndef SYNAPS_MPOL_RS_H
00002 #define SYNAPS_MPOL_RS_H
00003
00004 #include <synaps/init.h>
00005
00006 extern "C" {
00007
00008 #include "synaps/io_interf_rs.h"
00009 #include "synaps/io_ascii.h"
00010 extern void parse_vars_ascii(void);
00011 extern void reordonne_groebner(void);
00012 extern void bz_bus_out(BUS, bz_const);
00013 extern void send_Groebner(BUS,list_smp_bz_const);
00014 extern void get_Groebner(BUS,list_smp_bz_ref,RS_I32 *,float *);
00015 }
00016
00017
00018 __BEGIN_NAMESPACE_SYNAPS
00019
00020 #define dup_bz_elt(a,i) vect_bz_elt(vect_bz_rep2t(a->rep),i)
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 BUS init_bus(char * machine,char *server,char *gbhome)
00035 {
00036 BUS RS=NULL;
00037 bz init_bz;
00038 bz_init_str(init_bz,"21345817372864405881847059188222722561");
00039 RS=(BUS)malloc(sizeof(BUS_REP));
00040 RS->__out=(String)malloc(GB_BUFF_SIZE);
00041 RS->__in=(String)malloc(GB_BUFF_SIZE);
00042 RS->hostName=machine;
00043 RS->algoName=server;
00044 RS->prot=(DYN_PROT)malloc(sizeof(DYN_PROT_REP));
00045 C__initProtocol(RS->prot);
00046 C__initProtocol_BI(RS->prot,(C__int *)(init_bz->_mp_d),abs(init_bz->_mp_size));
00047 C__open(RS,gbhome,"","");
00048 return(RS);
00049
00050 }
00051
00052 void send_vars_u(BUS RS,char *v)
00053 {
00054 int i=1;
00055 send_n(RS,(char*)(&i),4,4);
00056 C__sendString(RS,v);
00057 C__flush(RS);
00058 }
00059
00060 void send_up(BUS RS,dup_bz_ref p)
00061 {
00062 unsigned int i=1,c=0;
00063 C__sendMessages(RS,FGBRS_INIT);
00064 C__sendMessages(RS,FGBRS_INPUT);
00065 C__sendMessages(RS,FGBRS_VARS);
00066 send_vars_u(RS,"x");
00067 C__sendMessages(RS,FGBRS_INPUT);
00068 C__flush(RS);
00069 C__sendMessages(RS,FGBRS_PROPERTIES);
00070 C__flush(RS);
00071 C__sendMessages(RS,FGBRS_PROP_UP);
00072 C__flush(RS);
00073 C__sendMessages(RS,FGBRS_INPUT);
00074 C__flush(RS);
00075 C__sendMessages(RS,FGBRS_LIST);
00076 C__flush(RS);
00077
00078 send_n(RS,(char*)(&i),4,4);
00079 for(i=0;i<(p->rep).dim;i++) {
00080 if (RS_NOT(bz_isNull(dup_bz_elt(p,i)))) c++;
00081 }
00082 fprintf(stderr,"debut liste data\n");
00083
00084 fflush(stderr);
00085
00086 send_n(RS,(char*)(&c),4,4);
00087 for(i=0;i<p->rep.dim;i++) {
00088 if (RS_NOT(bz_isNull(dup_bz_elt(p,i)))) {
00089
00090 fprintf(stderr,"@");
00091 fflush(stderr);
00092
00093 send_n(RS,(char *)(&i),4,4);
00094
00095 fprintf(stderr,"#");
00096 fflush(stderr);
00097
00098 bz_bus_out(RS,dup_bz_elt(p,i));
00099 }
00100 }
00101 C__flush(RS);
00102 }
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151 __END_NAMESPACE_SYNAPS
00152
00153 #endif // SYNAPS_MPOL_RS_H
00154