Class to display expressions to the terminal.
This is used in the PythonCdb bridge to provide 'str' type python printing for Ex objects. The cadabra2 command line application uses this class for all its output. This class does not necessarily produce output which is readable by sympy; for that, use the DisplaySympy class (as an example, partial derivatives will display using a LaTeX notation using the present class, but be printed as 'sympy.diff' by the DisplaySympy class).
|
void | print_multiplier (std::ostream &, Ex::iterator, int mult=1) |
|
void | print_opening_bracket (std::ostream &, str_node::bracket_t, str_node::parent_rel_t) |
|
void | print_closing_bracket (std::ostream &, str_node::bracket_t, str_node::parent_rel_t) |
|
void | print_parent_rel (std::ostream &, str_node::parent_rel_t, bool first) |
|
void | print_children (std::ostream &, Ex::iterator, int skip=0) |
|
void | print_productlike (std::ostream &, Ex::iterator, const std::string &inbetween) |
| Printing members for various standard constructions, e.g. More...
|
|
void | print_sumlike (std::ostream &, Ex::iterator) |
|
void | print_fraclike (std::ostream &, Ex::iterator) |
|
void | print_commalike (std::ostream &, Ex::iterator) |
|
void | print_arrowlike (std::ostream &, Ex::iterator) |
|
void | print_powlike (std::ostream &, Ex::iterator) |
|
void | print_intlike (std::ostream &, Ex::iterator) |
|
void | print_equalitylike (std::ostream &, Ex::iterator) |
|
void | print_commutator (std::ostream &str, Ex::iterator it, bool comm) |
|
void | print_components (std::ostream &, Ex::iterator) |
|
void | print_other (std::ostream &, Ex::iterator) |
|
bool | children_have_brackets (Ex::iterator ch) const |
|
bool DisplayTerminal::needs_brackets |
( |
Ex::iterator |
it | ) |
|
|
overrideprotectedvirtual |
Determine if a node needs extra brackets around it.
Uses context from the parent node if necessary. Has to be implemented in a derived class, because the answer depends on the printing method (e.g. (a+b)/c needs brackets when printed like this, but does not need brackets when printed as {a+b}{c}).
Implements cadabra::DisplayBase.