44template <concepts::distance_function DistanceFunction>
70 void compute(
const std::vector<variable_type>& variables,
72 const std::size_t num_samples = variables.size();
74 num_samples > 0,
"Sample points must be given.");
77 for (std::size_t i = 0; i < num_samples; ++i) {
78 auto min_distance = std::numeric_limits<scalar_type>::max();
79 for (std::size_t j = 0; j < num_samples; ++j) {
82 distance_function(variables[i], variables[j]);
83 if (distance < min_distance) {
84 min_distance = distance;
119 "Scale of length parameters must be a positive number.");
Definition of assertion macros.
#define NUM_COLLECT_DEBUG_ASSERT(CONDITION)
Macro to check whether a condition is satisfied in debug build only.
Class to calculate length parameters for RBF using length parameters localized for each sample point.
typename DistanceFunction::variable_type variable_type
Type of variables.
void scale(scalar_type value)
Set the scale of length parameters.
Eigen::VectorX< scalar_type > length_parameters_
Length parameters.
typename DistanceFunction::value_type scalar_type
Type of scalars.
auto length_parameter_at(index_type i) const -> scalar_type
Get the length parameter at a point.
scalar_type scale_
Scale of length parameters.
auto scale() const noexcept -> scalar_type
Get the current scale of length parameters.
void compute(const std::vector< variable_type > &variables, const distance_function_type &distance_function)
Compute the length parameters.
static constexpr auto default_scale
Default value of the scalar of length parameters.
static constexpr bool uses_global_length_parameter
Whether this calculator uses the globally fixed length parameters.
local_length_parameter_calculator()=default
Constructor.
DistanceFunction distance_function_type
Type of the distance function.
Definition of distance_function concept.
Definition of exceptions.
Definition of index_type type.
Definition of macros for logging.
std::ptrdiff_t index_type
Type of indices in this library.
Namespace of calculators of length parameters.
Definition of NUM_COLLECT_PRECONDITION macro.
#define NUM_COLLECT_PRECONDITION(CONDITION,...)
Check whether a precondition is satisfied and throw an exception if not.