Skip to content

Commit

Permalink
More quiet warnings...
Browse files Browse the repository at this point in the history
  • Loading branch information
johnoel committed Feb 14, 2024
1 parent 3216dba commit 556ef4f
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 32 deletions.
6 changes: 3 additions & 3 deletions src/df1b2-separable/df1b2lp6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,9 @@ dvector laplace_approximation_calculator::banded_calculations
}
if (initial_df1b2params::separable_flag)
{
dvector scale(1,(int)nvar); // need to get scale from somewhere
/*int check=*/initial_params::stddev_scale(scale,x);
dvector sscale=scale(1,Dux(1).indexmax());
dvector local_scale(1,(int)nvar); // need to get scale from somewhere
/*int check=*/initial_params::stddev_scale(local_scale,x);
dvector sscale=local_scale(1,Dux(1).indexmax());
for (i=1;i<=usize;i++)
{
Dux(i)=elem_prod(Dux(i),sscale);
Expand Down
20 changes: 10 additions & 10 deletions src/linad99/conjprod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ void fmmc::fmin(const double& fret, const dvector& _p, const dvector& _gg)
}

{
for (int j=1;j<=n;j++)
for (int local_j=1;local_j<=n;local_j++)
{
g[j] = -xi[j];
xi[j]=h[j]=g[j];
g[local_j] = -xi[local_j];
xi[local_j]=h[local_j]=g[local_j];
}
}

Expand Down Expand Up @@ -453,11 +453,11 @@ void fmmc::fmin(const double& fret, const dvector& _p, const dvector& _gg)

this->dgg=this->gg=0.0;
{
for (int j=1;j<=n;j++)
for (int local_j=1;local_j<=n;local_j++)
{
this->gg += g[j]*g[j];
/* dgg += xi[j]*xi[j]; */
this->dgg += (xi[j]+g[j])*xi[j];
this->gg += g[local_j]*g[local_j];
/* dgg += xi[local_j]*xi[local_j]; */
this->dgg += (xi[local_j]+g[local_j])*xi[local_j];
}
}
if (this->gg == 0.0)
Expand All @@ -467,10 +467,10 @@ void fmmc::fmin(const double& fret, const dvector& _p, const dvector& _gg)
}
this->gam=this->dgg/this->gg;
{
for (int j=1;j<=n;j++)
for (int local_j=1;local_j<=n;local_j++)
{
g[j] = -xi[j]; // g seems to hold the negative gradient
xi[j]=h[j]=g[j]+this->gam*h[j];
g[local_j] = -xi[local_j]; // g seems to hold the negative gradient
xi[local_j]=h[local_j]=g[local_j]+this->gam*h[local_j];
}
}
// if (this->iter <= ITMAX) goto label1000;
Expand Down
10 changes: 5 additions & 5 deletions src/linad99/df13fun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -965,15 +965,15 @@ df1_three_matrix choleski_decomp(const df1_three_matrix& MM)
* Description not yet available.
* \param
*/
dvariable& dvariable::operator = (const df1_three_variable& v)
dvariable& dvariable::operator = (const df1_three_variable& _v)
{
const prevariable * px=df1_three_variable::ind_var[0];
const prevariable * py=df1_three_variable::ind_var[1];
const prevariable * pz=df1_three_variable::ind_var[2];
double dfx= *v.get_u_x();
double dfy= *v.get_u_y();
double dfz= *v.get_u_z();
value(*this)=*v.get_u();
double dfx = *_v.get_u_x();
double dfy = *_v.get_u_y();
double dfz = *_v.get_u_z();
value(*this) = *_v.get_u();

gradient_structure::GRAD_STACK1->set_gradient_stack(default_evaluation3ind,
&(value(*this)),&(value(*px)),dfx,&(value(*py)),dfy,&(value(*pz)),
Expand Down
4 changes: 2 additions & 2 deletions src/nh99/lmnewton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ void function_minimizer::limited_memory_quasi_newton(

void function_minimizer::limited_memory_quasi_newton
(double& f, const independent_variables& _x, int m, int noprintx,
int maxfn, double crit)
int _maxfn, double crit)
{
independent_variables& x = (independent_variables&) _x;
if (m<=0)
Expand Down Expand Up @@ -353,7 +353,7 @@ void function_minimizer::limited_memory_quasi_newton
goto L50;
}
++icall;
if (icall > maxfn)
if (icall > _maxfn)
{
goto L50;
}
Expand Down
8 changes: 4 additions & 4 deletions src/nh99/nuts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,9 @@ void function_minimizer::nuts_mcmc_routine(int nmcmc,int iseed0, [[maybe_unused]
independent_variables _parsaveprime(1,nvar);

// These are used inside NUTS by reference
int _nalphaprime, _nprime, _nfevals;
double _alphaprime;
bool _sprime, _divergent;
int _nalphaprime = 0;
double _alphaprime = 0.0;
bool _sprime;
int ndivergent=0; // # divergences post-warmup
int nsamples=0; // total samples, not always nmcmc if duration option used
// Declare some local variables used below.
Expand Down Expand Up @@ -591,7 +591,7 @@ void function_minimizer::nuts_mcmc_routine(int nmcmc,int iseed0, [[maybe_unused]
epsvec(1)=eps; epsbar(1)=eps; Hbar(1)=0;
}
// Generate single NUTS trajectory by repeatedly doubling build_tree
_nprime=0; _divergent=0; _nfevals=0;
int _nprime=0; bool _divergent=0; int _nfevals=0;
n=1; s=1; j=0;
// Reset global ones to initial point of this trajectory
thetaminus_end=theta; thetaplus_end=theta; thetaprime=theta;
Expand Down
16 changes: 8 additions & 8 deletions src/nh99/randeff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,23 @@ dvariable function_minimizer::random_effects_maximization(const dvar_vector& _x)
}
gradient_structure::set_YES_DERIVATIVES();
// set convergence criterion for this phase
dvector convergence_criteria;
if (!(!convergence_criteria))
dvector local_convergence_criteria;
if (!(!local_convergence_criteria))
{
int ind=min(convergence_criteria.indexmax(),
int ind=min(local_convergence_criteria.indexmax(),
initial_params::current_phase);
crit=convergence_criteria(ind);
crit=local_convergence_criteria(ind);
}
if (!ISZERO(_crit))
{
crit = _crit;
}
dvector maximum_function_evaluations;
if (!(!maximum_function_evaluations) && !maxfn_option)
dvector local_maximum_function_evaluations;
if (!(!local_maximum_function_evaluations) && !maxfn_option)
{
int ind=min(maximum_function_evaluations.indexmax(),
int ind=min(local_maximum_function_evaluations.indexmax(),
initial_params::current_phase);
maxfn= (int) maximum_function_evaluations(ind);
maxfn= (int) local_maximum_function_evaluations(ind);
}
dvariable vf=0.0;

Expand Down

0 comments on commit 556ef4f

Please sign in to comment.