Skip to content

Issue 12 solving for variable#13

Open
Nicolo7 wants to merge 76 commits into
masterfrom
issue-12-solving-for-variable
Open

Issue 12 solving for variable#13
Nicolo7 wants to merge 76 commits into
masterfrom
issue-12-solving-for-variable

Conversation

@Nicolo7
Copy link
Copy Markdown

@Nicolo7 Nicolo7 commented Apr 21, 2020

Fixes #.

This addresses issue 12 of implementing the ability to solve for a variable, this Closes #12 which is issue-12-solving-for-variable

Description of the changes:

Building off of the two files created from issue-6-creating-algebra-class, I restructured the class by adding an extra variable. I then added a few extra functions to get, set, and clear those variables. Finally I added an extra function that would be able to solve for variables.

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.

joseartrivera and others added 30 commits February 24, 2020 10:27
* 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
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
joseartrivera and others added 26 commits April 1, 2020 09:12
…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
…icrosoft#784)

* refactor HistoryTest

* modify MultiWindowUnitTests to not use m_standardCalcManager

* rebase

Co-authored-by: Rudy Huyn <rudy.huyn@microsoft.com>
* Fix two pane crash on closing window

* clearcrash
microsoft#1133)

* Missing EquationInputArea and KGF Automation Names added

* Updated the KGF back button automation name and tooltip and added the automation name string for the KGF equation edit box

* Reverted the removal of x:names and updated Variable Step Textbox to Variable Step Value Textbox per PR feedback

* Updated the VariableListViewItem narrator announcement to include the name of the variable
* Fix two pane crash on closing window

* recycle equation colors

* PR comments
* Update internal package vers

* fix more bugs

* PR comments

* PR comments

* Undo last PR changes

* Pr comments
* Turn off keyboard shortcuts when in graphing mode

* Added automation names to the graphnumpad, added any missing ones to the resources.resw file

* Remove HonorShortcuts call in the EquationInputArea, update Equal button automation name to use the existing one

* conditionally set the HonorShortcuts when the nav menu is closed

* added disable shortcuts to override HonorShortcuts when it is set
* Update icon file

* function analysis and negate button icons updated

* Replace zoom reset button with graph view button

* Fixed issue where the window settings did not update after panning/zooming

* Updated icon styling and added logic for updating the graph view button state when user manipulates the graph and when all equations are removed

* updated LogGraphButton clicked to have an enum for the button value instead of a string

* Updated the logic for how to set the IsManualAdjustment, ensured graphsettings now update IsManualAdjustment when changed
* Fixed line colors out of bounds issue when switching to high contrast

* Update the fix to not reload the colors OnColorChanged when in HighContrast
I added the algebra classes (Algebra.cpp & Algebra.h) since the previous pull request hasnt been reviewed and cant be merged. In addition to this, I added a new variable that saves the string expression without spaces. Some parsing is faster and better in this case.
The newExpression function allows a manager class to instantiate new expressions without having to constantly create new algebra objects. This is a "setter" function that the constructor also will utilize.
The first part of the solving for a variable function is to handle the case where you run into a an + or a -
The second part of the solveForVariable function is handling the case for encountering the variable. This part is crucial as it determines whether or not the variable might be negative or not. It must be able to tell the difference between a negative and a positive variable.
The final part in the function is to handle the cases for whats left. There might be an extra number left over, or the answer might not contain a solution, or the answer might be infinite solutions. Then it can finally return the solution
These extra functions could allow a manager or super class to see the expression thats being dealt with and it allows the class to be able to clear the variables before setting something new in them.
Copy link
Copy Markdown
Member

@Jared-Gibson Jared-Gibson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the format method should be changed to have no parameters and be a void return type; the method should then use Algebra.expression as the string it formats. I think this change will be for the better since you already take in a string in the constructor and I'm assuming that is the only string that will every be worked on by this class.

@theEhlien
Copy link
Copy Markdown
Member

It appears that this branch has multiple requests that are out of sync from our own master branch and have been pulled from the Microsoft master branch. These changes will need to be discarded before the branch can be merged with our master cleanly. Other than that, I don't see additional problems apart from what Jared has already mentioned.

@smalls4894 smalls4894 self-requested a review May 3, 2020 22:33
@smalls4894
Copy link
Copy Markdown

Resolution required for commits shown that are possibly from Microsoft master branch instead of our groups branch. Well documented, but restructuring of class for ease of merging with master branch may be needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow the Algebra class to be able to solve for a single variable