11/*
22 * R : A Computer Language for Statistical Data Analysis
3- * Copyright (C) 1999-2014 The R Core Team
3+ * Copyright (C) 1999-2025 The R Core Team
44 *
55 * This program is free software; you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
@@ -116,7 +116,7 @@ vmmin(int n0, double *b, double *Fmin, optimfn fminfn, optimgr fmingr,
116116 double abstol , double reltol , int nREPORT , void * ex ,
117117 int * fncount , int * grcount , int * fail )
118118{
119- Rboolean accpoint , enough ;
119+ bool accpoint , enough ;
120120 double * g , * t , * X , * c , * * B ;
121121 int count , funcount , gradcount ;
122122 double f , gradproj ;
@@ -174,7 +174,7 @@ vmmin(int n0, double *b, double *Fmin, optimfn fminfn, optimgr fmingr,
174174
175175 if (gradproj < 0.0 ) { /* search direction is downhill */
176176 steplength = 1.0 ;
177- accpoint = FALSE ;
177+ accpoint = false ;
178178 do {
179179 count = 0 ;
180180 for (i = 0 ; i < n ; i ++ ) {
@@ -272,7 +272,7 @@ void nmmin(int n, double *Bvec, double *X, double *Fmin, optimfn fminfn,
272272{
273273 char action [50 ];
274274 int C ;
275- Rboolean calcvert ;
275+ bool calcvert ;
276276 double convtol , f ;
277277 int funcount = 0 , H , i , j , L = 0 ;
278278 int n1 = 0 ;
@@ -291,11 +291,11 @@ void nmmin(int n, double *Bvec, double *X, double *Fmin, optimfn fminfn,
291291 if (trace )
292292 Rprintf (" Nelder-Mead direct search function minimizer\n" );
293293 P = matrix (n , n + 1 );
294- * fail = FALSE ;
294+ * fail = false ;
295295 f = fminfn (n , Bvec , ex );
296296 if (!R_FINITE (f )) {
297297 error (_ ("function cannot be evaluated at initial parameters" ));
298- * fail = TRUE ;
298+ * fail = true ;
299299 } else {
300300 if (trace ) Rprintf ("function value for initial parameters = %f\n" , f );
301301 funcount = 1 ;
@@ -330,7 +330,7 @@ void nmmin(int n, double *Bvec, double *X, double *Fmin, optimfn fminfn,
330330 size += trystep ;
331331 }
332332 oldsize = size ;
333- calcvert = TRUE ;
333+ calcvert = true ;
334334 do {
335335 if (calcvert ) {
336336 for (j = 0 ; j < n1 ; j ++ ) {
@@ -343,7 +343,7 @@ void nmmin(int n, double *Bvec, double *X, double *Fmin, optimfn fminfn,
343343 P [n1 - 1 ][j ] = f ;
344344 }
345345 }
346- calcvert = FALSE ;
346+ calcvert = false ;
347347 }
348348
349349 VL = P [n1 - 1 ][L - 1 ];
@@ -427,7 +427,7 @@ void nmmin(int n, double *Bvec, double *X, double *Fmin, optimfn fminfn,
427427 } else {
428428 if (VR >= VH ) {
429429 strcpy (action , "SHRINK " );
430- calcvert = TRUE ;
430+ calcvert = true ;
431431 size = 0.0 ;
432432 for (j = 0 ; j < n1 ; j ++ ) {
433433 if (j + 1 != L ) {
@@ -472,7 +472,7 @@ void cgmin(int n, double *Bvec, double *X, double *Fmin,
472472 double abstol , double intol , void * ex , int type , int trace ,
473473 int * fncount , int * grcount , int maxit )
474474{
475- Rboolean accpoint ;
475+ bool accpoint ;
476476 double * c , * g , * t ;
477477 int count , cycle , cyclimit ;
478478 double f ;
@@ -484,7 +484,7 @@ void cgmin(int n, double *Bvec, double *X, double *Fmin,
484484 if (maxit <= 0 ) {
485485 * Fmin = fminfn (n , Bvec , ex );
486486 * fncount = * grcount = 0 ;
487- * fail = FALSE ;
487+ * fail = false ;
488488 return ;
489489 }
490490 if (trace ) {
@@ -578,7 +578,7 @@ void cgmin(int n, double *Bvec, double *X, double *Fmin,
578578 }
579579 steplength = oldstep ;
580580
581- accpoint = FALSE ;
581+ accpoint = false ;
582582 do {
583583 count = 0 ;
584584 for (i = 0 ; i < n ; i ++ ) {
0 commit comments