ldbl_basis.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "qs_config.h"
#include "config.h"
#include "ldbl_sortrus.h"
#include "ldbl_iqsutil.h"
#include "ldbl_lpdefs.h"
#include "ldbl_qstruct.h"
#include "ldbl_qsopt.h"
#include "ldbl_basis.h"
#include "ldbl_fct.h"
#include "ldbl_lp.h"
#include "ldbl_lib.h"

Include dependency graph for ldbl_basis.c:

Go to the source code of this file.

Defines

#define ldbl_BASIS_DEBUG   0
#define ldbl_BASIS_STATS   0

Functions

static int ldbl_choose_basis (int algorithm, long double pinf1, long double dinf1, long double pinf2, long double dinf2)
static int ldbl_get_initial_basis1 (ldbl_lpinfo *lp, int *vstat)
static int ldbl_get_initial_basis2 (ldbl_lpinfo *lp, int *vstat)
static void ldbl_get_var_info (ldbl_lpinfo *lp, ldbl_var_data *v)
int ldbl_ILLbasis_build_basisinfo (ldbl_lpinfo *lp)
void ldbl_ILLbasis_clear_vardata (ldbl_var_data *vd)
void ldbl_ILLbasis_column_solve (ldbl_lpinfo *lp, ldbl_svector *rhs, ldbl_svector *soln)
void ldbl_ILLbasis_column_solve_update (ldbl_lpinfo *lp, ldbl_svector *rhs, ldbl_svector *upd, ldbl_svector *soln)
int ldbl_ILLbasis_factor (ldbl_lpinfo *lp, int *singular)
void ldbl_ILLbasis_free_basisinfo (ldbl_lpinfo *lp)
int ldbl_ILLbasis_get_cinitial (ldbl_lpinfo *lp, int algorithm)
int ldbl_ILLbasis_get_initial (ldbl_lpinfo *lp, int algorithm)
void ldbl_ILLbasis_init_basisinfo (ldbl_lpinfo *lp)
void ldbl_ILLbasis_init_vardata (ldbl_var_data *vd)
int ldbl_ILLbasis_load (ldbl_lpinfo *lp, ldbl_ILLlp_basis *B)
int ldbl_ILLbasis_refactor (ldbl_lpinfo *lp)
void ldbl_ILLbasis_row_solve (ldbl_lpinfo *lp, ldbl_svector *rhs, ldbl_svector *soln)
int ldbl_ILLbasis_tableau_row (ldbl_lpinfo *lp, int row, long double *brow, long double *trow, long double *rhs, int strict)
int ldbl_ILLbasis_update (ldbl_lpinfo *lp, ldbl_svector *y, int lindex, int *refactor, int *singular)
static int ldbl_init_slack_basis (ldbl_lpinfo *lp, int *vstat, int *irow, int *rrow, int *unitcol, int *icol, int *rcol)
static int ldbl_primal_col_select (ldbl_lpinfo *lp, int *vstat, int *irow, int *rrow, int *unitcol, long double *v, int *perm, int *porder, int nbelem, int pcols)
static int ldbl_set_basis_indices (ldbl_lpinfo *lp, int *vstat)

Variables

static int TRACE = 0


Define Documentation

#define ldbl_BASIS_DEBUG   0

Definition at line 47 of file ldbl_basis.c.

#define ldbl_BASIS_STATS   0

Definition at line 45 of file ldbl_basis.c.


Function Documentation

static int ldbl_choose_basis ( int  algorithm,
long double  pinf1,
long double  dinf1,
long double  pinf2,
long double  dinf2 
)

Definition at line 1155 of file ldbl_basis.c.

References ILL_IFTRACE, ldbl_CB_EPS, ldbl_CB_INF_RATIO, ldbl_CB_PRI_RLIMIT, and PRIMAL_SIMPLEX.

Referenced by ldbl_ILLbasis_get_cinitial().

