Algorithm 2.
comparekmerset (string first-string, string second-string)
| Require: Pair of F-set strings generated from m/z of spectra using GenerateFsets function |
| Ensure: Returns the number of F-set that are common between the two spectra |
| /* splitfunction(string X) takes a string X and changes it into vector where each entry in vector corresponds to a single F-set */ |
| vector firstv=splitfunction(first-string) |
| vector secondv=splitfunction(second-string) |
| int count=0 |
| for (i = 0; i < firstv.size(); i + +) in parallel do |
| for (j = 0; j < secondv.size(); j + +) do |
| if (firstv[i].compare(secondv[j]) == 0) then |
| count++; |
| end if |
| end for |
| end for |
| return count; |