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
46 virtual bool approximate(const T* y, size_t M, size_t L, size_t N,
47 size_t bMax, T* x, wXf wXcallback, wXd wXDcallback,
48 GslminimizerResult* result,
49 const ApproximateOptions& options) = 0;
50
65 virtual void modified_van_mises_distance_sq(T* distance, const T* y, size_t M,
66 size_t L, size_t N, size_t bMax,
67 T* x, wXf wXcallback,
68 wXd wXDcallback) = 0;
69
85 T* gradient, const T* y, size_t M, size_t L, size_t N, size_t bMax, T* x,
86 wXf wXcallback, wXd wXDcallback) = 0;
87
102 virtual bool approximate(const GSLVectorType* y, size_t L, size_t N,
103 size_t bMax, GSLVectorType* x, wXf wXcallback,
104 wXd wXDcallback, GslminimizerResult* result,
105 const ApproximateOptions& options) = 0;
106
120 virtual void modified_van_mises_distance_sq(T* distance,
121 const GSLVectorType* y, size_t L,
122 size_t N, size_t bMax,
123 GSLVectorType* x, wXf wXcallback,
124 wXd wXDcallback) = 0;
125
140 GSLMatrixType* gradient, const GSLVectorType* y, size_t L, size_t N,
141 size_t bMax, GSLVectorType* x, wXf wXcallback, wXd wXDcallback) = 0;
142
156 virtual bool approximate(GSLMatrixType* y, size_t L, size_t bMax,
157 GSLMatrixType* x, wXf wXcallback, wXd wXDcallback,
158 GslminimizerResult* result,
159 const ApproximateOptions& options) = 0;
160
173 virtual void modified_van_mises_distance_sq(T* distance, GSLMatrixType* y,
174 size_t L, size_t bMax,
175 GSLMatrixType* x, wXf wXcallback,
176 wXd wXDcallback) = 0;
177
191 GSLMatrixType* gradient, GSLMatrixType* y, size_t L, size_t bMax,
192 GSLMatrixType* x, wXf wXcallback, wXd wXDcallback) = 0;
193};
194
195#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 bool approximate(const GSLVectorType *y, size_t L, size_t N, size_t bMax, GSLVectorType *x, wXf wXcallback, wXd wXDcallback, GslminimizerResult *result, const ApproximateOptions &options)=0
reduce the data points using gsl vectors
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, size_t bMax, 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 bool approximate(const T *y, size_t M, size_t L, size_t N, size_t bMax, T *x, wXf wXcallback, wXd wXDcallback, GslminimizerResult *result, const ApproximateOptions &options)=0
reduce the data points using raw pointers
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
Definition approximate_options.h:6
struct to hold the result of the minimization
Definition gsl_minimizer.h:32