mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 13:50:28 +01:00
[poincare] uninline methods in Evaluation and subclasses
This commit is contained in:
@@ -41,7 +41,7 @@ template<typename T>
|
||||
class Complex : public Evaluation<T> {
|
||||
public:
|
||||
Complex(ComplexNode<T> * n) : Evaluation<T>(n) {}
|
||||
Complex(T a, T b = 0.0) : Complex(std::complex<T>(a, b)) {}
|
||||
Complex(T a, T b = 0.0);
|
||||
Complex(std::complex<T> c);
|
||||
static Complex<T> Undefined() {
|
||||
return Complex<T>(NAN, NAN);
|
||||
|
||||
@@ -49,9 +49,7 @@ public:
|
||||
}
|
||||
|
||||
/* Hierarchy */
|
||||
Evaluation<T> childAtIndex(int i) const {
|
||||
return Evaluation<T>(static_cast<EvaluationNode<T> *>(TreeByReference::childAtIndex(i).node()));
|
||||
}
|
||||
Evaluation<T> childAtIndex(int i) const;
|
||||
typename Poincare::EvaluationNode<T>::Type type() const { return node()->type(); }
|
||||
bool isUndefined() const { return node()->isUndefined(); }
|
||||
T toScalar() const { return node()->toScalar(); }
|
||||
|
||||
@@ -56,12 +56,9 @@ class MatrixComplex : public Evaluation<T> {
|
||||
friend class MatrixComplexNode<T>;
|
||||
public:
|
||||
MatrixComplex(MatrixComplexNode<T> * node) : Evaluation<T>(node) {}
|
||||
MatrixComplex() : Evaluation<T>(TreePool::sharedPool()->createTreeNode<MatrixComplexNode<T> >()) {}
|
||||
MatrixComplex();
|
||||
MatrixComplex(std::complex<T> * operands, int numberOfRows, int numberOfColumns);
|
||||
static MatrixComplex<T> Undefined() {
|
||||
std::complex<T> undef = std::complex<T>(NAN, NAN);
|
||||
return MatrixComplex<T>((std::complex<T> *)&undef, 1, 1);
|
||||
}
|
||||
static MatrixComplex<T> Undefined();
|
||||
static MatrixComplex<T> createIdentity(int dim);
|
||||
MatrixComplex<T> inverse() const { return node()->inverse(); }
|
||||
MatrixComplex<T> transpose() const { return node()->transpose(); }
|
||||
|
||||
@@ -105,6 +105,9 @@ Expression ComplexNode<T>::complexToExpression(Preferences::ComplexFormat comple
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
Complex<T>::Complex(T a, T b) : Complex(std::complex<T>(a, b)) {}
|
||||
|
||||
template <typename T>
|
||||
Complex<T>::Complex(std::complex<T> c) :
|
||||
Evaluation<T>(TreePool::sharedPool()->createTreeNode<ComplexNode<T>>())
|
||||
@@ -114,6 +117,8 @@ Complex<T>::Complex(std::complex<T> c) :
|
||||
|
||||
template class ComplexNode<float>;
|
||||
template class ComplexNode<double>;
|
||||
template Complex<float>::Complex(float a, float b);
|
||||
template Complex<double>::Complex(double a, double b);
|
||||
template Complex<float>::Complex(std::complex<float> c);
|
||||
template Complex<double>::Complex(std::complex<double> c);
|
||||
|
||||
|
||||
@@ -3,11 +3,20 @@
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
template<typename T>
|
||||
Evaluation<T> Evaluation<T>::childAtIndex(int i) const {
|
||||
TreeByReference c = TreeByReference::childAtIndex(i);
|
||||
return static_cast<Evaluation<T> &>(c);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
Expression Evaluation<T>::complexToExpression(Preferences::ComplexFormat complexFormat) const {
|
||||
return node()->complexToExpression(complexFormat);
|
||||
}
|
||||
|
||||
template Evaluation<float> Evaluation<float>::childAtIndex(int i) const;
|
||||
template Evaluation<double> Evaluation<double>::childAtIndex(int i) const;
|
||||
|
||||
template Expression Evaluation<float>::complexToExpression(Preferences::ComplexFormat) const;
|
||||
template Expression Evaluation<double>::complexToExpression(Preferences::ComplexFormat) const;
|
||||
|
||||
|
||||
@@ -128,6 +128,15 @@ MatrixComplex<T>::MatrixComplex(std::complex<T> * operands, int numberOfRows, in
|
||||
setDimensions(numberOfRows, numberOfColumns);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
MatrixComplex<T>::MatrixComplex() : Evaluation<T>(TreePool::sharedPool()->createTreeNode<MatrixComplexNode<T> >()) {}
|
||||
|
||||
template<typename T>
|
||||
MatrixComplex<T> MatrixComplex<T>::Undefined() {
|
||||
std::complex<T> undef = std::complex<T>(NAN, NAN);
|
||||
return MatrixComplex<T>((std::complex<T> *)&undef, 1, 1);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
MatrixComplex<T> MatrixComplex<T>::createIdentity(int dim) {
|
||||
MatrixComplex<T> result;
|
||||
|
||||
Reference in New Issue
Block a user