
In the process, spruce up our realization diagnostics logging and factor out some of the repetitive code in the examples, because we're already changing those parts of the code to adapt them to the new encapsulation. This commit changes the example output format. I've checked by hand that the output is rearranged but not meaningfully changed.
28 lines
No EOL
864 B
Rust
28 lines
No EOL
864 B
Rust
mod common;
|
|
|
|
use common::{
|
|
print_gram_matrix,
|
|
print_loss_history,
|
|
print_realization_diagnostics,
|
|
print_title
|
|
};
|
|
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);
|
|
} |