Added header files

This commit is contained in:
Ethan Smith-Coss 2024-09-11 13:10:30 +01:00
parent 597b4a3f7f
commit bc0bd5ece3
Signed by: TheOnePath
GPG Key ID: 1D351CCC6D01F32B
3 changed files with 56 additions and 0 deletions

19
include/gp.h Normal file
View File

@ -0,0 +1,19 @@
#include <gsl/gsl_matrix.h>
#include "kernels.h"
#include "solve.h"
#ifndef GP_H
#define GP_H
typedef struct {
gsl_matrix *meanf;
gsl_matrix *covf;
} gp_model;
gp_model
gpfit
( gsl_matrix *x, gsl_matrix *y, gsl_matrix *xs, kernel_info info, double noise,
invert_t inv_t );
#endif // !GP_H

21
include/kernels.h Normal file
View File

@ -0,0 +1,21 @@
#include <gsl/gsl_matrix.h>
#ifndef KERNELS_H
#define KERNELS_H
typedef int(*kernel)(double, double, gsl_matrix* , gsl_matrix*, gsl_matrix*);
typedef struct {
kernel kern;
double sigmaf;
double length_scale;
} kernel_info;
int
squared_exp
( double sigmaf, double ell, gsl_matrix *A, gsl_matrix *B, gsl_matrix *result );
int
matern32
( double sigmaf, double ell, gsl_matrix *A, gsl_matrix *B, gsl_matrix *result );
#endif // !KERNELS_H

16
include/solve.h Normal file
View File

@ -0,0 +1,16 @@
#include <gsl/gsl_matrix.h>
#ifndef SOLVE_H
#define SOLVE_H
typedef int (*invert_t)(gsl_matrix*, gsl_matrix*);
int
inv_lu
( gsl_matrix *A, gsl_matrix *inverse );
int
inv_chol
( gsl_matrix *A, gsl_matrix *inverse );
#endif // !SOLVE_H