/* * The program takes as input files "s_in.txt" and "s_out.txt", that are the two NxM stoichiometric matrices * of input and output, where N=59 and M=39 are respectively the reactions and metabolites numbers of the * Red Blood Cell metabolic network. * The program produces as output the files "h.txt" which contains 10000 fluxes solutions of the Von Neumann problem. * * Created by Daniele Granata on 10/06/08. */ #include #include #include typedef unsigned long long int RANDn; /* definizione del tipo unsigned long long int */ double gen(); void normalize(); void Consumo(int,int, double); int Minover(int,int,double); int trovamin (int); void caricafile(); RANDn In; int a[59][39]={0}, b[59][63]={0}; double s[59]={0},c[39]={0}; double s_pr[59]={0},c_pr[39]={0}; double x; int main() { int N=59,M=39,j,m,t,k,i=0,v=0,passi=0; caricafile(); FILE *f; f=fopen("h.txt","w"); FILE *pippo; pippo=fopen("c.txt","w"); double somma=0.,p=0.; srand(time(0)); In=rand(); In=rand(); for(k=0;k<10000;k++){ p=0.5; passi=0; //x=1.; for(m=0;m0) s[j]=s[j]+(b[j][m]-p*a[j][m])*x; } normalize(); Consumo(N,M,p); m=trovamin(M); passi++; } if(passi!=1000000) { for(i=0;i