update: add test
This commit is contained in:
@@ -123,7 +123,7 @@ static void refine_interval(double xl, double xr, double yl, double yr, double r
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int init(double bmax, double rela_err_limit){
|
int init(double bmax, double rela_err_limit){
|
||||||
SampleData sample;
|
SampleData sample;
|
||||||
sample.capacity = 2;
|
sample.capacity = 2;
|
||||||
sample.size=2;
|
sample.size=2;
|
||||||
@@ -139,6 +139,10 @@ static int init(double bmax, double rela_err_limit){
|
|||||||
//sort
|
//sort
|
||||||
|
|
||||||
//output
|
//output
|
||||||
|
printf("Total sample points number: %d\n", sample.size);
|
||||||
|
for (int i = 0; i < sample.size; i++) {
|
||||||
|
printf("%.16g %.16g\n", sample.x[i], sample.y[i]);
|
||||||
|
}
|
||||||
|
|
||||||
free(sample.x);
|
free(sample.x);
|
||||||
free(sample.y);
|
free(sample.y);
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
double chi(double b);
|
double chi(double b);
|
||||||
|
int init(double bmax, double rela_err_limit);
|
||||||
|
|||||||
8
src/test.c
Normal file
8
src/test.c
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#include "common.h"
|
||||||
|
#include "init.h"
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
init(15.0, 1e-3);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user