25 size_t * tgt_points,
size_t count,
27 int * interpolation_complete);
44 size_t * tgt_points,
size_t count,
46 int * interpolation_complete) {
49 UNUSED(interpolation_complete);
56 yac_int * tgt_global_ids =
xmalloc(count *
sizeof(*tgt_global_ids));
58 xmalloc(count *
sizeof(*tgt_coordinates));
61 interp_grid, tgt_points, count, tgt_global_ids);
63 interp_grid, tgt_points, count, tgt_coordinates);
70 free(tgt_coordinates);
80 void * constructor_user_data,
82 void * do_search_user_data) {
90 if (constructor_callback != NULL)
91 constructor_callback(constructor_user_data);
171 "key \"%s\" has been set for the same callback type (%d)",
295 copy->
base.
vtable = config_check->base.vtable;
303 void const *a_,
void const *b_) {
323 void *constructor_user_data = NULL;
325 void *do_search_user_data = NULL;
328 &constructor_callback, &constructor_user_data);
333 constructor_callback, constructor_user_data,
343 CONSTRUCTOR_KEY_ALLOW_NULL = 1,
344 CONSTRUCTOR_KEY_ALLOW_EMPTY = 1,
345 CONSTRUCTOR_KEY_HAS_DEFAULT = 1,
346 CONSTRUCTOR_KEY_IS_DEFINED = 1,
347 DO_SEARCH_KEY_ALLOW_NULL = 1,
348 DO_SEARCH_KEY_ALLOW_EMPTY = 1,
349 DO_SEARCH_KEY_HAS_DEFAULT = 1,
350 DO_SEARCH_KEY_IS_DEFINED = 1,
353 struct yac_param *param_constructor_key =
358 CONSTRUCTOR_KEY_ALLOW_NULL, CONSTRUCTOR_KEY_ALLOW_EMPTY,
360 CONSTRUCTOR_KEY_IS_DEFINED);
367 DO_SEARCH_KEY_ALLOW_NULL, DO_SEARCH_KEY_ALLOW_EMPTY,
369 DO_SEARCH_KEY_IS_DEFINED);
372 param_constructor_key,
376 ROOT_PARAM_ARRAY_SIZE =
377 sizeof(root_param_array) /
sizeof(root_param_array[0])
381 "check", root_param_array, ROOT_PARAM_ARRAY_SIZE);
395 xmalloc(
sizeof(*config_check));
#define ENSURE_ARRAY_SIZE(arrayp, curr_array_size, req_size)
#define YAC_INSTRUMENT_START(ID)
Enter an instrumented region.
#define YAC_INSTRUMENT_STOP(ID)
Exit an instrumented region entered with YAC_INSTRUMENT_START(ID).
void yac_interp_grid_get_tgt_global_ids(struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, yac_int *tgt_global_ids)
void yac_interp_grid_get_tgt_coordinates(struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, yac_coordinate_pointer tgt_coordinates)
@ YAC_CHECK
Diagnostic check method (for testing)
#define YAC_MAX_ROUTINE_NAME_LENGTH
Maximum length for routine names (used as keys for callback registration)
static size_t do_search_callback(struct interp_method *method, struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, struct yac_interp_weights *weights, int *interpolation_complete)
static void interp_method_check_add_callback(callback_union callback, enum callback_type type, void *user_data, char const *key)
Register a callback function and user data for the check interpolation method.
static struct yac_interp_method_config_vtable yac_interp_method_config_vtable_check
callback_type
Type of callback function for the check interpolation method.
static struct interp_method * config_check_generate(struct yac_interp_method_config const *config)
void yac_interp_method_check_get_do_search_callback(char const *key, func_do_search *do_search_callback, void **user_data)
void yac_interp_method_check_add_constructor_callback(func_constructor constructor_callback, void *user_data, char const *key)
void yac_interp_method_check_get_constructor_callback(char const *key, func_constructor *constructor_callback, void **user_data)
void yac_interp_method_check_add_do_search_callback(func_do_search do_search_callback, void *user_data, char const *key)
static int config_check_compare(void const *a_, void const *b_)
static struct yac_interp_method_config * config_check_copy(const struct yac_interp_method_config *config)
static void config_check_delete(struct yac_interp_method_config *config)
static enum yac_interpolation_list config_check_get_type()
static void interp_method_get_callback(char const *key, callback_union *callback, enum callback_type type, void **user_data)
Retrieve a registered callback and its user data by key and type.
struct interp_method * yac_interp_method_check_new(func_constructor constructor_callback, void *constructor_user_data, func_do_search do_search_callback, void *do_search_user_data)
static void delete_check(struct interp_method *method)
static size_t callback_lookup_table_size
static struct yac_param * config_check_get_param(struct yac_interp_method_config const *config)
static size_t do_search_check(struct interp_method *method, struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, struct yac_interp_weights *weights, int *interpolation_complete)
void yac_interp_method_check_buf_free()
static struct interp_method_vtable interp_method_check_vtable
static size_t callback_lookup_table_array_size
struct yac_interp_method_config * yac_interp_method_config_default_check_new(void)
Creates a check interpolation method configuration with default parameters.
static struct @23 * callback_lookup_table
Callback pointer lookup table.
void(* func_do_search)(yac_int const *global_ids, double const (*coordinates_xyz)[3], size_t count, void *user_data)
#define YAC_INTERP_CHECK_CONSTRUCTOR_KEY_DEFAULT
void(* func_constructor)(void *user_data)
#define YAC_INTERP_CHECK_DO_SEARCH_KEY_DEFAULT
#define DEF_INTERP_METHOD_CONFIG_COMPARE_TYPE(TYPE)
#define DEF_INTERP_METHOD_CONFIG_TYPE(TYPE)
#define CHECK_STRING(STR)
struct yac_param * yac_param_str_new(const char *name, char **value_ptr, const char *default_value, int allow_NULL, int allow_empty, size_t max_str_len, int has_default, int is_defined)
Create a string parameter.
struct yac_param * yac_param_struct_new(const char *name, struct yac_param **subparams, size_t subparam_count)
Create a new struct parameter with a given name and subparameters.
struct interp_method_vtable * vtable
void * do_search_user_data
func_do_search do_search_callback
size_t(* do_search)(struct interp_method *method, struct yac_interp_grid *grid, size_t *tgt_points, size_t count, struct yac_interp_weights *weights, int *interpolation_complete)
Concrete implementation of yac_interp_method_config for the check method.
struct yac_interp_method_config base
base config object, must be first entry
struct yac_interp_method_check_config config
method-specific configuration
void(* delete)(struct yac_interp_method_config *config)
struct yac_param * root_param_cache
struct yac_interp_method_config_vtable const * vtable
static struct yac_interp_method_config * config
Union for storing different callback function pointers.
func_constructor constructor
#define YAC_ASSERT_F(exp, format,...)
double const (* yac_const_coordinate_pointer)[3]
double(* yac_coordinate_pointer)[3]