Removed functions
This commit is contained in:
parent
b975273de0
commit
62020d51e5
51
src/demo.c
51
src/demo.c
|
|
@ -6,56 +6,12 @@
|
||||||
#include "kernels.h"
|
#include "kernels.h"
|
||||||
#include "solve.h"
|
#include "solve.h"
|
||||||
#include "gp.h"
|
#include "gp.h"
|
||||||
|
#include "linalg.h"
|
||||||
|
#include "matio.h"
|
||||||
|
|
||||||
#define RNG_MAX 10
|
#define RNG_MAX 10
|
||||||
#define X_MAX 10
|
#define X_MAX 10
|
||||||
|
|
||||||
int linspace ( double start, double end, int length, gsl_matrix *out ) {
|
|
||||||
if ( out->size2 != length )
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
double by = end / length;
|
|
||||||
for ( int i = 0 ; i < length ; i++ )
|
|
||||||
(void)gsl_matrix_set(out, 0, i, i*by);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void print_matrix ( gsl_matrix *matrix ) {
|
|
||||||
printf("\n");
|
|
||||||
for ( int i = 0 ; i < matrix->size1 ; i++ ) {
|
|
||||||
for ( int j = 0 ; j < matrix->size2 ; j++ ) {
|
|
||||||
printf(" %.6e ", gsl_matrix_get(matrix, i, j));
|
|
||||||
}
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
void print_flatten ( gsl_matrix *matrix ) {
|
|
||||||
printf("\n");
|
|
||||||
if ( matrix->size1 == 1 ) {
|
|
||||||
for ( int i = 0 ; i < matrix->size2 ; i++ ) {
|
|
||||||
if ( i == matrix->size2-1 ) {
|
|
||||||
printf("%g\n", gsl_matrix_get(matrix, 0, i));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
printf("%g, ", gsl_matrix_get(matrix, 0, i));
|
|
||||||
}
|
|
||||||
printf("\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( int i = 0 ; i < matrix->size1 ; i++ ) {
|
|
||||||
if ( i == matrix->size1-1 ) {
|
|
||||||
printf("%g\n", gsl_matrix_get(matrix, i, 0));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
printf("%g, ", gsl_matrix_get(matrix, i, 0));
|
|
||||||
}
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
|
@ -83,10 +39,11 @@ int main(void)
|
||||||
};
|
};
|
||||||
gp_model model = gpfit(X, Y, Xs, info, noise, &inv_chol);
|
gp_model model = gpfit(X, Y, Xs, info, noise, &inv_chol);
|
||||||
|
|
||||||
print_flatten(X);
|
/* print_flatten(X);
|
||||||
print_flatten(Y);
|
print_flatten(Y);
|
||||||
print_flatten(Xs);
|
print_flatten(Xs);
|
||||||
print_flatten(model.meanf);
|
print_flatten(model.meanf);
|
||||||
|
*/
|
||||||
|
|
||||||
/* free all allocations made */
|
/* free all allocations made */
|
||||||
gsl_rng_free(rng);
|
gsl_rng_free(rng);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user