Esempio n. 1
0
float monge_elkan_similarity(const char *str1, const char *str2) {

	float ret;

	affine_idx_cost_t *aff_idx_c = affine_gap_5_1();
	sub_cost_t *sub_cost = sub_cost_5_3_min_3();

	comp_idx_cost_t comp_cost = { .gap_cost = aff_idx_c, .sub_cost = sub_cost };

	w_comp_idx_cost_t conf = { .win_size = 100, .comp_conf = &comp_cost };

	ret = monge_elkan_similarity_custom(str1, str2, &conf);

	free_affine_sub_cost(aff_idx_c);
	free_sub_cost(sub_cost);

	return (ret);

}
			if (d[i][j] > max_so_far)
				max_so_far = d[i][j];

		}

	}

	return max_so_far;

}

float smith_waterman_gotoh(const char *str1, const char *str2) {

	comp_idx_cost_t comp_cost = {
			.gap_cost = affine_gap_5_1(),
			.sub_cost = sub_cost_5_3_min_3()
	};

	w_comp_idx_cost_t conf = {
			.win_size = 100,
			.comp_conf = &comp_cost
	};

	return custom_smith_waterman_gotoh(str1, str2, &conf);

}

float custom_smith_waterman_gotoh_similarity(const char *str1, const char *str2, const void *v_conf) {

	const w_comp_idx_cost_t *conf = v_conf;