mpf_basis.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "qs_config.h"
#include "config.h"
#include "mpf_sortrus.h"
#include "mpf_iqsutil.h"
#include "mpf_lpdefs.h"
#include "mpf_qstruct.h"
#include "mpf_qsopt.h"
#include "mpf_basis.h"
#include "mpf_fct.h"
#include "mpf_lp.h"
#include "mpf_lib.h"

Include dependency graph for mpf_basis.c:

Go to the source code of this file.

Defines

#define mpf_BASIS_DEBUG   0
#define mpf_BASIS_STATS   0

Functions

static int mpf_choose_basis (int algorithm, mpf_t pinf1, mpf_t dinf1, mpf_t pinf2, mpf_t dinf2)
static int mpf_get_initial_basis1 (mpf_lpinfo *lp, int *vstat)
static int mpf_get_initial_basis2 (mpf_lpinfo *lp, int *vstat)
static void mpf_get_var_info (mpf_lpinfo *lp, mpf_var_data *v)
int mpf_ILLbasis_build_basisinfo (mpf_lpinfo *lp)
void mpf_ILLbasis_clear_vardata (mpf_var_data *vd)
void mpf_ILLbasis_column_solve (mpf_lpinfo *lp, mpf_svector *rhs, mpf_svector *soln)
void mpf_ILLbasis_column_solve_update (mpf_lpinfo *lp, mpf_svector *rhs, mpf_svector *upd, mpf_svector *soln)
int mpf_ILLbasis_factor (mpf_lpinfo *lp, int *singular)
void mpf_ILLbasis_free_basisinfo (mpf_lpinfo *lp)
int mpf_ILLbasis_get_cinitial (mpf_lpinfo *lp, int algorithm)
int mpf_ILLbasis_get_initial (mpf_lpinfo *lp, int algorithm)
void mpf_ILLbasis_init_basisinfo (mpf_lpinfo *lp)
void mpf_ILLbasis_init_vardata (mpf_var_data *vd)
int mpf_ILLbasis_load (mpf_lpinfo *lp, mpf_ILLlp_basis *B)
int mpf_ILLbasis_refactor (mpf_lpinfo *lp)
void mpf_ILLbasis_row_solve (mpf_lpinfo *lp, mpf_svector *rhs, mpf_svector *soln)
int mpf_ILLbasis_tableau_row (mpf_lpinfo *lp, int row, mpf_t *brow, mpf_t *trow, mpf_t *rhs, int strict)
int mpf_ILLbasis_update (mpf_lpinfo *lp, mpf_svector *y, int lindex, int *refactor, int *singular)
static int mpf_init_slack_basis (mpf_lpinfo *lp, int *vstat, int *irow, int *rrow, int *unitcol, int *icol, int *rcol)
static int mpf_primal_col_select (mpf_lpinfo *lp, int *vstat, int *irow, int *rrow, int *unitcol, mpf_t *v, int *perm, int *porder, int nbelem, int pcols)
static int mpf_set_basis_indices (mpf_lpinfo *lp, int *vstat)

Variables

static int TRACE = 0


Define Documentation

#define mpf_BASIS_DEBUG   0

Definition at line 47 of file mpf_basis.c.

#define mpf_BASIS_STATS   0

Definition at line 45 of file mpf_basis.c.


Function Documentation

static int mpf_choose_basis ( int  algorithm,
mpf_t  pinf1,
mpf_t  dinf1,
mpf_t  pinf2,
mpf_t  dinf2 
)

Definition at line 1155 of file mpf_basis.c.

References ILL_IFTRACE, mpf_CB_EPS, mpf_CB_INF_RATIO, mpf_CB_PRI_RLIMIT, and PRIMAL_SIMPLEX.

Referenced by mpf_ILLbasis_get_cinitial().

static int mpf_get_initial_basis1 ( mpf_lpinfo lp,
int *  vstat 
)

Definition at line 636 of file mpf_basis.c.

