Deterministic Gaussian Sampling
Loading...
Searching...
No Matches
dirac_to_dirac_approx_function_i.h
1#ifndef DIRAC_TO_DIRAC_APPROX_FUNCTION_I_H
2#define DIRAC_TO_DIRAC_APPROX_FUNCTION_I_H
3
4#include <gsl/gsl_matrix.h>
5#include <gsl/gsl_matrix_float.h>
6#include <gsl/gsl_matrix_long_double.h>
7
8#include <type_traits>
9
10#include "approximate_options.h"
11#include "gsl_minimizer.h"
12#include "gsl_vector_matrix_types.h"
13
20template <typename T>
22 public:
23 using GSLVectorType = typename GSLTemplateTypeAlias<T>::VectorType;
24 using GSLVectorViewType = typename GSLTemplateTypeAlias<T>::VectorViewType;
25 using GSLMatrixType = typename GSLTemplateTypeAlias<T>::MatrixType;
26 using wXf = void (*)(const double* x, double* res, size_t L, size_t N);
27 using wXd = wXf; // (*)(const double* x, double* res, size_t L, size_t N);
28
29 virtual ~dirac_to_dirac_approx_function_i() = default;
30
45 virtual bool approximate(const T* y, size_t M, size_t L, size_t N, T* x,
46 wXf wXcallback, wXd wXDcallback,
47 GslminimizerResult* result,
48 const ApproximateOptions& options) = 0;
49
64 virtual void modified_van_mises_distance_sq(T* distance, const T* y, size_t M,
65 size_t L, size_t N, size_t bMax,
66 T* x, wXf wXcallback,
67 wXd wXDcallback) = 0;
68
84 T* gradient, const T* y, size_t M, size_t L, size_t N, size_t bMax, T* x,
85 wXf wXcallback, wXd wXDcallback) = 0;
86
100 virtual bool approximate(const GSLVectorType* y, size_t L, size_t N,
101 GSLVectorType* x, wXf wXcallback, wXd wXDcallback,
102 GslminimizerResult* result,
103 const ApproximateOptions& options) = 0;
104
118 virtual void modified_van_mises_distance_sq(T* distance,
119 const GSLVectorType* y, size_t L,
120 size_t N, size_t bMax,
121 GSLVectorType* x, wXf wXcallback,
122 wXd wXDcallback) = 0;
123
138 GSLMatrixType* gradient, const GSLVectorType* y, size_t L, size_t N,
139 size_t bMax, GSLVectorType* x, wXf wXcallback, wXd wXDcallback) = 0;
140
153 virtual bool approximate(GSLMatrixType* y, size_t L, GSLMatrixType* x,
154 wXf wXcallback, wXd wXDcallback,
155 GslminimizerResult* result,
156 const ApproximateOptions& options) = 0;
157
170 virtual void modified_van_mises_distance_sq(T* distance, GSLMatrixType* y,
171 size_t L, size_t bMax,
172 GSLMatrixType* x, wXf wXcallback,
173 wXd wXDcallback) = 0;
174
188 GSLMatrixType* gradient, GSLMatrixType* y, size_t L, size_t bMax,
189 GSLMatrixType* x, wXf wXcallback, wXd wXDcallback) = 0;
190};
191
192#endif // DIRAC_TO_DIRAC_APPROX_FUNCTION_I_H
interface for the gausian mixture to dirac approximation with a custom weight function
Definition dirac_to_dirac_approx_function_i.h:21
virtual void modified_van_mises_distance_sq_derivative(GSLMatrixType *gradient, const GSLVectorType *y, size_t L, size_t N, size_t bMax, GSLVectorType *x, wXf wXcallback, wXd wXDcallback)=0
calculate modified van mises distance based on x and y
virtual void modified_van_mises_distance_sq(T *distance, const GSLVectorType *y, size_t L, size_t N, size_t bMax, GSLVectorType *x, wXf wXcallback, wXd wXDcallback)=0
calculate modified van mises distance based on x and y
virtual void modified_van_mises_distance_sq(T *distance, const T *y, size_t M, size_t L, size_t N, size_t bMax, T *x, wXf wXcallback, wXd wXDcallback)=0
calculate modified van mises distance based on x and y
virtual bool approximate(GSLMatrixType *y, size_t L, GSLMatrixType *x, wXf wXcallback, wXd wXDcallback, GslminimizerResult *result, const ApproximateOptions &options)=0
reduce the data points using gsl matricies where possible
virtual void modified_van_mises_distance_sq_derivative(GSLMatrixType *gradient, GSLMatrixType *y, size_t L, size_t bMax, GSLMatrixType *x, wXf wXcallback, wXd wXDcallback)=0
calculate modified van mises distance based on x and y
virtual void modified_van_mises_distance_sq_derivative(T *gradient, const T *y, size_t M, size_t L, size_t N, size_t bMax, T *x, wXf wXcallback, wXd wXDcallback)=0
calculate modified van mises distance based on x and y
virtual void modified_van_mises_distance_sq(T *distance, GSLMatrixType *y, size_t L, size_t bMax, GSLMatrixType *x, wXf wXcallback, wXd wXDcallback)=0
calculate modified van mises distance based on x and y
virtual bool approximate(const GSLVectorType *y, size_t L, size_t N, GSLVectorType *x, wXf wXcallback, wXd wXDcallback, GslminimizerResult *result, const ApproximateOptions &options)=0
reduce the data points using gsl vectors
virtual bool approximate(const T *y, size_t M, size_t L, size_t N, T *x, wXf wXcallback, wXd wXDcallback, GslminimizerResult *result, const ApproximateOptions &options)=0
reduce the data points using raw pointers
Definition approximate_options.h:6
struct to hold the result of the minimization
Definition gsl_minimizer.h:32