Numworks Epsilon  1.4.1
Graphing Calculator Operating System
conjugate.h
Go to the documentation of this file.
1 #ifndef POINCARE_CONJUGATE_H
2 #define POINCARE_CONJUGATE_H
3 
7 
8 namespace Poincare {
9 
10 class Conjugate : public StaticHierarchy<1> {
12 public:
13  Type type() const override;
14  Expression * clone() const override;
15 private:
16  /* Layout */
17  ExpressionLayout * privateCreateLayout(PrintFloat::Mode floatDisplayMode, ComplexFormat complexFormat) const override;
18  int writeTextInBuffer(char * buffer, int bufferSize, int numberOfSignificantDigits = PrintFloat::k_numberOfStoredSignificantDigits) const override {
19  return LayoutEngine::writePrefixExpressionTextInBuffer(this, buffer, bufferSize, numberOfSignificantDigits, "conj");
20  }
21  /* Simplification */
22  Expression * shallowReduce(Context& context, AngleUnit angleUnit) override;
23  /* Evaluation */
24  template<typename T> static Complex<T> computeOnComplex(const Complex<T> c, AngleUnit angleUnit);
25  Expression * privateApproximate(SinglePrecision p, Context& context, AngleUnit angleUnit) const override {
26  return ApproximationEngine::map<float>(this, context, angleUnit,computeOnComplex<float>);
27  }
28  Expression * privateApproximate(DoublePrecision p, Context& context, AngleUnit angleUnit) const override {
29  return ApproximationEngine::map<double>(this, context, angleUnit, computeOnComplex<double>);
30  }
31 };
32 
33 }
34 
35 #endif
36 
c(generic_all_nodes)
Type type() const override
Definition: conjugate.cpp:13
Expression * clone() const override
Definition: conjugate.cpp:17
static int writePrefixExpressionTextInBuffer(const Expression *expression, char *buffer, int bufferSize, int numberOfDigits, const char *operatorName)