Reorganize the shared example code
All checks were successful
/ test (pull_request) Successful in 3m36s
All checks were successful
/ test (pull_request) Successful in 3m36s
The new layout deviates from what the Rust book suggests https://doc.rust-lang.org/book/ch11-03-test-organization.html#submodules-in-integration-tests and uses the frowned-upon `#[path]` attribute, https://doc.rust-lang.org/style-guide/advice.html#modules but we've decided that having a descriptive module filename instead of `mod.rs` is worth the cost.
This commit is contained in:
parent
2137284358
commit
477d6a5064
5 changed files with 30 additions and 51 deletions
|
@ -1,11 +1,6 @@
|
|||
mod common;
|
||||
#[path = "common/print.rs"]
|
||||
mod print;
|
||||
|
||||
use common::{
|
||||
print_gram_matrix,
|
||||
print_loss_history,
|
||||
print_realization_diagnostics,
|
||||
print_title
|
||||
};
|
||||
use dyna3::engine::{realize_gram, sphere, ConstraintProblem, Realization};
|
||||
|
||||
fn main() {
|
||||
|
@ -25,10 +20,10 @@ fn main() {
|
|||
let realization_result = realize_gram(
|
||||
&problem, 1.0e-12, 0.5, 0.9, 1.1, 200, 110
|
||||
);
|
||||
print_title("Three spheres");
|
||||
print_realization_diagnostics(&realization_result);
|
||||
print::title("Three spheres");
|
||||
print::realization_diagnostics(&realization_result);
|
||||
if let Ok(Realization{ config, .. }) = realization_result.result {
|
||||
print_gram_matrix(&config);
|
||||
print::gram_matrix(&config);
|
||||
}
|
||||
print_loss_history(&realization_result.history);
|
||||
print::loss_history(&realization_result.history);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue