mpq_basis.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "qs_config.h"
#include "config.h"
#include "mpq_sortrus.h"
#include "mpq_iqsutil.h"
#include "mpq_lpdefs.h"
#include "mpq_qstruct.h"
#include "mpq_qsopt.h"
#include "mpq_basis.h"
#include "mpq_fct.h"
#include "mpq_lp.h"
#include "mpq_lib.h"

Include dependency graph for mpq_basis.c:

Go to the source code of this file.

Defines

#define mpq_BASIS_DEBUG   0
#define mpq_BASIS_STATS   0

Functions

static int mpq_choose_basis (int algorithm, mpq_t pinf1, mpq_t dinf1, mpq_t pinf2, mpq_t dinf2)
static int mpq_get_initial_basis1 (mpq_lpinfo *lp, int *vstat)
static int mpq_get_initial_basis2 (mpq_lpinfo *lp, int *vstat)
static void mpq_get_var_info (mpq_lpinfo *lp, mpq_var_data *v)
int mpq_ILLbasis_build_basisinfo (mpq_lpinfo *lp)
void mpq_ILLbasis_clear_vardata (mpq_var_data *vd)
void mpq_ILLbasis_column_solve (mpq_lpinfo *lp, mpq_svector *rhs, mpq_svector *soln)
void mpq_ILLbasis_column_solve_update (mpq_lpinfo *lp, mpq_svector *rhs, mpq_svector *upd, mpq_svector *soln)
int mpq_ILLbasis_factor (mpq_lpinfo *lp, int *singular)
void mpq_ILLbasis_free_basisinfo (mpq_lpinfo *lp)
int mpq_ILLbasis_get_cinitial (mpq_lpinfo *lp, int algorithm)
int mpq_ILLbasis_get_initial (mpq_lpinfo *lp, int algorithm)
void mpq_ILLbasis_init_basisinfo (mpq_lpinfo *lp)
void mpq_ILLbasis_init_vardata (mpq_var_data *vd)
int mpq_ILLbasis_load (mpq_lpinfo *lp, mpq_ILLlp_basis *B)
int mpq_ILLbasis_refactor (mpq_lpinfo *lp)
void mpq_ILLbasis_row_solve (mpq_lpinfo *lp, mpq_svector *rhs, mpq_svector *soln)
int mpq_ILLbasis_tableau_row (mpq_lpinfo *lp, int row, mpq_t *brow, mpq_t *trow, mpq_t *rhs, int strict)
int mpq_ILLbasis_update (mpq_lpinfo *lp, mpq_svector *y, int lindex, int *refactor, int *singular)
static int mpq_init_slack_basis (mpq_lpinfo *lp, int *vstat, int *irow, int *rrow, int *unitcol, int *icol, int *rcol)
static int mpq_primal_col_select (mpq_lpinfo *lp, int *vstat, int *irow, int *rrow, int *unitcol, mpq_t *v, int *perm, int *porder, int nbelem, int pcols)
static int mpq_set_basis_indices (mpq_lpinfo *lp, int *vstat)

Variables

static int TRACE = 0


Define Documentation

#define mpq_BASIS_DEBUG   0

Definition at line 47 of file mpq_basis.c.

#define mpq_BASIS_STATS   0

Definition at line 45 of file mpq_basis.c.


Function Documentation

static int mpq_choose_basis ( int  algorithm,
mpq_t  pinf1,
mpq_t  dinf1,
mpq_t  pinf2,
mpq_t  dinf2 
)

Definition at line 1155 of file mpq_basis.c.

References ILL_IFTRACE, mpq_CB_EPS, mpq_CB_INF_RATIO, mpq_CB_PRI_RLIMIT, and PRIMAL_SIMPLEX.

Referenced by mpq_ILLbasis_get_cinitial().

static int mpq_get_initial_basis1 ( mpq_lpinfo lp,
int *  vstat 
)

Definition at line 636 of file mpq_basis.c.

References mpq_var_data::cmax, mpq_lpinfo::cz, E_SIMPLEX_ERROR, ILL_CLEANUP, ILL_SAFE_MALLOC, mpq_lpinfo::lz, mpq_get_var_info(), mpq_ILLbasis_init_vardata(), mpq_INFTY, mpq_init_slack_basis(), mpq_var_data::nbndone, mpq_var_data::nbounded, mpq_lpinfo::ncols, mpq_var_data::nfree, mpq_lpinfo::nrows, mpq_var_data::nslacks, NULL, STAT_BASIC, mpq_lpinfo::uz, VBOUNDED, VFIXED, VFREE, VLOWER, mpq_lpinfo::vtype, and VUPPER.

Referenced by mpq_ILLbasis_get_cinitial(), and mpq_ILLbasis_get_initial().

Here is the call graph for this function:

static int mpq_get_initial_basis2 ( mpq_lpinfo lp,
int *  vstat 
)

Definition at line 798 of file mpq_basis.c.

References mpq_var_data::cmax, mpq_lpinfo::cz, E_SIMPLEX_ERROR, ILL_CLEANUP, ILL_IFFREE, ILL_SAFE_MALLOC, ILLutil_int_perm_quicksort(), mpq_lpinfo::lz, mpq_lpinfo::matcnt, mpq_BD_TOLER, mpq_get_var_info(), mpq_ILLbasis_clear_vardata(), mpq_ILLbasis_free_basisinfo(), mpq_ILLbasis_init_vardata(), mpq_ILLutil_EGlpNum_perm_quicksort(), mpq_INFTY, mpq_init_slack_basis(), mpq_primal_col_select(), mpq_var_data::nbndone, mpq_lpinfo::ncols, mpq_var_data::nfree, mpq_lpinfo::nrows, mpq_var_data::nslacks, NULL, mpq_lpinfo::rowbeg, mpq_lpinfo::rowcnt, mpq_lpinfo::rowind, mpq_lpinfo::rowval, STAT_BASIC, mpq_lpinfo::uz, VBOUNDED, VFIXED, VFREE, VLOWER, mpq_lpinfo::vtype, and VUPPER.

Referenced by mpq_ILLbasis_get_cinitial(), and mpq_ILLbasis_get_initial().

Here is the call graph for this function:

static void mpq_get_var_info ( mpq_lpinfo lp,
mpq_var_data v 
) [static]

Definition at line 405 of file mpq_basis.c.

References CLASS_LOGICAL, mpq_var_data::cmax, mpq_lpinfo::cz, mpq_NINFTY, mpq_var_data::nartif, mpq_var_data::nbndone, mpq_var_data::nbounded, mpq_lpinfo::ncols, mpq_var_data::nfixed, mpq_var_data::nfree, mpq_var_data::nslacks, VARTIFICIAL, VBOUNDED, mpq_lpinfo::vclass, VFIXED, VFREE, VLOWER, mpq_lpinfo::vtype, and VUPPER.

Referenced by mpq_get_initial_basis1(), and mpq_get_initial_basis2().

int mpq_ILLbasis_build_basisinfo ( mpq_lpinfo lp  ) 

Definition at line 123 of file mpq_basis.c.

References mpq_lpinfo::baz, mpq_lpinfo::fbasisid, ILL_SAFE_MALLOC, mpq_ILLbasis_free_basisinfo(), mpq_lpinfo::nbaz, mpq_ILLlpdata::ncols, mpq_ILLlpdata::nrows, mpq_lpinfo::O, mpq_lpinfo::vindex, and mpq_lpinfo::vstat.

Here is the call graph for this function:

void mpq_ILLbasis_clear_vardata ( mpq_var_data vd  ) 

Definition at line 56 of file mpq_basis.c.

References mpq_var_data::cmax.

Referenced by mpq_get_initial_basis2().

void mpq_ILLbasis_column_solve ( mpq_lpinfo lp,
mpq_svector rhs,
mpq_svector soln 
)

Definition at line 1445 of file mpq_basis.c.

References mpq_lpinfo::f, and mpq_ILLfactor_ftran().

Here is the call graph for this function:

void mpq_ILLbasis_column_solve_update ( mpq_lpinfo lp,
mpq_svector rhs,
mpq_svector upd,
mpq_svector soln 
)

Definition at line 1453 of file mpq_basis.c.

References mpq_lpinfo::f, and mpq_ILLfactor_ftran_update().

Here is the call graph for this function:

int mpq_ILLbasis_factor ( mpq_lpinfo lp,
int *  singular 
)

Definition at line 1352 of file mpq_basis.c.

References __QS_SB_VERB, mpq_lpinfo::basisid, mpq_lpinfo::baz, mpq_lpinfo::f, mpq_lpinfo::fbasisid, mpq_factor_work::fzero_tol, ILL_IFFREE, ILL_SAFE_MALLOC, mpq_lpinfo::matbeg, mpq_lpinfo::matcnt, mpq_lpinfo::matind, mpq_lpinfo::matval, mpq_factor_work::maxelem_cur, mpq_factor_work::maxelem_factor, mpq_factor_work::maxelem_orig, mpq_ILLfactor(), mpq_ILLfactor_create_factor_work(), mpq_ILLfactor_free_factor_work(), mpq_ILLfactor_init_factor_work(), mpq_ILLfct_update_basis_info(), mpq_ILLlpdata::nrows, mpq_lpinfo::O, mpq_factor_work::partial_cur, mpq_factor_work::partial_tol, mpq_ILLlpdata::rowmap, STAT_LOWER, STAT_UPPER, STAT_ZERO, mpq_factor_work::szero_tol, VARTIFICIAL, VBOUNDED, mpq_lpinfo::vindex, VLOWER, mpq_lpinfo::vtype, and VUPPER.

