|
Milo
0.1
Milo:EquationManipulationProgram
|
#include <milo.h>


Public Member Functions | |
| void | simplify (NodePtr ref, TermPtr new_term) |
| void | setParent () |
| void | setParent (Expression *parent) |
| NodeIter | begin () |
| NodeIter | end () |
| void | multiply (double n) |
| void | multiply (TermPtr old_term) |
| std::shared_ptr< Term > | getSharedPtr () |
Constructor and Virtual Destructor | |
| Term (Parser &p, Expression *parent=nullptr) | |
| Term (EqnXMLParser &in, Node *parent=nullptr) | |
| Term (NodeVector &f, Expression *parent) | |
| Term (Node *node, Expression *parent=nullptr, bool fNeg=false) | |
| ~Term () | |
Virtual Public Member Functions | |
| std::string | toString () const |
| bool | isLeaf () const |
| bool | isFactor () const |
| Node * | findNode (int x, int y) |
| Node * | findNode (const Box &b) |
| int | numFactors () const |
| void | normalize () |
| bool | simplify () |
| const std::string & | getName () const |
| std::type_index | getType () const |
Public Member Functions inherited from Node | |
| void | calculateSize (UI::Graphics &gc) |
| void | out (XML::Stream &xml) |
| void | calculateOrigin (UI::Graphics &gc, int x, int y) |
| void | setUpDraw (UI::Graphics &gc) |
| void | draw (UI::Graphics &gc) const |
| void | setSelect (Select s) |
| Select | getSelect () const |
| void | setDrawParenthesis (bool fDrawPar) |
| bool | getDrawParenthesis () const |
| const Frame & | getFrame () const |
| Node * | first () |
| Node * | last () |
| Node * | getNextLeft () |
| Node * | getNextRight () |
| void | setParent (Node *parent) |
| Node * | getParent () const |
| int | getDepth () const |
| int | getNth () const |
| void | addNth (int n) |
| void | multNth (int n) |
| void | setNth (int n) |
| void | negative () |
| bool | getSign () const |
| Complex | getValue () const |
| std::shared_ptr< Node > | getSharedPtr () |
| Node (Node *parent=nullptr, bool fNeg=false, Select s=NONE) | |
| Node (EqnXMLParser &in, Node *parent) | |
| virtual | ~Node () |
| Abstract base class needs virtual desctructor. | |
| virtual bool | less (NodePtr b) const |
Static Public Member Functions | |
| static Node * | parse (Parser &p, Node *parent=nullptr) |
| static bool | simplify (TermVector &terms, TermVector::iterator a, TermVector::iterator b) |
| static void | insertAfterMe (Node *me, NodePtr node) |
| static NodeIter | pos (Node *me) |
Static Public Member Functions inherited from Node | |
| static bool | createNodeByName (std::string name, Equation &eqn) |
Static Public Attributes | |
| static const std::string | name = "term" |
| Name of Term class. | |
| static const std::type_index | type = typeid(Term) |
| Type of Term class. | |
Static Public Attributes inherited from Node | |
| static const std::vector< std::string > | select_tags = { "NONE", "START", "END", "ALL" } |
Private Member Functions | |
| bool | add (Parser &p) |
Virtual Private Member Functions | |
| Node * | downLeft () |
| Node * | downRight () |
| Node * | getLeftSibling (Node *node) |
| Node * | getRightSibling (Node *node) |
| Complex | getNodeValue () const |
| void | xml_out (XML::Stream &xml) const |
| Frame | calcSize (UI::Graphics &gc) |
| void | calcOrig (UI::Graphics &gc, int x, int y) |
| void | drawNode (UI::Graphics &gc) const |
Private Attributes | |
| NodeVector | factors |
| Term owns this tree. | |
| Box | m_internal |
| Bounding box of this node. | |
Friends | |
| class | FactorIterator |
Additional Inherited Members | |
Public Types inherited from Node | |
| enum | Select { NONE, START, END, ALL } |
Represents a term as a vector of factors which are multiplied together.
|
inline |
| Term::Term | ( | EqnXMLParser & | in, |
| Node * | parent = nullptr |
||
| ) |
|
inline |
|
inline |
Constructor for Term class.
| node | Initialize node vector with this node. |
| parent | Parent expresion. |
| fNeg | If true, node is negative. |
|
inline |
Abstract base class needs virtual destructor.
|
private |
Add factors to this Term object from parser.
|
inline |
Get iterator to first factor of Term.
|
privatevirtual |
Calculate origin of this node offset from the point (x,y) given it.
| gc | Graphics context. |
| x | Horizontal origin. |
| y | Vertical origin. |
Implements Node.
|
privatevirtual |
Calculate size of this node in given graphics context.
| gc | Graphics context. |
Implements Node.
|
inlineprivatevirtual |
|
inlineprivatevirtual |
|
privatevirtual |
|
virtual |
Rescursive search to find deepest node at point (x,y).
| x | horizontal coordinate. |
| y | vertical coordinate. |
Reimplemented from Node.
Recursive function to return first node from a top to bottom search whose frame is inside Box b.
| b | Bounding box. |
Reimplemented from Node.
Left sibiling of given node.
| node | Reference node. |
Reimplemented from Node.
|
inlinevirtual |
|
privatevirtual |
Right sibiling of given node.
| node | Reference node. |
Reimplemented from Node.
|
inline |
|
inlinevirtual |
Insert new node after a reference node in node vector.
| me | Reference node. |
| node | New node. |
|
inlinevirtual |
Override for isFactor virtual function.
Reimplemented from Node.
|
inlinevirtual |
Override for isLeaf virtual function.
Reimplemented from Node.
| void Term::multiply | ( | double | n | ) |
Multiply this term by a number by inserting Number object.
| n | Value to multiply term by. |
| void Term::multiply | ( | TermPtr | old_term | ) |
Mulitiply this by term by another term.
| old_term | Move factors into this Term object. |
|
virtual |
|
virtual |
Get number of factor in this subtree.
Reimplemented from Node.
Helper static function to get iterator to given node.
| me | Pointer to a factor. |
|
inline |
Set all factor's parent to this Term.
|
inline |
Reset parent expression of this Term.
| parent | New parent expression. |
|
virtual |
Attempt to algebraically simplify the subtree this node is the root.
Reimplemented from Node.
|
static |
Compare every term to every other term to see if can combined. If terms are the same excpet for a number, they are combined.
| terms | Reference to term vector. |
| a | Iterator to first term to be compared. |
| b | Iterator to second term to be compared. If terms are combined this is deleted. |
|
virtual |
|
privatevirtual |
1.8.11