Skip to content

Commit

Permalink
change SINGLE -> REAL_32 throughout
Browse files Browse the repository at this point in the history
  • Loading branch information
dalekopera committed Jun 11, 2024
1 parent 415d14a commit 67f1168
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion include/cg_user.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

/* added by nick gould to allow single (float) precision */

#ifdef SINGLE
#ifdef REAL_32
typedef float rp_;
#else
typedef double rp_;
Expand Down
6 changes: 3 additions & 3 deletions include/cutest.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Boolean logicals provided, August 21 2013
* fortran intent(in) variables defined as const, Dec 2 2015
*
* this version 2024-02-18
* this version 2024-06-11
*
* ======================================================================
*/
Expand Down Expand Up @@ -61,10 +61,10 @@ typedef __float128 quadreal;
/* typedef _Bool logical; */
typedef bool logical;

#ifdef SINGLE
#ifdef REAL_32
typedef float rp_;
typedef float rpc_;
#elif QUAD
#elif REAL_128
#if defined(__INTEL_COMPILER) && defined(_WIN32)
typedef _Quad rp_;
typedef _Quad rpc_;
Expand Down
8 changes: 4 additions & 4 deletions include/cutest_modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Nick Gould for CUTEst
* initial version, 2023-11-02
* this version 2024-02-18
* this version 2024-06-11
*/

#ifdef INTEGER_64
Expand All @@ -15,7 +15,7 @@
#define CUTEST_KINDS_integer CUTEST_KINDS_int
#endif

#if defined HALF
#if defined REAL_16
#ifdef INTEGER_64
#define CUTEST_KINDS_precision CUTEST_KINDS_half_64
#define CUTEST_precision CUTEST_half_64
Expand All @@ -29,7 +29,7 @@
#define CUTEST_INTERFACE_precision CUTEST_INTERFACE_half
#define CUTEST_LQP_precision CUTEST_LQP_half
#endif
#elif defined SINGLE
#elif defined REAL_32
#ifdef INTEGER_64
#define CUTEST_KINDS_precision CUTEST_KINDS_single_64
#define CUTEST_precision CUTEST_single_64
Expand All @@ -43,7 +43,7 @@
#define CUTEST_INTERFACE_precision CUTEST_INTERFACE_single
#define CUTEST_LQP_precision CUTEST_LQP_single
#endif
#elif defined QUAD
#elif defined REAL_128
#ifdef INTEGER_64
#define CUTEST_KINDS_precision CUTEST_KINDS_quadruple_64
#define CUTEST_precision CUTEST_quadruple_64
Expand Down
6 changes: 3 additions & 3 deletions include/cutest_routines.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
*
* Nick Gould for CUTEst
* initial version, 2023-11-11
* this version 2024-04-05
* this version 2024-06-11
*/

#ifdef SINGLE
#ifdef REAL_32
#include "cutest_routines_single.h"
#elif QUAD
#elif REAL_128
#include "cutest_routines_quadruple.h"
#else
#include "cutest_routines_double.h"
Expand Down
4 changes: 2 additions & 2 deletions src/cg_descent/cg_descent_main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* THIS VERSION: CUTEST 2.3 - 2024-02-18 AT 09:00 GMT */
/* THIS VERSION: CUTEST 2.3 - 2024-06-11 AT 11:40 GMT */

/* ====================================================
* CUTEst interface for cg_descent April. 5, 2014
Expand Down Expand Up @@ -203,7 +203,7 @@ rp_ cg_valgrad

spec = fopen ("CG_DESCENT.SPC", "r") ;

#ifdef SINGLE
#ifdef REAL_32
char pg[ ]="%g";
#else
char pg[ ]="%lg";
Expand Down
4 changes: 2 additions & 2 deletions src/derchk/derchk_main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* THIS VERSION: CUTEST 2.3 - 2024-02-18 AT 09:10 GMT */
/* THIS VERSION: CUTEST 2.4 - 2024-06-11 AT 11:40 GMT */

/* ===========================================
* CUTEst interface to derivative checker
Expand Down Expand Up @@ -72,7 +72,7 @@ extern "C" { /* To prevent C++ compilers from mangling symbols */
rp_ *cxp, *cxm, *g;
int nerr = 0;

#ifdef SINGLE
#ifdef REAL_32
h = 1.0e-4;
der_max = 1.0e-2;
#else
Expand Down
20 changes: 10 additions & 10 deletions src/gsl/gsl_main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* THIS VERSION: CUTEST 2.3 - 2024-02-18 AT 09:10 GMT */
/* THIS VERSION: CUTEST 2.3 - 2024-06-11 AT 11:40 GMT */

/* =================================================
* CUTEst interface for GNU Scientific Library (GSL)
Expand Down Expand Up @@ -49,15 +49,15 @@ struct param_data {
int n;
};

#ifdef SINGLE
#ifdef REAL_32
int eval_fn( const gsl_vector_float *x, void *params, gsl_vector_float *f ) {
#else
int eval_fn( const gsl_vector *x, void *params, gsl_vector *f ) {
#endif
struct param_data *data = (struct param_data*) params;
int status;
rp_ obj, i;
#ifdef SINGLE
#ifdef REAL_32
const rp_ *xptr = gsl_vector_float_const_ptr(x, 0);
rp_ *fptr = gsl_vector_float_ptr(f, 0);
#else
Expand All @@ -68,7 +68,7 @@ int eval_fn( const gsl_vector *x, void *params, gsl_vector *f ) {
return GSL_SUCCESS;
}

#ifdef SINGLE
#ifdef REAL_32
int eval_jacobian( const gsl_vector_float *x, void *params,
gsl_matrix_float *J ) {
#else
Expand All @@ -85,7 +85,7 @@ int eval_jacobian( const gsl_vector *x, void *params,
int status, ldJ;
grlagf = false;
jtrans = true; /* GSL uses row major */
#ifdef SINGLE
#ifdef REAL_32
xptr = gsl_vector_float_const_ptr(x, 0);
Jptr = gsl_matrix_float_ptr(J, 0, 0);
#else
Expand All @@ -99,7 +99,7 @@ int eval_jacobian( const gsl_vector *x, void *params,
return GSL_SUCCESS;
}

