dbl_basis.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "qs_config.h"
#include "config.h"
#include "dbl_sortrus.h"
#include "dbl_iqsutil.h"
#include "dbl_lpdefs.h"
#include "dbl_qstruct.h"
#include "dbl_qsopt.h"
#include "dbl_basis.h"
#include "dbl_fct.h"
#include "dbl_lp.h"
#include "dbl_lib.h"

Include dependency graph for dbl_basis.c:

Go to the source code of this file.

Defines

#define dbl_BASIS_DEBUG   0
#define dbl_BASIS_STATS   0

Functions

static int dbl_choose_basis (int algorithm, double pinf1, double dinf1, double pinf2, double dinf2)
static int dbl_get_initial_basis1 (dbl_lpinfo *lp, int *vstat)
static int dbl_get_initial_basis2 (dbl_lpinfo *lp, int *vstat)
static void dbl_get_var_info (dbl_lpinfo *lp, dbl_var_data *v)
int dbl_ILLbasis_build_basisinfo (dbl_lpinfo *lp)
void dbl_ILLbasis_clear_vardata (dbl_var_data *vd)
void dbl_ILLbasis_column_solve (dbl_lpinfo *lp, dbl_svector *rhs, dbl_svector *soln)
void dbl_ILLbasis_column_solve_update (dbl_lpinfo *lp, dbl_svector *rhs, dbl_svector *upd, dbl_svector *soln)
int dbl_ILLbasis_factor (dbl_lpinfo *lp, int *singular)
void dbl_ILLbasis_free_basisinfo (dbl_lpinfo *lp)
int dbl_ILLbasis_get_cinitial (dbl_lpinfo *lp, int algorithm)
int dbl_ILLbasis_get_initial (dbl_lpinfo *lp, int algorithm)
void dbl_ILLbasis_init_basisinfo (dbl_lpinfo *lp)
void dbl_ILLbasis_init_vardata (dbl_var_data *vd)
int dbl_ILLbasis_load (dbl_lpinfo *lp, dbl_ILLlp_basis *B)
int dbl_ILLbasis_refactor (dbl_lpinfo *lp)
void dbl_ILLbasis_row_solve (dbl_lpinfo *lp, dbl_svector *rhs, dbl_svector *soln)
int dbl_ILLbasis_tableau_row (dbl_lpinfo *lp, int row, double *brow, double *trow, double *rhs, int strict)
int dbl_ILLbasis_update (dbl_lpinfo *lp, dbl_svector *y, int lindex, int *refactor, int *singular)
static int dbl_init_slack_basis (dbl_lpinfo *lp, int *vstat, int *irow, int *rrow, int *unitcol, int *icol, int *rcol)
static int dbl_primal_col_select (dbl_lpinfo *lp, int *vstat, int *irow, int *rrow, int *unitcol, double *v, int *perm, int *porder, int nbelem, int pcols)
static int dbl_set_basis_indices (dbl_lpinfo *lp, int *vstat)

Variables

static int TRACE = 0


Define Documentation

#define dbl_BASIS_DEBUG   0

Definition at line 47 of file dbl_basis.c.

#define dbl_BASIS_STATS   0

Definition at line 45 of file dbl_basis.c.


Function Documentation

static int dbl_choose_basis ( int  algorithm,
double  pinf1,
double  dinf1,
double  pinf2,
double  dinf2 
)

Definition at line 1155 of file dbl_basis.c.

References dbl_CB_EPS, dbl_CB_INF_RATIO, dbl_CB_PRI_RLIMIT, ILL_IFTRACE, and PRIMAL_SIMPLEX.

Referenced by dbl_ILLbasis_get_cinitial().

static int dbl_get_initial_basis1 ( dbl_lpinfo lp,
int *  vstat 
)

Definition at line 636 of file dbl_basis.c.

References dbl_var_data::cmax, dbl_lpinfo::cz, dbl_get_var_info(), dbl_ILLbasis_init_vardata(), dbl_INFTY, dbl_init_slack_basis(), E_SIMPLEX_ERROR, ILL_CLEANUP, ILL_SAFE_MALLOC, dbl_lpinfo::lz, dbl_var_data::nbndone, dbl_var_data::nbounded, dbl_lpinfo::ncols, dbl_var_data::nfree, dbl_lpinfo::nrows, dbl_var_data::nslacks, NULL, STAT_BASIC, dbl_lpinfo::uz, VBOUNDED, VFIXED, VFREE, VLOWER, dbl_lpinfo::vtype, and VUPPER.

