19 #ifndef OST_SEQ_SUBST_WEIGHT_MATRIX_HH
20 #define OST_SEQ_SUBST_WEIGHT_MATRIX_HH
30 namespace ost {
namespace seq {
namespace alg {
41 const static int ALPHABET_SIZE=
'Z'-
'A'+1;
47 ::memset(weights_, 0,
sizeof(
WeightType)*ALPHABET_SIZE*ALPHABET_SIZE);
52 int i=Index(aa_one, aa_two);
53 assert(i>=0 && i<ALPHABET_SIZE*ALPHABET_SIZE);
57 void SetWeight(
char aa_one,
char aa_two,
WeightType weight)
59 int i=Index(aa_one, aa_two);
60 assert(i>=0 && i<ALPHABET_SIZE*ALPHABET_SIZE);
64 int Index(
char aa_one,
char aa_two)
const {
65 return (toupper(aa_one)-
'A')*ALPHABET_SIZE+(toupper(aa_two)-
'A');
67 WeightType weights_[ALPHABET_SIZE*ALPHABET_SIZE];