]> git.donarmstrong.com Git - ape.git/blobdiff - src/me.h
final commit for ape 3.0-8
[ape.git] / src / me.h
index 3ceb771c95248e726626a0eaea556cd46fe29406..dc5e3ee38233cd91225a1915edc74c81a8745686 100644 (file)
--- a/src/me.h
+++ b/src/me.h
@@ -1,11 +1,10 @@
-//#include <stdio.h>
-//#include <stdlib.h>
-//#include <math.h>
-//#include <string.h>
-//#include <sys/types.h>
-//#include <sys/stat.h>
-//#include "main.h"
-//#include "graph.h"
+/* me.h    2012-04-30 */
+
+/* Copyright 2007-2008 Vincent Lefort, modified by Emmanuel Paradis */
+
+/* This file is part of the R-package `ape'. */
+/* See the file ../COPYING for licensing issues. */
+
 #include <R.h>
 
 #ifndef NONE
 #ifndef MAX_LABEL_LENGTH
 #define MAX_LABEL_LENGTH 30
 #endif
-#ifndef NODE_LABEL_LENGTH
-#define NODE_LABEL_LENGTH 30
-#endif
+//#ifndef NODE_LABEL_LENGTH
+//#define NODE_LABEL_LENGTH 30
+//#endif
 #ifndef EDGE_LABEL_LENGTH
 #define EDGE_LABEL_LENGTH 30
 #endif
 #ifndef MAX_DIGITS
 #define MAX_DIGITS 20
 #endif
-#ifndef INPUT_SIZE
-#define INPUT_SIZE 100
-#endif
+/* #ifndef INPUT_SIZE */
+/* #define INPUT_SIZE 100 */
+/* #endif */
 #ifndef MAX_INPUT_SIZE
 #define MAX_INPUT_SIZE 100000
 #endif
@@ -69,16 +68,16 @@ typedef struct word
 {
   char name[MAX_LABEL_LENGTH];
   struct word *suiv;
-}WORD;
+} WORD;
 
 typedef struct pointers
 {
   WORD *head;
   WORD *tail;
-}POINTERS;
+} POINTERS;
 
 typedef struct node {
-  char label[NODE_LABEL_LENGTH];
+  int label; /* char label[NODE_LABEL_LENGTH]; */
   struct edge *parentEdge;
   struct edge *leftEdge;
   struct edge *middleEdge;
@@ -110,14 +109,13 @@ typedef struct set
   struct set *secondNode;
 } set;
 
-void me_b(double *X, int *N, char **labels, char **treeStr, int *nni);
-void me_o(double *X, int *N, char **labels, char **treeStr, int *nni);
-int whiteSpace(char c);
+void me_b(double *X, int *N, int *labels, int *nni, int *spr, int *tbr, int *edge1, int *edge2, double *el);
+void me_o(double *X, int *N, int *labels, int *nni, int *edge1, int *edge2, double *el);
 double **initDoubleMatrix(int d);
-double **loadMatrix (double *X, char **labels, int n, set *S);
+double **loadMatrix (double *X, int *labels, int n, set *S);
 set *addToSet(node *v, set *X);
-node *makeNewNode(char *label, int i);
-node *makeNode(char *label, edge *parentEdge, int index);
+node *makeNewNode(int label, int i);
+node *makeNode(int label, edge *parentEdge, int index);
 node *copyNode(node *v);
 edge *siblingEdge(edge *e);
 edge *makeEdge(char *label, node *tail, node *head, double weight);
@@ -136,10 +134,8 @@ void freeSet(set *S);
 void freeTree(tree *T);
 void freeSubTree(edge *e);
 int leaf(node *v);
-tree *readNewickString (char *str, int numLeaves);
-node *decodeNewickSubtree(char *treeString, tree *T, int *uCount);
-void NewickPrintSubtree(tree *T, edge *e, char *str);
-void NewickPrintBinaryTree(tree *T, char *str);
-void NewickPrintTrinaryTree(tree *T, char *str);
-void NewickPrintTreeStr(tree *T, char *str);
-
+/* int whiteSpace(char c); */
+/* node *decodeNewickSubtree(char *treeString, tree *T, int *uCount); */
+/* tree *readNewickString (char *str, int numLeaves); */
+void subtree2phylo(node *parent, int *edge1, int *edge2, double *el, int *ilab);
+void tree2phylo(tree *T, int *edge1, int *edge2, double *el, int *ilab, int n);