References mpf_var_data::cmax, mpf_lpinfo::cz, E_SIMPLEX_ERROR, ILL_CLEANUP, ILL_SAFE_MALLOC, mpf_lpinfo::lz, mpf_get_var_info(), mpf_ILLbasis_init_vardata(), mpf_INFTY, mpf_init_slack_basis(), mpf_var_data::nbndone, mpf_var_data::nbounded, mpf_lpinfo::ncols, mpf_var_data::nfree, mpf_lpinfo::nrows, mpf_var_data::nslacks, NULL, STAT_BASIC, mpf_lpinfo::uz, VBOUNDED, VFIXED, VFREE, VLOWER, mpf_lpinfo::vtype, and VUPPER.

Referenced by mpf_ILLbasis_get_cinitial(), and mpf_ILLbasis_get_initial().

Here is the call graph for this function:

static int mpf_get_initial_basis2 ( mpf_lpinfo lp,
int *  vstat 
)

Definition at line 798 of file mpf_basis.c.

References mpf_var_data::cmax, mpf_lpinfo::cz, E_SIMPLEX_ERROR, ILL_CLEANUP, ILL_IFFREE, ILL_SAFE_MALLOC, ILLutil_int_perm_quicksort(), mpf_lpinfo::lz, mpf_lpinfo::matcnt, mpf_BD_TOLER, mpf_get_var_info(), mpf_ILLbasis_clear_vardata(), mpf_ILLbasis_free_basisinfo(), mpf_ILLbasis_init_vardata(), mpf_ILLutil_EGlpNum_perm_quicksort(), mpf_INFTY, mpf_init_slack_basis(), mpf_primal_col_select(), mpf_var_data::nbndone, mpf_lpinfo::ncols, mpf_var_data::nfree, mpf_lpinfo::nrows, mpf_var_data::nslacks, NULL, mpf_lpinfo::rowbeg, mpf_lpinfo::rowcnt, mpf_lpinfo::rowind, mpf_lpinfo::rowval, STAT_BASIC, mpf_lpinfo::uz, VBOUNDED, VFIXED, VFREE, VLOWER, mpf_lpinfo::vtype, and VUPPER.

Referenced by mpf_ILLbasis_get_cinitial(), and mpf_ILLbasis_get_initial().

Here is the call graph for this function:

static void mpf_get_var_info ( mpf_lpinfo lp,
mpf_var_data v 
) [static]

Definition at line 405 of file mpf_basis.c.

References CLASS_LOGICAL, mpf_var_data::cmax, mpf_lpinfo::cz, mpf_NINFTY, mpf_var_data::nartif, mpf_var_data::nbndone, mpf_var_data::nbounded, mpf_lpinfo::ncols, mpf_var_data::nfixed, mpf_var_data::nfree, mpf_var_data::nslacks, VARTIFICIAL, VBOUNDED, mpf_lpinfo::vclass, VFIXED, VFREE, VLOWER, mpf_lpinfo::vtype, and VUPPER.

Referenced by mpf_get_initial_basis1(), and mpf_get_initial_basis2().

int mpf_ILLbasis_build_basisinfo ( mpf_lpinfo lp  ) 

Definition at line 123 of file mpf_basis.c.

References mpf_lpinfo::baz, mpf_lpinfo::fbasisid, ILL_SAFE_MALLOC, mpf_ILLbasis_free_basisinfo(), mpf_lpinfo::nbaz, mpf_ILLlpdata::ncols, mpf_ILLlpdata::nrows, mpf_lpinfo::O, mpf_lpinfo::vindex, and mpf_lpinfo::vstat.

Here is the call graph for this function:

void mpf_ILLbasis_clear_vardata ( mpf_var_data vd  ) 

Definition at line 56 of file mpf_basis.c.

References mpf_var_data::cmax.

Referenced by mpf_get_initial_basis2().

void mpf_ILLbasis_column_solve ( mpf_lpinfo lp,
mpf_svector rhs,
mpf_svector soln 
)

Definition at line 1445 of file mpf_basis.c.

References mpf_lpinfo::f, and mpf_ILLfactor_ftran().