static int ldbl_get_initial_basis1 ( ldbl_lpinfo lp,
int *  vstat 
)

Definition at line 636 of file ldbl_basis.c.

References ldbl_var_data::cmax, ldbl_lpinfo::cz, E_SIMPLEX_ERROR, ILL_CLEANUP, ILL_SAFE_MALLOC, ldbl_get_var_info(), ldbl_ILLbasis_init_vardata(), ldbl_INFTY, ldbl_init_slack_basis(), ldbl_lpinfo::lz, ldbl_var_data::nbndone, ldbl_var_data::nbounded, ldbl_lpinfo::ncols, ldbl_var_data::nfree, ldbl_lpinfo::nrows, ldbl_var_data::nslacks, NULL, STAT_BASIC, ldbl_lpinfo::uz, VBOUNDED, VFIXED, VFREE, VLOWER, ldbl_lpinfo::vtype, and VUPPER.

Referenced by ldbl_ILLbasis_get_cinitial(), and ldbl_ILLbasis_get_initial().

Here is the call graph for this function:

static int ldbl_get_initial_basis2 ( ldbl_lpinfo lp,
int *  vstat 
)

Definition at line 798 of file ldbl_basis.c.

References ldbl_var_data::cmax, ldbl_lpinfo::cz, E_SIMPLEX_ERROR, ILL_CLEANUP, ILL_IFFREE, ILL_SAFE_MALLOC, ILLutil_int_perm_quicksort(), ldbl_BD_TOLER, ldbl_get_var_info(), ldbl_ILLbasis_clear_vardata(), ldbl_ILLbasis_free_basisinfo(), ldbl_ILLbasis_init_vardata(), ldbl_ILLutil_EGlpNum_perm_quicksort(), ldbl_INFTY, ldbl_init_slack_basis(), ldbl_primal_col_select(), ldbl_lpinfo::lz, ldbl_lpinfo::matcnt, ldbl_var_data::nbndone, ldbl_lpinfo::ncols, ldbl_var_data::nfree, ldbl_lpinfo::nrows, ldbl_var_data::nslacks, NULL, ldbl_lpinfo::rowbeg, ldbl_lpinfo::rowcnt, ldbl_lpinfo::rowind, ldbl_lpinfo::rowval, STAT_BASIC, ldbl_lpinfo::uz, VBOUNDED, VFIXED, VFREE, VLOWER, ldbl_lpinfo::vtype, and VUPPER.

Referenced by ldbl_ILLbasis_get_cinitial(), and ldbl_ILLbasis_get_initial().

Here is the call graph for this function:

static void ldbl_get_var_info ( ldbl_lpinfo lp,
ldbl_var_data v 
) [static]

Definition at line 405 of file ldbl_basis.c.

References CLASS_LOGICAL, ldbl_var_data::cmax, ldbl_lpinfo::cz, ldbl_NINFTY, ldbl_var_data::nartif, ldbl_var_data::nbndone, ldbl_var_data::nbounded, ldbl_lpinfo::ncols, ldbl_var_data::nfixed, ldbl_var_data::nfree, ldbl_var_data::nslacks, VARTIFICIAL, VBOUNDED, ldbl_lpinfo::vclass, VFIXED, VFREE, VLOWER, ldbl_lpinfo::vtype, and VUPPER.

Referenced by ldbl_get_initial_basis1(), and ldbl_get_initial_basis2().

int ldbl_ILLbasis_build_basisinfo ( ldbl_lpinfo lp  ) 

Definition at line 123 of file ldbl_basis.c.

References ldbl_lpinfo::baz, ldbl_lpinfo::fbasisid, ILL_SAFE_MALLOC, ldbl_ILLbasis_free_basisinfo(), ldbl_lpinfo::nbaz, ldbl_ILLlpdata::ncols, ldbl_ILLlpdata::nrows, ldbl_lpinfo::O, ldbl_lpinfo::vindex, and ldbl_lpinfo::vstat.

