Skip to content

Commit

Permalink
some const
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Jul 20, 2024
1 parent b384483 commit 4d5ef29
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions util/hybrj/hybrj_dogleg.H
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@

template<int neqs>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
void dogleg(amrex::Array1D<amrex::Real, 1, neqs * (neqs + 1) / 2>& r,
amrex::Array1D<amrex::Real, 1, neqs>& diag,
amrex::Array1D<amrex::Real, 1, neqs>& qtb,
void dogleg(const amrex::Array1D<amrex::Real, 1, neqs * (neqs + 1) / 2>& r,
const amrex::Array1D<amrex::Real, 1, neqs>& diag,
const amrex::Array1D<amrex::Real, 1, neqs>& qtb,
amrex::Real delta,
amrex::Array1D<amrex::Real, 1, neqs>& x,
amrex::Array1D<amrex::Real, 1, neqs>& wa1,
Expand Down
6 changes: 3 additions & 3 deletions util/hybrj/hybrj_enorm.H
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

template<int neqs>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
amrex::Real enorm(const int n, amrex::Array1D<amrex::Real, 1, neqs>& x) {
amrex::Real enorm(const int n, const amrex::Array1D<amrex::Real, 1, neqs>& 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;
Expand Down
4 changes: 2 additions & 2 deletions util/hybrj/hybrj_type.H
Original file line number Diff line number Diff line change
Expand Up @@ -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<int neqs>
struct hybrj_t {
Expand Down

0 comments on commit 4d5ef29

Please sign in to comment.