From 4d5ef296c2306a668a831ee495857fe2693e46bb Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Sat, 20 Jul 2024 11:33:17 -0400 Subject: [PATCH] some const --- util/hybrj/hybrj_dogleg.H | 6 +++--- util/hybrj/hybrj_enorm.H | 6 +++--- util/hybrj/hybrj_type.H | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/util/hybrj/hybrj_dogleg.H b/util/hybrj/hybrj_dogleg.H index c8a61dd8e9..88d17c32b4 100644 --- a/util/hybrj/hybrj_dogleg.H +++ b/util/hybrj/hybrj_dogleg.H @@ -43,9 +43,9 @@ template AMREX_GPU_HOST_DEVICE AMREX_INLINE -void dogleg(amrex::Array1D& r, - amrex::Array1D& diag, - amrex::Array1D& qtb, +void dogleg(const amrex::Array1D& r, + const amrex::Array1D& diag, + const amrex::Array1D& qtb, amrex::Real delta, amrex::Array1D& x, amrex::Array1D& wa1, diff --git a/util/hybrj/hybrj_enorm.H b/util/hybrj/hybrj_enorm.H index 60cbe91467..f2f6a137f5 100644 --- a/util/hybrj/hybrj_enorm.H +++ b/util/hybrj/hybrj_enorm.H @@ -24,12 +24,12 @@ template AMREX_GPU_HOST_DEVICE AMREX_INLINE -amrex::Real enorm(const int n, amrex::Array1D& x) { +amrex::Real enorm(const int n, const amrex::Array1D& x) { // note: n <= neqs - const amrex::Real rdwarf = 3.834e-20_rt; - const amrex::Real rgiant = 1.304e19_rt; + constexpr amrex::Real rdwarf = 3.834e-20_rt; + constexpr amrex::Real rgiant = 1.304e19_rt; amrex::Real s1 = 0.0_rt; amrex::Real s2 = 0.0_rt; diff --git a/util/hybrj/hybrj_type.H b/util/hybrj/hybrj_type.H index b573ef4bb5..90dd00697b 100644 --- a/util/hybrj/hybrj_type.H +++ b/util/hybrj/hybrj_type.H @@ -16,14 +16,14 @@ using namespace amrex::literals; // maxfev is a positive integer input variable. termination // occurs when the number of calls to fcn with iflag = 1 // has reached maxfev. -const int maxfev = 1000; +constexpr int maxfev = 1000; // factor is a positive input variable used in determining the // initial step bound. this bound is set to the product of // factor and the euclidean norm of diag*x if nonzero, or else // to factor itself. in most cases factor should lie in the // interval (.1,100.). 100. is a generally recommended value. -const amrex::Real factor = 100.0_rt; +constexpr amrex::Real factor = 100.0_rt; template struct hybrj_t {