GQCP
Loading...
Searching...
No Matches
NonLinearEquationSolver.hpp
Go to the documentation of this file.
1// This file is part of GQCG-GQCP.
2//
3// Copyright (C) 2017-2020 the GQCG developers
4//
5// GQCG-GQCP is free software: you can redistribute it and/or modify
6// it under the terms of the GNU Lesser General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// GQCG-GQCP is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with GQCG-GQCP. If not, see <http://www.gnu.org/licenses/>.
17
18#pragma once
19
20
26
27
28namespace GQCP {
29
30
36template <typename _Scalar>
38public:
39 using Scalar = _Scalar;
40
41
42public:
43 /*
44 * STATIC PUBLIC METHODS
45 */
46
56 template <typename LinearSolver = decltype(LinearEquationSolver<Scalar>::ColPivHouseholderQR())>
57 static IterativeAlgorithm<NonLinearEquationEnvironment<Scalar>> Newton(const double threshold = 1.0e-08, const size_t maximum_number_of_iterations = 128, const LinearSolver& linear_solver = LinearEquationSolver<Scalar>::ColPivHouseholderQR()) {
58
59 // Create the iteration cycle that effectively 'defines' a Newton-based system of equations solver: it uses a Newton-step based update of the variables
62
63 // Create a convergence criterion on the norm of subsequent iterations of variables
65
66 return IterativeAlgorithm<NonLinearEquationEnvironment<Scalar>>(newton_cycle, convergence_criterion, maximum_number_of_iterations);
67 }
68};
69
70
71} // namespace GQCP
Definition: ConsecutiveIteratesNormConvergence.hpp:40
Definition: IterativeAlgorithm.hpp:38
Definition: NewtonStepUpdate.hpp:44
Definition: NonLinearEquationEnvironment.hpp:35
Definition: NonLinearEquationSolver.hpp:37
static IterativeAlgorithm< NonLinearEquationEnvironment< Scalar > > Newton(const double threshold=1.0e-08, const size_t maximum_number_of_iterations=128, const LinearSolver &linear_solver=LinearEquationSolver< Scalar >::ColPivHouseholderQR())
Definition: NonLinearEquationSolver.hpp:57
_Scalar Scalar
Definition: NonLinearEquationSolver.hpp:39
Definition: StepCollection.hpp:41
enable_if_t< std::is_same< Environment, typename Z::Environment >::value, StepCollection< Environment > & > add(const Z &step)
Definition: StepCollection.hpp:92
Definition: BaseOneElectronIntegralBuffer.hpp:25