~ubuntu-branches/ubuntu/utopic/mafft/utopic-201405121512

« back to all changes in this revision

Viewing changes to core/genalign11.c

  • Committer: Package Import Robot
  • Author(s): Charles Plessy
  • Date: 2014-01-19 08:25:50 UTC
  • mfrom: (18.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140119082550-y9m1g39vel5jjm1t
Tags: 7.130-1
* New upstream release.
* Correct ‘XS-Testsuite’ to ‘Testsuite’ in debian/control.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
static TLS int localstop;
10
10
 
11
11
#if 1
12
 
static void match_calc( float *match, char **s1, char **s2, int i1, int lgth2 ) 
 
12
static void match_calc_mtx( double **mtx, float *match, char **s1, char **s2, int i1, int lgth2 ) 
13
13
{
14
 
        char tmpc = s1[0][i1];
15
14
        char *seq2 = s2[0];
 
15
        double *doubleptr = mtx[(int)s1[0][i1]];
16
16
 
17
17
        while( lgth2-- )
18
 
                *match++ = amino_dis[(int)tmpc][(int)*seq2++];
 
18
                *match++ = doubleptr[(int)*seq2++];
19
19
}
20
20
#else
21
21
static void match_calc( float *match, char **s1, char **s2, int i1, int lgth2 )
110
110
}
111
111
 
112
112
 
113
 
float genL__align11( char **seq1, char **seq2, int alloclen, int *off1pt, int *off2pt )
 
113
float genL__align11( double **n_dynamicmtx, char **seq1, char **seq2, int alloclen, int *off1pt, int *off2pt )
114
114
/* score no keisan no sai motokaraaru gap no atukai ni mondai ga aru */
115
115
{
116
116
//      int k;
146
146
        static TLS int **intwork;
147
147
        static TLS float **floatwork;
148
148
        static TLS int orlgth1 = 0, orlgth2 = 0;
 
149
        static TLS double **amino_dynamicmtx = NULL; // ??
149
150
        float maxwm;
150
151
        float tbk;
151
152
        int tbki, tbkj;
186
187
 
187
188
                        FreeFloatMtx( floatwork );
188
189
                        FreeIntMtx( intwork );
 
190
                        if( amino_dynamicmtx ) FreeDoubleMtx( amino_dynamicmtx ); amino_dynamicmtx = NULL;
189
191
 
190
192
                }
191
193
                return( 0.0 );
229
231
 
230
232
                        FreeFloatMtx( floatwork );
231
233
                        FreeIntMtx( intwork );
 
234
                        if( amino_dynamicmtx ) FreeDoubleMtx( amino_dynamicmtx ); amino_dynamicmtx = NULL;
232
235
                }
233
236
 
234
237
                ll1 = MAX( (int)(1.3*lgth1), orlgth1 ) + 100;
258
261
                floatwork = AllocateFloatMtx( nalphabets, MAX( ll1, ll2 )+2 ); 
259
262
                intwork = AllocateIntMtx( nalphabets, MAX( ll1, ll2 )+2 ); 
260
263
 
 
264
                amino_dynamicmtx = AllocateDoubleMtx( 0x80, 0x80 );
 
265
 
261
266
#if DEBUG
262
267
                fprintf( stderr, "succeeded\n" );
263
268
#endif
266
271
                orlgth2 = ll2 - 100;
267
272
        }
268
273
 
 
274
    for( i=0; i<nalphabets; i++) for( j=0; j<nalphabets; j++ )
 
275
                amino_dynamicmtx[(int)amino[i]][(int)amino[j]] = (double)n_dynamicmtx[i][j];
269
276
 
270
277
        mseq1[0] = mseq[0];
271
278
        mseq2[0] = mseq[1];
310
317
        currentw = w1;
311
318
        previousw = w2;
312
319
 
313
 
        match_calc( initverticalw, seq2, seq1, 0, lgth1 );
 
320
        match_calc_mtx( amino_dynamicmtx, initverticalw, seq2, seq1, 0, lgth1 );
314
321
 
315
 
        match_calc( currentw, seq1, seq2, 0, lgth2 );
 
322
        match_calc_mtx( amino_dynamicmtx, currentw, seq1, seq2, 0, lgth2 );
316
323
 
317
324
 
318
325
        lasti = lgth2+1;
368
375
 
369
376
                previousw[0] = initverticalw[i-1];
370
377
 
371
 
                match_calc( currentw, seq1, seq2, i, lgth2 );
 
378
                match_calc_mtx( amino_dynamicmtx, currentw, seq1, seq2, i, lgth2 );
372
379
#if DEBUG2
373
380
                fprintf( stderr, "%c   ", seq1[0][i] );
374
381
                fprintf( stderr, "%5.0f ", currentw[0] );