YetAnotherCoupler 3.2.0_a
Loading...
Searching...
No Matches
interp_method_fixed.c
Go to the documentation of this file.
1// Copyright (c) 2024 The YAC Authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifdef HAVE_CONFIG_H
6// Get the definition of the 'restrict' keyword.
7#include "config.h"
8#endif
9
11#include "interp_method_fixed.h"
12
13static size_t do_search_fixed(struct interp_method * method,
14 struct yac_interp_grid * interp_grid,
15 size_t * tgt_points, size_t count,
16 struct yac_interp_weights * weights);
17static void delete_fixed(struct interp_method * method);
18
19static struct interp_method_vtable
23
29
30static size_t do_search_fixed (struct interp_method * method,
31 struct yac_interp_grid * interp_grid,
32 size_t * tgt_points, size_t count,
33 struct yac_interp_weights * weights) {
34
35 struct remote_points tgts = {
36 .data =
37 yac_interp_grid_get_tgt_remote_points(interp_grid, tgt_points, count),
38 .count = count};
39
41 weights, &tgts, ((struct interp_method_fixed *)method)->value);
42
43 free(tgts.data);
44
45 return count;
46}
47
49
50 struct interp_method_fixed * method = xmalloc(1 * sizeof(*method));
51
53 method->value = value;
54
55 return (struct interp_method*)method;
56}
57
58static void delete_fixed(struct interp_method * method) {
59 free(method);
60}
struct remote_point * yac_interp_grid_get_tgt_remote_points(struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count)
struct @8::@9 value
static struct interp_method_vtable interp_method_fixed_vtable
static void delete_fixed(struct interp_method *method)
static size_t do_search_fixed(struct interp_method *method, struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, struct yac_interp_weights *weights)
struct interp_method * yac_interp_method_fixed_new(double value)
void yac_interp_weights_add_fixed(struct yac_interp_weights *weights, struct remote_points *tgts, double fixed_value)
#define xmalloc(size)
Definition ppm_xfuncs.h:66
struct interp_method_vtable * vtable
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)
struct remote_point * data