Skip to main content
← OpenMECP Documentation

select_diis_step

Function select_diis_step 

Source
pub fn select_diis_step(
    opt_state: &mut OptimizationState,
    config: &Config,
    step: usize,
) -> DVector<f64>
Expand description

Selects and runs the appropriate DIIS/GEDIIS step based on configuration.

This is a shared dispatch function to eliminate the three copies of DIIS dispatch logic that were previously duplicated across Normal/Read/Noread modes in main.rs (which had subtle differences between them).

§Arguments

  • opt_state - Mutable optimization state
  • config - Configuration with optimizer settings
  • step - Current optimization step number (1-indexed, for printouts)

§Returns

New geometry coordinates from the selected optimizer.