-/* void printMat(float **delta, int n); */
-
-/*;;;;;;;;;;; INPUT, OUTPUT, INITIALIZATION ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; ;
-; ;
-; The delta matrix is read from the input-file. ;
-; It is recommended to put it and the executable in ;
-; a special directory. The input-file and output-file ;
-; can be given as arguments to the executable by ;
-; typing them after the executable (Bionj input-file ;
-; output-file) or by typing them when asked by the ;
-; program. The input-file has to be formated according ;
-; the PHYLIP standard. The output file is formated ;
-; according to the NEWWICK standard. ;
-; ;
-; The lower-half of the delta matrix is occupied by ;
-; dissimilarities. The upper-half of the matrix is ;
-; occupied by variances. The first column ;
-; is initialized as 0; during the algorithm some ;
-; indices are no more used, and the corresponding ;
-; positions in the first column are set to 1. ;
-; ;
-; This delta matix is made symmetrical using the rule: ;
-; Dij = Dji <- (Dij + Dji)/2. The diagonal is set to 0; ;
-; during the further steps of the algorithm, it is used ;
-; to store the sums Sx. ;
-; ;
-; A second array, trees, is used to store taxon names. ;
-; During the further steps of the algoritm, some ;
-; positions in this array are emptied while the others ;
-; are used to store subtrees. ;
-; ;
-\*;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;*/
-
-
-/*;;;;;;;;;;;;;;;;;;;;;;;;;; Initialize ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;*\
-; ;
-; Description : This function reads an input file and return the ;
-; delta matrix and trees: the list of taxa. ;
-; ;
-; input : ;
-; float **delta : delta matrix ;
-; FILE *input : pointer to input file ;
-; int n : number of taxa ;
-; char **trees : list of taxa ;
-; ;
-; return value: ;
-; float **delta : delta matrix ;
-; char *trees : list of taxa ;
-; ;
-\*;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;*/
-
-//void Initialize(float **delta, FILE *input, int n, POINTERS *trees)
-void Initialize(float **delta, double *X, char **labels, int n, POINTERS *trees)
-{
- int lig; /* matrix line */
- int col; /* matrix column */
-// float distance;
- //char name_taxon[LEN]; /* taxon name */
- char name_taxon[MAX_LABEL_LENGTH];
- char format[MAX_DIGITS];
- WORD *name;
-
- snprintf (format, MAX_DIGITS, "%%%ds", MAX_LABEL_LENGTH);
-
- for(lig=1; lig <= n; lig++)
- {
- //fscanf(input,"%s",name_taxon); /* read taxon name */
- //fscanf (input, format, name_taxon); /* read taxon name */
- strncpy (name_taxon, labels[lig-1], MAX_LABEL_LENGTH);
- name=(WORD *)calloc(1,sizeof(WORD)); /* taxon name is */
- if(name == NULL) /* put in trees */
- {
- error("out of memory");
- }
- else
- {
- strncpy (name->name, name_taxon, MAX_LABEL_LENGTH);
- name->suiv=NULL;
- trees[lig].head=name;
- trees[lig].tail=name;
- for(col=lig; col <= n; col++)
- {
- //fscanf(input,"%f",&distance); /* read the distance */
-// &distance = X[XINDEX(lig,col)];
- delta[col][lig]=X[XINDEX(lig,col)];
- delta[lig][col]=X[XINDEX(lig,col)];
- if (lig==col)
- delta[lig][col]=0;
- }
- }
- }
- return;
-}