-
Notifications
You must be signed in to change notification settings - Fork 0
/
init_F.c
46 lines (35 loc) · 1.19 KB
/
init_F.c
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
35
36
37
38
39
40
41
42
43
44
45
46
/*
* init_F.c
*
* Created on: Oct 21, 2015
* Author: Sunny K
* reads in text file f
* store dosing schedule as F[dose_per][Type_dose]
*/
#include <stdio.h> /* This program simulates dynamics of affinity maturation in germinal centers */
//#include <stdlib.h>
//#include <math.h>
//#include <time.h> /* for seeding the rd # generator */
#include "header_gillespie.h"
#include <errno.h>
void init_F(double F_curr[][Type_dose]){
FILE *F_dosing_schedule;
F_dosing_schedule=fopen("F_dosing_schedule.txt","r");
if (F_dosing_schedule == NULL) {
fprintf(stderr, "file open error\n");
}
int i=0;
char line[80];
while(fgets(line, 80, F_dosing_schedule) != NULL)
{
/* get a line, up to 80 chars from fr. done if NULL */
// printf(line);
printf("printing");
sscanf (line, "%lf %lf %lf %lf", &(F_curr[i][0]),&(F_curr[i][1]),&(F_curr[i][2]),&(F_curr[i][3]));
/* convert the string to a long int */
// Validation
// printf("%e %e %e %e\n",F_curr[i][0],F_curr[i][1],F_curr[i][2],F_curr[i][3]);
i++;
}
fclose(F_dosing_schedule);
}