JWS-112 Bumping version of Mafft to version 7.310.
[jabaws.git] / binaries / src / mafft / core / MSalign11.c
index 2991db2..bff6c90 100644 (file)
@@ -35,7 +35,7 @@ static void extendmseq( char **mseq1, char **mseq2, char **seq1, char **seq2, in
        fprintf( stderr, "added %c to mseq2, mseq2 = %s \n", seq2[0][j], mseq2[0] );
 }
 
-static void match_calc( float *match, char **s1, char **s2, int i1, int lgth2 )
+static void match_calc( double *match, char **s1, char **s2, int i1, int lgth2 )
 {
        char tmpc = s1[0][i1];
        char *seq2 = s2[0];
@@ -44,10 +44,10 @@ static void match_calc( float *match, char **s1, char **s2, int i1, int lgth2 )
                *match++ = amino_dis[(int)tmpc][(int)*seq2++];
 }
 
-static float Atracking( float *lasthorizontalw, float *lastverticalw, 
+static double Atracking( double *lasthorizontalw, double *lastverticalw, 
                                                char **seq1, char **seq2, 
                         char **mseq1, char **mseq2, 
-                        float **cpmx1, float **cpmx2, 
+                        double **cpmx1, double **cpmx2, 
                         int **ijp )
 {
        int i, j, l, iin, jin, ifi, jfi, lgth1, lgth2, k, limk;
@@ -118,23 +118,23 @@ static float Atracking( float *lasthorizontalw, float *lastverticalw,
        return( 0.0 );
 }
 
-void backdp( float **WMMTX, float wmmax, float *maxinw, float *maxinh, int lgth1, int lgth2, int alloclen, float *w1, float *w2, float *initverticalw, float *m, int *mp, int iin, int jin, char **seq1, char **seq2, char **mseq1, char **mseq2 )
+void backdp( double **WMMTX, double wmmax, double *maxinw, double *maxinh, int lgth1, int lgth2, int alloclen, double *w1, double *w2, double *initverticalw, double *m, int *mp, int iin, int jin, char **seq1, char **seq2, char **mseq1, char **mseq2 )
 {
        register int i, j;
        int prevhiti, prevhitj;
 //     int lasti, lastj; 
-       float g;
-       float fpenalty = (float)penalty;
+       double g;
+       double fpenalty = (double)penalty;
 #if USE_PENALTY_EX
-       float fpenalty_ex = (float)penalty_ex;
+       double fpenalty_ex = (double)penalty_ex;
 #endif
-       float *currentw, *previousw, *wtmp;
-       float mi;
+       double *currentw, *previousw, *wtmp;
+       double mi;
        int mpi;
        int *mpjpt;
-       float *mjpt, *prept, *curpt;
-       float wm = 0.0;
-       float forwwm;
+       double *mjpt, *prept, *curpt;
+       double wm = 0.0;
+       double forwwm;
 
        currentw = w1;
        previousw = w2;
@@ -280,7 +280,7 @@ void backdp( float **WMMTX, float wmmax, float *maxinw, float *maxinh, int lgth1
 }
 
 
-float MSalign11( char **seq1, char **seq2, int alloclen )
+double MSalign11( char **seq1, char **seq2, int alloclen )
 /* score no keisan no sai motokaraaru gap no atukai ni mondai ga aru */
 {
 //     int k;
@@ -289,37 +289,37 @@ float MSalign11( char **seq1, char **seq2, int alloclen )
        int iin = 0, jin = 0;  // by Mathog, a guess
        int lgth1, lgth2;
        int resultlen;
-       float wm = 0.0;   /* int ?????? */
-       float g;
-       float *currentw, *previousw;
-       float fpenalty = (float)penalty;
+       double wm = 0.0;   /* int ?????? */
+       double g;
+       double *currentw, *previousw;
+       double fpenalty = (double)penalty;
 #if USE_PENALTY_EX
-       float fpenalty_ex = (float)penalty_ex;
+       double fpenalty_ex = (double)penalty_ex;
 #endif
-       float *maxinw = NULL, *maxinwpt = NULL; // by D.Mathog, guess
-       float *maxinh = NULL; // by D.Mathog, guess
+       double *maxinw = NULL, *maxinwpt = NULL; // by D.Mathog, guess
+       double *maxinh = NULL; // by D.Mathog, guess
 #if 1
-       float wmmax;
-       float *wtmp;
+       double wmmax;
+       double *wtmp;
        int *ijppt;
-       float *mjpt, *prept, *curpt;
+       double *mjpt, *prept, *curpt;
        int *mpjpt;
 #endif
-       static float mi, *m;
+       static double mi, *m;
        static int **ijp;
        static int mpi, *mp;
-       static float *w1, *w2;
-       static float *match;
-       static float *initverticalw;    /* kufuu sureba iranai */
-       static float *lastverticalw;    /* kufuu sureba iranai */
+       static double *w1, *w2;
+       static double *match;
+       static double *initverticalw;    /* kufuu sureba iranai */
+       static double *lastverticalw;    /* kufuu sureba iranai */
        static char **mseq1;
        static char **mseq2;
        static char **mseq;
-       static float **cpmx1;
-       static float **cpmx2;
+       static double **cpmx1;
+       static double **cpmx2;
        static int **intwork;
-       static float **WMMTX;
-       static float **floatwork;
+       static double **WMMTX;
+       static double **doublework;
        static int orlgth1 = 0, orlgth2 = 0;
 
        if( orlgth1 == 0 )
@@ -355,7 +355,7 @@ float MSalign11( char **seq1, char **seq2, int alloclen )
                        FreeFloatMtx( cpmx1 );
                        FreeFloatMtx( cpmx2 );
 
-                       FreeFloatMtx( floatwork );
+                       FreeFloatMtx( doublework );
                        FreeIntMtx( intwork );
                }
 
@@ -381,11 +381,11 @@ float MSalign11( char **seq1, char **seq2, int alloclen )
 
                mseq = AllocateCharMtx( njob, ll1+ll2 );
 
-               cpmx1 = AllocateFloatMtx( 26, ll1+2 );
-               cpmx2 = AllocateFloatMtx( 26, ll2+2 );
+               cpmx1 = AllocateFloatMtx( nalphabets, ll1+2 );
+               cpmx2 = AllocateFloatMtx( nalphabets, ll2+2 );
 
-               floatwork = AllocateFloatMtx( 26, MAX( ll1, ll2 )+2 ); 
-               intwork = AllocateIntMtx( 26, MAX( ll1, ll2 )+2 ); 
+               doublework = AllocateFloatMtx( nalphabets, MAX( ll1, ll2 )+2 ); 
+               intwork = AllocateIntMtx( nalphabets, MAX( ll1, ll2 )+2 ); 
 
 #if DEBUG
                fprintf( stderr, "succeeded\n" );