Skip to content

Commit

Permalink
Merge pull request #63 from jschueller/ftarget
Browse files Browse the repository at this point in the history
Add ftarget. Thank Julien @jschueller !
  • Loading branch information
zaikunzhang authored Sep 15, 2023
2 parents c9aa7a8 + 7f24bd5 commit b1f467b
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 40 deletions.
7 changes: 5 additions & 2 deletions c/bobyqa_c.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module bobyqa_c_mod
contains


subroutine bobyqa_c(cobj_ptr, n, x, f, xl, xu, nf, rhobeg, rhoend, maxfun, iprint, info) bind(C)
subroutine bobyqa_c(cobj_ptr, n, x, f, xl, xu, nf, rhobeg, rhoend, ftarget, maxfun, iprint, info) bind(C)
use, intrinsic :: iso_c_binding, only : C_DOUBLE, C_INT, C_FUNPTR
use, non_intrinsic :: cintrf_mod, only : COBJ
use, non_intrinsic :: consts_mod, only : RP, IK
Expand All @@ -34,6 +34,7 @@ subroutine bobyqa_c(cobj_ptr, n, x, f, xl, xu, nf, rhobeg, rhoend, maxfun, iprin
integer(C_INT), intent(out) :: nf
real(C_DOUBLE), intent(in), value :: rhobeg
real(C_DOUBLE), intent(in), value :: rhoend
real(C_DOUBLE), intent(in), value :: ftarget
integer(C_INT), intent(in), value :: maxfun
integer(C_INT), intent(in), value :: iprint
integer(C_INT), intent(out) :: info
Expand All @@ -46,6 +47,7 @@ subroutine bobyqa_c(cobj_ptr, n, x, f, xl, xu, nf, rhobeg, rhoend, maxfun, iprin
real(RP) :: f_loc
real(RP) :: rhobeg_loc
real(RP) :: rhoend_loc
real(RP) :: ftarget_loc
real(RP) :: x_loc(n)
real(RP) :: xl_loc(n)
real(RP) :: xu_loc(n)
Expand All @@ -56,12 +58,13 @@ subroutine bobyqa_c(cobj_ptr, n, x, f, xl, xu, nf, rhobeg, rhoend, maxfun, iprin
xu_loc = real(xu, kind(xu_loc))
rhobeg_loc = real(rhobeg, kind(rhobeg))
rhoend_loc = real(rhoend, kind(rhoend))
ftarget_loc = real(ftarget, kind(ftarget))
maxfun_loc = int(maxfun, kind(maxfun_loc))
iprint_loc = int(iprint, kind(iprint_loc))

! Call the Fortran code
call bobyqa(calfun, x_loc, f_loc, xl=xl_loc, xu=xu_loc, nf=nf_loc, rhobeg=rhobeg_loc, rhoend=rhoend_loc, &
& maxfun=maxfun_loc, iprint=iprint_loc, info=info_loc)
& ftarget=ftarget_loc, maxfun=maxfun_loc, iprint=iprint_loc, info=info_loc)

! Write the outputs
x = real(x_loc, kind(x))
Expand Down
8 changes: 6 additions & 2 deletions c/cobyla_c.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module cobyla_c_mod


subroutine cobyla_c(m_nlcon, cobjcon_ptr, n, x, f, cstrv, nlconstr, m_ineq, Aineq, bineq, m_eq, Aeq, beq, xl, xu, &
& nf, rhobeg, rhoend, maxfun, iprint, info) bind(C)
& nf, rhobeg, rhoend, ftarget, maxfun, iprint, info) bind(C)
use, intrinsic :: iso_c_binding, only : C_DOUBLE, C_INT, C_FUNPTR
use, non_intrinsic :: cintrf_mod, only : COBJCON
use, non_intrinsic :: consts_mod, only : RP, IK
Expand Down Expand Up @@ -43,6 +43,7 @@ subroutine cobyla_c(m_nlcon, cobjcon_ptr, n, x, f, cstrv, nlconstr, m_ineq, Aine
integer(C_INT), intent(out) :: nf
real(C_DOUBLE), intent(in), value :: rhobeg
real(C_DOUBLE), intent(in), value :: rhoend
real(C_DOUBLE), intent(in), value :: ftarget
integer(C_INT), intent(in), value :: maxfun
integer(C_INT), intent(in), value :: iprint
integer(C_INT), intent(out) :: info
Expand All @@ -62,6 +63,7 @@ subroutine cobyla_c(m_nlcon, cobjcon_ptr, n, x, f, cstrv, nlconstr, m_ineq, Aine
real(RP) :: f_loc
real(RP) :: rhobeg_loc
real(RP) :: rhoend_loc
real(RP) :: ftarget_loc
real(RP) :: x_loc(n)
real(RP) :: xl_loc(n)
real(RP) :: xu_loc(n)
Expand All @@ -78,6 +80,7 @@ subroutine cobyla_c(m_nlcon, cobjcon_ptr, n, x, f, cstrv, nlconstr, m_ineq, Aine
xu_loc = real(xu, kind(xu_loc))
rhobeg_loc = real(rhobeg, kind(rhobeg))
rhoend_loc = real(rhoend, kind(rhoend))
ftarget_loc = real(ftarget, kind(ftarget))
maxfun_loc = int(maxfun, kind(maxfun_loc))
iprint_loc = int(iprint, kind(iprint_loc))
m_nlcon_loc = int(m_nlcon, kind(m_nlcon_loc))
Expand All @@ -86,7 +89,8 @@ subroutine cobyla_c(m_nlcon, cobjcon_ptr, n, x, f, cstrv, nlconstr, m_ineq, Aine
call cobyla(calcfc, m_nlcon_loc, x_loc, f_loc, cstrv=cstrv_loc, nlconstr=nlconstr_loc, &
& Aineq=Aineq_loc, bineq=bineq_loc, Aeq=Aeq_loc, beq=beq_loc, &
& xl=xl_loc, xu=xu_loc, nf=nf_loc, &
& rhobeg=rhobeg_loc, rhoend=rhoend_loc, maxfun=maxfun_loc, iprint=iprint_loc, info=info_loc)
& rhobeg=rhobeg_loc, rhoend=rhoend_loc, ftarget=ftarget_loc, maxfun=maxfun_loc, &
& iprint=iprint_loc, info=info_loc)

! Write the outputs
x = real(x_loc, kind(x))
Expand Down
3 changes: 2 additions & 1 deletion c/examples/bobyqa/bobyqa_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ int main(int argc, char * argv[])
double xu[2] = {6.0, 6.0};
const double rhobeg = 1.0;
const double rhoend = 1e-3;
const double ftarget = -INFINITY;
const int iprint = PRIMA_MSG_EXIT;
const int maxfun = 1000;
int nf = 0;
const int rc = prima_bobyqa(&fun, n, x, &f, xl, xu, &nf, rhobeg, rhoend, maxfun, iprint);
const int rc = prima_bobyqa(&fun, n, x, &f, xl, xu, &nf, rhobeg, rhoend, ftarget, maxfun, iprint);
const char *msg = prima_get_rc_string(rc);
printf("x*={%g, %g} rc=%d msg='%s' evals=%d\n", x[0], x[1], rc, msg, nf);
return (fabs(x[0]-3)>2e-2 || fabs(x[1]-2)>2e-2);
Expand Down
3 changes: 2 additions & 1 deletion c/examples/cobyla/cobyla_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ int main(int argc, char * argv[])
double xu[2] = {6.0, 6.0};
const double rhobeg = 1.0;
const double rhoend = 1e-3;
const double ftarget = -INFINITY;
const int iprint = PRIMA_MSG_EXIT;
const int maxfun = 1000;
int nf = 0;
const int rc = prima_cobyla(m_nlcon, &fun, n, x, &f, &cstrv, nlconstr, m_ineq, Aineq, bineq, m_eq, Aeq, beq, xl, xu, &nf, rhobeg, rhoend, maxfun, iprint);
const int rc = prima_cobyla(m_nlcon, &fun, n, x, &f, &cstrv, nlconstr, m_ineq, Aineq, bineq, m_eq, Aeq, beq, xl, xu, &nf, rhobeg, rhoend, ftarget, maxfun, iprint);
const char *msg = prima_get_rc_string(rc);
printf("x*={%g, %g} f*=%g cstrv=%g nlconstr=%g rc=%d msg='%s' evals=%d\n", x[0], x[1], f, cstrv, nlconstr[0], rc, msg, nf);
return (fabs(x[0]-3)>2e-2 || fabs(x[1]-2)>2e-2);
Expand Down
3 changes: 2 additions & 1 deletion c/examples/lincoa/lincoa_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ int main(int argc, char * argv[])
double xu[2] = {6.0, 6.0};
const double rhobeg = 1.0;
const double rhoend = 1e-3;
const double ftarget = -INFINITY;
const int iprint = PRIMA_MSG_EXIT;
const int maxfun = 100000;
int nf = 0;
const int rc = prima_lincoa(&fun, n, x, &f, &cstrv, m_ineq, Aineq, bineq, m_eq, Aeq, beq, xl, xu, &nf, rhobeg, rhoend, maxfun, iprint);
const int rc = prima_lincoa(&fun, n, x, &f, &cstrv, m_ineq, Aineq, bineq, m_eq, Aeq, beq, xl, xu, &nf, rhobeg, rhoend, ftarget, maxfun, iprint);
const char *msg = prima_get_rc_string(rc);
printf("x*={%g, %g} f*=%g cstrv=%g rc=%d msg='%s' evals=%d\n", x[0], x[1], f, cstrv, rc, msg, maxfun);
return (fabs(x[0]-3)>2e-2 || fabs(x[1]-2)>2e-2);
Expand Down
3 changes: 2 additions & 1 deletion c/examples/newuoa/newuoa_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ int main(int argc, char * argv[])
double f = 0.0;
const double rhobeg = 1.0;
const double rhoend = 1e-3;
const double ftarget = -INFINITY;
const int iprint = PRIMA_MSG_EXIT;
const int maxfun = 1000;
int nf = 0;
const int rc = prima_newuoa(&fun, n, x, &f, &nf, rhobeg, rhoend, maxfun, iprint);
const int rc = prima_newuoa(&fun, n, x, &f, &nf, rhobeg, rhoend, ftarget, maxfun, iprint);
const char *msg = prima_get_rc_string(rc);
printf("x*={%g, %g} rc=%d msg='%s' evals=%d\n", x[0], x[1], rc, msg, nf);
return (fabs(x[0]-3)>2e-2 || fabs(x[1]-2)>2e-2);
Expand Down
3 changes: 2 additions & 1 deletion c/examples/uobyqa/uobyqa_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ int main(int argc, char * argv[])
double f = 0.0;
const double rhobeg = 1.0;
const double rhoend = 1e-3;
const double ftarget = -INFINITY;
const int iprint = PRIMA_MSG_EXIT;
const int maxfun = 1000;
int nf = 0;
const int rc = prima_uobyqa(&fun, n, x, &f, &nf, rhobeg, rhoend, maxfun, iprint);
const int rc = prima_uobyqa(&fun, n, x, &f, &nf, rhobeg, rhoend, ftarget, maxfun, iprint);
const char *msg = prima_get_rc_string(rc);
printf("x*={%g, %g} rc=%d msg='%s' evals=%d\n", x[0], x[1], rc, msg, nf);
return (fabs(x[0]-3)>2e-2 || fabs(x[1]-2)>2e-2);
Expand Down
12 changes: 7 additions & 5 deletions c/include/prima/prima.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ typedef void (*prima_objcon)(const double x[], double *f, double constr[]);
* nf : number of objective function calls (output)
* rhobeg : a reasonable initial change to the variables
* rhoend : required accuracy for the variables
* ftarget : target function value; optimization stops when the value <= ftarget
* can be set to -INFINITY to disable
* maxfun : maximum number of function evaluations
* iprint : verbosity level, see the prima_message enum
* m_nlcon : number of non-linear constraints (>=0)
Expand All @@ -101,31 +103,31 @@ typedef void (*prima_objcon)(const double x[], double *f, double constr[]);
PRIMAC_API
int prima_bobyqa(const prima_obj calfun, const int n, double x[n], double *f,
const double xl[n], const double xu[n],
int *nf, const double rhobeg, const double rhoend, const int maxfun, const int iprint);
int *nf, const double rhobeg, const double rhoend, const double ftarget, const int maxfun, const int iprint);

PRIMAC_API
int prima_newuoa(const prima_obj calfun, const int n, double x[n], double *f,
int *nf, const double rhobeg, const double rhoend, const int maxfun, const int iprint);
int *nf, const double rhobeg, const double rhoend, const double ftarget, const int maxfun, const int iprint);

PRIMAC_API
int prima_uobyqa(const prima_obj calfun, const int n, double x[n], double *f,
int *nf, const double rhobeg, const double rhoend, const int maxfun, const int iprint);
int *nf, const double rhobeg, const double rhoend, const double ftarget, const int maxfun, const int iprint);

PRIMAC_API
int prima_cobyla(const int m_nlcon, const prima_objcon calcfc, const int n, double x[n], double *f,
double *cstrv, double nlconstr[m_nlcon],
const int m_ineq, const double Aineq[m_ineq*n], const double bineq[m_ineq],
const int m_eq, const double Aeq[m_eq*n], const double beq[m_eq],
const double xl[n], const double xu[n],
int *nf, const double rhobeg, const double rhoend, const int maxfun, const int iprint);
int *nf, const double rhobeg, const double rhoend, const double ftarget, const int maxfun, const int iprint);

