Previously, the working arrays were initialized only during IpOpt setup (i.e. when run_optimizer is called). However they might be needed without the call to run_optimizer, e.g. when plot_results is called on the initial pcof0 vector. Hence, initializing them inside the params constructor ensures that they are always availble.
Note: This pull request changes the interface for constructing the params struct (::objparams): the constructor needs to know the length of the pcof vector, hence 'nCoeff' should be passed to the constructor.
Previously, the working arrays were initialized only during IpOpt setup (i.e. when run_optimizer is called). However they might be needed without the call to run_optimizer, e.g. when plot_results is called on the initial pcof0 vector. Hence, initializing them inside the params constructor ensures that they are always availble.
Note: This pull request changes the interface for constructing the params struct (::objparams): the constructor needs to know the length of the pcof vector, hence 'nCoeff' should be passed to the constructor.