2013-10-13から1日間の記事一覧

C++で自然スプライン補完

c++

C++で自然スプライン補完 #include<stdio.h> #include<gsl/gsl_linalg.h> void f(double* x,int size,double* x_knots,int knots_size,double* a,double* b,double* c,double* d,double* output){ //x should be sorted; int j=0; double r3; double r2; double r1; double r0; int k=0;</gsl/gsl_linalg.h></stdio.h>…

gslで線形方程式、連立一次方程式をとく。

c c++

gslで線形方程式、連立一次方程式をとく。 #include<stdio.h> #include<gsl/gsl_linalg.h> void solve(double** m,double* v,int len){ using namespace std; int s; double *mb; int k=0; mb=(double*)malloc(sizeof(double)*len*len); for(int i=0;i</gsl/gsl_linalg.h></stdio.h>