README.md

Thu, 01 Dec 2022 23:37:14 +0200

author
Tuomo Valkonen <tuomov@iki.fi>
date
Thu, 01 Dec 2022 23:37:14 +0200
changeset 6
bcb508479948
parent 0
eb3c7813b67a
child 9
21b0e537ac0e
permissions
-rw-r--r--

README fine-tuning and build.rs for uglifying it for rustdoc.

0
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
1
6
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
2 # Proximal methods for point source localisation: the implementation
0
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
3
6
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
4 This package contains [Rust][] codes for the manuscript “_Proximal methods for
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
5 point source localisation_” by Tuomo Valkonen ⟨tuomov@iki.fi⟩. It concerns
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
6 solution of problems of the type
0
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
7 $$
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
8 \min_{μ ∈ ℳ(Ω)}~ F(x) + λ \|μ\|_{ℳ(Ω)} + δ_{≥ 0}(x),
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
9 $$
6
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
10 where $F$ is a data term, and $ℳ(Ω)$ is the space of Radon measures on the
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
11 (rectangular) domain $Ω ⊂ ℝ^n$. Implemented are $F(x)=\frac12\|Ax-b\|_2^2$ and
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
12 $F(x)=\|Ax-b\|_1$ for the forward operator $A \in 𝕃(ℳ(Ω); ℝ^m)$ modelling a
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
13 simple sensor grid. For the 2-norm-squared data term implemented are the
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
14 algorithms μFB, μFISTA, and μPDPS from the aforementioned manuscript along with
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
15 comparison relaxed and fully corrective conditional gradient methods from the
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
16 literature. For the 1-norm data term only the μPDPS is applicable.
0
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
17
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
18 ## Installation and usage
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
19
6
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
20 ### Installing dependencies
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
21
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
22 Most dependencies are managed by the Cargo build system of [Rust][]. You will
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
23 only need to install the “nightly” Rust compiler and the
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
24 [GNU Scientific Library][gsl] manually. At the time of writing this README,
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
25 [alg_tools][] also needs to be downloaded separately.
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
26
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
27 1. Install the [Rust][] infrastructure (including Cargo) with [rustup][].
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
28 2. Install a “nightly” release of the Rust compiler. With rustup, installed in
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
29 the previous step, this can be done with
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
30 ```console
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
31 rustup toolchain install nightly
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
32 ```
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
33 3. Install [GNU Scientific Library][gsl]. On a Mac with [Homebrew] installed,
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
34 this can be done with
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
35 ```console
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
36 brew install gsl
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
37 ```
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
38 For other operating systems, suggestions are available in the
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
39 [rust-GSL crate documentation][rust-GSL].
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
40 On Windows, you will likely need to pass extra `RUSTFLAGS` options to
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
41 Cargo in the following steps to locate the library.
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
42
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
43 4. Download [alg_tools][] and unpack it under the same directory as this
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
44 package.
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
45
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
46 [rustup]: https://rustup.rs
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
47 [alg_tools]: https://tuomov.iki.fi/software/alg_tools/
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
48 [Rust]: https://www.rust-lang.org/
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
49 [rust-GSL]: https://docs.rs/GSL/6.0.0/rgsl/
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
50 [gsl]: https://www.gnu.org/software/gsl/
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
51 [Homebrew]: https://brew.sh
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
52
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
53 ### Building and running the experiments
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
54
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
55 To compile the code and run the experiments in the manuscript, use
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
56 ```console
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
57 cargo run --release
0
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
58 ```
6
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
59 When doing this for the first time, several dependencies will be downloaded.
0
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
60 The `--release` flag is required to build optimised high performance code.
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
61 Without that flag the performance will be significantly worse.
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
62
6
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
63 Alternatively, you may build the executable with
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
64 ```console
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
65 cargo build --release
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
66 ```
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
67 and then run it with
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
68 ```
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
69 target/release/pointsource_algs
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
70 ```
0
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
71
6
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
72 ### Documentation
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
73
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
74 Use the `--help` option to get an extensive listing of command line options.
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
75 If using `cargo` to run the executable, you have to pass any arguments to this
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
76 program after a double-dash:
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
77 ```console
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
78 cargo run --release -- --help
0
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
79 ```
6
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
80
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
81 ## Internals
0
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
82
6
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
83 If you are interested in the program internals, the integrated source code
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
84 documentation may be built and opened with
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
85 ```console
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
86 cargo doc # build dependency docs
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
87 misc/cargo-d --open # build and open KaTeX-aware docs for this crate
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
88 ```
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
89 The `cargo-d` script ensures that KaTeX mathematics is rendered in the
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
90 generated documentation. Unfortunately, `rustdoc`, akin to Rust largely itself,
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
91 is stuck in 80's 7-bit gringo ASCII world, and does not support modern markdown
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
92 features, such as mathematics. Instead, to render mathematics, an ugly
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
93 workaround is needed together with lots of painful raw HTML escapes in the
bcb508479948 README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
94 documentation.
0
eb3c7813b67a Initial version
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
95

mercurial