Page MenuHomec4science

driver_structs.hpp
No OneTemporary

File Metadata

Created
Sat, Nov 16, 20:11

driver_structs.hpp

#ifndef SPECMICP_DFPMSOLVER_DRIVERSTRUCTS_HPP
#define SPECMICP_DFPMSOLVER_DRIVERSTRUCTS_HPP
#include "common.hpp"
#include "utils/sparse_solvers/sparse_solver_structs.hpp"
namespace specmicp {
namespace dfpmsolver {
//! \brief Options of a driver
//!
struct DriverOptions
{
scalar_t residuals_tolerance; //!< Tolerance for the residual
scalar_t step_tolerance; //!< Tolerance for the minimum step length
scalar_t threshold_stationary_point; //!< if ||R||>threshold, the point is classified as stationary
int maximum_iterations; //!< Maximum iterations allowed
scalar_t maximum_step_length; //!< Maximum step length allowed
int max_iterations_at_max_length; //!< Maximum number of iterations at maximum step length
scalar_t coeff_accept_newton_step; //!< Accept Newton step if enough progress is made
sparse_solvers::SparseSolver sparse_solver; //!< The sparse solver to use
DriverOptions():
residuals_tolerance(5e-5),
step_tolerance(1e-10),
threshold_stationary_point(1e-4),
maximum_iterations(200),
maximum_step_length(1e3),
max_iterations_at_max_length(50),
coeff_accept_newton_step(0.9),
sparse_solver(sparse_solvers::SparseSolver::SparseQR)
{}
};
//! \brief Performance of a driver
struct DriverPerformance
{
int nb_call_residuals;
int nb_call_jacobian;
int nb_iterations;
int nb_consecutive_max_step_taken;
int nb_max_step_taken;
bool maximum_step_taken;
scalar_t current_residual;
scalar_t current_update;
DriverPerformance():
nb_call_residuals(0),
nb_call_jacobian(0),
nb_iterations(0),
nb_consecutive_max_step_taken(0),
nb_max_step_taken(0),
maximum_step_taken(0),
current_residual(0.0),
current_update(0.0)
{}
};
} // end namespace dfpmsolver
} // end namespace specmicp
#endif // SPECMICP_DFPMSOLVER_DRIVERSTRUCTS_HPP

Event Timeline