#ifdef SINGLE
#ifdef REAL_32
int eval_fn_jacobian( const gsl_vector_float *x, void *params,
gsl_vector_float *f, gsl_matrix_float *J ) {
#else
Expand All @@ -117,7 +117,7 @@ int eval_fn_jacobian( const gsl_vector *x, void *params,
rp_ obj;
grlagf = false;
jtrans = true; /* GSL uses row major */
#ifdef SINGLE
#ifdef REAL_32
xptr = gsl_vector_float_const_ptr(x, 0);
Jptr = gsl_matrix_float_ptr(J, 0, 0);
fptr = gsl_vector_float_ptr(f, 0);
Expand Down Expand Up @@ -168,7 +168,7 @@ int MAINENTRY( void ){
rp_ epsabs, epsrel;
struct param_data params;

#ifdef SINGLE
#ifdef REAL_32
gsl_vector_float_view xview;
#else
gsl_vector_view xview;
Expand Down Expand Up @@ -337,7 +337,7 @@ int MAINENTRY( void ){
fdf.p = CUTEst_nvar;
fdf.params = &params;
/* Set up optimizer with function and initial guess */
#ifdef SINGLE
#ifdef REAL_32
xview = gsl_vector_float_view_array(x, CUTEst_nvar);
#else
xview = gsl_vector_view_array(x, CUTEst_nvar);
Expand All @@ -358,7 +358,7 @@ int MAINENTRY( void ){
}
rewind( indr );

#ifdef SINGLE
#ifdef REAL_32
char pf[ ]="%f%*[^\n]\n";
#else
char pf[ ]="%lf%*[^\n]\n";
Expand Down
10 changes: 5 additions & 5 deletions src/makedefs/definitions
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Standard CUTEst makefile definitions

# Nick Gould, for GALAHAD production
# This version: 2024-04-05
# This version: 2024-06-11

# makefile shell

SHELL = /bin/$(BINSHELL)

ifeq "$(PRECIS)" "single_64"
DPREC = -DSINGLE -DINTEGER_64
DPREC = -DREAL_32 -DINTEGER_64
HSL_PRECIS = s64
else ifeq "$(PRECIS)" "quadruple_64"
DPREC = -DINTEGER_64 -DQUAD $(QUADREAL)
DPREC = -DINTEGER_64 -DREAL_128 $(QUADREAL)
HSL_PRECIS = q64
else ifeq "$(PRECIS)" "double_64"
DPREC = -DINTEGER_64
HSL_PRECIS = d64
else ifeq "$(PRECIS)" "single"
DPREC = -DSINGLE
DPREC = -DREAL_32
HSL_PRECIS = s
else ifeq "$(PRECIS)" "quadruple"
DPREC = -DQUAD $(QUADREAL)
DPREC = -DREAL_128 $(QUADREAL)
HSL_PRECIS = q
else
DPREC =
Expand Down
4 changes: 2 additions & 2 deletions src/nomad/nomad_main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* THIS VERSION: CUTEST 2.3 - 2024-02-18 AT 09:10 GMT */
/* THIS VERSION: CUTEST 2.3 - 2024-06-11 AT 11:40 GMT */

/* ====================================================
* CUTEst interface simulating a black box for NOMAD.
Expand Down Expand Up @@ -117,7 +117,7 @@ extern "C" { /* To prevent C++ compilers from mangling symbols */
return 0;
}

#ifdef SINGLE
#ifdef REAL_32
char pf[ ]="%f";
#else
char pf[ ]="%lf";
Expand Down
4 changes: 2 additions & 2 deletions src/osqp/osqp_main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* THIS VERSION: CUTEST 2.3 - 2024-02-18 AT 08:50 GMT */
/* THIS VERSION: CUTEST 2.3 - 2024-06-11 AT 11:50 GMT */

/* ===========================================
* CUTEst interface to OSQP
Expand Down Expand Up @@ -485,7 +485,7 @@ int MAINENTRY(void) {
$OSQP/include/types.h for the parameter names and descriptions and
$OSQP/include/constants.h for default values */

#ifdef SINGLE
#ifdef REAL_32
char pg[ ]="%g";
#else
char pg[ ]="%lg";
Expand Down
4 changes: 2 additions & 2 deletions src/ral_nlls/ral_nlls_main.F90
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
! THIS VERSION: CUTEST 2.3 - 2024-02-18 AT 09:20 GMT.
! THIS VERSION: CUTEST 2.3 - 2024-06-11 AT 11:40 GMT.

#include "cutest_modules.h"
#include "cutest_routines.h"
#ifdef SINGLE
#ifdef REAL_32
#define RAL_NLLS_precision RAL_NLLS_single
#else
#define RAL_NLLS_precision RAL_NLLS_double
Expand Down
4 changes: 2 additions & 2 deletions src/ral_nlls/ral_nlls_test.F90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
! THIS VERSION: CUTEST 2.3 - 2024-02-18 AT 09:00 GMT.
! THIS VERSION: CUTEST 2.3 - 2024-06-11 AT 11:40 GMT.

#include "cutest_modules.h"
#ifdef SINGLE
#ifdef REAL_32
#define RAL_NLLS_precision RAL_NLLS_single
#else
#define RAL_NLLS_precision RAL_NLLS_double
Expand Down

0 comments on commit 67f1168

Please sign in to comment.