basis.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "qs_config.h"
#include "config.h"
#include "sortrus.h"
#include "iqsutil.h"
#include "lpdefs.h"
#include "qstruct.h"
#include "qsopt.h"
#include "basis.h"
#include "fct.h"
#include "lp.h"
#include "lib.h"

Include dependency graph for basis.c:

Go to the source code of this file.

Defines

#define BASIS_DEBUG   0
#define BASIS_STATS   0

Functions

static int choose_basis (int algorithm, EGlpNum_t pinf1, EGlpNum_t dinf1, EGlpNum_t pinf2, EGlpNum_t dinf2)
static int get_initial_basis1 (lpinfo *lp, int *vstat)
static int get_initial_basis2 (lpinfo *lp, int *vstat)
static void get_var_info (lpinfo *lp, var_data *v)
int ILLbasis_build_basisinfo (lpinfo *lp)
void ILLbasis_clear_vardata (var_data *vd)
void ILLbasis_column_solve (lpinfo *lp, svector *rhs, svector *soln)
void ILLbasis_column_solve_update (lpinfo *lp, svector *rhs, svector *upd, svector *soln)
int ILLbasis_factor (lpinfo *lp, int *singular)
void ILLbasis_free_basisinfo (lpinfo *lp)
int ILLbasis_get_cinitial (lpinfo *lp, int algorithm)
int ILLbasis_get_initial (lpinfo *lp, int algorithm)
void ILLbasis_init_basisinfo (lpinfo *lp)
void ILLbasis_init_vardata (var_data *vd)
int ILLbasis_load (lpinfo *lp, ILLlp_basis *B)
int ILLbasis_refactor (lpinfo *lp)
void ILLbasis_row_solve (lpinfo *lp, svector *rhs, svector *soln)
int ILLbasis_tableau_row (lpinfo *lp, int row, EGlpNum_t *brow, EGlpNum_t *trow, EGlpNum_t *rhs, int strict)
int ILLbasis_update (lpinfo *lp, svector *y, int lindex, int *refactor, int *singular)
static int init_slack_basis (lpinfo *lp, int *vstat, int *irow, int *rrow, int *unitcol, int *icol, int *rcol)
static int primal_col_select (lpinfo *lp, int *vstat, int *irow, int *rrow, int *unitcol, EGlpNum_t *v, int *perm, int *porder, int nbelem, int pcols)
static int set_basis_indices (lpinfo *lp, int *vstat)

Variables

static int TRACE = 0


Define Documentation

#define BASIS_DEBUG   0

Definition at line 47 of file basis.c.

#define BASIS_STATS   0

Definition at line 45 of file basis.c.


Function Documentation

static int choose_basis ( int  algorithm,
EGlpNum_t  pinf1,
EGlpNum_t  dinf1,
EGlpNum_t  pinf2,
EGlpNum_t  dinf2 
)

Definition at line 1155 of file basis.c.

References CB_EPS, CB_INF_RATIO, CB_PRI_RLIMIT, ILL_IFTRACE, and PRIMAL_SIMPLEX.

Referenced by ILLbasis_get_cinitial().

static int get_initial_basis1 ( lpinfo lp,
int *  vstat 
)

Definition at line 636 of file basis.c.

References var_data::cmax, lpinfo::cz, E_SIMPLEX_ERROR, get_var_info(), ILL_CLEANUP, ILL_SAFE_MALLOC, ILLbasis_init_vardata(), INFTY, init_slack_basis(), lpinfo::lz, var_data::nbndone, var_data::nbounded, lpinfo::ncols, var_data::nfree, lpinfo::nrows, var_data::nslacks, NULL, STAT_BASIC, lpinfo::uz, VBOUNDED, VFIXED, VFREE, VLOWER, lpinfo::vtype, and VUPPER.

Referenced by ILLbasis_get_cinitial(), and ILLbasis_get_initial().

Here is the call graph for this function:

static int get_initial_basis2 ( lpinfo lp,
int *  vstat 
)

Definition at line 798 of file basis.c.

