Skip to content

Commit

Permalink
add doc
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoMVale committed Jun 16, 2024
1 parent 5ef90f7 commit bd857da
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions c/example/example5.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
/*
This is a translation of example 5 from the ODRPACK95 documentation.
*/

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#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)
{
Expand Down Expand Up @@ -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;
}

0 comments on commit bd857da

Please sign in to comment.