mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[Reformat] Clean all spaces
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
#include <string.h>
|
||||
#include <new>
|
||||
#if POINCARE_TREE_LOG
|
||||
#include <iostream>
|
||||
#include <ostream>
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
@@ -256,13 +256,9 @@ public:
|
||||
Representative::Prefixable::No,
|
||||
NoPrefix),
|
||||
},
|
||||
|
||||
SolideAngleRepresentatives[] = {
|
||||
Representative("sr", nullptr, Representative::Prefixable::No, NoPrefix),
|
||||
},
|
||||
|
||||
|
||||
|
||||
MassRepresentatives[] = {
|
||||
Representative("g", nullptr,
|
||||
Representative::Prefixable::Yes,
|
||||
@@ -299,15 +295,12 @@ public:
|
||||
Representative::Prefixable::Yes,
|
||||
PositiveLongScalePrefixes),
|
||||
},
|
||||
|
||||
LuminousFluxRepresentatives[] = {
|
||||
Representative("lm", "_cd*_sr", Representative::Prefixable::No, NoPrefix),
|
||||
},
|
||||
|
||||
IlluminanceRepresentatives[] = {
|
||||
Representative("lx", "_cd*_sr*_m^(-2)", Representative::Prefixable::No, NoPrefix),
|
||||
},
|
||||
|
||||
ForceRepresentatives[] = {
|
||||
Representative("N", "_kg*_m*_s^-2",
|
||||
Representative::Prefixable::Yes,
|
||||
|
||||
@@ -224,29 +224,14 @@ Unit Unit::Builder(const Dimension * dimension, const Representative * represent
|
||||
}
|
||||
|
||||
Expression Unit::shallowReduce(ExpressionNode::ReductionContext reductionContext) {
|
||||
|
||||
|
||||
if (reductionContext.symbolicComputation() == ExpressionNode::SymbolicComputation::ReplaceAllSymbolsWithUndefinedAndDoNotReplaceUnits) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
UnitNode * unitNode = static_cast<UnitNode *>(node());
|
||||
|
||||
|
||||
const Dimension * dim = unitNode->dimension();
|
||||
|
||||
|
||||
const Representative * rep = unitNode->representative();
|
||||
|
||||
|
||||
const Prefix * pre = unitNode->prefix();
|
||||
|
||||
|
||||
|
||||
int8_t prefixMultiplier = pre->exponent();
|
||||
|
||||
|
||||
if (rep == dim->stdRepresentative()) {
|
||||
const Prefix * stdPre = dim->stdRepresentativePrefix();
|
||||
unitNode->setPrefix(stdPre);
|
||||
@@ -258,15 +243,10 @@ Expression Unit::shallowReduce(ExpressionNode::ReductionContext reductionContext
|
||||
} else {
|
||||
result = Expression::Parse(rep->definition(), nullptr, false).deepReduce(reductionContext);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (prefixMultiplier != 0) {
|
||||
Expression multiplier = Power::Builder(Rational::Builder(10), Rational::Builder(prefixMultiplier)).shallowReduce(reductionContext);
|
||||
result = Multiplication::Builder(multiplier, result).shallowReduce(reductionContext);
|
||||
}
|
||||
|
||||
|
||||
replaceWithInPlace(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user