Issue 6 creating algebra class#11
Conversation
* unload * pr fixes
* various settings fixes * PR fixes
* Fix accessibility bugs * style fix
* Updated Analyze Equation to set the current value of the variables before analysis * Updated SetGraphArgs to take in a graph parameter and use it in AnalyzeEquation()
* Support other locales for decimal and list seperators * PR fixes
* fix bugs * Update src/Calculator/Resources/en-US/Resources.resw Co-Authored-By: Rudy Huyn <rudyhuyn@gmail.com> Co-authored-by: Rudy Huyn <rudyhuyn@gmail.com>
…1058) * Replace ItemRepeater with ListView * Allow animations * undo temp key change * Remove animation
…microsoft#1065) * Add context menu items back * Disable if no selection
…lysis (microsoft#1067) * Select equation on focus * PR comment
Delete config files for internal FCIB and test processes which are no longer in use.
It is our GitHub anniversary, which means it is time to update the Windows Calculator project roadmap for 2020.
* Add telemetry for keyboard button usage in graphing mode * Added the diagnostics for EquationAdded and FunctionAnalysis * Added remaining diagnostics events for graphing calculator * Fix proj files to include the IsStoreBuild condition. Move the Delayer class to the Calculator/Utils folder * Ensure the variable textbox has focus before logging diagnostics * Move maxVariableCount check into the tracelogger class * Created enums and updated the slider value changed method to remove the variable from the map after the log method is called * Re-enable hidden lines when the expression is updated * Fixed extra line in grapher.h and removed the conditional logging for variable count * Updated logging per PR feedback * Updated variable logging and fixed issues in the IsEquationLineDisabled binding the EditTextBox control. * Update per PR feedback * Added TraceLogging project to contain shared logging logic. * Updated TraceLogging project and updated tracelogger classes to use the TraceLogging project methods * Updated VariableLogging to log variable name. And updated per PR comments * Updated Variables logging to log count changed instead of variable added and fixed issue with variableSliders not being initialized * Remove outdated tracelogging call caused by rebase * Updated Delayer class to DispatcherTimerDelayer and fixed some small formatting issues * Fixed missing Dalyer class name updates * Removed extra line in traceloger.h
* Make the pointer follow the mouse * Only render when necessary * Move trace rendering to background thread
* Added dark them to graph control, started dark theme for the controls on the graph * Dark theme for graphing mode updated to use event model, diagnostics added, cleaned up code that wasn't needed * Updated prepare-release-internalonly.yaml internal package version * Updated Theme Settings properties, removed version change, other small changes from PR feedback> * Updated the localSettings check and updated the GraphTheme event to send bool instead of string * Updated the equation line color to change with the graph theme * Rebased onto master and issues created during the rebase * Updates per code review feedback * Update settings properties to just have IsMatchAppTheme property and updated the high contrast settings for the graph control * Match version to current in master * Updated per PR feedback * Fix resetting the m_lastLineColorIndex to only happen when reassignColors is true * Changed second if to else if in the OnPropertyChanged method * fixed control button and equation line colors
…aphing engine package. (microsoft#1121)
* give chevron focus * fix merge issues * fix key
…the EquationEditBox for the previously analyzed function. (microsoft#1141)
* Fix microsoft#851: inconsistent operand order for log_y(x) - fixed the bug in scioper.cpp - changed the related test in CalculatorUnitTests - also changed the text in GraphingNumpad * Change the name of LogBaseX for consistency basically every occurence is repalced by logbasey, except for the localized string for narrator, which I left for the localization team to fix. * Fix the test * Revert GraphingNumPad.cpp * Fixup according to review
The header file will contain the variables and functions for algebraic operations for the symbolic calculator.
This file will contain all of the logic and functionality of the algebra classes functions so that algebriac operations will be performed. This classs must specifically be able to simplify expressions.
Since the calculator stores inputs as "wstrings", itll be easier to work with strings for expression simplification. That being said, converters were created. Algebra class structure was also changed to help better implement methods.
A method was created to help make sure that the expression is correctly formatted. This includes parenthesis counting.
The algebra class needs to be structured in such a way that it assumes there is a parent class converting the wstring input into a string input. This makes it easier for future classes so that they may work under the assumption that a class will be given a string. The parent class will also handle the conversion from wstring to string, so some functions were ommited.
The functions evaluate, precedence, and applyOp are now constructed in Algebra.cpp. The function precedence was also implemented as well.
Keeping things simple, I wasnt able to add functionality for exponents yet, so for now only 4 operators can take place when simplifying. I also got rid of a header file creating issues for the program.
Handled a few cases when parsing such as what to do if encountering a blank space, a starting parenthesis, and a digit.
This time it can handle the case of what to do when it encounters a closing parenthesis.
This case handles the final situation once the expression has been parsed. It will evaluate and can simplify.
The purpose of the format function is to correctly format the expression so that a space is in between each token. This allows other functions such as evaluate to work properly.
Now that the expression is for sure going to be in the correct format, we can continue making additions to this class with ease. I also finished implementign the simpifyExpression function.
Jared-Gibson
left a comment
There was a problem hiding this comment.
For your Algebra.h, you do not need the inline keywords as all the functions defined inside the class are implicitly inline (ref: https://www.geeksforgeeks.org/inline-functions-cpp/ and http://www.cplusplus.com/articles/G3wTURfi/). Other than that, I would also add some comments in the header file that explain what each method does/why it does.
|
Nico, I was also wondering about the other commits shown that are not yours. It seems as though this branch is ahead of our master branch and has possibly been created from Microsoft's master rather than our master. I'm not sure if this is a big deal or not, but thought it was worth mentioning in case that was not the intent here. |
|
More documentation required, resolution needed for commits possibly created from Microsoft master branch |
Fixes #.
This addresses issue 6 of creating an algebra class capable of simplifying expressions.
Once reviewed and approved, this will close the branch issue-6-creating-algebra-class
Description of the changes:
Two files were created, Algebra.h & Algebra.cpp. These files contain the logic and capability of taking a string expression from a supposed parent class, and simplifying that expression. Many functions were implemented for proper parsing and evaluation.
How changes were validated:
I tested my changes by creating a separate project and running the code there. It was the same IDE and so that should minimize any differences. Plus since it was not accessing any other files except its own, then there was no need to create a separate testing copy.