Closed amontoison closed 3 months ago
@zaikunzhang Note that I removed these checks because we can't have anymore null pointers for the problem or the options.
if (!problem) return PRIMA_NULL_PROBLEM;
and
if (!options) return PRIMA_NULL_OPTIONS;
It also means that the argument
options
is not used anymore inprima_check_problem
.
Thank you @amontoison for the quick action!
I agree with what you mentioned above.
What about adding const
to problem
and options
wherever possible? For example, change
int prima_minimize(const prima_algorithm_t algorithm, prima_problem_t problem, prima_options_t options, prima_result_t *const result);
to
int prima_minimize(const prima_algorithm_t algorithm, const prima_problem_t problem, const prima_options_t options, prima_result_t *const result);
Thank you.
What about adding
const
toproblem
andoptions
wherever possible? For example, changeint prima_minimize(const prima_algorithm_t algorithm, prima_problem_t problem, prima_options_t options, prima_result_t *const result);
to
int prima_minimize(const prima_algorithm_t algorithm, const prima_problem_t problem, const prima_options_t options, prima_result_t *const result);
I forgot to add these const
. It should be fixed the last commit that I pushed :+1:
@zaikunzhang Note that I removed these checks because we can't have anymore null pointers for the problem or the options.
and
It also means that the argument
options
is not used anymore inprima_check_problem
.