Here is the call graph for this function:

void mpq_ILLbasis_free_basisinfo ( mpq_lpinfo lp  ) 

Definition at line 101 of file mpq_basis.c.

References mpq_lpinfo::baz, mpq_lpinfo::f, mpq_factor_work::fzero_tol, ILL_IFFREE, mpq_factor_work::maxelem_cur, mpq_factor_work::maxelem_factor, mpq_factor_work::maxelem_orig, mpq_ILLfactor_free_factor_work(), mpq_lpinfo::nbaz, mpq_factor_work::partial_cur, mpq_factor_work::partial_tol, mpq_factor_work::szero_tol, mpq_lpinfo::vindex, and mpq_lpinfo::vstat.

Here is the call graph for this function:

int mpq_ILLbasis_get_cinitial ( mpq_lpinfo lp,
int  algorithm 
)

Definition at line 1213 of file mpq_basis.c.

References __QS_SB_VERB, mpq_lpinfo::basisid, mpq_lpinfo::baz, mpq_tol_struct::dfeas_tol, mpq_lpinfo::dinfeas, E_SIMPLEX_ERROR, mpq_lpinfo::fbasisid, ILL_CLEANUP, ILL_IFFREE, ILL_SAFE_MALLOC, mpq_lpinfo::matcnt, mpq_choose_basis(), mpq_get_initial_basis1(), mpq_get_initial_basis2(), mpq_ILLbasis_build_basisinfo(), mpq_ILLbasis_factor(), mpq_ILLbasis_free_basisinfo(), mpq_ILLbasis_init_basisinfo(), mpq_ILLfct_check_dfeasible(), mpq_ILLfct_check_pfeasible(), mpq_ILLfct_compute_dz(), mpq_ILLfct_compute_piz(), mpq_ILLfct_compute_xbz(), mpq_ILLfct_dual_adjust(), mpq_ILLwrite_lp_file(), mpq_set_basis_indices(), mpq_lpinfo::ncols, mpq_lpinfo::nrows, NULL, mpq_lpinfo::O, mpq_tol_struct::pfeas_tol, mpq_lpinfo::pinfeas, PRIMAL_SIMPLEX, mpq_lpinfo::tol, and mpq_feas_info::totinfeas.

Here is the call graph for this function:

int mpq_ILLbasis_get_initial ( mpq_lpinfo lp,
int  algorithm 
)

Definition at line 1105 of file mpq_basis.c.

References mpq_lpinfo::basisid, E_SIMPLEX_ERROR, ILL_IFFREE, ILL_SAFE_MALLOC, mpq_get_initial_basis1(), mpq_get_initial_basis2(), mpq_ILLbasis_build_basisinfo(), mpq_ILLbasis_free_basisinfo(), mpq_ILLbasis_init_basisinfo(), mpq_ILLwrite_lp_file(), mpq_set_basis_indices(), mpq_lpinfo::ncols, NULL, mpq_lpinfo::O, and PRIMAL_SIMPLEX.

Here is the call graph for this function:

void mpq_ILLbasis_init_basisinfo ( mpq_lpinfo lp  ) 

Definition at line 91 of file mpq_basis.c.

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

Referenced by mpq_ILLbasis_get_cinitial(), mpq_ILLbasis_get_initial(), mpq_ILLbasis_load(), and mpq_ILLsimplex_init_lpinfo().

void mpq_ILLbasis_init_vardata ( mpq_var_data vd  ) 

Definition at line 49 of file mpq_basis.c.

References mpq_var_data::cmax.

Referenced by mpq_get_initial_basis1(), and mpq_get_initial_basis2().

int mpq_ILLbasis_load ( mpq_lpinfo lp,
mpq_ILLlp_basis B 
)

Definition at line 141 of file mpq_basis.c.

References mpq_lpinfo::basisid, mpq_lpinfo::baz, mpq_ILLlp_basis::cstat, mpq_lpinfo::fbasisid, mpq_ILLbasis_build_basisinfo(), mpq_ILLbasis_free_basisinfo(), mpq_ILLbasis_init_basisinfo(), mpq_lpinfo::nbaz, mpq_ILLlpdata::ncols, mpq_ILLlpdata::nrows, mpq_ILLlpdata::nstruct, mpq_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, mpq_ILLlpdata::rowmap, mpq_ILLlp_basis::rstat, mpq_ILLlpdata::sense, STAT_BASIC, STAT_LOWER, STAT_UPPER, STAT_ZERO, mpq_ILLlpdata::structmap, mpq_lpinfo::vindex, and mpq_lpinfo::vstat.