Referenced by dbl_ILLbasis_get_cinitial(), and dbl_ILLbasis_get_initial().

Here is the call graph for this function:

static int dbl_get_initial_basis2 ( dbl_lpinfo lp,
int *  vstat 
)

Definition at line 798 of file dbl_basis.c.

References dbl_var_data::cmax, dbl_lpinfo::cz, dbl_BD_TOLER, dbl_get_var_info(), dbl_ILLbasis_clear_vardata(), dbl_ILLbasis_free_basisinfo(), dbl_ILLbasis_init_vardata(), dbl_ILLutil_EGlpNum_perm_quicksort(), dbl_INFTY, dbl_init_slack_basis(), dbl_primal_col_select(), E_SIMPLEX_ERROR, ILL_CLEANUP, ILL_IFFREE, ILL_SAFE_MALLOC, ILLutil_int_perm_quicksort(), dbl_lpinfo::lz, dbl_lpinfo::matcnt, dbl_var_data::nbndone, dbl_lpinfo::ncols, dbl_var_data::nfree, dbl_lpinfo::nrows, dbl_var_data::nslacks, NULL, dbl_lpinfo::rowbeg, dbl_lpinfo::rowcnt, dbl_lpinfo::rowind, dbl_lpinfo::rowval, STAT_BASIC, dbl_lpinfo::uz, VBOUNDED, VFIXED, VFREE, VLOWER, dbl_lpinfo::vtype, and VUPPER.

Referenced by dbl_ILLbasis_get_cinitial(), and dbl_ILLbasis_get_initial().

Here is the call graph for this function:

static void dbl_get_var_info ( dbl_lpinfo lp,
dbl_var_data v 
) [static]

Definition at line 405 of file dbl_basis.c.

References CLASS_LOGICAL, dbl_var_data::cmax, dbl_lpinfo::cz, dbl_NINFTY, dbl_var_data::nartif, dbl_var_data::nbndone, dbl_var_data::nbounded, dbl_lpinfo::ncols, dbl_var_data::nfixed, dbl_var_data::nfree, dbl_var_data::nslacks, VARTIFICIAL, VBOUNDED, dbl_lpinfo::vclass, VFIXED, VFREE, VLOWER, dbl_lpinfo::vtype, and VUPPER.

Referenced by dbl_get_initial_basis1(), and dbl_get_initial_basis2().

int dbl_ILLbasis_build_basisinfo ( dbl_lpinfo lp  ) 

Definition at line 123 of file dbl_basis.c.

References dbl_lpinfo::baz, dbl_ILLbasis_free_basisinfo(), dbl_lpinfo::fbasisid, ILL_SAFE_MALLOC, dbl_lpinfo::nbaz, dbl_ILLlpdata::ncols, dbl_ILLlpdata::nrows, dbl_lpinfo::O, dbl_lpinfo::vindex, and dbl_lpinfo::vstat.

Here is the call graph for this function:

void dbl_ILLbasis_clear_vardata ( dbl_var_data vd  ) 

Definition at line 56 of file dbl_basis.c.

References dbl_var_data::cmax.

void dbl_ILLbasis_column_solve ( dbl_lpinfo lp,
dbl_svector rhs,
dbl_svector soln 
)

Definition at line 1445 of file dbl_basis.c.

References dbl_ILLfactor_ftran(), and dbl_lpinfo::f.

Here is the call graph for this function:

void dbl_ILLbasis_column_solve_update ( dbl_lpinfo lp,
dbl_svector rhs,
dbl_svector upd,
dbl_svector soln 
)

Definition at line 1453 of file dbl_basis.c.

References dbl_ILLfactor_ftran_update(), and dbl_lpinfo::f.

Here is the call graph for this function:

int dbl_ILLbasis_factor ( dbl_lpinfo lp,
int *  singular 
)

Definition at line 1352 of file dbl_basis.c.

