rename [gset_soft_thres to [gs]et_soft_threshold]
[mussa.git] / alg / mussa.cpp
index 9efe35adf5781b48f0ff405336e80ddd7eac0101..003f68aac8e045e2b8b309133c2914b75b167f2e 100644 (file)
@@ -95,7 +95,8 @@ void
 Mussa::set_threshold(int a_threshold)
 {
   threshold = a_threshold;
-  //soft_thres = a_threshold;
+  if (a_threshold > soft_thres) 
+    soft_thres = a_threshold;
 }
 
 int Mussa::get_threshold() const
@@ -104,12 +105,18 @@ int Mussa::get_threshold() const
 }
 
 void
-Mussa::set_soft_thres(int sft_thres)
+Mussa::set_soft_threshold(int new_threshold)
 {
-  soft_thres = sft_thres;
+  if (new_threshold < threshold) {
+    soft_thres = threshold;
+  } else if (new_threshold > window) {
+    soft_thres = window; 
+  } else {
+    soft_thres = new_threshold;
+  }
 }
 
-int Mussa::get_soft_thres() const
+int Mussa::get_soft_threshold() const
 {
   return soft_thres;
 }
@@ -471,7 +478,7 @@ Mussa::nway()
 {
   vector<string> some_Seqs;
 
-  the_paths.set_soft_thres(soft_thres);
+  the_paths.set_soft_threshold(soft_thres);
 
   if (ana_mode == TransitiveNway) {
     the_paths.trans_path_search(all_comps);