PRIMAC_API
int prima_lincoa(const prima_obj calfun, const int n, double x[n], double *f,
double *cstrv,
const int m_ineq, const double Aineq[m_ineq*n], const double bineq[m_ineq],
const int m_eq, const double Aeq[m_eq*n], const double beq[m_eq],
const double xl[n], const double xu[n],
int *nf, const double rhobeg, const double rhoend, const int maxfun, const int iprint);
int *nf, const double rhobeg, const double rhoend, const double ftarget, const int maxfun, const int iprint);

#ifdef __cplusplus
}
Expand Down
8 changes: 6 additions & 2 deletions c/lincoa_c.f90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module lincoa_c_mod


subroutine lincoa_c(cobj_ptr, n, x, f, cstrv, m_ineq, Aineq, bineq, m_eq, Aeq, beq, xl, xu, &
& nf, rhobeg, rhoend, maxfun, iprint, info) bind(C)
& nf, rhobeg, rhoend, ftarget, maxfun, iprint, info) bind(C)
use, intrinsic :: iso_c_binding, only : C_DOUBLE, C_INT, C_FUNPTR
use, non_intrinsic :: cintrf_mod, only : COBJ
use, non_intrinsic :: consts_mod, only : RP, IK
Expand Down Expand Up @@ -42,6 +42,7 @@ subroutine lincoa_c(cobj_ptr, n, x, f, cstrv, m_ineq, Aineq, bineq, m_eq, Aeq, b
integer(C_INT), intent(out) :: nf
real(C_DOUBLE), intent(in), value :: rhobeg
real(C_DOUBLE), intent(in), value :: rhoend
real(C_DOUBLE), intent(in), value :: ftarget
integer(C_INT), intent(in), value :: maxfun
integer(C_INT), intent(in), value :: iprint
integer(C_INT), intent(out) :: info
Expand All @@ -59,6 +60,7 @@ subroutine lincoa_c(cobj_ptr, n, x, f, cstrv, m_ineq, Aineq, bineq, m_eq, Aeq, b
real(RP) :: f_loc
real(RP) :: rhobeg_loc
real(RP) :: rhoend_loc
real(RP) :: ftarget_loc
real(RP) :: x_loc(n)
real(RP) :: xl_loc(n)
real(RP) :: xu_loc(n)
Expand All @@ -75,14 +77,16 @@ subroutine lincoa_c(cobj_ptr, n, x, f, cstrv, m_ineq, Aineq, bineq, m_eq, Aeq, b
xu_loc = real(xu, kind(xu_loc))
rhobeg_loc = real(rhobeg, kind(rhobeg))
rhoend_loc = real(rhoend, kind(rhoend))
ftarget_loc = real(ftarget, kind(ftarget))
maxfun_loc = int(maxfun, kind(maxfun_loc))
iprint_loc = int(iprint, kind(iprint_loc))

! Call the Fortran code
call lincoa(calfun, x_loc, f_loc, cstrv=cstrv_loc, &
& Aineq=Aineq_loc, bineq=bineq_loc, Aeq=Aeq_loc, beq=beq_loc, &
& xl=xl_loc, xu=xu_loc, nf=nf_loc, &
& rhobeg=rhobeg_loc, rhoend=rhoend_loc, maxfun=maxfun_loc, iprint=iprint_loc, info=info_loc)
& rhobeg=rhobeg_loc, rhoend=rhoend_loc, &
& ftarget=ftarget_loc, maxfun=maxfun_loc, iprint=iprint_loc, info=info_loc)

! Write the outputs
x = real(x_loc, kind(x))
Expand Down
7 changes: 5 additions & 2 deletions c/newuoa_c.f90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module newuoa_c_mod
contains


subroutine newuoa_c(cobj_ptr, n, x, f, nf, rhobeg, rhoend, maxfun, iprint, info) bind(C)
subroutine newuoa_c(cobj_ptr, n, x, f, nf, rhobeg, rhoend, ftarget, maxfun, iprint, info) bind(C)
use, intrinsic :: iso_c_binding, only : C_DOUBLE, C_INT, C_FUNPTR
use, non_intrinsic :: cintrf_mod, only : COBJ
use, non_intrinsic :: consts_mod, only : RP, IK
Expand All @@ -31,6 +31,7 @@ subroutine newuoa_c(cobj_ptr, n, x, f, nf, rhobeg, rhoend, maxfun, iprint, info)
integer(C_INT), intent(out) :: nf
real(C_DOUBLE), intent(in), value :: rhobeg
real(C_DOUBLE), intent(in), value :: rhoend
real(C_DOUBLE), intent(in), value :: ftarget
integer(C_INT), intent(in), value :: maxfun
integer(C_INT), intent(in), value :: iprint
integer(C_INT), intent(out) :: info
Expand All @@ -43,17 +44,19 @@ subroutine newuoa_c(cobj_ptr, n, x, f, nf, rhobeg, rhoend, maxfun, iprint, info)
real(RP) :: f_loc
real(RP) :: rhobeg_loc
real(RP) :: rhoend_loc
real(RP) :: ftarget_loc
real(RP) :: x_loc(n)

! Read the inputs and convert them to the Fortran side types
x_loc = real(x, kind(x_loc))
rhobeg_loc = real(rhobeg, kind(rhobeg))
rhoend_loc = real(rhoend, kind(rhoend))
ftarget_loc = real(ftarget, kind(ftarget))
maxfun_loc = int(maxfun, kind(maxfun_loc))
iprint_loc = int(iprint, kind(iprint_loc))

! Call the Fortran code
call newuoa(calfun, x_loc, f_loc, nf=nf_loc, rhobeg=rhobeg_loc, rhoend=rhoend_loc, &
call newuoa(calfun, x_loc, f_loc, nf=nf_loc, rhobeg=rhobeg_loc, rhoend=rhoend_loc, ftarget=ftarget_loc, &
& maxfun=maxfun_loc, iprint=iprint_loc, info=info_loc)

! Write the outputs
Expand Down
30 changes: 15 additions & 15 deletions c/prima.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,64 +7,64 @@ int cobyla_c(const int m_nlcon, const prima_objcon calcfc, const int n, double x
const int m_ineq, const double Aineq[m_ineq*n], const double bineq[m_ineq],
const int m_eq, const double Aeq[m_eq*n], const double beq[m_eq],
const double xl[n], const double xu[n],
int *nf, const double rhobeg, const double rhoend, const int maxfun, const int iprint, int *info);
int *nf, const double rhobeg, const double rhoend, const double ftarget, const int maxfun, const int iprint, int *info);
int bobyqa_c(prima_obj calfun, const int n, double x[n], double *f, const double xl[n], const double xu[n],
int *nf, const double rhobeg, const double rhoend, const int maxfun, const int iprint, int *info);
int *nf, const double rhobeg, const double rhoend, const double ftarget, const int maxfun, const int iprint, int *info);
int newuoa_c(prima_obj calfun, const int n, double x[n], double *f,
int *nf, const double rhobeg, const double rhoend, const int maxfun, const int iprint, int *info);
int *nf, const double rhobeg, const double rhoend, const double ftarget, const int maxfun, const int iprint, int *info);
int uobyqa_c(prima_obj calfun, const int n, double x[n], double *f,
int *nf, const double rhobeg, const double rhoend, const int maxfun, const int iprint, int *info);
int *nf, const double rhobeg, const double rhoend, const double ftarget, const int maxfun, const int iprint, int *info);
int lincoa_c(prima_obj calfun, const int n, double x[n], double *f,
double *cstrv,
const int m_ineq, const double Aineq[m_ineq*n], const double bineq[m_ineq],
const int m_eq, const double Aeq[m_eq*n], const double beq[m_eq],
const double xl[n], const double xu[n],
int *nf, const double rhobeg, const double rhoend, const int maxfun, const int iprint, int *info);
int *nf, const double rhobeg, const double rhoend, const double ftarget, const int maxfun, const int iprint, int *info);