References __QS_SB_VERB, dbl_lpinfo::basisid, dbl_lpinfo::baz, dbl_ILLfactor(), dbl_ILLfactor_create_factor_work(), dbl_ILLfactor_free_factor_work(), dbl_ILLfactor_init_factor_work(), dbl_ILLfct_update_basis_info(), dbl_lpinfo::f, dbl_lpinfo::fbasisid, dbl_factor_work::fzero_tol, ILL_IFFREE, ILL_SAFE_MALLOC, dbl_lpinfo::matbeg, dbl_lpinfo::matcnt, dbl_lpinfo::matind, dbl_lpinfo::matval, dbl_factor_work::maxelem_cur, dbl_factor_work::maxelem_factor, dbl_factor_work::maxelem_orig, dbl_ILLlpdata::nrows, dbl_lpinfo::O, dbl_factor_work::partial_cur, dbl_factor_work::partial_tol, dbl_ILLlpdata::rowmap, STAT_LOWER, STAT_UPPER, STAT_ZERO, dbl_factor_work::szero_tol, VARTIFICIAL, VBOUNDED, dbl_lpinfo::vindex, VLOWER, dbl_lpinfo::vtype, and VUPPER.

Here is the call graph for this function:

void dbl_ILLbasis_free_basisinfo ( dbl_lpinfo lp  ) 

Definition at line 101 of file dbl_basis.c.

References dbl_lpinfo::baz, dbl_ILLfactor_free_factor_work(), dbl_lpinfo::f, dbl_factor_work::fzero_tol, ILL_IFFREE, dbl_factor_work::maxelem_cur, dbl_factor_work::maxelem_factor, dbl_factor_work::maxelem_orig, dbl_lpinfo::nbaz, dbl_factor_work::partial_cur, dbl_factor_work::partial_tol, dbl_factor_work::szero_tol, dbl_lpinfo::vindex, and dbl_lpinfo::vstat.

Here is the call graph for this function:

int dbl_ILLbasis_get_cinitial ( dbl_lpinfo lp,
int  algorithm 
)

Definition at line 1213 of file dbl_basis.c.

References __QS_SB_VERB, dbl_lpinfo::basisid, dbl_lpinfo::baz, dbl_choose_basis(), dbl_get_initial_basis1(), dbl_get_initial_basis2(), dbl_ILLbasis_build_basisinfo(), dbl_ILLbasis_factor(), dbl_ILLbasis_free_basisinfo(), dbl_ILLbasis_init_basisinfo(), dbl_ILLfct_check_dfeasible(), dbl_ILLfct_check_pfeasible(), dbl_ILLfct_compute_dz(), dbl_ILLfct_compute_piz(), dbl_ILLfct_compute_xbz(), dbl_ILLfct_dual_adjust(), dbl_ILLwrite_lp_file(), dbl_set_basis_indices(), dbl_tol_struct::dfeas_tol, dbl_lpinfo::dinfeas, E_SIMPLEX_ERROR, dbl_lpinfo::fbasisid, ILL_CLEANUP, ILL_IFFREE, ILL_SAFE_MALLOC, dbl_lpinfo::matcnt, dbl_lpinfo::ncols, dbl_lpinfo::nrows, NULL, dbl_lpinfo::O, dbl_tol_struct::pfeas_tol, dbl_lpinfo::pinfeas, PRIMAL_SIMPLEX, dbl_lpinfo::tol, and dbl_feas_info::totinfeas.

Here is the call graph for this function:

int dbl_ILLbasis_get_initial ( dbl_lpinfo lp,
int  algorithm 
)

Definition at line 1105 of file dbl_basis.c.

References dbl_lpinfo::basisid, dbl_get_initial_basis1(), dbl_get_initial_basis2(), dbl_ILLbasis_build_basisinfo(), dbl_ILLbasis_free_basisinfo(), dbl_ILLbasis_init_basisinfo(), dbl_ILLwrite_lp_file(), dbl_set_basis_indices(), E_SIMPLEX_ERROR, ILL_IFFREE, ILL_SAFE_MALLOC, dbl_lpinfo::ncols, NULL, dbl_lpinfo::O, and PRIMAL_SIMPLEX.

Here is the call graph for this function:

void dbl_ILLbasis_init_basisinfo ( dbl_lpinfo lp  ) 

Definition at line 91 of file dbl_basis.c.

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

void dbl_ILLbasis_init_vardata ( dbl_var_data vd  ) 

Definition at line 49 of file dbl_basis.c.

References dbl_var_data::cmax.

int dbl_ILLbasis_load ( dbl_lpinfo lp,
dbl_ILLlp_basis B 
)

Definition at line 141 of file dbl_basis.c.

