Skip to content

Commit

Permalink
undid erroneous precision-dependent procedure names for C interfaces …
Browse files Browse the repository at this point in the history
…(doh!)
  • Loading branch information
dalekopera committed Oct 11, 2024
1 parent c7cd6f9 commit b243e5b
Show file tree
Hide file tree
Showing 12 changed files with 148 additions and 144 deletions.
2 changes: 2 additions & 0 deletions include/cutest.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* THIS VERSION: CUTEST 2.3 - 2024-10-11 AT 09:00 GMT */

/*
* ======================================================================
*
Expand Down
30 changes: 15 additions & 15 deletions src/derchk/derchk_main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* THIS VERSION: CUTEST 2.4 - 2024-06-11 AT 11:40 GMT */
/* THIS VERSION: CUTEST 2.3 - 2024-10-11 AT 09:00 GMT */

/* ===========================================
* CUTEst interface to derivative checker
Expand Down Expand Up @@ -82,14 +82,14 @@ extern "C" { /* To prevent C++ compilers from mangling symbols */

/* Open problem description file OUTSDIF.d */
ierr = 0;
FORTRAN_open_r(&funit, fname, &ierr);
FORTRAN_open(&funit, fname, &ierr);
if (ierr) {
printf("Error opening file OUTSDIF.d.\nAborting.\n");
exit(1);
}

