numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
implicit_exponential_problem.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
25
26namespace num_prob_collect::ode {
27
32public:
34 using variable_type = double;
35
37 using scalar_type = double;
38
40 using jacobian_type = double;
41
43 using mass_type = double;
44
46 static constexpr auto allowed_evaluations =
48 .diff_coeff = true, .jacobian = true, .mass = true};
49
55 void evaluate_on(double /*time*/, double variable,
56 num_collect::ode::evaluation_type /*evaluations*/) {
57 diff_coeff_ = jacobian_ * variable;
58 }
59
65 [[nodiscard]] auto diff_coeff() const -> const double& {
66 return diff_coeff_;
67 }
68
74 [[nodiscard]] auto jacobian() const noexcept -> const jacobian_type& {
75 return jacobian_;
76 }
77
83 [[nodiscard]] auto mass() const noexcept -> const mass_type& {
84 return mass_;
85 }
86
87private:
89 double diff_coeff_{};
90
92 double mass_{2.0}; // NOLINT
93
95 double jacobian_{2.0}; // NOLINT
96};
97
99 implicit_exponential_problem>);
100static_assert(
102
103} // namespace num_prob_collect::ode
Class of test problem to calculate exponential function.
static constexpr auto allowed_evaluations
Allowed evaluations.
auto diff_coeff() const -> const double &
Get the differential coefficient.
auto jacobian() const noexcept -> const jacobian_type &
Get the Jacobian.
void evaluate_on(double, double variable, num_collect::ode::evaluation_type)
Evaluate on a (time, variable) pair.
auto mass() const noexcept -> const mass_type &
Get the mass.
Concept of problems of differentiable ordinary differential equations.
Concept of problems of ordinary differential equations with mass.
Definition of differentiable_problem concept.
Definition of evaluation_type enumeration.
Definition of mass_problem concept.
Namespace of ordinary differential equation problems.
Definition namespaces.h:28
Struct to specify types of evaluations.