update: add test

This commit is contained in:
2025-11-06 17:04:09 -05:00
parent c6560acb4c
commit ea5ca0b679
3 changed files with 14 additions and 1 deletions

View File

@@ -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);

View File

@@ -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
View File

@@ -0,0 +1,8 @@
#include "common.h"
#include "init.h"
int main(){
init(15.0, 1e-3);
return 0;
}