Fri, 14 Feb 2025 23:16:14 -0500
Add .cargo/config.toml setting for finding GSL on macos.
0 | 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 | 3 | |
40 | 4 | This package contains the [Rust] codes for the numerical experiments in the articles |
5 | * T. Valkonen, “_Proximal methods for | |
6 | point source localisation_”, Journal of Nonsmooth Analysis and Optimization 4 (2023), 10433, [doi:10.46298/jnsao-2023-10433] ([arXiv:2212.02991]) | |
7 | * T. Valkonen, “_Point source localisation with unbalanced optimal transport_” (2025), submitted. | |
8 | ||
9 | It concerns solution of problems of the type | |
0 | 10 | $$ |
12
861f6c033646
Oops, some μ were x in the README.
Tuomo Valkonen <tuomov@iki.fi>
parents:
9
diff
changeset
|
11 | \min_{μ ∈ ℳ(Ω)}~ F(μ) + λ \|μ\|_{ℳ(Ω)} + δ_{≥ 0}(μ), |
0 | 12 | $$ |
6
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
13 | where $F$ is a data term, and $ℳ(Ω)$ is the space of Radon measures on the |
12
861f6c033646
Oops, some μ were x in the README.
Tuomo Valkonen <tuomov@iki.fi>
parents:
9
diff
changeset
|
14 | (rectangular) domain $Ω ⊂ ℝ^n$. Implemented are $F(μ)=\frac12\|Aμ-b\|_2^2$ and |
861f6c033646
Oops, some μ were x in the README.
Tuomo Valkonen <tuomov@iki.fi>
parents:
9
diff
changeset
|
15 | $F(μ)=\|Aμ-b\|_1$ for the forward operator $A \in 𝕃(ℳ(Ω); ℝ^m)$ modelling a |
40 | 16 | simple sensor grid. |
0 | 17 | |
18 | ## Installation and usage | |
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 | |
13
bdc57366d4f5
arXiv links, README beautification
Tuomo Valkonen <tuomov@iki.fi>
parents:
12
diff
changeset
|
22 | Most dependencies are managed by the Cargo build system of [Rust]. You will |
6
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 |
13
bdc57366d4f5
arXiv links, README beautification
Tuomo Valkonen <tuomov@iki.fi>
parents:
12
diff
changeset
|
24 | [GNU Scientific Library] manually. At the time of writing this README, |
bdc57366d4f5
arXiv links, README beautification
Tuomo Valkonen <tuomov@iki.fi>
parents:
12
diff
changeset
|
25 | [alg_tools] also needs to be downloaded separately. |
6
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
26 | |
13
bdc57366d4f5
arXiv links, README beautification
Tuomo Valkonen <tuomov@iki.fi>
parents:
12
diff
changeset
|
27 | 1. Install the [Rust] infrastructure (including Cargo) with [rustup]. |
6
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 | ``` |
13
bdc57366d4f5
arXiv links, README beautification
Tuomo Valkonen <tuomov@iki.fi>
parents:
12
diff
changeset
|
33 | 3. Install [GNU Scientific Library]. On a Mac with [Homebrew] installed, |
6
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 | ``` |
17
de8d43ebfd0d
Oops, broke some README external links
Tuomo Valkonen <tuomov@iki.fi>
parents:
13
diff
changeset
|
38 | For other operating systems, suggestions are available in the [rust-GSL] |
de8d43ebfd0d
Oops, broke some README external links
Tuomo Valkonen <tuomov@iki.fi>
parents:
13
diff
changeset
|
39 | crate documentation. On Windows, you will likely need to pass extra |
de8d43ebfd0d
Oops, broke some README external links
Tuomo Valkonen <tuomov@iki.fi>
parents:
13
diff
changeset
|
40 | `RUSTFLAGS` options to Cargo in the following steps to locate the library. |
6
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
41 | |
13
bdc57366d4f5
arXiv links, README beautification
Tuomo Valkonen <tuomov@iki.fi>
parents:
12
diff
changeset
|
42 | 4. Download [alg_tools] and unpack it under the same directory as this |
6
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
43 | package. |
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
44 | |
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
45 | [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
|
46 | [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
|
47 | [Rust]: https://www.rust-lang.org/ |
17
de8d43ebfd0d
Oops, broke some README external links
Tuomo Valkonen <tuomov@iki.fi>
parents:
13
diff
changeset
|
48 | [GNU Scientific Library]: https://www.gnu.org/software/gsl/ |
de8d43ebfd0d
Oops, broke some README external links
Tuomo Valkonen <tuomov@iki.fi>
parents:
13
diff
changeset
|
49 | [rust-GSL]: https://docs.rs/GSL/6.0.0/rgsl/ |
6
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
50 | [Homebrew]: https://brew.sh |
13
bdc57366d4f5
arXiv links, README beautification
Tuomo Valkonen <tuomov@iki.fi>
parents:
12
diff
changeset
|
51 | [arXiv:2212.02991]: https://arxiv.org/abs/2212.02991 |
40 | 52 | [doi:10.46298/jnsao-2023-10433]: http://doi.org/10.46298/jnsao-2023-10433 |
6
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
53 | |
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
54 | ### 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
|
55 | |
35 | 56 | To compile and install the program, use |
57 | ```console | |
58 | cargo install --path=. | |
59 | ``` | |
60 | When doing this for the first time, several dependencies will be downloaded. | |
40 | 61 | Now you can run the default set of experiments with |
35 | 62 | ``` |
63 | pointsource_algs -o results | |
64 | ``` | |
65 | The `-o results` option tells `pointsource_algs` to write results in the | |
66 | `results` directory. The option is required. | |
67 | ||
68 | Alternatively, you may build and run the program without installing with | |
6
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
69 | ```console |
9
21b0e537ac0e
Command line parameter passing simplifications and make `-o` required.
Tuomo Valkonen <tuomov@iki.fi>
parents:
6
diff
changeset
|
70 | cargo run --release -- -o results |
0 | 71 | ``` |
35 | 72 | The double-dash separates the options for the Cargo build system |
73 | and `pointsource_algs`. | |
0 | 74 | |
6
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
75 | ### Documentation |
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
76 | |
9
21b0e537ac0e
Command line parameter passing simplifications and make `-o` required.
Tuomo Valkonen <tuomov@iki.fi>
parents:
6
diff
changeset
|
77 | Use the `--help` option to get an extensive listing of command line options to |
35 | 78 | customise algorithm parameters and the experiments performed. |
6
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
79 | |
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
80 | ## Internals |
0 | 81 | |
6
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
82 | 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
|
83 | 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
|
84 | ```console |
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
85 | 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
|
86 | 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
|
87 | ``` |
bcb508479948
README fine-tuning and build.rs for uglifying it for rustdoc.
Tuomo Valkonen <tuomov@iki.fi>
parents:
0
diff
changeset
|
88 | The `cargo-d` script ensures that KaTeX mathematics is rendered in the |
13
bdc57366d4f5
arXiv links, README beautification
Tuomo Valkonen <tuomov@iki.fi>
parents:
12
diff
changeset
|
89 | generated documentation through an ugly workaround. Unfortunately, |
bdc57366d4f5
arXiv links, README beautification
Tuomo Valkonen <tuomov@iki.fi>
parents:
12
diff
changeset
|
90 | `rustdoc`, akin to Rust largely itself, is stuck in 80's 7-bit gringo ASCII |
bdc57366d4f5
arXiv links, README beautification
Tuomo Valkonen <tuomov@iki.fi>
parents:
12
diff
changeset
|
91 | world, and does not support modern markdown features, such as mathematics. |
0 | 92 |