Here is the call graph for this function:

int mpq_ILLbasis_refactor ( mpq_lpinfo lp  ) 

Definition at line 1429 of file mpq_basis.c.

References __QS_SB_VERB, mpq_ILLbasis_factor(), and QS_LP_CHANGE_PREC.

Here is the call graph for this function:

void mpq_ILLbasis_row_solve ( mpq_lpinfo lp,
mpq_svector rhs,
mpq_svector soln 
)

Definition at line 1462 of file mpq_basis.c.

References mpq_lpinfo::f, and mpq_ILLfactor_btran().

Here is the call graph for this function:

int mpq_ILLbasis_tableau_row ( mpq_lpinfo lp,
int  row,
mpq_t *  brow,
mpq_t *  trow,
mpq_t *  rhs,
int  strict 
)

Definition at line 266 of file mpq_basis.c.

References __QS_SB_VERB, mpq_lpinfo::basisid, mpq_lpinfo::baz, mpq_lpinfo::bz, mpq_svector::coef, E_BASIS_SINGULAR, E_GENERAL_ERROR, mpq_lpinfo::fbasisid, ILL_CLEANUP, ILL_IFTRACE, mpq_svector::indx, mpq_lpinfo::lz, mpq_ILLbasis_factor(), mpq_ILLfct_compute_vA(), mpq_ILLfct_compute_zA(), mpq_ILLfct_compute_zz(), mpq_ILLsvector_alloc(), mpq_ILLsvector_free(), mpq_ILLsvector_init(), mpq_PIVZ_TOLER, mpq_lpinfo::nbaz, mpq_lpinfo::ncols, mpq_ILLlpdata::nrows, mpq_lpinfo::nrows, NULL, mpq_svector::nzcnt, mpq_lpinfo::O, STAT_BASIC, STAT_LOWER, STAT_UPPER, mpq_lpinfo::uz, mpq_lpinfo::vindex, mpq_lpinfo::vstat, and mpq_lpinfo::xbz.

Here is the call graph for this function:

int mpq_ILLbasis_update ( mpq_lpinfo lp,
mpq_svector y,
int  lindex,
int *  refactor,
int *  singular 
)

Definition at line 1470 of file mpq_basis.c.

References __QS_SB_VERB, E_FACTOR_BLOWUP, E_UPDATE_NOSPACE, E_UPDATE_SINGULAR_COL, E_UPDATE_SINGULAR_ROW, mpq_lpinfo::f, mpq_ILLbasis_factor(), mpq_ILLfactor_update(), mpq_ILLlib_writebasis(), mpq_ILLwrite_lp_file(), NULL, and mpq_lpinfo::O.

Referenced by mpq_dual_phaseI_step(), mpq_dual_phaseII_step(), mpq_primal_phaseI_step(), and mpq_primal_phaseII_step().

Here is the call graph for this function:

static int mpq_init_slack_basis ( mpq_lpinfo lp,
int *  vstat,
int *  irow,
int *  rrow,
int *  unitcol,
int *  icol,
int *  rcol 
) [static]

Definition at line 457 of file mpq_basis.c.

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

Referenced by mpq_get_initial_basis1(), and mpq_get_initial_basis2().

static int mpq_primal_col_select ( mpq_lpinfo lp,
int *  vstat,
int *  irow,
int *  rrow,
int *  unitcol,
mpq_t *  v,
int *  perm,
int *  porder,
int  nbelem,
int  pcols 
) [static]

Definition at line 511 of file mpq_basis.c.

References mpq_lpinfo::matbeg, mpq_lpinfo::matcnt, mpq_lpinfo::matind, mpq_lpinfo::matval, mpq_INFTY, mpq_NINFTY, mpq_PARAM_IBASIS_RPIVOT, mpq_PARAM_IBASIS_RTRIANG, mpq_lpinfo::nrows, and STAT_BASIC.

Referenced by mpq_get_initial_basis2().

static int mpq_set_basis_indices ( mpq_lpinfo lp,
int *  vstat 
)

Definition at line 1062 of file mpq_basis.c.

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

Referenced by mpq_ILLbasis_get_cinitial(), and mpq_ILLbasis_get_initial().


Variable Documentation

int TRACE = 0 [static]

Definition at line 24 of file mpq_basis.c.


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