Numworks Epsilon  1.4.1
Graphing Calculator Operating System
Poincare::Symbol Class Reference

#include <symbol.h>

Inheritance diagram for Poincare::Symbol:
Poincare::StaticHierarchy< 0 > Poincare::Expression

Public Types

enum  SpecialSymbols : char {
  Ans = 1, un = 2, un1 = 3, un2 = 4,
  vn = 5, vn1 = 6, vn2 = 7, M0 = 8,
  M1 = 9, M2, M3, M4,
  M5, M6, M7, M8,
  M9 = 17
}
 
- Public Types inherited from Poincare::Expression
enum  Type : uint8_t {
  Type::Undefined = 0, Type::Rational = 1, Type::Decimal, Type::Multiplication,
  Type::Power, Type::Addition, Type::Factorial, Type::Division,
  Type::Store, Type::Sine, Type::Cosine, Type::Tangent,
  Type::AbsoluteValue, Type::ArcCosine, Type::ArcSine, Type::ArcTangent,
  Type::BinomialCoefficient, Type::Ceiling, Type::ComplexArgument, Type::Conjugate,
  Type::Derivative, Type::Determinant, Type::DivisionQuotient, Type::DivisionRemainder,
  Type::Factor, Type::Floor, Type::FracPart, Type::GreatCommonDivisor,
  Type::HyperbolicArcCosine, Type::HyperbolicArcSine, Type::HyperbolicArcTangent, Type::HyperbolicCosine,
  Type::HyperbolicSine, Type::HyperbolicTangent, Type::ImaginaryPart, Type::Integral,
  Type::LeastCommonMultiple, Type::Logarithm, Type::MatrixTrace, Type::NaperianLogarithm,
  Type::NthRoot, Type::Opposite, Type::Parenthesis, Type::PermuteCoefficient,
  Type::Product, Type::Random, Type::Randint, Type::RealPart,
  Type::Round, Type::SquareRoot, Type::Subtraction, Type::Sum,
  Type::Symbol, Type::Complex, Type::Matrix, Type::ConfidenceInterval,
  Type::MatrixDimension, Type::MatrixInverse, Type::MatrixTranspose, Type::PredictionInterval,
  Type::SimplificationRoot
}
 
enum  ComplexFormat { ComplexFormat::Cartesian = 0, ComplexFormat::Polar = 1, ComplexFormat::Default = 2 }
 
enum  AngleUnit { AngleUnit::Degree = 0, AngleUnit::Radian = 1, AngleUnit::Default = 2 }
 
enum  Sign { Sign::Negative = -1, Sign::Unknown = 0, Sign::Positive = 1 }
 
typedef bool(* CircuitBreaker) ()
 
typedef bool(* ExpressionTest) (const Expression *e, Context &context)
 

Public Member Functions

 Symbol (char name)
 
 Symbol (Symbol &&other)
 
 Symbol (const Symbol &other)
 
char name () const
 
Type type () const override
 
Expressionclone () const override
 
int polynomialDegree (char symbolName) const override
 
Sign sign () const override
 
bool isMatrixSymbol () const
 
bool isScalarSymbol () const
 
bool isApproximate (Context &context) const
 
float characteristicXRange (Context &context, AngleUnit angleUnit=AngleUnit::Default) const override
 
bool hasAnExactRepresentation (Context &context) const
 
- Public Member Functions inherited from Poincare::StaticHierarchy< 0 >
 StaticHierarchy ()
 
 StaticHierarchy (const Expression *const *operands, bool cloneOperands=true)
 
 StaticHierarchy (const Expression *expression, bool cloneOperands=true)
 
 StaticHierarchy (const Expression *expression1, const Expression *expression2, bool cloneOperands=true)
 
 StaticHierarchy (const StaticHierarchy &other)=delete
 
 StaticHierarchy (StaticHierarchy &&other)=delete
 
 StaticHierarchy (const Expression *e, bool cloneOperands)
 
 StaticHierarchy (const Expression *e1, const Expression *e2, bool cloneOperands)
 
 ~StaticHierarchy ()
 
StaticHierarchyoperator= (const StaticHierarchy &other)=delete
 
StaticHierarchyoperator= (StaticHierarchy &&other)=delete
 
virtual void setArgument (ListData *listData, int numberOfEntries, bool clone)
 
int numberOfOperands () const override
 
const Expression *const * operands () const override
 
virtual bool hasValidNumberOfOperands (int numberOfOperands) const
 
- Public Member Functions inherited from Poincare::Expression
virtual ~Expression ()=default
 
const Expressionoperand (int i) const
 
ExpressioneditableOperand (int i)
 
ExpressionreplaceWith (Expression *newOperand, bool deleteAfterReplace=true)
 
void replaceOperand (const Expression *oldOperand, Expression *newOperand, bool deleteOldOperand=true)
 
void detachOperand (const Expression *e)
 
void detachOperands ()
 
void swapOperands (int i, int j)
 
Expressionparent () const
 
void setParent (Expression *parent)
 
bool hasAncestor (const Expression *e) const
 
bool recursivelyMatches (ExpressionTest test, Context &context) const
 
