6 #ifndef __CCL_LEARN_NHAT_H
7 #define __CCL_LEARN_NHAT_H
15 #define NUM_SEARCH 27000 // NUM_SEARCH = num_theta^{dim_t};
18 #define NUM_CONSTRAINT 4 //NUM_CONSTRAINT = dim_u
22 #include <gsl/gsl_linalg.h>
23 #include <gsl/gsl_blas.h>
24 #include <gsl/gsl_math.h>
25 #include <gsl/gsl_sf.h>
192 void calclate_N(
double * N,
const double *A,
int row,
int col);
double * I_u
The identity matrix.
Definition: ccl_learn_nhat.h:44
void get_unit_vector(const double *theta, int dim_t, double *alpha)
Computation routine for generating unit vector for row vector alpha by given theta anlges...
int dim_u
The dimensionality of action space.
Definition: ccl_learn_nhat.h:57
This structure defines the searching parameters for NHAT_search.
Definition: ccl_learn_nhat.h:34
int nhat_mem_free_result(NHAT_result *result, int n_models)
Free the memory for model results.
double * list
A dictionary of search space and theta angles.
Definition: ccl_learn_nhat.h:43
int nhat_mem_alloc_model(NHAT_Model *model, const NHAT_search *search)
Allocates the memory for NHAT_Model.
int init_search_param(NHAT_search *search, int dim_u, int dim_n, int num_theta)
Initialisation of the searching parameters.
void learn_nhat(const double *Un, const int dim_u, const int dim_n, NHAT_Model *optimal)
Main computation routine for learn nhat.
int dim_c
The dimensionality of constraints.
Definition: ccl_learn_nhat.h:60
#define NUM_CONSTRAINT
Definition: ccl_learn_nhat.h:18
int nhat_mem_alloc_result(NHAT_Model *model, const NHAT_search search, int dim_c)
Allocates the memory for model results.
void search_alpha_nhat(const double *Vn, const double *Un, NHAT_Model *model, const NHAT_search *search, NHAT_Model *model_out, double *stats)
Search the rest rows of A matrix.
double * theta
Returned optimal theta parameters.
Definition: ccl_learn_nhat.h:62
double * alpha
Returned optimal alpha in unit vector.
Definition: ccl_learn_nhat.h:63
#define NUM_SEARCH
Definition: ccl_learn_nhat.h:15
void calclate_N(double *N, const double *A, int row, int col)
Calculation of nullspace projection matrix.
double nmse_j
The normalised mean sqaure error of residual error.
Definition: ccl_learn_nhat.h:67
int nhat_mem_free_model(NHAT_Model *model)
Free the memory for NHAT_Model.
This structure defines the model parameters for NHAT_Model.
Definition: ccl_learn_nhat.h:56
int dim_n
The number of data points.
Definition: ccl_learn_nhat.h:36
void search_first_alpha(const double *Vn, const double *Un, NHAT_Model *model, const NHAT_search *search, double *stats)
Search first row of A matrix.
int nhat_mem_free_search(NHAT_search *search)
Free the memory for NHAT_search.
CCL header file for math.
int nhat_duplicate_model(NHAT_Model *dest, const NHAT_Model *src)
Duplicate the NHAT_Model model from src to dest.
double * max_theta
The upper bound of theta angle.
Definition: ccl_learn_nhat.h:42
int dim_u
The dimensionality of action space.
Definition: ccl_learn_nhat.h:35
int dim_t
Number of parameters needed to represent a unit vector.
Definition: ccl_learn_nhat.h:38
double umse_j
The mean sqaure error of residual error.
Definition: ccl_learn_nhat.h:66
int nhat_mem_alloc_optimal(NHAT_Model *optimal, const NHAT_search search, int dim_c)
Allocates the memory for optimal model.
int dim_s
The dimensionality of the searching space.
Definition: ccl_learn_nhat.h:39
int nhat_mem_free_optimal(NHAT_Model *optimal)
Free the memory for optimal model.
int num_theta
Number of candidate constraints (from 0 to pi)
Definition: ccl_learn_nhat.h:37
int nhat_mem_alloc_search(NHAT_search *search)
Allocates the memory for NHAT_search.
double epsilon
Tolerance of seraching.
Definition: ccl_learn_nhat.h:40
double * P
Returned optimal projection matrix.
Definition: ccl_learn_nhat.h:64
double variance
Variance of nullspace components.
Definition: ccl_learn_nhat.h:65
int dim_t
Number of parameters needed to represent a unit vector.
Definition: ccl_learn_nhat.h:59
This structure defines the model parameters for NHAT_result.
Definition: ccl_learn_nhat.h:77
int dim_n
The number of data points.
Definition: ccl_learn_nhat.h:58
double * min_theta
The lower bound of theta angle.
Definition: ccl_learn_nhat.h:41
void generate_search_space(NHAT_search *search)
Generate search space.