![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Functions | |
| bool | is_auto_generated (const TikzNode &nd) |
| isAutoGeneratedNode: a ClassSwitch named CS_..._to_..., the name link gives the switch it inserts. | |
| std::string | output_anchor (const TikzNode &nd, const TikzOptions &opt) |
| getOutputAnchor: a Queue's arrows leave its server circle when one is drawn; every other node, a Delay included, its box. | |
| std::string | self_loop (const std::string &id, const TikzNode &nd, const TikzOptions &opt) |
| renderSelfLoop: the wide loop from the server circle of a Queue that draws one, the plain-node loop otherwise. | |
| bool | file_exists (const std::string &p) |
| bool | ends_with (const std::string &s, const std::string &suf) |
| void | write_text (const std::string &path, const std::string &text) |
| void | copy_file (const std::string &from, const std::string &to) |
| std::string | compile_pdf (const std::string &tex, const util::TempDir &dir) |
| exportToPDF: compile tex in a fresh directory and return the PDF path. | |
| std::string | find_on_path (const std::string &cmd) |
| The first executable named cmd on PATH, empty when there is none (TikZViewer.isCommandAvailable). | |
| bool | spawn_detached (const std::vector< std::string > &argv) |
| Start argv detached (own session, std streams on /dev/null, double fork so no zombie); false if it cannot start. | |
| bool | display_pdf (const std::string &pdf) |
| TikZViewer.displayPDF: a standalone viewer first, then the desktop default; false when neither is found. | |
| const std::string & | model_name (const TikzGraph &g) |
| template<class T> | |
| const std::string & | model_name (const qn::NetworkStruct< T > &sn) |
| template<class T> | |
| const std::string & | model_name (qn::Network< T > &m) |
| std::string | java_sched_name (lang::SchedStrategy s) |
| Java's SchedStrategy.name(): the enumerator spelling, which is the upper-cased text of sched_to_text. | |
| std::string | java_fixed (double v, int prec) |
| Java's String.format("%." + prec + "f", v). | |
| std::string | sanitize_id (const std::string &name) |
| name.replaceAll("[^a-zA-Z0-9]", "_"): one underscore per CODE POINT, so a UTF-8 sequence is one character. | |
| void | replace_all (std::string &s, const std::string &from, const std::string &to) |
| std::string | escape_latex (std::string t) |
| TikZNodeRenderer.escapeLatex, applied in the SAME sequence of whole-string replacements, so a backslash comes out as \textbackslash\{\}, exactly as the JAR's later brace replacement leaves it. | |
| void | reorder_by_barycenter (std::vector< std::size_t > &layer, const std::vector< std::vector< std::size_t > > &connections, const std::vector< std::size_t > &reference, std::size_t nnodes) |
| reorderLayerByBarycenter: sort a layer by the mean position of its neighbours in the reference layer. | |
| std::string | styled_node (const std::string &style, const std::string &id, double x, double y, const std::string &body, const TikzNode &nd, const TikzOptions &opt) |
| \node[style] (id) at (x,y) {body}; followed by the name label the options ask for. | |
| std::string | server_label (double c) |
| String.valueOf(queue.getNumberOfServers()), the JAR's Integer.MAX_VALUE pool being infinity. | |
Variables | |
| constexpr int | kToolTimeout = 600 |
| Seconds a pdflatex or pdftoppm run may take before it is killed; a TikZ picture needs a few. | |
|
inline |
exportToPDF: compile tex in a fresh directory and return the PDF path.
The directory belongs to dir, so the caller copies the PDF out before it goes.
Definition at line 113 of file tikz.h.
References line::util::capture(), compile_pdf(), line::Error::Error(), line::util::ProcResult::exitCode, line::util::TempDir::file(), file_exists(), kToolTimeout, line::util::ProcResult::out, line::util::TempDir::path(), line::util::ProcResult::timedOut, and write_text().
Referenced by compile_pdf(), line::io::export_tikz(), line::io::tikz_export_png(), and line::io::tikz_view().
|
inline |
Definition at line 97 of file tikz.h.
References copy_file(), and line::InputError::InputError().
Referenced by copy_file(), and line::io::export_tikz().
|
inline |
TikZViewer.displayPDF: a standalone viewer first, then the desktop default; false when neither is found.
Definition at line 293 of file tikz.h.
References display_pdf(), find_on_path(), and spawn_detached().
Referenced by display_pdf(), and line::io::tikz_view().
|
inline |
Definition at line 86 of file tikz.h.
References ends_with().
Referenced by ends_with(), line::io::export_tikz(), and line::io::tikz_export_png().
|
inline |
TikZNodeRenderer.escapeLatex, applied in the SAME sequence of whole-string replacements, so a backslash comes out as \textbackslash\{\}, exactly as the JAR's later brace replacement leaves it.
Definition at line 161 of file tikz_graph.h.
References escape_latex(), and replace_all().
Referenced by escape_latex(), and styled_node().
|
inline |
Definition at line 81 of file tikz.h.
References file_exists().
Referenced by compile_pdf(), file_exists(), and find_on_path().
|
inline |
The first executable named cmd on PATH, empty when there is none (TikZViewer.isCommandAvailable).
Definition at line 259 of file tikz.h.
References file_exists(), and find_on_path().
Referenced by display_pdf(), and find_on_path().
|
inline |
isAutoGeneratedNode: a ClassSwitch named CS_..._to_..., the name link gives the switch it inserts.
Definition at line 62 of file tikz.h.
References line::lang::ClassSwitch, is_auto_generated(), line::io::TikzNode::name, and line::io::TikzNode::type.
Referenced by is_auto_generated(), and line::io::to_tikz().
|
inline |
Java's String.format("%." + prec + "f", v).
The digits are the shortest decimal expansion that reads back as v (what Double.toString prints), rounded half up at prec decimals, which is FormattedFloatingDecimal.applyPrecision. A negative value keeps its sign even when it rounds to zero, as Java's does ("-0.00").
Definition at line 79 of file tikz_graph.h.
References java_fixed().
Referenced by java_fixed(), styled_node(), and line::io::tikz_render_routed_edge().
|
inline |
Java's SchedStrategy.name(): the enumerator spelling, which is the upper-cased text of sched_to_text.
Definition at line 63 of file tikz_graph.h.
References java_sched_name(), line::lang::NONE, and line::lang::sched_to_text().
Referenced by java_sched_name(), and line::io::tikz_graph().
| const std::string & line::io::tikz_detail::model_name | ( | const qn::NetworkStruct< T > & | sn | ) |
Definition at line 310 of file tikz.h.
References model_name().
|
inline |
Definition at line 308 of file tikz.h.
References model_name(), and line::io::TikzGraph::name.
Referenced by model_name(), model_name(), model_name(), and line::io::tikz_view().
| const std::string & line::io::tikz_detail::model_name | ( | qn::Network< T > & | m | ) |
Definition at line 312 of file tikz.h.
References model_name(), and line::qn::Network< T >::raw_struct().
|
inline |
getOutputAnchor: a Queue's arrows leave its server circle when one is drawn; every other node, a Delay included, its box.
Definition at line 68 of file tikz.h.
References output_anchor(), line::lang::Queue, and line::io::TikzNode::type.
Referenced by output_anchor(), and line::io::to_tikz().
|
inline |
reorderLayerByBarycenter: sort a layer by the mean position of its neighbours in the reference layer.
Definition at line 40 of file tikz_layout.h.
References reorder_by_barycenter().
Referenced by reorder_by_barycenter(), and line::io::tikz_layout().
|
inline |
Definition at line 148 of file tikz_graph.h.
References replace_all().
Referenced by escape_latex(), and replace_all().
|
inline |
name.replaceAll("[^a-zA-Z0-9]", "_"): one underscore per CODE POINT, so a UTF-8 sequence is one character.
Definition at line 134 of file tikz_graph.h.
References sanitize_id().
Referenced by sanitize_id(), line::io::tikz_render_node(), and line::io::to_tikz().
|
inline |
renderSelfLoop: the wide loop from the server circle of a Queue that draws one, the plain-node loop otherwise.
Definition at line 73 of file tikz.h.
References line::lang::Queue, self_loop(), and line::io::TikzNode::type.
Referenced by self_loop(), and line::io::to_tikz().
|
inline |
String.valueOf(queue.getNumberOfServers()), the JAR's Integer.MAX_VALUE pool being infinity.
Definition at line 178 of file tikz_node_renderer.h.
References server_label().
Referenced by server_label(), and line::io::tikz_render_node().
|
inline |
Start argv detached (own session, std streams on /dev/null, double fork so no zombie); false if it cannot start.
Definition at line 272 of file tikz.h.
References spawn_detached().
Referenced by display_pdf(), and spawn_detached().
|
inline |
\node[style] (id) at (x,y) {body}; followed by the name label the options ask for.
Definition at line 168 of file tikz_node_renderer.h.
References escape_latex(), java_fixed(), line::io::TikzNode::name, and styled_node().
Referenced by styled_node(), and line::io::tikz_render_node().
|
inline |
Definition at line 90 of file tikz.h.
References line::InputError::InputError(), and write_text().
Referenced by compile_pdf(), line::io::export_tikz(), line::io::export_tikz_to_file(), line::io::tikz_view(), and write_text().
|
constexpr |
Seconds a pdflatex or pdftoppm run may take before it is killed; a TikZ picture needs a few.
Definition at line 107 of file tikz.h.
Referenced by compile_pdf(), and line::io::tikz_export_png().