numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
num_collect::regularization::implicit_gcv_calculator< Solver > Class Template Reference

Class to calculate the objective function of GCV. More...

#include <num_collect/regularization/implicit_gcv.h>

+ Inheritance diagram for num_collect::regularization::implicit_gcv_calculator< Solver >:
+ Collaboration diagram for num_collect::regularization::implicit_gcv_calculator< Solver >:

Public Types

using data_type = typename solver_type::data_type
 Type of data.
 
using scalar_type = typename solver_type::scalar_type
 Type of scalars.
 
using solver_type = Solver
 Type of solvers.
 

Public Member Functions

 implicit_gcv_calculator (solver_type &solver, const data_type &data, const data_type &initial_solution)
 Constructor.
 
void generate_noise ()
 Generate noise with a random seed.
 
template<base::concepts::invocable<> RandomNumberGenerator>
void generate_noise (RandomNumberGenerator &generator)
 Generate noise to use in calculation.
 
auto noise_rate (scalar_type value) -> implicit_gcv_calculator &
 Set the rate of noise.
 
auto num_samples (index_type value) -> implicit_gcv_calculator &
 Set the number of samples for approximation of denominator of GCV.
 
auto operator() (scalar_type param) -> scalar_type
 Calculate GCV function.
 
auto solver () const noexcept -> solver_type &
 Get the solver.
 

Private Attributes

const data_typedata_
 Actual data.
 
util::vector< data_typedata_with_noise_ {}
 Data with noise.
 
data_type forwarded_data_ {}
 Buffer of data generated from the solution.
 
data_type forwarded_data_with_noise_ {}
 Buffer of data generated from the solution with noise.
 
const data_typeinitial_solution_
 Initial solution.
 
util::vector< data_typenoise_
 Vector of noise.
 
scalar_type noise_multiplier_ {}
 Multiplier of noise.
 
scalar_type noise_rate_ {default_noise_rate}
 Rate of noise.
 
data_type solution_ {}
 Buffer of the solution.
 
data_type solution_with_noise_ {}
 Buffer of the solution with noise.
 
solver_typesolver_
 Solver.
 

Static Private Attributes

static constexpr scalar_type default_noise_rate = 1e-2
 Default rate of noise.
 

Detailed Description

template<concepts::implicit_regularized_solver Solver>
class num_collect::regularization::implicit_gcv_calculator< Solver >

Class to calculate the objective function of GCV.

Template Parameters
SolverType of solvers.

Definition at line 50 of file implicit_gcv.h.

Member Typedef Documentation

◆ data_type

template<concepts::implicit_regularized_solver Solver>
using num_collect::regularization::implicit_gcv_calculator< Solver >::data_type = typename solver_type::data_type

Type of data.

Definition at line 59 of file implicit_gcv.h.

◆ scalar_type

template<concepts::implicit_regularized_solver Solver>
using num_collect::regularization::implicit_gcv_calculator< Solver >::scalar_type = typename solver_type::scalar_type

Type of scalars.

Definition at line 56 of file implicit_gcv.h.

◆ solver_type

template<concepts::implicit_regularized_solver Solver>
using num_collect::regularization::implicit_gcv_calculator< Solver >::solver_type = Solver

Type of solvers.

Definition at line 53 of file implicit_gcv.h.

Constructor & Destructor Documentation

◆ implicit_gcv_calculator()

template<concepts::implicit_regularized_solver Solver>
num_collect::regularization::implicit_gcv_calculator< Solver >::implicit_gcv_calculator ( solver_type & solver,
const data_type & data,
const data_type & initial_solution )
inline

Constructor.

Parameters
[in]solverSolver.
[in]dataData.
[in]initial_solutionInitial solution.

Definition at line 71 of file implicit_gcv.h.

Member Function Documentation

◆ generate_noise() [1/2]

template<concepts::implicit_regularized_solver Solver>
void num_collect::regularization::implicit_gcv_calculator< Solver >::generate_noise ( )
inline

Generate noise with a random seed.

Definition at line 169 of file implicit_gcv.h.

◆ generate_noise() [2/2]

template<concepts::implicit_regularized_solver Solver>
template<base::concepts::invocable<> RandomNumberGenerator>
void num_collect::regularization::implicit_gcv_calculator< Solver >::generate_noise ( RandomNumberGenerator & generator)
inline

Generate noise to use in calculation.

Template Parameters
RandomNumberGeneratorType of the generator of random numbers.
Parameters
[in]generatorGenerator of random numbers.

Definition at line 155 of file implicit_gcv.h.

◆ noise_rate()