bool isApproximate (Context &context) const
 
bool isIdenticalTo (const Expression *e) const
 
ExpressionLayoutcreateLayout (PrintFloat::Mode floatDisplayMode=PrintFloat::Mode::Default, ComplexFormat complexFormat=ComplexFormat::Default) const
 
template<typename T >
Expressionapproximate (Context &context, AngleUnit angleUnit=AngleUnit::Default) const
 
template<typename T >
T approximateToScalar (Context &context, AngleUnit angleUnit=AngleUnit::Default) const
 

Static Public Member Functions

static SpecialSymbols matrixSymbol (char index)
 
- Static Public Member Functions inherited from Poincare::Expression
static Expressionparse (char const *string)
 
static void ReplaceSymbolWithExpression (Expression **expressionAddress, char symbol, Expression *expression)
 
static void setCircuitBreaker (CircuitBreaker cb)
 
static bool shouldStopProcessing ()
 
static bool IsMatrix (const Expression *e, Context &context)
 
static ExpressionParseAndSimplify (const char *text, Context &context, AngleUnit angleUnit=AngleUnit::Default)
 
static void Simplify (Expression **expressionAddress, Context &context, AngleUnit angleUnit=AngleUnit::Default)
 
template<typename T >
static T approximateToScalar (const char *text, Context &context, AngleUnit angleUnit=AngleUnit::Default)
 

Additional Inherited Members

- Protected Types inherited from Poincare::Expression
typedef float SinglePrecision
 
typedef double DoublePrecision
 
- Protected Member Functions inherited from Poincare::StaticHierarchy< 0 >
void build (const Expression *const *operands, int numberOfOperands, bool cloneOperands)
 
int simplificationOrderSameType (const Expression *e, bool canBeInterrupted) const override
 
- Protected Member Functions inherited from Poincare::Expression
 Expression ()
 
void detachOperandAtIndex (int i)
 
- Static Protected Member Functions inherited from Poincare::Expression
template<typename T >
static T epsilon ()
 
static int SimplificationOrder (const Expression *e1, const Expression *e2, bool canBeInterrupted=false)
 
- Protected Attributes inherited from Poincare::StaticHierarchy< 0 >
const Expressionm_operands [T]
 
- Static Protected Attributes inherited from Poincare::Expression
static constexpr int k_maxNumberOfSteps = 10000
 

Detailed Description

Definition at line 8 of file symbol.h.

Member Enumeration Documentation

◆ SpecialSymbols

Enumerator
Ans 
un 
un1 
un2 
vn 
vn1 
vn2 
M0 
M1 
M2 
M3 
M4 
M5 
M6 
M7 
M8 
M9 

Definition at line 10 of file symbol.h.

Constructor & Destructor Documentation

◆ Symbol() [1/3]

Poincare::Symbol::Symbol ( char  name)

Definition at line 86 of file symbol.cpp.

◆ Symbol() [2/3]

Poincare::Symbol::Symbol ( Symbol &&  other)

Definition at line 91 of file symbol.cpp.

◆ Symbol() [3/3]

Poincare::Symbol::Symbol ( const Symbol other)

Definition at line 96 of file symbol.cpp.

Member Function Documentation

◆ characteristicXRange()

float Poincare::Symbol::characteristicXRange ( Context context,
AngleUnit  angleUnit = AngleUnit::Default 
) const
overridevirtual

Reimplemented from Poincare::Expression.

Definition at line 145 of file symbol.cpp.

◆ clone()

Expression * Poincare::Symbol::clone ( ) const
overridevirtual

Implements Poincare::Expression.

Definition at line 101 of file symbol.cpp.

◆ hasAnExactRepresentation()

bool Poincare::Symbol::hasAnExactRepresentation ( Context context) const

Definition at line 152 of file symbol.cpp.

◆ isApproximate()

bool Poincare::Symbol::isApproximate ( Context context) const

Definition at line 137 of file symbol.cpp.

◆ isMatrixSymbol()

bool Poincare::Symbol::isMatrixSymbol ( ) const

Definition at line 231 of file symbol.cpp.

◆ isScalarSymbol()

bool Poincare::Symbol::isScalarSymbol ( ) const

Definition at line 238 of file symbol.cpp.

◆ matrixSymbol()

Symbol::SpecialSymbols Poincare::Symbol::matrixSymbol ( char  index)
static

Definition at line 58 of file symbol.cpp.

◆ name()

char Poincare::Symbol::name ( ) const

Definition at line 185 of file symbol.cpp.

◆ polynomialDegree()

int Poincare::Symbol::polynomialDegree ( char  symbolName) const
overridevirtual

Reimplemented from Poincare::Expression.

Definition at line 105 of file symbol.cpp.

◆ sign()

Expression::Sign Poincare::Symbol::sign ( ) const
overridevirtual

Reimplemented from Poincare::Expression.

Definition at line 123 of file symbol.cpp.

◆ type()

Expression::Type Poincare::Symbol::type ( ) const
overridevirtual

Implements Poincare::Expression.

Definition at line 181 of file symbol.cpp.


The documentation for this class was generated from the following files: