Page MenuHomec4science

driver_structs.hpp
No OneTemporary

File Metadata

Created
Thu, Jul 11, 09:33

driver_structs.hpp

/*-------------------------------------------------------
Copyright (c) 2014,2015 Fabien Georget <fabieng@princeton.edu>, Princeton University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Princeton University nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------*/
#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 absolute_tolerance; //!< Absolute 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),
absolute_tolerance(1e-12),
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 absolute_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),
absolute_residual(0.0),
current_update(0.0)
{}
};
} // end namespace dfpmsolver
} // end namespace specmicp
#endif // SPECMICP_DFPMSOLVER_DRIVERSTRUCTS_HPP

Event Timeline