Version 10/30/18
Educational Objectives: After completing this assignment, the student should be able to accomplish the following:
Operational Objectives: Work Exercises 1,2,3 in Course Notes: Strings 4.
Deliverables:
LCS.cpp # implements Longest Common Subsequence [solution to Exercise 1] ED.cpp # implements Edit Distance [solution to Exercise 3] log.txt # work log / test diary [begins with solution to Exercise 2]
The official development/testing/assessment environment is specified in the Course Organizer. Code should compile without warnings or errors.
In order not to confuse the submit system, create and work within a separate subdirectory cop4531/proj5.
Maintain your work log in the text file log.txt as documentation of effort, testing results, and development history. This file may also be used to report on any relevant issues encountered during project development.
General requirement on genericity. Use generics whenever possible. For example:
In short: re-use components from LIB (or your own versions) whenever possible. Don't re-invent the wheels.
Begin by copying these files into your project directory:
LIB/proj5/deliverables.sh # submission configuration file LIB/area51/LCS_i.x # benchmark Longest Common Subsequence executable LIB/area51/ED_i.x # benchmark Edit Distance executable
Note that the benchmark executables may exhibit different behavior than the samples in LIB/notes_support of the same name.
Create the files LCS.cpp and ED.cpp as described in Exercises 1 and 3.
Create the file log.txt as usual, and add solutions to Exercise 2.
Follow these steps when you are ready to submit:
Warning: Submit scripts do not work on the program and linprog servers. Use shell.cs.fsu.edu or quake.cs.fsu.edu to submit projects. If you do not receive the second confirmation with the contents of your project, there has been a malfunction.
These libraries may NOT be used:
<string> <set> <unordered_set> <map> <unordered_map> <algorithm>
There are equivalent components of the fsu::library in ~cop4531p/LIB that may be used.
Be sure that the source code files LCS.cpp and ED.cpp compile directly to executables using the c4531 command line compile macro:
c4531 LCS # produces LCS.x c4531 ED # produces ED.x
Don't make the mistake of assuming standards are down because we are allowing one-command compile. At this stage of your career, all code that you write should be up to high standards of design, formatting, wise name choices, self-documenting code and design, and all the other things that make code pleasurably readable.
In particular, we recommend using two enumerated types DIR = { ZERO, LEFT, UP, DIAG }; (for direction in the P matrix) and EDITS = { Delete, Insert, Substitute, Match }; (for edit transcripts) with overloaded output operator<< for each type. This alone will make your code more readable and maintainable.
No global variables, and large objects (e.g., sequences and matrices) should be passed by reference or pointer (when the function call is expected to modify the object) or const reference or pointer (when no modification should occur).
LCS.x and ED.x should exhibit behavior identical to their LIB/area51 benchmarks.
Check out:
LIB/tcpp/matrix.h # matrices LIB/tcpp/genalg.h # fsu::Max
Note that fsu::Matrix < T > has some useful methods (aside from the "double" bracket operator[][]) - particularly Dump(std::ostream& os , size_t width).
When taking the Min of three things, we suggest coding it directly using this logic:
// Min (A,B,C) val = A; if (B < val) val = B; if (C < val) val = C;
This means that A wins ties with either B or C and B wins ties with C. This will be helpful in getting consistent results in the parent matrix P. Using operators:
Min (A,B,C) = (A <= (x = (B <= C ? B : C)) ? A : x); // <-- this Min (A,B,C) = (A < (x = (B < C ? B : C)) ? A : x); // <-- NOT this