Skip to content

Commit

Permalink
240501.112439.HKT C: make prima_get_rc_string, `prima_check_problem…
Browse files Browse the repository at this point in the history
…` and `prima_init_result` static; the first handles libprima#188
  • Loading branch information
zaikunzhang committed May 1, 2024
1 parent 635c675 commit e3e414c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
5 changes: 0 additions & 5 deletions c/include/prima/prima.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ typedef enum {
} prima_rc_t;


// Function to get the message string corresponding to a return code
PRIMAC_API
const char *prima_get_rc_string(const prima_rc_t rc);


/*
* Objective function required by UOBYQA, NEWUOA, BOBYQA, and LINCOA
* x : on input, the vector of variables (should not be modified)
Expand Down
6 changes: 0 additions & 6 deletions c/include/prima/prima_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@

#include "prima/prima.h"

// Function to check whether the problem matches the algorithm
prima_rc_t prima_check_problem(const prima_problem_t problem, const prima_algorithm_t algorithm);

// Function to initialize the result
prima_rc_t prima_init_result(prima_result_t *const result, const prima_problem_t problem);

// Functions implemented in Fortran (*_c.f90)
int cobyla_c(const int m_nlcon, const prima_objcon_t calcfc, const void *data, const int n, double x[], double *const f, double *const cstrv, double nlconstr[],
const int m_ineq, const double Aineq[], const double bineq[],
Expand Down
6 changes: 3 additions & 3 deletions c/prima.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ prima_rc_t prima_init_options(prima_options_t *const options)


// Function to check whether the problem matches the algorithm
prima_rc_t prima_check_problem(const prima_problem_t problem, const prima_algorithm_t algorithm)
static prima_rc_t prima_check_problem(const prima_problem_t problem, const prima_algorithm_t algorithm)
{
if (!problem.x0)
return PRIMA_NULL_X0;
Expand All @@ -76,7 +76,7 @@ prima_rc_t prima_check_problem(const prima_problem_t problem, const prima_algori


// Function to get the string corresponding to the return code
const char *prima_get_rc_string(const prima_rc_t rc)
static const char *prima_get_rc_string(const prima_rc_t rc)
{
switch (rc) {
case PRIMA_SMALL_TR_RADIUS:
Expand Down Expand Up @@ -130,7 +130,7 @@ const char *prima_get_rc_string(const prima_rc_t rc)


// Function to initialize the result
prima_rc_t prima_init_result(prima_result_t *const result, const prima_problem_t problem)
static prima_rc_t prima_init_result(prima_result_t *const result, const prima_problem_t problem)
{
if (!result)
return PRIMA_NULL_RESULT;
Expand Down

0 comments on commit e3e414c

Please sign in to comment.