Here is the call graph for this function:

void mpf_ILLbasis_column_solve_update ( mpf_lpinfo lp,
mpf_svector rhs,
mpf_svector upd,
mpf_svector soln 
)

Definition at line 1453 of file mpf_basis.c.

References mpf_lpinfo::f, and mpf_ILLfactor_ftran_update().

Here is the call graph for this function:

int mpf_ILLbasis_factor ( mpf_lpinfo lp,
int *  singular 
)

Definition at line 1352 of file mpf_basis.c.

References __QS_SB_VERB, mpf_lpinfo::basisid, mpf_lpinfo::baz, mpf_lpinfo::f, mpf_lpinfo::fbasisid, mpf_factor_work::fzero_tol, ILL_IFFREE, ILL_SAFE_MALLOC, mpf_lpinfo::matbeg, mpf_lpinfo::matcnt, mpf_lpinfo::matind, mpf_lpinfo::matval, mpf_factor_work::maxelem_cur, mpf_factor_work::maxelem_factor, mpf_factor_work::maxelem_orig, mpf_ILLfactor(), mpf_ILLfactor_create_factor_work(), mpf_ILLfactor_free_factor_work(), mpf_ILLfactor_init_factor_work(), mpf_ILLfct_update_basis_info(), mpf_ILLlpdata::nrows, mpf_lpinfo::O, mpf_factor_work::partial_cur, mpf_factor_work::partial_tol, mpf_ILLlpdata::rowmap, STAT_LOWER, STAT_UPPER, STAT_ZERO, mpf_factor_work::szero_tol, VARTIFICIAL, VBOUNDED, mpf_lpinfo::vindex, VLOWER, mpf_lpinfo::vtype, and VUPPER.

Here is the call graph for this function:

void mpf_ILLbasis_free_basisinfo ( mpf_lpinfo lp  ) 

Definition at line 101 of file mpf_basis.c.

References mpf_lpinfo::baz, mpf_lpinfo::f, mpf_factor_work::fzero_tol, ILL_IFFREE, mpf_factor_work::maxelem_cur, mpf_factor_work::maxelem_factor, mpf_factor_work::maxelem_orig, mpf_ILLfactor_free_factor_work(), mpf_lpinfo::nbaz, mpf_factor_work::partial_cur, mpf_factor_work::partial_tol, mpf_factor_work::szero_tol, mpf_lpinfo::vindex, and mpf_lpinfo::vstat.

Here is the call graph for this function:

int mpf_ILLbasis_get_cinitial ( mpf_lpinfo lp,
int  algorithm 
)

Definition at line 1213 of file mpf_basis.c.

References __QS_SB_VERB, mpf_lpinfo::basisid, mpf_lpinfo::baz, mpf_tol_struct::dfeas_tol, mpf_lpinfo::dinfeas, E_SIMPLEX_ERROR, mpf_lpinfo::fbasisid, ILL_CLEANUP, ILL_IFFREE, ILL_SAFE_MALLOC, mpf_lpinfo::matcnt, mpf_choose_basis(), mpf_get_initial_basis1(), mpf_get_initial_basis2(), mpf_ILLbasis_build_basisinfo(), mpf_ILLbasis_factor(), mpf_ILLbasis_free_basisinfo(), mpf_ILLbasis_init_basisinfo(), mpf_ILLfct_check_dfeasible(), mpf_ILLfct_check_pfeasible(), mpf_ILLfct_compute_dz(), mpf_ILLfct_compute_piz(), mpf_ILLfct_compute_xbz(), mpf_ILLfct_dual_adjust(), mpf_ILLwrite_lp_file(), mpf_set_basis_indices(), mpf_lpinfo::ncols, mpf_lpinfo::nrows, NULL, mpf_lpinfo::O, mpf_tol_struct::pfeas_tol, mpf_lpinfo::pinfeas, PRIMAL_SIMPLEX, mpf_lpinfo::tol, and mpf_feas_info::totinfeas.

Here is the call graph for this function:

