numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
implicit_regularized_solver.h
Go to the documentation of this file.
1/*
2 * Copyright 2024 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
33template <typename T>
34concept implicit_regularized_solver = requires() {
35 typename T::scalar_type;
37
38 typename T::data_type;
40
41 requires std::is_same_v<typename T::scalar_type,
42 typename Eigen::NumTraits<typename T::data_type::Scalar>::Real>;
43
44 requires requires(T& solver, const typename T::scalar_type& param,
45 typename T::data_type& solution) { solver.solve(param, solution); };
46
47 requires requires(const T& solver) {
48 { solver.data_size() } -> base::concepts::decayed_to<index_type>;
49 };
50
51 requires requires(const T& solver) {
52 {
53 solver.param_search_region()
55 std::pair<typename T::scalar_type, typename T::scalar_type>>;
56 };
57
58 requires requires(const T& solver, const typename T::data_type& solution) {
59 {
60 solver.residual_norm(solution)
62 };
63
64 requires requires(const T& solver, const typename T::data_type& solution) {
65 {
66 solver.regularization_term(solution)
68 };
69
70 requires requires(T& solver, const typename T::data_type& data) {
71 solver.change_data(data);
72 };
73};
74
75} // namespace num_collect::regularization::concepts
Concept of Eigen's dense matrices.
Definition of decayed_to concept.
Definition of dense_matrix concept.
Definition of index_type type.
Definition of real_scalar concept.