14 static void clean_up_inner_problem();
15 static void init_inner_problem();
33 init_inner_problem(s, &p_in);
34 if (solve_DFGM(s,&p_in) == -1){
35 ERROR(
"Error in solving solveDFGM()\n");
36 clean_up_inner_problem(&p_in);
39 clean_up_inner_problem(&p_in);
49 _DEBUG(
"alpha %0.10f\n", alpha);
68 ERROR(
"Error deciding the problem case\n");
74 struct Array ds_array, pf_array;
85 real_t dual_value_new = 0.0;
97 clock_t tic, toc, tic_in, toc_in;
107 niter_inner +=
FGM(p_in);
123 real_t dual_value = dual_obj(s,prob_case);
139 if (dual_value_diff < s->opt->eps_ds){
146 if (pf < s->opt->eps_pf)
195 ERROR(
"Error deciding the problem case\n");
206 theta_new = 0.5 * (1.0 + sqrt(1.0 + 4.0*(theta*theta)));
207 beta = (theta-1.0)/theta_new;
239 ERROR(
"Error deciding the problem case\n");
275 ERROR(
"Error deciding the problem case\n");
283 niter_inner +=
FGM(p_in);
325 ERROR(
"Error deciding the problem case\n");
332 niter_inner +=
FGM(p_in);
344 dual_value_new = dual_obj(s,prob_case);
345 dual_value_diff =
abs_2(dual_value_new - dual_value);
346 dual_value = dual_value_new;
378 ERROR(
"Error deciding the problem case\n");
410 ERROR(
"Error deciding the problem case\n");
415 ERROR(
"Choose algorithm 3 or 4 when running DFGM()\n");
457 ERROR(
"Choose algorithm 3 or 4 when running DFGM()\n");
468 if (last_eps_ds == 1)
520 ERROR(
"Error deciding the problem case\n");
556 static void clean_up_inner_problem(
struct Struct_FGM *s)
void vector_add(const real_t *v1, const real_t *v2, real_t *res, const uint32_t length)
void free_pointer(real_t *pointer)
void insertArray(struct Array *a, real_t element)
real_t abs_2(const real_t a)
#define _DEBUG(fmt, args...)
real_t obj(const real_t *z, const real_t *H, const real_t *c, real_t *temp)
void vector_min(const real_t *v1, const real_t *v2, real_t *res, const uint32_t length)
void initArray(struct Array *a, uint32_t initialSize)
real_t * vector_alloc(uint32_t size)
uint32_t iterations_inner_tot
int32_t DFGM(struct Struct_DFGM *s)
uint32_t flag_last_satisfied
void vector_sub(const real_t *v1, const real_t *v2, real_t *res, const uint32_t length)
uint32_t FGM(struct Struct_FGM *s)
void vector_max_with_zero(real_t *v, const uint32_t length)
uint32_t niter_feasible_pf
real_t vector_norm_2(real_t *v, const uint32_t length)
uint32_t num_exceeded_max_niter_inner
void vector_copy(const real_t *v1, real_t *v2, const uint32_t length)
void vector_scalar_mul(const real_t *v1, const real_t scalar, real_t *res, const uint32_t length)
void mtx_vec_mul(const real_t *mtx, const real_t *v, real_t *res, const uint32_t rows, const uint32_t cols)
void vector_max(const real_t *v1, const real_t *v2, real_t *res, const uint32_t length)
#define _DEBUG2(fmt, args...)
uint32_t niter_feasible_ds
void freeArray(struct Array *a)
real_t vector_mul(const real_t *v1, const real_t *v2, const uint32_t length)