Skip to content
Snippets Groups Projects
Commit d7c46f4d authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

Prace: Upgrade

parent 4e7c21f6
No related branches found
No related tags found
No related merge requests found
...@@ -140,3 +140,9 @@ def refs(element, content, processor): ...@@ -140,3 +140,9 @@ def refs(element, content, processor):
copy(div1, *x), copy(div1, *x),
texb("}"), texb("}"),
] ]
@formatitko_command
def directtex(element, content, processor):
(code_line,) = element.content
assert isinstance(code_line, pf.Code)
return [texi(code_line.text)]
...@@ -9,7 +9,7 @@ import sys, os ...@@ -9,7 +9,7 @@ import sys, os
d = pathlib.Path("/".join(__file__.split("/")[:-1])) d = pathlib.Path("/".join(__file__.split("/")[:-1]))
def load(name): def load(name):
return data_lib.Data(d/name, validate_versions=False, remove_duplications=True) return data_lib.Data(name, validate_versions=False, remove_duplications=True)
def load_main_test(): def load_main_test():
return load(d/"main_test/log") return load(d/"main_test/log")
......
...@@ -711,7 +711,7 @@ vynutíme $\vec{y_i} = -\vec{y_j}$. Na to nám stačí jediná podmínka -- ří ...@@ -711,7 +711,7 @@ vynutíme $\vec{y_i} = -\vec{y_j}$. Na to nám stačí jediná podmínka -- ří
Účelovou funkcí pak řekneme, že sousední auta mají preferovat stejnou barvu, tedy jejich body na sféře mají být blízko sebe, což znamená, že skalární součin má být co největší. Účelovou funkcí pak řekneme, že sousední auta mají preferovat stejnou barvu, tedy jejich body na sféře mají být blízko sebe, což znamená, že skalární součin má být co největší.
:::{c=box t=algo name="Řešení pomocí semidefinitního programování" notation="sdp"} :::{c=box t=algo name="Řešení pomocí semidefinitního programování" notation="sdp"}
\hfil{\penalty-10000}\relax Vyřešíme následující semidefinitní program v dekomponovaném tvaru: [`\hfil{\penalty-10000}\relax{}`]{c=directtex}Vyřešíme následující semidefinitní program v dekomponovaném tvaru:
$$\progline{maximalizuj}{\sum_{0\le i<2n-1} \vec{y_i}^{\rm T} \vec{y_{i+1}}}{}$$ $$\progline{maximalizuj}{\sum_{0\le i<2n-1} \vec{y_i}^{\rm T} \vec{y_{i+1}}}{}$$
$$\progline{za podmínek}{\vec{y_{a_{i,0}}} = -\vec{y_{a_{i,1}}}}{0\le i < n}$$ $$\progline{za podmínek}{\vec{y_{a_{i,0}}} = -\vec{y_{a_{i,1}}}}{0\le i < n}$$
$$\progline{}{|y_i| = 1}{0\le i < 2n}$$ $$\progline{}{|y_i| = 1}{0\le i < 2n}$$
...@@ -1257,7 +1257,7 @@ def gen_alg(pipeline_name, algo_name, name_suffix, floatpage, add_note=False): ...@@ -1257,7 +1257,7 @@ def gen_alg(pipeline_name, algo_name, name_suffix, floatpage, add_note=False):
*(["chyb"] if print_errors else []), *(["chyb"] if print_errors else []),
[pf.Math("\\overline{\\delta_{\\algo{"+algo_name+"}}(n)}", format='InlineMath')], [pf.Math("\\overline{\\delta_{\\algo{"+algo_name+"}}(n)}", format='InlineMath')],
[pf.Math("S_{\\delta_{\\algo{"+algo_name+"}}}(n)", format='InlineMath')], [pf.Math("S_{\\delta_{\\algo{"+algo_name+"}}}(n)", format='InlineMath')],
*([pf.Math(f"{i} \%", format='InlineMath')] for i in percentils) *([pf.Math(f"{i} \\%", format='InlineMath')] for i in percentils)
))) )))
note = element.content if add_note else [] note = element.content if add_note else []
return processor.transform([pf.Figure(table, *note, caption=pf.Caption(pf.Plain(*parse_string("Statistika algoritmu "), pf.Math(f"\\algo{{{algo_name}}}", format="InlineMath"), *name_suffix, *parse_string("."))), attributes=dict(floatpage=floatpage, tocmac="", type="table", type_text="Tabulka"))]) return processor.transform([pf.Figure(table, *note, caption=pf.Caption(pf.Plain(*parse_string("Statistika algoritmu "), pf.Math(f"\\algo{{{algo_name}}}", format="InlineMath"), *name_suffix, *parse_string("."))), attributes=dict(floatpage=floatpage, tocmac="", type="table", type_text="Tabulka"))])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment