numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
explicit_regularized_solver.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 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
22#include <utility>
23
24#include <Eigen/Core>
25
30
32
38template <typename T>
39concept explicit_regularized_solver = requires() {
40 typename T::scalar_type;
42
43 typename T::data_type;
45
46 requires std::is_same_v<typename T::scalar_type,
47 typename Eigen::NumTraits<typename T::data_type::Scalar>::Real>;
48
49 requires requires(T& solver, const typename T::scalar_type& param,
50 typename T::data_type& solution) { solver.solve(param, solution); };
51
52 requires requires(T& solver, const typename T::scalar_type& param) {
53 {
54 solver.residual_norm(param)
56 {
57 solver.regularization_term(param)
59
60 {
61 solver.first_derivative_of_residual_norm(param)
63 {
64 solver.first_derivative_of_regularization_term(param)
66
67 {
68 solver.second_derivative_of_residual_norm(param)
70 {
71 solver.second_derivative_of_regularization_term(param)
73
74 {
75 solver.sum_of_filter_factor(param)
77
78 { solver.data_size() } -> base::concepts::decayed_to<index_type>;
79
80 {
81 solver.param_search_region()
83 std::pair<typename T::scalar_type, typename T::scalar_type>>;
84
85 {
86 solver.l_curve_curvature(param)
88 {
89 solver.gcv(param)
91 };
92};
93
94} // namespace num_collect::regularization::concepts
Concept of Eigen's dense matrices.
Concept of solvers using explicit formulas for regularization.
Definition of decayed_to concept.
Definition of dense_matrix concept.
Definition of index_type type.
Definition of real_scalar concept.