46template <base::concepts::dense_matrix Coeff, base::concepts::dense_matrix Data>
60 static_assert(std::is_same_v<
typename coeff_type::Scalar,
61 typename data_type::Scalar>);
62 static_assert(data_type::RowsAtCompileTime == Eigen::Dynamic);
76 svd_.compute(coeff, Eigen::ComputeThinU | Eigen::ComputeThinV);
80 svd_.matrixU().leftCols(rank) *
81 svd_.matrixU().leftCols(rank).adjoint() * data)
92 singular_value / (singular_value * singular_value + param);
93 solution += factor *
svd_.matrixV().col(i) *
rot_data_.row(i);
104 return svd_.singularValues();
114 const scalar_type den = singular_value * singular_value + param;
116 (param * param) / (den * den) *
rot_data_.row(i).squaredNorm();
128 const scalar_type den = singular_value * singular_value + param;
129 res += (singular_value * singular_value) / (den * den) *
142 const scalar_type den = singular_value * singular_value + param;
143 res += (
static_cast<scalar_type>(2) * param * singular_value *
145 (den * den * den) *
rot_data_.row(i).squaredNorm();
157 const scalar_type den = singular_value * singular_value + param;
158 res += (-
static_cast<scalar_type>(2) * singular_value *
160 (den * den * den) *
rot_data_.row(i).squaredNorm();
172 const scalar_type den = singular_value * singular_value + param;
173 res += (
static_cast<scalar_type>(2) * singular_value *
174 singular_value * singular_value * singular_value -
175 static_cast<scalar_type>(4) * param * singular_value *
177 (den * den * den * den) *
rot_data_.row(i).squaredNorm();
189 const scalar_type den = singular_value * singular_value + param;
190 res += (
static_cast<scalar_type>(6) * singular_value *
192 (den * den * den * den) *
rot_data_.row(i).squaredNorm();
204 const scalar_type den = singular_value * singular_value + param;
205 res += singular_value * singular_value / den;
218 max_singular_value * max_singular_value;
225 Eigen::BDCSVD<coeff_type>
svd_{};
Class of tags of logs without memory management.
Base class of solvers using explicit formulas for regularization.
typename Eigen::NumTraits< typename data_type::Scalar >::Real scalar_type
Class to perform Tikhonov regularization.
auto singular_values() const -> const typename Eigen::BDCSVD< coeff_type >::SingularValuesType &
Get the singular values.
auto second_derivative_of_residual_norm(const scalar_type ¶m) const -> scalar_type
Calculate the second-order derivative of the squared norm of the residual.
auto data_size() const -> index_type
Get the size of data.
auto sum_of_filter_factor(const scalar_type ¶m) const -> scalar_type
Calculate the sum of filter factors.
void solve(const scalar_type ¶m, data_type &solution) const
Solve for a regularization parameter.
auto first_derivative_of_residual_norm(const scalar_type ¶m) const -> scalar_type
Calculate the first-order derivative of the squared norm of the residual.
auto param_search_region() const -> std::pair< scalar_type, scalar_type >
Get the default region to search for the optimal regularization parameter.
auto regularization_term(const scalar_type ¶m) const -> scalar_type
Calculate the regularization term.
data_type rot_data_
Data in the space of singular values.
scalar_type min_res_
Minimum residual.
Eigen::BDCSVD< coeff_type > svd_
SVD of the coefficient matrix.
auto first_derivative_of_regularization_term(const scalar_type ¶m) const -> scalar_type
Calculate the first-order derivative of the Regularization term.
auto residual_norm(const scalar_type ¶m) const -> scalar_type
Calculate the squared norm of the residual.
Coeff coeff_type
Type of coefficient matrices.
auto second_derivative_of_regularization_term(const scalar_type ¶m) const -> scalar_type
Calculate the send-order derivative of the Regularization term.
void compute(const coeff_type &coeff, const data_type &data)
Compute internal matrices.
Definition of tikhonov class.
Definition of dense_matrix concept.
Definition of explicit_regularized_solver_base class.
Definition of index_type type.
Definition of log_tag_view class.
Namespace of Eigen library.
std::ptrdiff_t index_type
Type of indices in this library.
constexpr auto coeff_max_param
Coefficient (maximum parameter to be searched) / (maximum singular value or eigen value).
constexpr auto coeff_min_param
Coefficient (minimum parameter to be searched) / (maximum singular value or eigen value).
Namespace of regularization algorithms.
constexpr auto tikhonov_tag
Tag of fista.
Header to check and warn about use of fast-math mode for Eigen::BDCSVD.