Issue 3 integral class Implementation#15
Open
theEhlien wants to merge 16 commits into
Open
Conversation
Updated project and project filter files to include Integral.cpp and Integral.h
- Added planning for implementation and functions - integration of Algebra class simplifyExpression added as comments
- Add function that finds variable to integrate upon - Start function that splits the expression into coefficients and exponents
- some functionality of splitExpression is added - remaining functionality of splitExpression is outlined in comments
- add a check before splitting the expression that makes sure there is a 'dx' form at end of expression - splitExpression removes integratedUpon symbol at end so it does not try to make that a term as well
- add checks for a^x form - add checks for e^x form
- add function declaration for evalTerm and fix Doxygen comments in header - add neccessary data structures to store evaluated data - create basic function call to do the evaluations
- This merge is to implement Unit Testing
- Created testing for integral class - Updated testCoverage.md and testResults.md to reflect where our team is putting unit testing - Fixed bugs in Integral class as needed for testing to pass
Jared-Gibson
approved these changes
May 4, 2020
Member
Jared-Gibson
left a comment
There was a problem hiding this comment.
Everything looks pretty good except for that copy-paste area.
Comment on lines
+148
to
+184
| // check for '/' (fraction) in it - if fraction, change coefficient for this term to match | ||
| if (*it == '/') { //leading coefficient is a fraction | ||
|
|
||
| std::string coeffTmp = ""; //coeffTmp holds digits until next non-digit char | ||
| it += 1; | ||
| while (*it != ' ' && *it != '+' && *it != '-') { | ||
| coeffTmp.push_back(*it); | ||
| ++it; | ||
| } | ||
| double coeffDouble = coeff.at(termIndex) / stod(coeffTmp); | ||
| coeff.at(termIndex) = coeffDouble; //overwrite parsed double value in coeff vector | ||
|
|
||
| } | ||
|
|
||
| if (*it == ' ' && *(it + 1) == '/' && *(it + 2) != ' ') { //leading coefficient is fraction (space before '/') | ||
| std::string coeffTmp = ""; // coeffTmp holds digits until next non-digit char | ||
| it += 2; | ||
| while (*it != ' ' && *it != '+' && *it != '-') | ||
| { | ||
| coeffTmp.push_back(*it); | ||
| ++it; | ||
| } | ||
| double coeffDouble = coeff.at(termIndex) / stod(coeffTmp); | ||
| coeff.at(termIndex) = coeffDouble; // overwrite parsed double value in coeff vector | ||
| } | ||
|
|
||
| if (*it == ' ' && *(it + 1) == '/' && *(it + 2) == ' ') { //leading coefficient is fraction (space before and after '/') | ||
| std::string coeffTmp = ""; // coeffTmp holds digits until next non-digit char | ||
| it += 3; | ||
| while (*it != ' ' && *it != '+' && *it != '-') | ||
| { | ||
| coeffTmp.push_back(*it); | ||
| ++it; | ||
| } | ||
| double coeffDouble = coeff.at(termIndex) / stod(coeffTmp); | ||
| coeff.at(termIndex) = coeffDouble; // overwrite parsed double value in coeff vector | ||
| } |
Member
There was a problem hiding this comment.
It seems that you do the same thing in these three if cases; perhaps they could be condensed into a method for re-usability.
|
Good documentation, code follows existing format well, tests all run fine with no obvious bugs |
|
Upon running the code no bugs or issues arrived, and the comments look well documented and concise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the changes:
evaluateIntegral (code is written but cannot work yet because of simplify function)
simplify (code is written but relies on an object that does not exist in the project yet - Algebra)
stringBuilder (has not been implemented yet)