From bd857dac95b9eb9ce0ac1af540492eb8089703de Mon Sep 17 00:00:00 2001 From: HugoMVale <57530119+HugoMVale@users.noreply.github.com> Date: Sun, 16 Jun 2024 19:02:14 +0200 Subject: [PATCH] add doc --- c/example/example5.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/c/example/example5.c b/c/example/example5.c index 9588fb8..1815a38 100644 --- a/c/example/example5.c +++ b/c/example/example5.c @@ -1,8 +1,13 @@ +/* +This is a translation of example 5 from the ODRPACK95 documentation. +*/ + #include #include #include #include "../include/odrpack/odrpack.h" +// User-supplied function for evaluating the model and its partial derivatives void fcn(int *n, int *m, int *np, int *nq, int *ldn, int *ldm, int *ldnp, double *beta, double *xplusd, int *ifixb, int *ifixx, int *ldifx, int *ideval, double *f, double *fjacb, double *fjacd, int *istop) { @@ -47,12 +52,12 @@ int main() #define nq 1 double beta[np] = {2.0, 0.5}; - double l[np] = {0.0, 0.0}; - double u[np] = {10.0, 0.9}; + double lower[np] = {0.0, 0.0}; + double upper[np] = {10.0, 0.9}; double x[n * m] = {0.982, 1.998, 4.978, 6.01}; double y[n * nq] = {2.7, 7.4, 148.0, 403.0}; - odr_c(fcn, n, m, np, nq, beta, y, x, l, u); + odr_c(fcn, n, m, np, nq, beta, y, x, lower, upper); return 0; }