Ignore:
Timestamp:
Sep 19, 2007, 2:17:05 AM (16 years ago)
Author:
Peter
Message:

rewriting SW algo, making code clearer, and perhaps removing a few bugs...?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/alignment_test.cc

    r870 r875  
    114114    }
    115115
     116  std::string a("AGGUUGUCCGUGGUGAGUUCGCA");
     117  std::string b("GAGGUUGUCCGUGGUGAGUUCG");
     118  utility::matrix m(a.size(), b.size());
     119  for (size_t j=0; j<a.size(); ++j)
     120    for (size_t k=0; k<b.size(); ++k)
     121      m(j,k) = (a[j]==b[k] ? 1 : -1000);
     122  double score=utility::SmithWaterman(m, 100, 100);
     123  if (score!=21)
     124    ok=false;
     125
    116126  // testing ssearch
    117127  if (utility::ssearch("Hello", "Hll", 0.0, 1.0)!=2){
     
    124134    ok=false;
    125135
     136  if (ok)
     137    *error << "Test is ok." << std::endl;
     138  else
     139    *error << "Test fails." << std::endl;
     140   
     141  if (error!=&std::cerr)
     142    delete error;
     143
    126144  if (ok) {
    127145    return 0;
Note: See TracChangeset for help on using the changeset viewer.