References BD_TOLER, var_data::cmax, lpinfo::cz, E_SIMPLEX_ERROR, get_var_info(), ILL_CLEANUP, ILL_IFFREE, ILL_SAFE_MALLOC, ILLbasis_clear_vardata(), ILLbasis_free_basisinfo(), ILLbasis_init_vardata(), ILLutil_EGlpNum_perm_quicksort(), ILLutil_int_perm_quicksort(), INFTY, init_slack_basis(), lpinfo::lz, lpinfo::matcnt, var_data::nbndone, lpinfo::ncols, var_data::nfree, lpinfo::nrows, var_data::nslacks, NULL, primal_col_select(), lpinfo::rowbeg, lpinfo::rowcnt, lpinfo::rowind, lpinfo::rowval, STAT_BASIC, lpinfo::uz, VBOUNDED, VFIXED, VFREE, VLOWER, lpinfo::vtype, and VUPPER.

Referenced by ILLbasis_get_cinitial(), and ILLbasis_get_initial().

Here is the call graph for this function:

static void get_var_info ( lpinfo lp,
var_data v 
) [static]

Definition at line 405 of file basis.c.

References CLASS_LOGICAL, var_data::cmax, lpinfo::cz, var_data::nartif, var_data::nbndone, var_data::nbounded, lpinfo::ncols, var_data::nfixed, var_data::nfree, NINFTY, var_data::nslacks, VARTIFICIAL, VBOUNDED, lpinfo::vclass, VFIXED, VFREE, VLOWER, lpinfo::vtype, and VUPPER.

Referenced by get_initial_basis1(), and get_initial_basis2().

int ILLbasis_build_basisinfo ( lpinfo lp  ) 

Definition at line 123 of file basis.c.

References lpinfo::baz, lpinfo::fbasisid, ILL_SAFE_MALLOC, ILLbasis_free_basisinfo(), lpinfo::nbaz, ILLlpdata::ncols, ILLlpdata::nrows, lpinfo::O, lpinfo::vindex, and lpinfo::vstat.

Referenced by ILLbasis_get_cinitial(), ILLbasis_get_initial(), and ILLbasis_load().

Here is the call graph for this function:

void ILLbasis_clear_vardata ( var_data vd  ) 

Definition at line 56 of file basis.c.

References var_data::cmax.

Referenced by get_initial_basis2().

void ILLbasis_column_solve ( lpinfo lp,
svector rhs,
svector soln 
)

Definition at line 1445 of file basis.c.

References lpinfo::f, and ILLfactor_ftran().

Referenced by ILLfct_compute_dpIIy(), ILLfct_compute_dpIy(), ILLfct_compute_dsteep_upv(), ILLfct_compute_yz(), and ILLprice_get_newnorms().

Here is the call graph for this function:

void ILLbasis_column_solve_update ( lpinfo lp,
svector rhs,
svector upd,
svector soln 
)

Definition at line 1453 of file basis.c.

References lpinfo::f, and ILLfactor_ftran_update().

Referenced by ILLfct_compute_yz().

Here is the call graph for this function:

int ILLbasis_factor ( lpinfo lp,
int *  singular 
)

Definition at line 1352 of file basis.c.

References __QS_SB_VERB, lpinfo::basisid, lpinfo::baz, lpinfo::f, lpinfo::fbasisid, factor_work::fzero_tol, ILL_IFFREE, ILL_SAFE_MALLOC, ILLfactor(), ILLfactor_create_factor_work(), ILLfactor_free_factor_work(), ILLfactor_init_factor_work(), ILLfct_update_basis_info(), lpinfo::matbeg, lpinfo::matcnt, lpinfo::matind, lpinfo::matval, factor_work::maxelem_cur, factor_work::maxelem_factor, factor_work::maxelem_orig, ILLlpdata::nrows, lpinfo::O, factor_work::partial_cur, factor_work::partial_tol, ILLlpdata::rowmap, STAT_LOWER, STAT_UPPER, STAT_ZERO, factor_work::szero_tol, VARTIFICIAL, VBOUNDED, lpinfo::vindex, VLOWER, lpinfo::vtype, and VUPPER.