/* these functions just call the fortran compatibility layer and return the status code */
int prima_cobyla(const int m_nlcon, const prima_objcon calcfc, const int n, double x[n], double *f, double *cstrv, double nlconstr[m_nlcon],
const int m_ineq, const double Aineq[m_ineq*n], const double bineq[m_ineq],
const int m_eq, const double Aeq[m_eq*n], const double beq[m_eq],
const double xl[n], const double xu[n],
int *nf, const double rhobeg, const double rhoend, const int maxfun, const int iprint)
int *nf, const double rhobeg, const double rhoend, const double ftarget, const int maxfun, const int iprint)
{
int info = 0;
cobyla_c(m_nlcon, calcfc, n, x, f, cstrv, nlconstr, m_ineq, Aineq, bineq, m_eq, Aeq, beq, xl, xu, nf, rhobeg, rhoend, maxfun, iprint, &info);
cobyla_c(m_nlcon, calcfc, n, x, f, cstrv, nlconstr, m_ineq, Aineq, bineq, m_eq, Aeq, beq, xl, xu, nf, rhobeg, rhoend, ftarget, maxfun, iprint, &info);
return info;
}

int prima_bobyqa(const prima_obj calfun, const int n, double x[n], double *f, const double xl[n], const double xu[n],
int *nf, const double rhobeg, const double rhoend, const int maxfun, const int iprint)
int *nf, const double rhobeg, const double rhoend, const double ftarget, const int maxfun, const int iprint)
{
int info = 0;
bobyqa_c(calfun, n, x, f, xl, xu, nf, rhobeg, rhoend, maxfun, iprint, &info);
bobyqa_c(calfun, n, x, f, xl, xu, nf, rhobeg, rhoend, ftarget, maxfun, iprint, &info);
return info;
}