Here is the call graph for this function:

void ldbl_ILLbasis_clear_vardata ( ldbl_var_data vd  ) 

Definition at line 56 of file ldbl_basis.c.

References ldbl_var_data::cmax.

Referenced by ldbl_get_initial_basis2().

void ldbl_ILLbasis_column_solve ( ldbl_lpinfo lp,
ldbl_svector rhs,
ldbl_svector soln 
)

Definition at line 1445 of file ldbl_basis.c.

References ldbl_lpinfo::f, and ldbl_ILLfactor_ftran().

Here is the call graph for this function:

void ldbl_ILLbasis_column_solve_update ( ldbl_lpinfo lp,
ldbl_svector rhs,
ldbl_svector upd,
ldbl_svector soln 
)

Definition at line 1453 of file ldbl_basis.c.

References ldbl_lpinfo::f, and ldbl_ILLfactor_ftran_update().

Here is the call graph for this function:

int ldbl_ILLbasis_factor ( ldbl_lpinfo lp,
int *  singular 
)

Definition at line 1352 of file ldbl_basis.c.

References __QS_SB_VERB, ldbl_lpinfo::basisid, ldbl_lpinfo::baz, ldbl_lpinfo::f, ldbl_lpinfo::fbasisid, ldbl_factor_work::fzero_tol, ILL_IFFREE, ILL_SAFE_MALLOC, ldbl_ILLfactor(), ldbl_ILLfactor_create_factor_work(), ldbl_ILLfactor_free_factor_work(), ldbl_ILLfactor_init_factor_work(), ldbl_ILLfct_update_basis_info(), ldbl_lpinfo::matbeg, ldbl_lpinfo::matcnt, ldbl_lpinfo::matind, ldbl_lpinfo::matval, ldbl_factor_work::maxelem_cur, ldbl_factor_work::maxelem_factor, ldbl_factor_work::maxelem_orig, ldbl_ILLlpdata::nrows, ldbl_lpinfo::O, ldbl_factor_work::partial_cur, ldbl_factor_work::partial_tol, ldbl_ILLlpdata::rowmap, STAT_LOWER, STAT_UPPER, STAT_ZERO, ldbl_factor_work::szero_tol, VARTIFICIAL, VBOUNDED, ldbl_lpinfo::vindex, VLOWER, ldbl_lpinfo::vtype, and VUPPER.

Here is the call graph for this function:

void ldbl_ILLbasis_free_basisinfo ( ldbl_lpinfo lp  ) 

Definition at line 101 of file ldbl_basis.c.

References ldbl_lpinfo::baz, ldbl_lpinfo::f, ldbl_factor_work::fzero_tol, ILL_IFFREE, ldbl_ILLfactor_free_factor_work(), ldbl_factor_work::maxelem_cur, ldbl_factor_work::maxelem_factor, ldbl_factor_work::maxelem_orig, ldbl_lpinfo::nbaz, ldbl_factor_work::partial_cur, ldbl_factor_work::partial_tol, ldbl_factor_work::szero_tol, ldbl_lpinfo::vindex, and ldbl_lpinfo::vstat.

Here is the call graph for this function:

int ldbl_ILLbasis_get_cinitial ( ldbl_lpinfo lp,
int  algorithm 
)

Definition at line 1213 of file ldbl_basis.c.

