README.md

Sat, 28 Dec 2024 19:31:21 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sat, 28 Dec 2024 19:31:21 -0500
changeset 57
1afca417d71b
parent 54
cfd8d2304e9e
child 59
743984f4664e
permissions
-rw-r--r--

Further alg_tools updates

26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
1
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
2 # Non-Riemannian optimisation
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
3
54
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
4 This package contains [Rust] codes for the manuscript “_Forward-backward
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
5 methods in bilaterally bounded Alexandov spaces_” ([arXiv:????])
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
6 by Heikki von Koch and Tuomo Valkonen ⟨tuomov@iki.fi⟩.
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
7 It concerns the solution of problems of the type
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
8 $$
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
9 \min_{x ∈ M} F(x) + G(x)
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
10 $$
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
11 where $F$ is a smooth function and $G$ a possibly nonsmooth convex function
54
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
12 on a manifold $M$, which we do not assume to be Riemannian. It may,
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
13 for example, be an embedded manifold in $ℝ^3$, which sharp corners.
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
14 We have implemented the cube and the cylinder, as well as squared and
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
15 non-squared distance functions.
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
16
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
17 ## Installation and usage
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
18
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
19 ### Installing dependencies
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
20
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
21 Most dependencies are managed by the Cargo build system of [Rust]. You will
52
1d8e5731a4d3 Update README and dependencies.
Tuomo Valkonen <tuomov@iki.fi>
parents: 51
diff changeset
22 only need to manually install the “stable” Rust system itself.
1d8e5731a4d3 Update README and dependencies.
Tuomo Valkonen <tuomov@iki.fi>
parents: 51
diff changeset
23 At the time of writing this README, [alg_tools] also needs to be downloaded
1d8e5731a4d3 Update README and dependencies.
Tuomo Valkonen <tuomov@iki.fi>
parents: 51
diff changeset
24 separately.
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
25
54
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
26 1. Install the [Rust] infrastructure (including Cargo) with [rustup].
52
1d8e5731a4d3 Update README and dependencies.
Tuomo Valkonen <tuomov@iki.fi>
parents: 51
diff changeset
27 2. Download [alg_tools] and unpack it under the same directory as this
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
28 package.
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
29
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
30 [rustup]: https://rustup.rs
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
31 [alg_tools]: https://tuomov.iki.fi/software/alg_tools/
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
32 [Rust]: https://www.rust-lang.org/
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
33 [arXiv:????]: https://arxiv.org/abs/????
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
34
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
35 ### Building and running the experiments
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
36
52
1d8e5731a4d3 Update README and dependencies.
Tuomo Valkonen <tuomov@iki.fi>
parents: 51
diff changeset
37 To compile and install the program, use:
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
38 ```console
52
1d8e5731a4d3 Update README and dependencies.
Tuomo Valkonen <tuomov@iki.fi>
parents: 51
diff changeset
39 cargo install --path=.
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
40 ```
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
41 When doing this for the first time, several dependencies will be downloaded.
52
1d8e5731a4d3 Update README and dependencies.
Tuomo Valkonen <tuomov@iki.fi>
parents: 51
diff changeset
42 After this, you may run the experiment with
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
43 ```console
52
1d8e5731a4d3 Update README and dependencies.
Tuomo Valkonen <tuomov@iki.fi>
parents: 51
diff changeset
44 non-riemannian-opt
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
45 ```
52
1d8e5731a4d3 Update README and dependencies.
Tuomo Valkonen <tuomov@iki.fi>
parents: 51
diff changeset
46
1d8e5731a4d3 Update README and dependencies.
Tuomo Valkonen <tuomov@iki.fi>
parents: 51
diff changeset
47 Alternatively, you may build (without installing) and run the experiments with
1d8e5731a4d3 Update README and dependencies.
Tuomo Valkonen <tuomov@iki.fi>
parents: 51
diff changeset
48 ```console
1d8e5731a4d3 Update README and dependencies.
Tuomo Valkonen <tuomov@iki.fi>
parents: 51
diff changeset
49 cargo run --release
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
50 ```
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
51
54
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
52 ### Generating the graphical illustrations
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
53
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
54 We include LaTeX/PGFPLOTS files for graphically illustrating the numerical results.
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
55 To generate `cube.pdf` and `cylinder.pdf` that visualise the computations, after running
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
56 `non-riemannian-opt` as indicated above, you can use:
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
57 ```console
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
58 cd visualisations
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
59 pdflatex cube
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
60 pdflatex cylinder
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
61 ```
cfd8d2304e9e Some README and Cargo.toml details
Tuomo Valkonen <tuomov@iki.fi>
parents: 52
diff changeset
62
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
63 ## Internals
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
64
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
65 If you are interested in the program internals, the integrated source code
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
66 documentation may be built and opened with
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
67 ```console
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
68 cargo doc # build dependency docs
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
69 misc/cargo-d --open # build and open KaTeX-aware docs for this crate
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
70 ```
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
71 The `cargo-d` script ensures that KaTeX mathematics is rendered in the
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
72 generated documentation through an ugly workaround. Unfortunately,
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
73 `rustdoc`, akin to Rust largely itself, is stuck in 80's 7-bit gringo ASCII
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
74 world, and does not support modern markdown features, such as mathematics.
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
75

mercurial