int prima_newuoa(const prima_obj calfun, const int n, double x[n], double *f,
int *nf, const double rhobeg, const double rhoend, const int maxfun, const int iprint)
int *nf, const double rhobeg, const double rhoend, const double ftarget, const int maxfun, const int iprint)
{
int info = 0;
newuoa_c(calfun, n, x, f, nf, rhobeg, rhoend, maxfun, iprint, &info);
newuoa_c(calfun, n, x, f, nf, rhobeg, rhoend, ftarget, maxfun, iprint, &info);
return info;
}

int prima_uobyqa(const prima_obj calfun, const int n, double x[n], double *f,
int *nf, const double rhobeg, const double rhoend, const int maxfun, const int iprint)
int *nf, const double rhobeg, const double rhoend, const double ftarget, const int maxfun, const int iprint)
{
int info = 0;
uobyqa_c(calfun, n, x, f, nf, rhobeg, rhoend, maxfun, iprint, &info);
uobyqa_c(calfun, n, x, f, nf, rhobeg, rhoend, ftarget, maxfun, iprint, &info);
return info;
}

int prima_lincoa(const prima_obj calfun, const int n, double x[n], double *f, double *cstrv,
const int m_ineq, const double Aineq[m_ineq*n], const double bineq[m_ineq],
const int m_eq, const double Aeq[m_eq*n], const double beq[m_eq],
const double xl[n], const double xu[n],
int *nf, const double rhobeg, const double rhoend, const int maxfun, const int iprint)
int *nf, const double rhobeg, const double rhoend, const double ftarget, const int maxfun, const int iprint)
{
int info = 0;
lincoa_c(calfun, n, x, f, cstrv, m_ineq, Aineq, bineq, m_eq, Aeq, beq, xl, xu, nf, rhobeg, rhoend, maxfun, iprint, &info);
lincoa_c(calfun, n, x, f, cstrv, m_ineq, Aineq, bineq, m_eq, Aeq, beq, xl, xu, nf, rhobeg, rhoend, ftarget, maxfun, iprint, &info);
return info;
}

Expand Down
Loading

0 comments on commit b1f467b

Please sign in to comment.