Version 11/10/17
Educational Objectives: After completing this assignment, the student should be able to accomplish the following:
Operational Objectives: Design and implement the class template PatternSearch< Radix, Prime > that acts as a function object on input 2D arrays, returning the location of a first match or the size of the search space when no match is found.
Deliverables: Files:
ps.h # definition & implementation of template< size_t Radix, size_t Prime > class PatternSearch psdriver.cpp # driver client makefile # builds all project object code and executables manual.txt # operating instructions for software [team document] report.txt # overview of team and project [team document] log.txt # personal log for team member [individual document]
Submit command: submit.sh deliverables.rk
PatternSearch should be a class template that generalizes the outline for RabinKarp given in Strings 3.
Minimum required generalizations:
I/O: An overloaded input operator, and a "verification display" are needed to support the application.
Input Files: Specific line formatting of input files should not be required, so that if a file is reformatted (e.g., in "paragraphs") it will not affect the way the file is interpreted. The characters '\t' and '\n' (tab and newline) should be excluded from the pattern character set, and replaced with ' ' (blank) in patterns and search spaces.
Be sure to conform to the specs:
Where n is incoming search space size and k is the pattern size.
Probability: There should be a method long double Probability() const that returns the probability estimate of success under either rule.
User Feedback: Most user interaction is handled by the driver program. There is one place where the PatternSearch class needs to send informative statements depending on specific results. See the class notes and/or the area51/frk.x executable for details. It is important to have your output conform to those.
See Strings 3 for discussion and ideas on details.
See the executables fkmp.x and frk.x in LIB/area51 for behavior in 1D to generalize to 2D.