References __QS_SB_VERB, ldbl_lpinfo::basisid, ldbl_lpinfo::baz, ldbl_tol_struct::dfeas_tol, ldbl_lpinfo::dinfeas, E_SIMPLEX_ERROR, ldbl_lpinfo::fbasisid, ILL_CLEANUP, ILL_IFFREE, ILL_SAFE_MALLOC, ldbl_choose_basis(), ldbl_get_initial_basis1(), ldbl_get_initial_basis2(), ldbl_ILLbasis_build_basisinfo(), ldbl_ILLbasis_factor(), ldbl_ILLbasis_free_basisinfo(), ldbl_ILLbasis_init_basisinfo(), ldbl_ILLfct_check_dfeasible(), ldbl_ILLfct_check_pfeasible(), ldbl_ILLfct_compute_dz(), ldbl_ILLfct_compute_piz(), ldbl_ILLfct_compute_xbz(), ldbl_ILLfct_dual_adjust(), ldbl_ILLwrite_lp_file(), ldbl_set_basis_indices(), ldbl_lpinfo::matcnt, ldbl_lpinfo::ncols, ldbl_lpinfo::nrows, NULL, ldbl_lpinfo::O, ldbl_tol_struct::pfeas_tol, ldbl_lpinfo::pinfeas, PRIMAL_SIMPLEX, ldbl_lpinfo::tol, and ldbl_feas_info::totinfeas.

Here is the call graph for this function:

int ldbl_ILLbasis_get_initial ( ldbl_lpinfo lp,
int  algorithm 
)

Definition at line 1105 of file ldbl_basis.c.

References ldbl_lpinfo::basisid, E_SIMPLEX_ERROR, ILL_IFFREE, ILL_SAFE_MALLOC, ldbl_get_initial_basis1(), ldbl_get_initial_basis2(), ldbl_ILLbasis_build_basisinfo(), ldbl_ILLbasis_free_basisinfo(), ldbl_ILLbasis_init_basisinfo(), ldbl_ILLwrite_lp_file(), ldbl_set_basis_indices(), ldbl_lpinfo::ncols, NULL, ldbl_lpinfo::O, and PRIMAL_SIMPLEX.

Here is the call graph for this function:

void ldbl_ILLbasis_init_basisinfo ( ldbl_lpinfo lp  ) 

Definition at line 91 of file ldbl_basis.c.

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

Referenced by ldbl_ILLbasis_get_cinitial(), ldbl_ILLbasis_get_initial(), ldbl_ILLbasis_load(), and ldbl_ILLsimplex_init_lpinfo().

void ldbl_ILLbasis_init_vardata ( ldbl_var_data vd  ) 

Definition at line 49 of file ldbl_basis.c.

References ldbl_var_data::cmax.

Referenced by ldbl_get_initial_basis1(), and ldbl_get_initial_basis2().

int ldbl_ILLbasis_load ( ldbl_lpinfo lp,
ldbl_ILLlp_basis B 
)

Definition at line 141 of file ldbl_basis.c.

References ldbl_lpinfo::basisid, ldbl_lpinfo::baz, ldbl_ILLlp_basis::cstat, ldbl_lpinfo::fbasisid, ldbl_ILLbasis_build_basisinfo(), ldbl_ILLbasis_free_basisinfo(), ldbl_ILLbasis_init_basisinfo(), ldbl_lpinfo::nbaz, ldbl_ILLlpdata::ncols, ldbl_ILLlpdata::nrows, ldbl_ILLlpdata::nstruct, ldbl_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, ldbl_ILLlpdata::rowmap, ldbl_ILLlp_basis::rstat, ldbl_ILLlpdata::sense, STAT_BASIC, STAT_LOWER, STAT_UPPER, STAT_ZERO, ldbl_ILLlpdata::structmap, ldbl_lpinfo::vindex, and ldbl_lpinfo::vstat.

Here is the call graph for this function:

int ldbl_ILLbasis_refactor ( ldbl_lpinfo lp  ) 

Definition at line 1429 of file ldbl_basis.c.

References __QS_SB_VERB, ldbl_ILLbasis_factor(), and QS_LP_CHANGE_PREC.

Here is the call graph for this function:

void ldbl_ILLbasis_row_solve ( ldbl_lpinfo lp,
ldbl_svector rhs,
ldbl_svector soln 
)

Definition at line 1462 of file ldbl_basis.c.