Referenced by dual_phaseI_step(), dual_phaseII_step(), ILLbasis_get_cinitial(), ILLbasis_refactor(), ILLbasis_tableau_row(), ILLbasis_update(), and ILLsimplex().

Here is the call graph for this function:

void ILLbasis_free_basisinfo ( lpinfo lp  ) 

Definition at line 101 of file basis.c.

References lpinfo::baz, lpinfo::f, factor_work::fzero_tol, ILL_IFFREE, ILLfactor_free_factor_work(), factor_work::maxelem_cur, factor_work::maxelem_factor, factor_work::maxelem_orig, lpinfo::nbaz, factor_work::partial_cur, factor_work::partial_tol, factor_work::szero_tol, lpinfo::vindex, and lpinfo::vstat.

Referenced by get_initial_basis2(), ILLbasis_build_basisinfo(), ILLbasis_get_cinitial(), ILLbasis_get_initial(), ILLbasis_load(), and ILLsimplex_free_lpinfo().

Here is the call graph for this function:

int ILLbasis_get_cinitial ( lpinfo lp,
int  algorithm 
)

Definition at line 1213 of file basis.c.

References __QS_SB_VERB, lpinfo::basisid, lpinfo::baz, choose_basis(), tol_struct::dfeas_tol, lpinfo::dinfeas, E_SIMPLEX_ERROR, lpinfo::fbasisid, get_initial_basis1(), get_initial_basis2(), ILL_CLEANUP, ILL_IFFREE, ILL_SAFE_MALLOC, ILLbasis_build_basisinfo(), ILLbasis_factor(), ILLbasis_free_basisinfo(), ILLbasis_init_basisinfo(), ILLfct_check_dfeasible(), ILLfct_check_pfeasible(), ILLfct_compute_dz(), ILLfct_compute_piz(), ILLfct_compute_xbz(), ILLfct_dual_adjust(), ILLwrite_lp_file(), lpinfo::matcnt, lpinfo::ncols, lpinfo::nrows, NULL, lpinfo::O, tol_struct::pfeas_tol, lpinfo::pinfeas, PRIMAL_SIMPLEX, set_basis_indices(), lpinfo::tol, and feas_info::totinfeas.

Referenced by ILLsimplex().

Here is the call graph for this function:

int ILLbasis_get_initial ( lpinfo lp,
int  algorithm 
)

Definition at line 1105 of file basis.c.

References lpinfo::basisid, E_SIMPLEX_ERROR, get_initial_basis1(), get_initial_basis2(), ILL_IFFREE, ILL_SAFE_MALLOC, ILLbasis_build_basisinfo(), ILLbasis_free_basisinfo(), ILLbasis_init_basisinfo(), ILLwrite_lp_file(), lpinfo::ncols, NULL, lpinfo::O, PRIMAL_SIMPLEX, and set_basis_indices().

Referenced by ILLsimplex().

Here is the call graph for this function:

void ILLbasis_init_basisinfo ( lpinfo lp  ) 

Definition at line 91 of file basis.c.

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

Referenced by ILLbasis_get_cinitial(), ILLbasis_get_initial(), ILLbasis_load(), and ILLsimplex_init_lpinfo().

void ILLbasis_init_vardata ( var_data vd  ) 

Definition at line 49 of file basis.c.

References var_data::cmax.

Referenced by get_initial_basis1(), and get_initial_basis2().

int ILLbasis_load ( lpinfo lp,
ILLlp_basis B 
)

Definition at line 141 of file basis.c.

References lpinfo::basisid, lpinfo::baz, ILLlp_basis::cstat, lpinfo::fbasisid, ILLbasis_build_basisinfo(), ILLbasis_free_basisinfo(), ILLbasis_init_basisinfo(), lpinfo::nbaz, ILLlpdata::ncols, ILLlpdata::nrows, ILLlpdata::nstruct, 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, ILLlpdata::rowmap, ILLlp_basis::rstat, ILLlpdata::sense, STAT_BASIC, STAT_LOWER, STAT_UPPER, STAT_ZERO, ILLlpdata::structmap, lpinfo::vindex, and lpinfo::vstat.

