mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare] TreeByReference::node is not virtual anymore
This commit is contained in:
@@ -55,7 +55,7 @@ public:
|
||||
T real() { return node()->real(); }
|
||||
T imag() { return node()->imag(); }
|
||||
private:
|
||||
ComplexNode<T> * node() const override { return static_cast<ComplexNode<T> *>(Evaluation<T>::node()); }
|
||||
ComplexNode<T> * node() const { return static_cast<ComplexNode<T> *>(Evaluation<T>::node()); }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
constexpr static int k_maxExponent = 1000;
|
||||
private:
|
||||
constexpr static int k_maxMantissaLength = 20;
|
||||
DecimalNode * node() const override { return static_cast<DecimalNode *>(Number::node()); }
|
||||
DecimalNode * node() const { return static_cast<DecimalNode *>(Number::node()); }
|
||||
Decimal(size_t size, const Integer & m, int e);
|
||||
Expression setSign(ExpressionNode::Sign s, Context & context, Preferences::AngleUnit angleUnit) const;
|
||||
// Simplification
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
node()->setColor(color);
|
||||
}
|
||||
private:
|
||||
virtual EmptyLayoutNode * node() const override { return static_cast<EmptyLayoutNode *>(LayoutReference::node()); }
|
||||
EmptyLayoutNode * node() const { return static_cast<EmptyLayoutNode *>(LayoutReference::node()); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
// Does not work :static_assert(sizeof(U) == sizeof(Evaluation<T>), "Size mismatch");
|
||||
return *reinterpret_cast<U *>(const_cast<Evaluation<T> *>(this));
|
||||
}
|
||||
EvaluationNode<T> * node() const override {
|
||||
EvaluationNode<T> * node() const {
|
||||
assert(TreeByValue::node() == nullptr || !TreeByValue::node()->isGhost());
|
||||
return static_cast<EvaluationNode<T> *>(TreeByValue::node());
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
Expression replaceSymbolWithExpression(char symbol, Expression expression) const { return node()->replaceSymbolWithExpression(symbol, expression); }
|
||||
|
||||
/* Reference */
|
||||
ExpressionNode * node() const override {
|
||||
ExpressionNode * node() const {
|
||||
assert(TreeByValue::node() == nullptr || !TreeByValue::node()->isGhost());
|
||||
return static_cast<ExpressionNode *>(TreeByValue::node());
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
node()->setFloat(value);
|
||||
}
|
||||
private:
|
||||
FloatNode<T> * node() const override { return static_cast<FloatNode<T> *>(Number::node()); }
|
||||
FloatNode<T> * node() const { return static_cast<FloatNode<T> *>(Number::node()); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
LayoutReference::addChildAtIndex(l, index, currentNumberOfChildren, cursor);
|
||||
}
|
||||
private:
|
||||
virtual GridLayoutNode * node() const override { return static_cast<GridLayoutNode *>(LayoutReference::node()); }
|
||||
virtual GridLayoutNode * node() const { return static_cast<GridLayoutNode *>(LayoutReference::node()); }
|
||||
void setNumberOfRows(int rows) {
|
||||
assert(rows >= 0);
|
||||
node()->setNumberOfRows(rows);
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
node()->setNegative(negative);
|
||||
}
|
||||
private:
|
||||
InfinityNode * node() const override { return static_cast<InfinityNode *>(Number::node()); }
|
||||
InfinityNode * node() const { return static_cast<InfinityNode *>(Number::node()); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ public:
|
||||
static Integer Factorial(const Integer & i);
|
||||
private:
|
||||
// TreeNode
|
||||
IntegerNode * node() const override { return static_cast<IntegerNode *>(Number::node()); }
|
||||
IntegerNode * node() const { return static_cast<IntegerNode *>(Number::node()); }
|
||||
|
||||
Integer(const native_uint_t * digits, size_t numberOfDigits, bool negative, bool enableOverflow = false);
|
||||
Integer(size_t size, const native_uint_t * digits, size_t numberOfDigits, bool negative);
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
return cast;
|
||||
}
|
||||
|
||||
LayoutNode * node() const override {
|
||||
LayoutNode * node() const {
|
||||
assert(!TreeByReference::node()->isGhost());
|
||||
return static_cast<LayoutNode *>(TreeByReference::node());
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ private:
|
||||
// TODO: find another solution for inverse and determinant (avoid capping the matrix)
|
||||
static constexpr int k_maxNumberOfCoefficients = 100;
|
||||
|
||||
MatrixNode * node() const override { return static_cast<MatrixNode *>(Expression::node()); }
|
||||
MatrixNode * node() const { return static_cast<MatrixNode *>(Expression::node()); }
|
||||
void setNumberOfRows(int rows) { assert(rows >= 0); node()->setNumberOfRows(rows); }
|
||||
void setNumberOfColumns(int columns) { assert(columns >= 0); node()->setNumberOfColumns(columns); }
|
||||
/* rowCanonize turns a matrix in its reduced row echelon form. */
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
Number setSign(ExpressionNode::Sign s, Context & context, Preferences::AngleUnit angleUnit) const { return static_cast<Number>(Expression::setSign(s, context, angleUnit)); }
|
||||
protected:
|
||||
Number() : Expression() {}
|
||||
NumberNode * node() const override { return static_cast<NumberNode *>(Expression::node()); }
|
||||
NumberNode * node() const { return static_cast<NumberNode *>(Expression::node()); }
|
||||
private:
|
||||
typedef Integer (*IntegerBinaryOperation)(const Integer & i, const Integer & j);
|
||||
typedef Rational (*RationalBinaryOperation)(const Rational & i, const Rational & j);
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
Rational(native_int_t i, native_int_t j) : Rational(Integer(i), Integer(j)) {}
|
||||
|
||||
// TreeNode
|
||||
RationalNode * node() const override { return static_cast<RationalNode *>(Number::node()); }
|
||||
RationalNode * node() const { return static_cast<RationalNode *>(Number::node()); }
|
||||
|
||||
// Properties
|
||||
Integer signedIntegerNumerator() const;
|
||||
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
// Symbol
|
||||
char name() const { return node()->name(); }
|
||||
private:
|
||||
SymbolNode * node() const override { return static_cast<SymbolNode *>(Expression::node()); }
|
||||
SymbolNode * node() const { return static_cast<SymbolNode *>(Expression::node()); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
TreeByReference clone() const;
|
||||
|
||||
int identifier() const { return m_identifier; }
|
||||
virtual TreeNode * node() const { return TreePool::sharedPool()->node(m_identifier); }
|
||||
TreeNode * node() const { return TreePool::sharedPool()->node(m_identifier); }
|
||||
|
||||
bool isGhost() const { return node()->isGhost(); }
|
||||
bool isUninitialized() const { return node()->isUninitialized(); }
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
bool isUninitialized() const { return TreeByReference::isUninitialized(); }
|
||||
bool isAllocationFailure() const { return TreeByReference::isAllocationFailure(); }
|
||||
|
||||
TreeNode * node() const override { return TreeByReference::node(); }
|
||||
TreeNode * node() const { return TreeByReference::node(); }
|
||||
|
||||
/* Hierarchy */
|
||||
int numberOfChildren() const { return TreeByReference::numberOfChildren(); }
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
}
|
||||
int data() { return node()->data(); }
|
||||
private:
|
||||
BlobNode * node() const override { return static_cast<BlobNode *>(TreeByReference::node()); }
|
||||
BlobNode * node() const { return static_cast<BlobNode *>(TreeByReference::node()); }
|
||||
};
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
}
|
||||
int data() { return node()->data(); }
|
||||
private:
|
||||
BlobNode * node() const override { return static_cast<BlobNode *>(TreeByValue::node()); }
|
||||
BlobNode * node() const { return static_cast<BlobNode *>(TreeByValue::node()); }
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user