2026-01-27T15:19:25
This commit is contained in:
24
integrate.h
Normal file
24
integrate.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef INTEGRATE_H_
|
||||
#define INTEGRATE_H_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
typedef float (*integrand_f)(float x, void *ctx);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
INTEG_OK = 0,
|
||||
INTEG_ERR_BAD_ARGS = -1,
|
||||
INTEG_ERR_N_EVEN_REQUIRED = -2
|
||||
} integ_status_t;
|
||||
|
||||
integ_status_t midpoint(integrand_f f, void *ctx, float a, float b, unsigned n,
|
||||
float *out);
|
||||
|
||||
integ_status_t trapezoid(integrand_f f, void *ctx, float a, float b, unsigned n,
|
||||
float *out);
|
||||
|
||||
integ_status_t simpson(integrand_f f, void *ctx, float a, float b, unsigned n,
|
||||
float *out);
|
||||
|
||||
#endif // INTEGRATE_H_
|
||||
Reference in New Issue
Block a user