b23d4a1860
Put shared code in the conditionally compiled `engine::irisawa` module.
25 lines
1008 B
Rust
25 lines
1008 B
Rust
use dyna3::engine::{Q, irisawa::realize_irisawa_hexlet};
|
|
|
|
fn main() {
|
|
const SCALED_TOL: f64 = 1.0e-12;
|
|
let (config, success, history) = realize_irisawa_hexlet(SCALED_TOL);
|
|
print!("\nCompleted Gram matrix:{}", config.tr_mul(&*Q) * &config);
|
|
if success {
|
|
println!("Target accuracy achieved!");
|
|
} else {
|
|
println!("Failed to reach target accuracy");
|
|
}
|
|
println!("Steps: {}", history.scaled_loss.len() - 1);
|
|
println!("Loss: {}", history.scaled_loss.last().unwrap());
|
|
if success {
|
|
println!("\nChain diameters:");
|
|
println!(" {} sun (given)", 1.0 / config[(3, 3)]);
|
|
for k in 4..9 {
|
|
println!(" {} sun", 1.0 / config[(3, k)]);
|
|
}
|
|
}
|
|
println!("\nStep │ Loss\n─────┼────────────────────────────────");
|
|
for (step, scaled_loss) in history.scaled_loss.into_iter().enumerate() {
|
|
println!("{:<4} │ {}", step, scaled_loss);
|
|
}
|
|
} |