mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare/unit] Dimension::Vector::FromBaseUnits accepts only products of powers of base units
and no other factor at all
This commit is contained in:
committed by
Émilie Feral
parent
394e86a28a
commit
2f708cc36c
@@ -127,13 +127,8 @@ Unit::Dimension::Vector<Integer> UnitNode::Dimension::Vector<Integer>::FromBaseU
|
||||
factor = factor.childAtIndex(0);
|
||||
}
|
||||
|
||||
// FIXME Remove this once this case may not occur anymore
|
||||
// The leading factors may not be of Unit type
|
||||
if (factor.type() != ExpressionNode::Type::Unit) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Fill the vector with the unit's exponent
|
||||
assert(factor.type() == ExpressionNode::Type::Unit);
|
||||
const ptrdiff_t indexInTable = static_cast<UnitNode *>(factor.node())->dimension() - Unit::DimensionTable;
|
||||
assert(0 <= indexInTable && indexInTable < NumberOfBaseUnits);
|
||||
vector.setCoefficientAtIndex(indexInTable, exponent);
|
||||
|
||||
Reference in New Issue
Block a user