References ldbl_lpinfo::f, and ldbl_ILLfactor_btran().

Here is the call graph for this function:

int ldbl_ILLbasis_tableau_row ( ldbl_lpinfo lp,
int  row,
long double *  brow,
long double *  trow,
long double *  rhs,
int  strict 
)

Definition at line 266 of file ldbl_basis.c.

References __QS_SB_VERB, ldbl_lpinfo::basisid, ldbl_lpinfo::baz, ldbl_lpinfo::bz, ldbl_svector::coef, E_BASIS_SINGULAR, E_GENERAL_ERROR, ldbl_lpinfo::fbasisid, ILL_CLEANUP, ILL_IFTRACE, ldbl_svector::indx, ldbl_ILLbasis_factor(), ldbl_ILLfct_compute_vA(), ldbl_ILLfct_compute_zA(), ldbl_ILLfct_compute_zz(), ldbl_ILLsvector_alloc(), ldbl_ILLsvector_free(), ldbl_ILLsvector_init(), ldbl_PIVZ_TOLER, ldbl_lpinfo::lz, ldbl_lpinfo::nbaz, ldbl_lpinfo::ncols, ldbl_ILLlpdata::nrows, ldbl_lpinfo::nrows, NULL, ldbl_svector::nzcnt, ldbl_lpinfo::O, STAT_BASIC, STAT_LOWER, STAT_UPPER, ldbl_lpinfo::uz, ldbl_lpinfo::vindex, ldbl_lpinfo::vstat, and ldbl_lpinfo::xbz.

Here is the call graph for this function:

int ldbl_ILLbasis_update ( ldbl_lpinfo lp,
ldbl_svector y,
int  lindex,
int *  refactor,
int *  singular 
)

Definition at line 1470 of file ldbl_basis.c.

References __QS_SB_VERB, E_FACTOR_BLOWUP, E_UPDATE_NOSPACE, E_UPDATE_SINGULAR_COL, E_UPDATE_SINGULAR_ROW, ldbl_lpinfo::f, ldbl_ILLbasis_factor(), ldbl_ILLfactor_update(), ldbl_ILLlib_writebasis(), ldbl_ILLwrite_lp_file(), NULL, and ldbl_lpinfo::O.

Referenced by ldbl_dual_phaseI_step(), ldbl_dual_phaseII_step(), ldbl_primal_phaseI_step(), and ldbl_primal_phaseII_step().

Here is the call graph for this function:

static int ldbl_init_slack_basis ( ldbl_lpinfo lp,
int *  vstat,
int *  irow,
int *  rrow,
int *  unitcol,
int *  icol,
int *  rcol 
) [static]

Definition at line 457 of file ldbl_basis.c.

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

Referenced by ldbl_get_initial_basis1(), and ldbl_get_initial_basis2().

static int ldbl_primal_col_select ( ldbl_lpinfo lp,
int *  vstat,
int *  irow,
int *  rrow,
int *  unitcol,
long double *  v,
int *  perm,
int *  porder,
int  nbelem,
int  pcols 
) [static]

Definition at line 511 of file ldbl_basis.c.

References ldbl_INFTY, ldbl_NINFTY, ldbl_PARAM_IBASIS_RPIVOT, ldbl_PARAM_IBASIS_RTRIANG, ldbl_lpinfo::matbeg, ldbl_lpinfo::matcnt, ldbl_lpinfo::matind, ldbl_lpinfo::matval, ldbl_lpinfo::nrows, and STAT_BASIC.

Referenced by ldbl_get_initial_basis2().

static int ldbl_set_basis_indices ( ldbl_lpinfo lp,
int *  vstat 
)

Definition at line 1062 of file ldbl_basis.c.

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

Referenced by ldbl_ILLbasis_get_cinitial(), and ldbl_ILLbasis_get_initial().


Variable Documentation

int TRACE = 0 [static]

Definition at line 24 of file ldbl_basis.c.


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