Closed amontoison closed 6 months ago
@zaikunzhang I checked all routines, except this one because it's a callback:
typedef void (*prima_callback_t)(const int n, const double x[], const double f, int nf, int tr, const double cstrv, int m_nlcon, const double nlconstr[], bool *terminate);
I think that we can add
const
for all arguments. What do you think?
Thank you @amontoison . Yes, I think so.
Hi @amontoison ,
I hope you are safely home.
Could you add const in the following?
I think that we can add const for all arguments. What do you think? Thank you @amontoison . Yes, I think so.
The build fails. See https://github.com/amontoison/prima/actions/runs/8169119061 Could you have a look?
Thank you.
Zaikun
Hi @zaikunzhang! Yes, I came home safely, thanks!
I updated the PR, let's see if all tests passed now. :crossed_fingers: For the other modifications that we talked about, i.e. update the signature of
int prima_minimize(const prima_algorithm_t algorithm, prima_problem_t *problem, prima_options_t *options, prima_result_t *const result)
into
int prima_minimize(const prima_algorithm_t algorithm, prima_problem_t problem, prima_options_t options, prima_result_t *const result)
we also need to update these two routines because they are called in prima_minimize
:
int prima_check_problem(prima_problem_t *const problem, prima_options_t *const options, const int use_constr, const prima_algorithm_t algorithm)
int prima_init_result(prima_result_t *const result, prima_problem_t *const problem)
Is it fine to also update these two functions? If yes, I will open another PR.
Hi @amontoison ,
Yes, I came home safely, thanks!
Super !
I updated the PR, let's see if all tests passed now. 🤞
Excellent! Everything has passed. I will check the code, but I do not think there will be much to change since we talked about it and agreed.
Is it fine to also update these two functions? If yes, I will open another PR.
I agree. Yes, please.
Merci beaucoup !
A+, Zaikun
@zaikunzhang I checked all routines, except this one because it's a callback:
I think that we can add
const
for all arguments. What do you think?