Referenced by ILLsimplex().

Here is the call graph for this function:

int ILLbasis_refactor ( lpinfo lp  ) 

Definition at line 1429 of file basis.c.

References __QS_SB_VERB, ILLbasis_factor(), and QS_LP_CHANGE_PREC.

Referenced by ILLsimplex_retest_dsolution(), and ILLsimplex_retest_psolution().

Here is the call graph for this function:

void ILLbasis_row_solve ( lpinfo lp,
svector rhs,
svector soln 
)

Definition at line 1462 of file basis.c.

References lpinfo::f, and ILLfactor_btran().

Referenced by ILLfct_compute_binvrow(), ILLfct_compute_ppIzz(), ILLfct_compute_psteep_upv(), and ILLprice_get_newnorms().

Here is the call graph for this function:

int ILLbasis_tableau_row ( lpinfo lp,
int  row,
EGlpNum_t *  brow,
EGlpNum_t *  trow,
EGlpNum_t *  rhs,
int  strict 
)

Definition at line 266 of file basis.c.

References __QS_SB_VERB, lpinfo::basisid, lpinfo::baz, lpinfo::bz, svector::coef, E_BASIS_SINGULAR, E_GENERAL_ERROR, lpinfo::fbasisid, ILL_CLEANUP, ILL_IFTRACE, ILLbasis_factor(), ILLfct_compute_vA(), ILLfct_compute_zA(), ILLfct_compute_zz(), ILLsvector_alloc(), ILLsvector_free(), ILLsvector_init(), svector::indx, lpinfo::lz, lpinfo::nbaz, lpinfo::ncols, ILLlpdata::nrows, lpinfo::nrows, NULL, svector::nzcnt, lpinfo::O, PIVZ_TOLER, STAT_BASIC, STAT_LOWER, STAT_UPPER, lpinfo::uz, lpinfo::vindex, lpinfo::vstat, and lpinfo::xbz.

Referenced by ILLlib_tableau().

Here is the call graph for this function:

int ILLbasis_update ( lpinfo lp,
svector y,
int  lindex,
int *  refactor,
int *  singular 
)

Definition at line 1470 of file basis.c.

References __QS_SB_VERB, E_FACTOR_BLOWUP, E_UPDATE_NOSPACE, E_UPDATE_SINGULAR_COL, E_UPDATE_SINGULAR_ROW, lpinfo::f, ILLbasis_factor(), ILLfactor_update(), ILLlib_writebasis(), ILLwrite_lp_file(), NULL, and lpinfo::O.

Referenced by dual_phaseI_step(), dual_phaseII_step(), primal_phaseI_step(), and primal_phaseII_step().

Here is the call graph for this function:

static int init_slack_basis ( lpinfo lp,
int *  vstat,
int *  irow,
int *  rrow,
int *  unitcol,
int *  icol,
int *  rcol 
) [static]

Definition at line 457 of file basis.c.

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

Referenced by get_initial_basis1(), and get_initial_basis2().

static int primal_col_select ( lpinfo lp,
int *  vstat,
int *  irow,
int *  rrow,
int *  unitcol,
EGlpNum_t *  v,
int *  perm,
int *  porder,
int  nbelem,
int  pcols 
) [static]

Definition at line 511 of file basis.c.

References INFTY, lpinfo::matbeg, lpinfo::matcnt, lpinfo::matind, lpinfo::matval, NINFTY, lpinfo::nrows, PARAM_IBASIS_RPIVOT, PARAM_IBASIS_RTRIANG, and STAT_BASIC.

Referenced by get_initial_basis2().

static int set_basis_indices ( lpinfo lp,
int *  vstat 
)

Definition at line 1062 of file basis.c.

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

Referenced by ILLbasis_get_cinitial(), and ILLbasis_get_initial().


Variable Documentation

int TRACE = 0 [static]

Definition at line 24 of file basis.c.

Referenced by parseargs().


Generated on Thu Mar 29 09:32:42 2012 for QSopt_ex by  doxygen 1.4.7