Exemplo n.º 1
0
Viterbi::Viterbi(int max_seq_length,bool local,float penalty_gap_query,float penalty_gap_template,
        float correlation, int par_min_overlap, float shift, const int ss_mode, float ssw,
        const float S73[NDSSP][NSSPRED][MAXCF], const float S33[NSSPRED][MAXCF][NSSPRED][MAXCF],
        const float S37[NSSPRED][MAXCF][NDSSP])
: S73(S73), S33(S33), S37(S37)
{
    this->max_seq_length=max_seq_length;
    this->local = local;
    this->penalty_gap_query = penalty_gap_query;
    this->penalty_gap_template = penalty_gap_template;
    this->sMM_DG_MI_GD_IM_vec = (simd_float *) malloc_simd_float(VECSIZE_FLOAT*max_seq_length*5*sizeof(float));

    this->correlation = correlation;
    this->par_min_overlap = par_min_overlap;
//    this->exclstr = new char[strlen(exclstr)+1];
//    strcpy(this->exclstr, exclstr);
    this->shift = shift;
    this->ssw = ssw;
//    //  S73[NDSSP][NSSPRED][MAXCF]
//    //  7 * 3 * 10
//    //  3 * 10 = 30
//    //  32 <- next bigger simd size
//    this->ss73_lookup =  (simd_int *) malloc_simd_float((NDSSP - 1) * 32 * sizeof(unsigned char));
//    // S33[NSSPRED][MAXCF][NSSPRED][MAXCF]
//    //  3 * 10 * (3 * 10)
//    //  (3 * 10) = 30
//    //  32 <- next bigger simd size
//    this->ss33_lookup =  (simd_int *) malloc_simd_float((NSSPRED - 1) * (MAXCF - 1) * 32 * sizeof(unsigned char));
//
    // pre computed scores for one row
    this->ss_score = (float *) malloc_simd_float(VECSIZE_FLOAT*max_seq_length*sizeof(float));
    this->ss_mode = ss_mode;
    

}
Exemplo n.º 2
0
PosteriorDecoder::PosteriorDecoder(int maxres, bool local, int q_length, const float ssw,
								   const float S73[NDSSP][NSSPRED][MAXCF], const float S33[NSSPRED][MAXCF][NSSPRED][MAXCF],
								   const float S37[NSSPRED][MAXCF][NDSSP]) :
		m_max_res(maxres),
		m_local(local),
		m_q_length(q_length),
		S73(S73), S33(S33), S37(S37)
{
	this->ssw = ssw;
	this->m_curr = (PosteriorMatrixCol *) malloc_simd_float((m_max_res + 2 ) * sizeof(PosteriorMatrixCol));
	this->m_prev = (PosteriorMatrixCol *) malloc_simd_float((m_max_res + 2 ) * sizeof(PosteriorMatrixCol));

	this->m_s_curr = (double*) malloc_simd_float((m_max_res + 2 ) * sizeof(double));
	this->m_s_prev = (double*) malloc_simd_float((m_max_res + 2 ) * sizeof(double));

	this->p_last_col = (double*) malloc_simd_float(q_length * sizeof(double));

	//m_p_min = (m_local ? simdf32_set(0.0f) : simdf32_set(-FLT_MAX));

	this->m_p_forward = malloc_simd_float( sizeof(float));

	this->m_back_forward_matrix_threshold = 0.0001;
	this->m_backward_entries.clear();
	this->m_forward_entries.clear();

	this->scale = new double[q_length + 2];
	this->m_temp_hit = new Hit;
}