int mpf_ILLbasis_get_initial ( mpf_lpinfo lp,
int  algorithm 
)

Definition at line 1105 of file mpf_basis.c.

References mpf_lpinfo::basisid, E_SIMPLEX_ERROR, ILL_IFFREE, ILL_SAFE_MALLOC, mpf_get_initial_basis1(), mpf_get_initial_basis2(), mpf_ILLbasis_build_basisinfo(), mpf_ILLbasis_free_basisinfo(), mpf_ILLbasis_init_basisinfo(), mpf_ILLwrite_lp_file(), mpf_set_basis_indices(), mpf_lpinfo::ncols, NULL, mpf_lpinfo::O, and PRIMAL_SIMPLEX.

Here is the call graph for this function:

void mpf_ILLbasis_init_basisinfo ( mpf_lpinfo lp  ) 

Definition at line 91 of file mpf_basis.c.

References mpf_lpinfo::baz, mpf_lpinfo::f, mpf_lpinfo::nbaz, mpf_lpinfo::vindex, and mpf_lpinfo::vstat.

Referenced by mpf_ILLbasis_get_cinitial(), mpf_ILLbasis_get_initial(), mpf_ILLbasis_load(), and mpf_ILLsimplex_init_lpinfo().

void mpf_ILLbasis_init_vardata ( mpf_var_data vd  ) 

Definition at line 49 of file mpf_basis.c.

References mpf_var_data::cmax.

Referenced by mpf_get_initial_basis1(), and mpf_get_initial_basis2().

int mpf_ILLbasis_load ( mpf_lpinfo lp,
mpf_ILLlp_basis B 
)

Definition at line 141 of file mpf_basis.c.

References mpf_lpinfo::basisid, mpf_lpinfo::baz, mpf_ILLlp_basis::cstat, mpf_lpinfo::fbasisid, mpf_ILLbasis_build_basisinfo(), mpf_ILLbasis_free_basisinfo(), mpf_ILLbasis_init_basisinfo(), mpf_lpinfo::nbaz, mpf_ILLlpdata::ncols, mpf_ILLlpdata::nrows, mpf_ILLlpdata::nstruct, mpf_lpinfo::O, QS_COL_BSTAT_BASIC, QS_COL_BSTAT_FREE, QS_COL_BSTAT_LOWER, QS_COL_BSTAT_UPPER, QS_ROW_BSTAT_BASIC, QS_ROW_BSTAT_LOWER, QS_ROW_BSTAT_UPPER, mpf_ILLlpdata::rowmap, mpf_ILLlp_basis::rstat, mpf_ILLlpdata::sense, STAT_BASIC, STAT_LOWER, STAT_UPPER, STAT_ZERO, mpf_ILLlpdata::structmap, mpf_lpinfo::vindex, and mpf_lpinfo::vstat.

Here is the call graph for this function:

int mpf_ILLbasis_refactor ( mpf_lpinfo lp  ) 

Definition at line 1429 of file mpf_basis.c.

References __QS_SB_VERB, mpf_ILLbasis_factor(), and QS_LP_CHANGE_PREC.

Here is the call graph for this function:

void mpf_ILLbasis_row_solve ( mpf_lpinfo lp,
mpf_svector rhs,
mpf_svector soln 
)

Definition at line 1462 of file mpf_basis.c.

References mpf_lpinfo::f, and mpf_ILLfactor_btran().

Here is the call graph for this function:

int mpf_ILLbasis_tableau_row ( mpf_lpinfo lp,
int  row,
mpf_t *  brow,
mpf_t *  trow,
mpf_t *  rhs,
int  strict 
)

Definition at line 266 of file mpf_basis.c.

