Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Make the 'lagrange' parameter of 'vec_jac' const #91

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ADOL-C/include/adolc/drivers/drivers.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ ADOLC_DLL_EXPORT fint large_jacobian_(fint *, fint *, fint *, fint *, fdouble *,
/*--------------------------------------------------------------------------*/
/* vector_jacobian */
/* vec_jac(tag, m, n, repeat, x[n], u[m], v[n]) */
ADOLC_DLL_EXPORT int vec_jac(short, int, int, int, const double *, double *,
double *);
ADOLC_DLL_EXPORT int vec_jac(short, int, int, int, const double *,
const double *, double *);
ADOLC_DLL_EXPORT fint vec_jac_(fint *, fint *, fint *, fint *, fdouble *,
fdouble *, fdouble *);
const fdouble *, fdouble *);

/*--------------------------------------------------------------------------*/
/* jacobian_vector */
Expand Down
4 changes: 2 additions & 2 deletions ADOL-C/include/adolc/fortutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
/* Now the C THINGS */
BEGIN_C_DECLS

ADOLC_DLL_EXPORT void spread1(int m, fdouble *x, double *X);
ADOLC_DLL_EXPORT void pack1(int m, double *X, fdouble *x);
ADOLC_DLL_EXPORT void spread1(int m, const fdouble *x, double *X);
ADOLC_DLL_EXPORT void pack1(int m, const double *X, fdouble *x);

ADOLC_DLL_EXPORT void spread2(int m, int n, fdouble *x, double **X);
ADOLC_DLL_EXPORT void pack2(int m, int n, double **X, fdouble *x);
Expand Down
4 changes: 2 additions & 2 deletions ADOL-C/include/adolc/interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,10 @@ ADOLC_DLL_EXPORT int nonl_ind_old_forward_tight(short, int, int, const double *,
/* FOS */
/* fos_reverse(tag, m, n, u[m], z[n]) */
/* (defined in fo_rev.c) */
ADOLC_DLL_EXPORT int fos_reverse(short, int, int, double *, double *);
ADOLC_DLL_EXPORT int fos_reverse(short, int, int, const double *, double *);

/* now pack the arrays into vectors for Fortran calling */
ADOLC_DLL_EXPORT fint fos_reverse_(fint *, fint *, fint *, fdouble *,
ADOLC_DLL_EXPORT fint fos_reverse_(fint *, fint *, fint *, const fdouble *,
fdouble *);

/*--------------------------------------------------------------------------*/
Expand Down
2 changes: 1 addition & 1 deletion ADOL-C/src/drivers/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int gradient(short tag, int n, const double *argument, double *result) {
/* */
/* vec_jac(tag, m, n, repeat, x[n], u[m], v[n]) */
int vec_jac(short tag, int m, int n, int repeat, const double *argument,
double *lagrange, double *row) {
const double *lagrange, double *row) {
int rc = -1;
double *y = NULL;

Expand Down
2 changes: 1 addition & 1 deletion ADOL-C/src/drivers/driversf.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fint gradient_(fint *ftag, fint *fn, fdouble *fargument, fdouble *fresult) {
/* */
/* vec_jac(tag, m, n, repeat, x[n], u[m], v[n]) */
fint vec_jac_(fint *ftag, fint *fm, fint *fn, fint *frepeat, fdouble *fargument,
fdouble *flagrange, fdouble *frow) {
const fdouble *flagrange, fdouble *frow) {
int rc = -1;
short tag = (short)*ftag;
int m = *fm, n = *fn, repeat = *frepeat;
Expand Down
8 changes: 3 additions & 5 deletions ADOL-C/src/fo_rev.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@
int fos_reverse(short tnum, /* tape id */
int depen, /* consistency chk on # of deps */
int indep, /* consistency chk on # of indeps */
double *lagrange, double *results) /* coefficient vectors */
const double *lagrange,
double *results) /* coefficient vectors */

#endif
#elif _FOV_
Expand Down Expand Up @@ -737,10 +738,7 @@
*Ares = 0.0;
#else
if (ADOLC_CURRENT_TAPE_INFOS.in_nested_ctx) {
FOR_0_LE_l_LT_p {
ARES_INC = LAGRANGETRANS(l, indexd);
LAGRANGETRANS(l, indexd) = 0.0;
}
FOR_0_LE_l_LT_p { ARES_INC = LAGRANGETRANS(l, indexd); }

Check warning on line 741 in ADOL-C/src/fo_rev.c

View check run for this annotation

Codecov / codecov/patch

ADOL-C/src/fo_rev.c#L741

Added line #L741 was not covered by tests
} else {
FOR_0_LE_l_LT_p ARES_INC = LAGRANGE(l, indexd);
}
Expand Down
4 changes: 2 additions & 2 deletions ADOL-C/src/fortutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
/* */

/*--------------------------------------------------------------------------*/
void spread1(int m, fdouble *x, double *X) {
void spread1(int m, const fdouble *x, double *X) {

Check warning on line 24 in ADOL-C/src/fortutils.c

View check run for this annotation

Codecov / codecov/patch

ADOL-C/src/fortutils.c#L24

Added line #L24 was not covered by tests
int j;
for (j = 0; j < m; j++)
X[j] = *x++;
}

/*--------------------------------------------------------------------------*/
void pack1(int m, double *X, fdouble *x) {
void pack1(int m, const double *X, fdouble *x) {

Check warning on line 31 in ADOL-C/src/fortutils.c

View check run for this annotation

Codecov / codecov/patch

ADOL-C/src/fortutils.c#L31

Added line #L31 was not covered by tests
int j;
for (j = 0; j < m; j++)
*x++ = X[j];
Expand Down
3 changes: 2 additions & 1 deletion ADOL-C/src/interfacesf.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@
}

/*--------------------------------------------------------------------------*/
fint fos_reverse_(fint *ftag, fint *fm, fint *fn, fdouble *fu, fdouble *fz) {
fint fos_reverse_(fint *ftag, fint *fm, fint *fn, const fdouble *fu,

Check warning on line 132 in ADOL-C/src/interfacesf.c

View check run for this annotation

Codecov / codecov/patch

ADOL-C/src/interfacesf.c#L132

Added line #L132 was not covered by tests
fdouble *fz) {
int rc = -1;
int tag = *ftag, m = *fm, n = *fn;
double *u = myalloc1(m);
Expand Down
Loading