numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
implicit_formula_base.h
Go to the documentation of this file.
1/*
2 * Copyright 2021 MusicScience37 (Kenta Kabashima)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
20#pragma once
21
27
29
37template <typename Derived, concepts::problem Problem,
38 concepts::ode_equation_solver FormulaSolver>
39class implicit_formula_base : public formula_base<Derived, Problem> {
40public:
43
44 using typename base_type::problem_type;
45 using typename base_type::scalar_type;
46 using typename base_type::variable_type;
47
49 using formula_solver_type = FormulaSolver;
50
51protected:
53
54public:
62
68 [[nodiscard]] auto formula_solver() -> formula_solver_type& {
69 return formula_solver_;
70 }
71
77 [[nodiscard]] auto formula_solver() const -> const formula_solver_type& {
78 return formula_solver_;
79 }
80
87 auto tolerances(const error_tolerances<variable_type>& val) -> Derived& {
88 formula_solver_.tolerances(val);
89 return derived();
90 }
91
97 [[nodiscard]] auto logger() const noexcept
98 -> const num_collect::logging::logger& {
99 return formula_solver_.logger();
100 }
101
107 [[nodiscard]] auto logger() noexcept -> num_collect::logging::logger& {
108 return formula_solver_.logger();
109 }
110
111private:
114};
115
116} // namespace num_collect::ode::runge_kutta
Class of error tolerances hairer1993.
Base class of formulas in ODE solvers.
typename problem_type::variable_type variable_type
Type of variables.
auto problem() -> problem_type &
Get the problem.
Problem problem_type
Type of problem.
typename problem_type::scalar_type scalar_type
Type of scalars.
auto derived() noexcept -> Derived &
Access derived object.
auto tolerances(const error_tolerances< variable_type > &val) -> Derived &
Set the error tolerances.
implicit_formula_base(const problem_type &problem=problem_type())
Constructor.
auto logger() noexcept -> num_collect::logging::logger &
Access to the logger.
auto formula_solver() const -> const formula_solver_type &
Get solver of formula.
auto derived() noexcept -> Derived &
Access derived object.
auto formula_solver() -> formula_solver_type &
Get solver of formula.
FormulaSolver formula_solver_type
Type of solver of formula.
auto logger() const noexcept -> const num_collect::logging::logger &
Access to the logger.
formula_solver_type formula_solver_
Solver of formula.
Definition of error_tolerances class.
Definition of formula_base class.
Definition of logger class.
Namespace of Runge-Kutta method.
Namespace of num_collect source codes.
Definition of ode_equation_solver concept.
Definition of problem concept.