Skip to content

Commit

Permalink
Fix runtime error from set_multinomial_weights.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnoel committed Sep 27, 2023
1 parent 464cfa4 commit ce9f4c8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ binomial_w2:
ifeq ($(CMDSHELL),cmd)
pushd admb-re\\weights && $(ADMB_HOME)\\admb $(OPTIONS) $@ && $(PROG) $@ $(ADMB_RUN_ARGS) && popd
else
-cd admb-re/weights && $(ADMB_HOME)/admb$(EXT) $(OPTIONS) $@ && $(PROG) ./$@ $(ADMB_RUN_ARGS)
cd admb-re/weights && $(ADMB_HOME)/admb$(EXT) $(OPTIONS) $@ && $(PROG) ./$@ $(ADMB_RUN_ARGS)
endif

autodif: bigmin hemholtz io_examp newt
Expand Down
2 changes: 1 addition & 1 deletion src/df1b2-separable/f1b2fnl2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void laplace_approximation_calculator::do_separable_stuff(void)
switch(hesstype)
{
case 2:
++separable_calls_counter;
if (!pmin->multinomial_weights) ++separable_calls_counter;
if (saddlepointflag==2)
{
do_separable_stuff_x_u_block_diagonal(ff);
Expand Down
6 changes: 3 additions & 3 deletions src/nh99/xmodelm3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ void tracing_message(int traceflag,const char *s);
}
void function_minimizer::set_multinomial_weights(dvector& d)
{
multinomial_weights=new dvector(d);
multinomial_weights = new dvector(d);
}

function_minimizer::function_minimizer(long int sz):
Expand All @@ -557,7 +557,7 @@ function_minimizer::function_minimizer(long int sz):
ffbest(0)
{
lapprox=0;
multinomial_weights=0;
multinomial_weights = nullptr;
//cout << lapprox << endl;
maxfn = 1000;
iprint = 1;
Expand Down Expand Up @@ -635,7 +635,7 @@ function_minimizer::~function_minimizer()
if (multinomial_weights)
{
delete multinomial_weights;
multinomial_weights = 0;
multinomial_weights = nullptr;
}
if (lapprox)
{
Expand Down

0 comments on commit ce9f4c8

Please sign in to comment.