template<concepts::implicit_regularized_solver Solver>
auto num_collect::regularization::implicit_gcv_calculator< Solver >::noise_rate ( scalar_type value) -> implicit_gcv_calculator&
inline

Set the rate of noise.

Parameters
[in]valueValue.
Returns
This object.

Definition at line 124 of file implicit_gcv.h.

◆ num_samples()

template<concepts::implicit_regularized_solver Solver>
auto num_collect::regularization::implicit_gcv_calculator< Solver >::num_samples ( index_type value) -> implicit_gcv_calculator&
inline

Set the number of samples for approximation of denominator of GCV.

Parameters
[in]valueValue.
Returns
This object.

Definition at line 140 of file implicit_gcv.h.

◆ operator()()

template<concepts::implicit_regularized_solver Solver>
auto num_collect::regularization::implicit_gcv_calculator< Solver >::operator() ( scalar_type param) -> scalar_type
inlinenodiscard

Calculate GCV function.

Parameters
[in]paramRegularization parameter.
Returns
Value.

Definition at line 84 of file implicit_gcv.h.

◆ solver()

template<concepts::implicit_regularized_solver Solver>
auto num_collect::regularization::implicit_gcv_calculator< Solver >::solver ( ) const -> solver_type&
inlinenodiscardnoexcept

Get the solver.

Returns
Solver.

Definition at line 179 of file implicit_gcv.h.

Member Data Documentation

◆ data_

template<concepts::implicit_regularized_solver Solver>
const data_type* num_collect::regularization::implicit_gcv_calculator< Solver >::data_
private

Actual data.

Definition at line 188 of file implicit_gcv.h.

◆ data_with_noise_

template<concepts::implicit_regularized_solver Solver>
util::vector<data_type> num_collect::regularization::implicit_gcv_calculator< Solver >::data_with_noise_ {}
private

Data with noise.

Definition at line 203 of file implicit_gcv.h.

◆ default_noise_rate

template<concepts::implicit_regularized_solver Solver>
scalar_type num_collect::regularization::implicit_gcv_calculator< Solver >::default_noise_rate = 1e-2
staticconstexprprivate

Default rate of noise.

Definition at line 194 of file implicit_gcv.h.

◆ forwarded_data_

template<concepts::implicit_regularized_solver Solver>
data_type num_collect::regularization::implicit_gcv_calculator< Solver >::forwarded_data_ {}
private

Buffer of data generated from the solution.

Definition at line 215 of file implicit_gcv.h.

◆ forwarded_data_with_noise_

template<concepts::implicit_regularized_solver Solver>
data_type num_collect::regularization::implicit_gcv_calculator< Solver >::forwarded_data_with_noise_ {}
private

Buffer of data generated from the solution with noise.

Definition at line 218 of file implicit_gcv.h.

◆ initial_solution_

template<concepts::implicit_regularized_solver Solver>
const data_type* num_collect::regularization::implicit_gcv_calculator< Solver >::initial_solution_
private

Initial solution.

Definition at line 206 of file implicit_gcv.h.

◆ noise_

template<concepts::implicit_regularized_solver Solver>
util::vector<data_type> num_collect::regularization::implicit_gcv_calculator< Solver >::noise_
private

Vector of noise.

Definition at line 191 of file implicit_gcv.h.

◆ noise_multiplier_

template<concepts::implicit_regularized_solver Solver>
scalar_type num_collect::regularization::implicit_gcv_calculator< Solver >::noise_multiplier_ {}
private

Multiplier of noise.

Definition at line 200 of file implicit_gcv.h.

◆ noise_rate_

template<concepts::implicit_regularized_solver Solver>
scalar_type num_collect::regularization::implicit_gcv_calculator< Solver >::noise_rate_ {default_noise_rate}
private

Rate of noise.

Definition at line 197 of file implicit_gcv.h.

◆ solution_

template<concepts::implicit_regularized_solver Solver>
data_type num_collect::regularization::implicit_gcv_calculator< Solver >::solution_ {}
private

Buffer of the solution.

Definition at line 209 of file implicit_gcv.h.

◆ solution_with_noise_

template<concepts::implicit_regularized_solver Solver>
data_type num_collect::regularization::implicit_gcv_calculator< Solver >::solution_with_noise_ {}
private

Buffer of the solution with noise.

Definition at line 212 of file implicit_gcv.h.

◆ solver_

template<concepts::implicit_regularized_solver Solver>
solver_type* num_collect::regularization::implicit_gcv_calculator< Solver >::solver_
private

Solver.

Definition at line 185 of file implicit_gcv.h.


The documentation for this class was generated from the following file: