17 #include <gsl/gsl_blas.h>
18 #include <gsl/gsl_math.h>
19 #include <gsl/gsl_statistics.h>
20 #include <gsl/gsl_rng.h>
21 #include <gsl/gsl_randist.h>
22 #include <gsl/gsl_permutation.h>
23 #include <gsl/gsl_sort.h>
50 void ccl_mat_add (
double *A,
const double *B,
int row,
int col);
60 void ccl_mat_sub(
double *A,
const double *B,
int row,
int col);
80 void mat_hotz_app (
double *A,
int i,
int j,
const double *B,
int k,
int d,
double* c);
92 void mat_vert_app (
const double *A,
int i,
int j,
const double *B,
int k,
int d,
double * c);
104 void ccl_dot_product (
const double *A,
int i,
int j,
const double *B,
int k,
int d,
double *C);
113 void ccl_mat_inv(
const double *A,
int i,
int j,
double *invA);
122 void ccl_MP_pinv(
const double *A_in,
int row,
int col,
double *invA);
154 void linspace(
double min,
double max,
double n,
double *y);
165 void repmat(
const double *mat,
int row,
int col,
int rows,
int cols,
double *A);
174 void repvec(
const gsl_vector *vec,
int rows,
int cols, gsl_matrix * A);
182 void repvvec(
const double *vec,
int size,
int rows,
double *A);
191 void flt_mat(
const double *mat,
int row,
int col,
double *vec);
201 void ccl_mat_var(
const double* data_in,
int row,
int col,
int axis,
double * var);
230 void vec_to_mat(
const gsl_vector *vec, gsl_matrix *mat);
239 void nround(
const double *n,
int size,
unsigned int c,
double *ret);
248 void generate_kmeans_centres(
const double * X,
const int dim_x,
const int dim_n,
const int dim_b,
double * centres);
258 void ccl_get_sub_mat_cols(
const double * mat,
const int row,
const int col,
const int * ind,
int size,
double * ret);
269 int ccl_mat_distance(
const double *A,
const int a_i,
const int a_j,
const double *B,
const int b_i,
const int b_j,
double * D);
278 void ccl_mat_sum(
const double *mat,
const int i,
const int j,
const int axis,
double * ret);
288 void ccl_mat_min(
const double * mat,
const int i,
const int j,
const int axis,
double* val,
int* indx);
297 void ccl_mat_mean(
const double *mat,
const int i,
const int j,
const int axis,
double*val);
309 int ccl_find_index_int(
const int *a,
const int num_elements,
const int operand,
const int value,
int* idx);
321 int ccl_find_index_double(
const double *a,
const int num_elements,
const int operand,
const double value,
int* idx);
342 void ccl_gaussian_rbf(
const double * X,
int i,
int j,
const double *C,
int k,
int d,
double s,
double * BX);
361 int ccl_any(
double* vec,
double epx,
int size,
int op);
gsl_matrix * U
Pad to full matrix of A.
Definition: ccl_math.h:34
void ccl_mat_reshape(const double *vec, int i, int j, double *mat)
Reshape vector to matrix.
void repvec(const gsl_vector *vec, int rows, int cols, gsl_matrix *A)
Replicate vector.
gsl_matrix * Sigma_pinv
Pseudo inverse of sigma.
Definition: ccl_math.h:33
gsl_matrix * V
SVD return of A.
Definition: ccl_math.h:32
void ccl_mat_sum(const double *mat, const int i, const int j, const int axis, double *ret)
Summation of a matrix.
gsl_matrix * A_pinv
Pseodo inverse of A.
Definition: ccl_math.h:35
void mat_vert_app(const double *A, int i, int j, const double *B, int k, int d, double *c)
Append matrix vertically.
void ccl_MP_pinv(const double *A_in, int row, int col, double *invA)
Matrix inverse of arbitrary matrix.
void linspace(double min, double max, double n, double *y)
Equally divided space.
void ccl_mat_add(double *A, const double *B, int row, int col)
Matrix addition.
int ccl_MP_inv_ws_free(MP_INV_WS *ws)
Free the workspace memory for MP_INV_WS.
gsl_vector * u
SVD return of A.
Definition: ccl_math.h:39
void ccl_gaussian_rbf(const double *X, int i, int j, const double *C, int k, int d, double s, double *BX)
Radial basis function.
void ccl_mat_min(const double *mat, const int i, const int j, const int axis, double *val, int *indx)
Minimum values of a matrix.
int ccl_MP_inv_ws_alloc(MP_INV_WS *ws, int n, int m)
Allocates the workspace memory for MP_INV_WS.
void ccl_mat_var(const double *data_in, int row, int col, int axis, double *var)
Variances of a matrix.
gsl_vector * _tmp_vec
A temporal vector.
Definition: ccl_math.h:38
int ccl_mat_distance(const double *A, const int a_i, const int a_j, const double *B, const int b_i, const int b_j, double *D)
Distance of two matrices.
double ccl_vec_sum(double *vec, int size)
Sum of a vector.
void ccl_mat_inv(const double *A, int i, int j, double *invA)
Matrix inverse of square matrix.
void ccl_dot_product(const double *A, int i, int j, const double *B, int k, int d, double *C)
Dot product of two matrix.
void generate_kmeans_centres(const double *X, const int dim_x, const int dim_n, const int dim_b, double *centres)
K mean algorithm.
gsl_matrix * _tmp_mat
A temporal matrix.
Definition: ccl_math.h:37
void print_mat_d(double *mat, int row, int col)
Print double matrix.
void ccl_mat_transpose(const double *mat, int i, int j, double *mat_T)
Matrix transpose.
void vec_to_mat(const gsl_vector *vec, gsl_matrix *mat)
Convert vector type to matrix type.
gsl_matrix * A
Copy of input matrix A.
Definition: ccl_math.h:36
int ccl_find_index_double(const double *a, const int num_elements, const int operand, const double value, int *idx)
Find index of an array of integers. operand 1: = ; 2 >=; 3<= .
void ccl_get_sub_mat_cols(const double *mat, const int row, const int col, const int *ind, int size, double *ret)
Get sub cols of a matrix.
int ccl_any(double *vec, double epx, int size, int op)
Return true if any of the element in the vector satify the tolerance: op==0 '>=', op==1 '<='...
This structure describes the workspace memory of calculating matrix pseudo inverse MP_INV_WS...
Definition: ccl_math.h:31
void ccl_mat_mean(const double *mat, const int i, const int j, const int axis, double *val)
Mean values of a matrix.
void flt_mat(const double *mat, int row, int col, double *vec)
Flatten matrix to vector.
void print_mat_i(int *mat, int row, int col)
Print int matrix.
void print_mat(gsl_matrix *mat)
Print GSL matrix.
int ccl_find_index_int(const int *a, const int num_elements, const int operand, const int value, int *idx)
Find index of an array of integers.
void repvvec(const double *vec, int size, int rows, double *A)
Replicate vector vertically (to be removed).
void ccl_mat_set_col(double *mat, int i, int j, int c, double *vec)
Find index of an array of doubles. operand 1: = ; 2 >=; 3<= .
void nround(const double *n, int size, unsigned int c, double *ret)
Round double array to some decimal.
void ccl_mat_sub(double *A, const double *B, int row, int col)
Matrix subtraction.
void repmat(const double *mat, int row, int col, int rows, int cols, double *A)
Replicate matrix.
void mat_hotz_app(double *A, int i, int j, const double *B, int k, int d, double *c)
Append matrix horizontally.