References dbl_lpinfo::basisid, dbl_lpinfo::baz, dbl_ILLlp_basis::cstat, dbl_ILLbasis_build_basisinfo(), dbl_ILLbasis_free_basisinfo(), dbl_ILLbasis_init_basisinfo(), dbl_lpinfo::fbasisid, dbl_lpinfo::nbaz, dbl_ILLlpdata::ncols, dbl_ILLlpdata::nrows, dbl_ILLlpdata::nstruct, dbl_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, dbl_ILLlpdata::rowmap, dbl_ILLlp_basis::rstat, dbl_ILLlpdata::sense, STAT_BASIC, STAT_LOWER, STAT_UPPER, STAT_ZERO, dbl_ILLlpdata::structmap, dbl_lpinfo::vindex, and dbl_lpinfo::vstat.

Here is the call graph for this function:

int dbl_ILLbasis_refactor ( dbl_lpinfo lp  ) 

Definition at line 1429 of file dbl_basis.c.

References __QS_SB_VERB, dbl_ILLbasis_factor(), and QS_LP_CHANGE_PREC.

Here is the call graph for this function:

void dbl_ILLbasis_row_solve ( dbl_lpinfo lp,
dbl_svector rhs,
dbl_svector soln 
)

Definition at line 1462 of file dbl_basis.c.

References dbl_ILLfactor_btran(), and dbl_lpinfo::f.

Here is the call graph for this function:

int dbl_ILLbasis_tableau_row ( dbl_lpinfo lp,
int  row,
double *  brow,
double *  trow,
double *  rhs,
int  strict 
)

Definition at line 266 of file dbl_basis.c.

References __QS_SB_VERB, dbl_lpinfo::basisid, dbl_lpinfo::baz, dbl_lpinfo::bz, dbl_svector::coef, dbl_ILLbasis_factor(), dbl_ILLfct_compute_vA(), dbl_ILLfct_compute_zA(), dbl_ILLfct_compute_zz(), dbl_ILLsvector_alloc(), dbl_ILLsvector_free(), dbl_ILLsvector_init(), dbl_PIVZ_TOLER, E_BASIS_SINGULAR, E_GENERAL_ERROR, dbl_lpinfo::fbasisid, ILL_CLEANUP, ILL_IFTRACE, dbl_svector::indx, dbl_lpinfo::lz, dbl_lpinfo::nbaz, dbl_lpinfo::ncols, dbl_ILLlpdata::nrows, dbl_lpinfo::nrows, NULL, dbl_svector::nzcnt, dbl_lpinfo::O, STAT_BASIC, STAT_LOWER, STAT_UPPER, dbl_lpinfo::uz, dbl_lpinfo::vindex, dbl_lpinfo::vstat, and dbl_lpinfo::xbz.

Here is the call graph for this function:

int dbl_ILLbasis_update ( dbl_lpinfo lp,
dbl_svector y,
int  lindex,
int *  refactor,
int *  singular 
)

Definition at line 1470 of file dbl_basis.c.

References __QS_SB_VERB, dbl_ILLbasis_factor(), dbl_ILLfactor_update(), dbl_ILLlib_writebasis(), dbl_ILLwrite_lp_file(), E_FACTOR_BLOWUP, E_UPDATE_NOSPACE, E_UPDATE_SINGULAR_COL, E_UPDATE_SINGULAR_ROW, dbl_lpinfo::f, NULL, and dbl_lpinfo::O.

Here is the call graph for this function:

static int dbl_init_slack_basis ( dbl_lpinfo lp,
int *  vstat,
int *  irow,
int *  rrow,
int *  unitcol,
int *  icol,
int *  rcol 
) [static]

Definition at line 457 of file dbl_basis.c.

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

Referenced by dbl_get_initial_basis1(), and dbl_get_initial_basis2().

static int dbl_primal_col_select ( dbl_lpinfo lp,
int *  vstat,
int *  irow,
int *  rrow,
int *  unitcol,
double *  v,
int *  perm,
int *  porder,
int  nbelem,
int  pcols 
) [static]

Definition at line 511 of file dbl_basis.c.

References dbl_INFTY, dbl_NINFTY, dbl_PARAM_IBASIS_RPIVOT, dbl_PARAM_IBASIS_RTRIANG, dbl_lpinfo::matbeg, dbl_lpinfo::matcnt, dbl_lpinfo::matind, dbl_lpinfo::matval, dbl_lpinfo::nrows, and STAT_BASIC.

Referenced by dbl_get_initial_basis2().

static int dbl_set_basis_indices ( dbl_lpinfo lp,
int *  vstat 
)

Definition at line 1062 of file dbl_basis.c.

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

Referenced by dbl_ILLbasis_get_cinitial(), and dbl_ILLbasis_get_initial().


Variable Documentation

int TRACE = 0 [static]

Definition at line 24 of file dbl_basis.c.


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