Skip to content

Commit f436295

Browse files
committed
Renaming functions to more accurate names
1 parent 7755355 commit f436295

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

ExprFormulaTester/ExprFormulaTester.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,12 @@ int main()
256256
//IntFormTest = "5+10x";
257257
//std::cout << IntFormTest.ToString() << " = " << IntFormTest.EvalValues(IntValueDefinitions) << std::endl;
258258

259-
MediumDecFormula AltFormTest = "5+5+x";
259+
MediumDecFormula AltFormTest = "5+5+x+(x)";
260260
tsl::ordered_map<std::string, MediumDec> ValueDefinitions;
261261
ValueDefinitions.insert_or_assign("x", MediumDec::One);
262262

263263
std::cout << "(MediumDecFormula) "<< AltFormTest.ToString() <<std::endl;
264-
AltFormTest = AltFormTest.SimplifyFormula(ValueDefinitions);
264+
AltFormTest = AltFormTest.EvaluateToSimplifiedForm(ValueDefinitions);
265265
std::cout << " = " << AltFormTest.ToString() << std::endl;
266266
//AltFormTest = "5.5^(1.5+x)+6x";
267267
//std::cout << "(MediumDecFormula) " << AltFormTest.ToString() << " = " << rootTest.ToString() << std::endl;

GlobalCode/Databases/MediumDecFormula.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace BlazesRusCode
4343
/// <param name="FormCopy">The form copy.</param>
4444
/// <param name="ElementValues">The element values.</param>
4545
/// <param name="FormIndex">Index of the form.</param>
46-
void SwapUpdatedFormData(ValueMap& ElementValues, size_t FormIndex = 0)
46+
void ReplaceVariablesWithValues(ValueMap& ElementValues, size_t FormIndex = 0)
4747
{
4848
std::string CurString;
4949
MediumDec targetResult;
@@ -52,7 +52,7 @@ namespace BlazesRusCode
5252
{
5353
if (CurrentVal->second.ElementCat == FormulaElementType::Formula)//FormulaDetected
5454
{
55-
SwapUpdatedFormData(ElementValues, CurrentVal->second.Index);
55+
ReplaceVariablesWithValues(ElementValues, CurrentVal->second.Index);
5656
//if (Data.at(FormIndex).size() == 1)
5757
//{
5858
// FormData& ContainedFormulaElement = Data.at(CurrentVal->first);
@@ -89,10 +89,10 @@ namespace BlazesRusCode
8989
/// </summary>
9090
/// <param name="ElementValues">The element values.</param>
9191
/// <returns>BlazesRusCode.MediumDecFormula</returns>
92-
MediumDecFormula SimplifyFormula(ValueMap ElementValues)
92+
MediumDecFormula EvaluateToSimplifiedForm(ValueMap ElementValues)
9393
{
9494
MediumDecFormula FormCopy = *this;//Duplicate values so can erase parts when calculating
95-
FormCopy.SwapUpdatedFormData(ElementValues);
95+
FormCopy.ReplaceVariablesWithValues(ElementValues);
9696
return FormCopy;//EvaluateOrderOfOperations(FormCopy);
9797
}
9898

0 commit comments

Comments
 (0)