/* Determine problem size */
CUTEST_cdimen_r( &status, &funit, &CUTEst_nvar, &CUTEst_ncon);
CUTEST_cdimen( &status, &funit, &CUTEst_nvar, &CUTEst_ncon);
if (status) {
printf("CUTEst error.\nAborting.\n");
exit(2);
Expand All @@ -112,7 +112,7 @@ extern "C" { /* To prevent C++ compilers from mangling symbols */
MALLOC(v, CUTEst_ncon+1, rp_);
MALLOC(cl, CUTEst_ncon+1, rp_);
MALLOC(cu, CUTEst_ncon+1, rp_);
CUTEST_csetup_r( &status, &funit, &iout, &io_buffer,
CUTEST_csetup( &status, &funit, &iout, &io_buffer,
&CUTEst_nvar, &CUTEst_ncon, x, bl, bu,
v, cl, cu, equatn, linear,
&e_order, &l_order, &v_order );
Expand All @@ -125,7 +125,7 @@ extern "C" { /* To prevent C++ compilers from mangling symbols */
MALLOC(linear, 1, logical);
MALLOC(cl, 1, rp_);
MALLOC(cu, 1, rp_);
CUTEST_usetup_r( &status, &funit, &iout, &io_buffer, &CUTEst_nvar,
CUTEST_usetup( &status, &funit, &iout, &io_buffer, &CUTEst_nvar,
x, bl, bu);
if (status) {
printf("CUTEst error.\nAborting.\n");
Expand All @@ -145,14 +145,14 @@ extern "C" { /* To prevent C++ compilers from mangling symbols */
MALLOC(Gnames, CUTEst_ncon, char*); /* Array of strings */
for (i = 0; i < CUTEst_ncon; i++)
MALLOC(Gnames[i], FSTRING_LEN+1, char);
CUTEST_cnames_r( &status, &CUTEst_nvar, &CUTEst_ncon,
CUTEST_cnames( &status, &CUTEst_nvar, &CUTEst_ncon,
pname, vnames, gnames);
if (status) {
printf("CUTEst error.\nAborting.\n");
exit(2);
}
} else {
CUTEST_unames_r( &status, &CUTEst_nvar, pname, vnames);
CUTEST_unames( &status, &CUTEst_nvar, pname, vnames);
if (status) {
printf("CUTEst error.\nAborting.\n");
exit(2);
Expand Down Expand Up @@ -205,7 +205,7 @@ extern "C" { /* To prevent C++ compilers from mangling symbols */

/* Evaluate gradient at initial point. */
MALLOC(g, CUTEst_nvar, rp_);
CUTEST_ugr_r( &status, &CUTEst_nvar, x, g);
CUTEST_ugr( &status, &CUTEst_nvar, x, g);
if (status) {
printf("CUTEst error.\nAborting.\n");
exit(2);
Expand All @@ -222,29 +222,29 @@ extern "C" { /* To prevent C++ compilers from mangling symbols */
xi = x[i];
x[i] = xi + h;
if (constrained) {
CUTEST_cfn_r( &status, &CUTEst_nvar, &CUTEst_ncon,
CUTEST_cfn( &status, &CUTEst_nvar, &CUTEst_ncon,
x, &fxp, cxp);
if (status) {
printf("CUTEst error.\nAborting.\n");
exit(2);
}
} else {
CUTEST_ufn_r( &status, &CUTEst_nvar, x, &fxp);
CUTEST_ufn( &status, &CUTEst_nvar, x, &fxp);
if (status) {
printf("CUTEst error.\nAborting.\n");
exit(2);
}
}
x[i] = xi - h;
if (constrained) {
CUTEST_cfn_r( &status, &CUTEst_nvar, &CUTEst_ncon,
CUTEST_cfn( &status, &CUTEst_nvar, &CUTEst_ncon,
x, &fxm, cxm);
if (status) {
printf("CUTEst error.\nAborting.\n");
exit(2);
}
} else {
CUTEST_ufn_r( &status, &CUTEst_nvar, x, &fxm);
CUTEST_ufn( &status, &CUTEst_nvar, x, &fxm);
if (status) {
printf("CUTEst error.\nAborting.\n");
exit(2);
Expand Down Expand Up @@ -273,7 +273,7 @@ extern "C" { /* To prevent C++ compilers from mangling symbols */
}

/* Get CUTEst statistics */
CUTEST_creport_r( &status, calls, cpu);
CUTEST_creport( &status, calls, cpu);
if (status) {
printf("CUTEst error.\nAborting.\n");
exit(2);
Expand Down Expand Up @@ -304,7 +304,7 @@ extern "C" { /* To prevent C++ compilers from mangling symbols */
printf("*********************\n\n");

ierr = 0;
FORTRAN_close_r(&funit, &ierr);
FORTRAN_close(&funit, &ierr);
if (ierr)
printf("Error closing %s on unit %d.\n", fname, (int)funit);

Expand All @@ -323,7 +323,7 @@ extern "C" { /* To prevent C++ compilers from mangling symbols */
for (i = 0; i < CUTEst_ncon; i++) FREE(Gnames[i]);
if (constrained) FREE(Gnames);

CUTEST_uterminate_r( &status );
CUTEST_uterminate( &status );

return 0;

Expand Down
6 changes: 3 additions & 3 deletions src/genc/genc.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* THIS VERSION: CUTEST 2.2 - 2023-12-02 AT 14:30 GMT */
/* THIS VERSION: CUTEST 2.3 - 2024-10-11 AT 09:00 GMT */

/* Generic C solver, to be used with
* generic C driver, gencma.c
Expand Down Expand Up @@ -31,7 +31,7 @@ void genspc( integer funit, char *fname )
Possibly, this routine contains precision-dependent directives */

/* Open relevant file */
FORTRAN_open_r( &funit, fname, &ierr );
FORTRAN_open( &funit, fname, &ierr );
if ( ierr )
{
printf( "Error opening spec file %s.\nAborting.\n", fname );
Expand All @@ -40,7 +40,7 @@ void genspc( integer funit, char *fname )

/* ... Do something ... */

FORTRAN_close_r( &funit, &ierr );
FORTRAN_close( &funit, &ierr );
return;

}
Expand Down
24 changes: 12 additions & 12 deletions src/genc/genc_main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* THIS VERSION: CUTEST 2.2 - 2024-08-20 AT 08:00 GMT */
/* THIS VERSION: CUTEST 2.3 - 2024-10-11 AT 09:00 GMT */

/* ============================================
* CUTEst interface for generic package
Expand Down Expand Up @@ -72,15 +72,15 @@ int MAINENTRY( void ){

/* Open problem description file OUTSDIF.d */
ierr = 0;
FORTRAN_open_r( &funit, fname, &ierr );
FORTRAN_open( &funit, fname, &ierr );
if ( ierr )
{
printf("Error opening file OUTSDIF.d.\nAborting.\n");
exit(1);
}

/* Determine problem size */
CUTEST_cdimen_r( &status, &funit, &CUTEst_nvar, &CUTEst_ncon );
CUTEST_cdimen( &status, &funit, &CUTEst_nvar, &CUTEst_ncon );

if ( status )
{
Expand All @@ -89,7 +89,7 @@ int MAINENTRY( void ){
}

MALLOC(classification, FCSTRING_LEN + 1, char);
CUTEST_classification_r( &status, &funit, classification );
CUTEST_classification( &status, &funit, classification );

/* Determine whether to call constrained or unconstrained tools */
if ( CUTEst_ncon ) constrained = TRUE_;
Expand All @@ -106,7 +106,7 @@ int MAINENTRY( void ){
MALLOC( v, CUTEst_ncon, rp_ );
MALLOC( cl, CUTEst_ncon, rp_ );
MALLOC( cu, CUTEst_ncon, rp_ );
CUTEST_csetup_r( &status, &funit, &iout, &io_buffer,
CUTEST_csetup( &status, &funit, &iout, &io_buffer,
&CUTEst_nvar, &CUTEst_ncon, x, bl, bu,
v, cl, cu, equatn, linear,
&e_order, &l_order, &v_order );
Expand Down Expand Up @@ -146,7 +146,7 @@ int MAINENTRY( void ){
printf("\n"); */
}
else
{ CUTEST_usetup_r( &status, &funit, &iout, &io_buffer,
{ CUTEST_usetup( &status, &funit, &iout, &io_buffer,
&CUTEst_nvar, x, bl, bu );
/* printf("CUTEst_nvar = %d\n", CUTEst_nvar); */
}
Expand All @@ -169,12 +169,12 @@ int MAINENTRY( void ){
MALLOC(Gnames, CUTEst_ncon, char *); /* Array of strings */
for (i = 0; i < CUTEst_ncon; i++)
MALLOC(Gnames[i], FSTRING_LEN + 1, char);
CUTEST_cnames_r( &status, &CUTEst_nvar, &CUTEst_ncon,
CUTEST_cnames( &status, &CUTEst_nvar, &CUTEst_ncon,
pname, vnames, gnames );
}
else
{
CUTEST_unames_r( &status, &CUTEst_nvar, pname, vnames );
CUTEST_unames( &status, &CUTEst_nvar, pname, vnames );
}

if ( status )
Expand Down Expand Up @@ -244,7 +244,7 @@ int MAINENTRY( void ){
ExitCode = 0;

/* Get CUTEst statistics */
CUTEST_creport_r( &status, calls, cpu );
CUTEST_creport( &status, calls, cpu );

if ( status )
{
Expand Down Expand Up @@ -275,7 +275,7 @@ int MAINENTRY( void ){
printf(" ******************************************************************\n\n");

ierr = 0;
FORTRAN_close_r( &funit, &ierr );
FORTRAN_close( &funit, &ierr );
if ( ierr )
{
printf( "Error closing %s on unit %d.\n", fname, (int)funit );
Expand All @@ -290,9 +290,9 @@ int MAINENTRY( void ){
FREE( linear );

if ( constrained )
CUTEST_cterminate_r( &status );
CUTEST_cterminate( &status );
else
CUTEST_uterminate_r( &status );
CUTEST_uterminate( &status );

return 0;

Expand Down
30 changes: 15 additions & 15 deletions src/gsl/gsl_main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* THIS VERSION: CUTEST 2.4 - 2024-08-20 AT 07:40 GMT */
/* THIS VERSION: CUTEST 2.3 - 2024-10-11 AT 09:00 GMT */

/* =================================================
* CUTEst interface for GNU Scientific Library (GSL)
Expand Down Expand Up @@ -64,7 +64,7 @@ int eval_fn( const gsl_vector *x, void *params, gsl_vector *f ) {
const rp_ *xptr = gsl_vector_const_ptr(x, 0);
rp_ *fptr = gsl_vector_ptr(f, 0);
#endif
CUTEST_cfn_r( &status, &data->n, &data->m, xptr, &obj, fptr);
CUTEST_cfn( &status, &data->n, &data->m, xptr, &obj, fptr);
return GSL_SUCCESS;
}

Expand Down Expand Up @@ -93,7 +93,7 @@ int eval_jacobian( const gsl_vector *x, void *params,
Jptr = gsl_matrix_ptr(J, 0, 0);
#endif
ldJ = J->tda;
CUTEST_cgr_r( &status, &data->n, &data->m, xptr, y, &grlagf, g, &jtrans,
CUTEST_cgr( &status, &data->n, &data->m, xptr, y, &grlagf, g, &jtrans,
&ldJ, &data->m, Jptr );
free(y); free(g); /* Values ignored */
return GSL_SUCCESS;
Expand Down Expand Up @@ -126,9 +126,9 @@ int eval_fn_jacobian( const gsl_vector *x, void *params,
Jptr = gsl_matrix_ptr(J, 0, 0);
fptr = gsl_vector_ptr(f, 0);
#endif
CUTEST_cfn_r( &status, &data->n, &data->m, xptr, &obj, fptr);
CUTEST_cfn( &status, &data->n, &data->m, xptr, &obj, fptr);
ldJ = J->tda;
CUTEST_cgr_r( &status, &data->n, &data->m, xptr, y, &grlagf, g, &jtrans,
CUTEST_cgr( &status, &data->n, &data->m, xptr, y, &grlagf, g, &jtrans,
&ldJ, &data->m, Jptr );
free(y); free(g); /* Values ignored */
return GSL_SUCCESS;
Expand Down Expand Up @@ -188,15 +188,15 @@ int MAINENTRY( void ){

/* Open problem description file OUTSDIF.d */
ierr = 0;
FORTRAN_open_r( &funit, fname, &ierr );
FORTRAN_open( &funit, fname, &ierr );
if ( ierr )
{
printf("Error opening file OUTSDIF.d.\nAborting.\n");
exit(1);
}

/* Determine problem size */
CUTEST_cdimen_r( &status, &funit, &CUTEst_nvar, &CUTEst_ncon );
CUTEST_cdimen( &status, &funit, &CUTEst_nvar, &CUTEst_ncon );

if ( status )
{
Expand All @@ -219,7 +219,7 @@ int MAINENTRY( void ){
MALLOC( v, CUTEst_ncon, rp_ );
MALLOC( cl, CUTEst_ncon, rp_ );
MALLOC( cu, CUTEst_ncon, rp_ );
CUTEST_csetup_r( &status, &funit, &iout, &io_buffer,
CUTEST_csetup( &status, &funit, &iout, &io_buffer,
&CUTEst_nvar, &CUTEst_ncon, x, bl, bu,
v, cl, cu, equatn, linear,
&e_order, &l_order, &v_order );
Expand Down Expand Up @@ -259,7 +259,7 @@ int MAINENTRY( void ){
printf("\n"); */
}
else
CUTEST_usetup_r( &status, &funit, &iout, &io_buffer,
CUTEST_usetup( &status, &funit, &iout, &io_buffer,
&CUTEst_nvar, x, bl, bu );

if ( status )
Expand All @@ -278,12 +278,12 @@ int MAINENTRY( void ){
if ( constrained )
{
MALLOC(gnames, CUTEst_ncon * FSTRING_LEN, char); /* For Fortran */
CUTEST_cnames_r( &status, &CUTEst_nvar, &CUTEst_ncon,
CUTEST_cnames( &status, &CUTEst_nvar, &CUTEst_ncon,
pname, vnames, gnames );
}
else
{
CUTEST_unames_r( &status, &CUTEst_nvar, pname, vnames );
CUTEST_unames( &status, &CUTEst_nvar, pname, vnames );
}

if ( status )
Expand Down Expand Up @@ -559,7 +559,7 @@ int MAINENTRY( void ){
fnval = 0.5*normf*normf;*/

/* Get CUTEst statistics */
CUTEST_creport_r( &status, calls, cpu );
CUTEST_creport( &status, calls, cpu );

if ( status )
{
Expand Down Expand Up @@ -630,7 +630,7 @@ int MAINENTRY( void ){
printf(" ******************************************************************\n\n");

ierr = 0;
FORTRAN_close_r( &funit, &ierr );
FORTRAN_close( &funit, &ierr );
if ( ierr )
{
printf( "Error closing %s on unit %d.\n", fname, (int)funit );
Expand All @@ -647,9 +647,9 @@ int MAINENTRY( void ){
FREE(Vnames);

if ( constrained )
CUTEST_cterminate_r( &status );
CUTEST_cterminate( &status );
else
CUTEST_uterminate_r( &status );
CUTEST_uterminate( &status );

return 0;

Expand Down
Loading

0 comments on commit b243e5b

Please sign in to comment.