forked from StudioInfinity/dyna3

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.
23 lines
No EOL
780 B
Rust
23 lines
No EOL
780 B
Rust
#[path = "common/print.rs"]
|
|
mod print;
|
|
|
|
use dyna3::engine::{Realization, examples::realize_irisawa_hexlet};
|
|
|
|
fn main() {
|
|
const SCALED_TOL: f64 = 1.0e-12;
|
|
let realization_result = realize_irisawa_hexlet(SCALED_TOL);
|
|
print::title("Irisawa hexlet");
|
|
print::realization_diagnostics(&realization_result);
|
|
if let Ok(Realization { config, .. }) = realization_result.result {
|
|
// print the diameters of the chain spheres
|
|
println!("\nChain diameters:");
|
|
println!(" {} sun (given)", 1.0 / config[(3, 3)]);
|
|
for k in 4..9 {
|
|
println!(" {} sun", 1.0 / config[(3, k)]);
|
|
}
|
|
|
|
// print the completed Gram matrix
|
|
print::gram_matrix(&config);
|
|
}
|
|
print::loss_history(&realization_result.history);
|
|
} |