References __QS_SB_VERB, mpf_lpinfo::basisid, mpf_lpinfo::baz, mpf_lpinfo::bz, mpf_svector::coef, E_BASIS_SINGULAR, E_GENERAL_ERROR, mpf_lpinfo::fbasisid, ILL_CLEANUP, ILL_IFTRACE, mpf_svector::indx, mpf_lpinfo::lz, mpf_ILLbasis_factor(), mpf_ILLfct_compute_vA(), mpf_ILLfct_compute_zA(), mpf_ILLfct_compute_zz(), mpf_ILLsvector_alloc(), mpf_ILLsvector_free(), mpf_ILLsvector_init(), mpf_PIVZ_TOLER, mpf_lpinfo::nbaz, mpf_lpinfo::ncols, mpf_ILLlpdata::nrows, mpf_lpinfo::nrows, NULL, mpf_svector::nzcnt, mpf_lpinfo::O, STAT_BASIC, STAT_LOWER, STAT_UPPER, mpf_lpinfo::uz, mpf_lpinfo::vindex, mpf_lpinfo::vstat, and mpf_lpinfo::xbz.

Here is the call graph for this function:

int mpf_ILLbasis_update ( mpf_lpinfo lp,
mpf_svector y,
int  lindex,
int *  refactor,
int *  singular 
)

Definition at line 1470 of file mpf_basis.c.

References __QS_SB_VERB, E_FACTOR_BLOWUP, E_UPDATE_NOSPACE, E_UPDATE_SINGULAR_COL, E_UPDATE_SINGULAR_ROW, mpf_lpinfo::f, mpf_ILLbasis_factor(), mpf_ILLfactor_update(), mpf_ILLlib_writebasis(), mpf_ILLwrite_lp_file(), NULL, and mpf_lpinfo::O.

Referenced by mpf_dual_phaseI_step(), mpf_dual_phaseII_step(), mpf_primal_phaseI_step(), and mpf_primal_phaseII_step().

Here is the call graph for this function:

static int mpf_init_slack_basis ( mpf_lpinfo lp,
int *  vstat,
int *  irow,
int *  rrow,
int *  unitcol,
int *  icol,
int *  rcol 
) [static]

Definition at line 457 of file mpf_basis.c.

References CLASS_LOGICAL, mpf_lpinfo::lz, mpf_lpinfo::matbeg, mpf_lpinfo::matind, mpf_lpinfo::ncols, NULL, STAT_BASIC, STAT_LOWER, STAT_UPPER, STAT_ZERO, mpf_lpinfo::uz, VARTIFICIAL, VBOUNDED, mpf_lpinfo::vclass, VFIXED, VFREE, VLOWER, mpf_lpinfo::vtype, and VUPPER.

Referenced by mpf_get_initial_basis1(), and mpf_get_initial_basis2().

static int mpf_primal_col_select ( mpf_lpinfo lp,
int *  vstat,
int *  irow,
int *  rrow,
int *  unitcol,
mpf_t *  v,
int *  perm,
int *  porder,
int  nbelem,
int  pcols 
) [static]

Definition at line 511 of file mpf_basis.c.

References mpf_lpinfo::matbeg, mpf_lpinfo::matcnt, mpf_lpinfo::matind, mpf_lpinfo::matval, mpf_INFTY, mpf_NINFTY, mpf_PARAM_IBASIS_RPIVOT, mpf_PARAM_IBASIS_RTRIANG, mpf_lpinfo::nrows, and STAT_BASIC.

Referenced by mpf_get_initial_basis2().

static int mpf_set_basis_indices ( mpf_lpinfo lp,
int *  vstat 
)

Definition at line 1062 of file mpf_basis.c.

References mpf_lpinfo::baz, E_SIMPLEX_ERROR, mpf_lpinfo::nbaz, mpf_lpinfo::ncols, mpf_lpinfo::nnbasic, mpf_lpinfo::nrows, STAT_BASIC, STAT_LOWER, STAT_UPPER, STAT_ZERO, mpf_lpinfo::vindex, and mpf_lpinfo::vstat.

Referenced by mpf_ILLbasis_get_cinitial(), and mpf_ILLbasis_get_initial().


Variable Documentation

int TRACE = 0 [static]

Definition at line 24 of file mpf_basis.c.


Generated on Thu Mar 29 09:41:38 2012 for QSopt_ex by  doxygen 1.4.7